:root {
    /* Color Palette - Material Design / ProkopSW */
    --bg-app: #fafafa;
    --bg-panel: #ffffff;
    --bg-input: #ffffff;

    --text-primary: rgba(0, 0, 0, 0.87);
    /* High contrast */
    --text-secondary: rgba(0, 0, 0, 0.6);
    /* Medium contrast */
    --text-muted: rgba(0, 0, 0, 0.38);

    --accent-primary: #3f51b5;
    /* Indigo 500 */
    --accent-hover: #303f9f;
    /* Indigo 700 */
    --accent-glow: rgba(63, 81, 181, 0.5);

    --border-subtle: rgba(0, 0, 0, 0.12);
    --border-focus: #3f51b5;

    --font-sans: 'Inter', -apple-system, BlinkMacSystemFont, "Helvetica", "Arial", sans-serif;
    --font-mono: 'JetBrains Mono', monospace;

    --radius-lg: 4px;
    --radius-md: 4px;
    --radius-sm: 4px;

    --shadow-lg: 0px 3px 5px -1px rgba(0, 0, 0, 0.2), 0px 6px 10px 0px rgba(0, 0, 0, 0.14), 0px 1px 18px 0px rgba(0, 0, 0, 0.12);
    --shadow-md: 0px 2px 4px -1px rgba(0, 0, 0, 0.2), 0px 4px 5px 0px rgba(0, 0, 0, 0.14), 0px 1px 10px 0px rgba(0, 0, 0, 0.12);
    --shadow-sm: 0px 3px 1px -2px rgba(0, 0, 0, 0.2), 0px 2px 2px 0px rgba(0, 0, 0, 0.14), 0px 1px 5px 0px rgba(0, 0, 0, 0.12);
}

* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

body {
    background-color: var(--bg-app);
    color: var(--text-primary);
    font-family: var(--font-sans);
    line-height: 1.5;
    min-height: 100vh;
    display: flex;
    justify-content: center;
}

.app-container {
    width: 100%;
    max-width: 960px;
    padding: 2rem;
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
}

/* Header */
.app-header {
    text-align: left;
    padding: 1rem 0;
}

.app-header h1 {
    font-size: 3rem;
    font-weight: 400;
    color: var(--text-primary);
    margin-bottom: 0.5rem;
    letter-spacing: 0em;
}

.subtitle {
    color: var(--text-secondary);
    font-size: 1.1rem;
    font-weight: 400;
}

/* Input Section */
.input-wrapper {
    background: var(--bg-panel);
    border: 1px solid var(--border-subtle);
    border-radius: var(--radius-md);
    padding: 1rem;
    box-shadow: none;
    transition: border-color 0.2s;
}

.input-wrapper:focus-within {
    border-color: var(--border-focus);
    border-width: 2px;
    padding: calc(1rem - 1px);
}

textarea {
    width: 100%;
    height: 200px;
    background: transparent;
    border: none;
    color: var(--text-primary);
    font-family: var(--font-sans);
    font-size: 1rem;
    resize: vertical;
    outline: none;
}

textarea::placeholder {
    color: var(--text-muted);
}

.input-actions {
    display: flex;
    justify-content: flex-start;
    margin-top: 1rem;
    padding-top: 0;
    border-top: none;
}

.btn-primary {
    background-color: var(--accent-primary);
    color: white;
    border: none;
    padding: 6px 16px;
    border-radius: var(--radius-md);
    font-weight: 500;
    font-size: 0.875rem;
    text-transform: uppercase;
    cursor: pointer;
    transition: background-color 250ms cubic-bezier(0.4, 0, 0.2, 1) 0ms, box-shadow 250ms cubic-bezier(0.4, 0, 0.2, 1) 0ms, border 250ms cubic-bezier(0.4, 0, 0.2, 1) 0ms;
    box-shadow: var(--shadow-sm);
    letter-spacing: 0.02857em;
    line-height: 1.75;
}

.btn-primary:hover {
    background-color: var(--accent-hover);
    box-shadow: var(--shadow-md);
}

.btn-primary:active {
    box-shadow: var(--shadow-sm);
}

.btn-primary:disabled {
    background-color: rgba(0, 0, 0, 0.12);
    color: rgba(0, 0, 0, 0.26);
    box-shadow: none;
    cursor: not-allowed;
}

/* Results Section */
.results-section {
    margin-top: 2rem;
    animation: fadeIn 0.5s ease-out;
}

.results-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1rem;
}

.results-header h2 {
    font-size: 1.5rem;
    font-weight: 400;
    color: var(--text-primary);
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

/* Table Styles - Compact & High Contrast */
.results-table {
    width: 100%;
    border-collapse: collapse;
    background: var(--bg-panel);
    border-radius: var(--radius-md);
    box-shadow: var(--shadow-sm);
    overflow: hidden;
}

.results-table th {
    background: var(--bg-panel);
    padding: 8px 16px;
    /* Compact padding */
    text-align: left;
    font-size: 0.875rem;
    font-weight: 500;
    color: var(--text-secondary);
    border-bottom: 1px solid var(--border-subtle);
}

.results-table td {
    padding: 8px 16px;
    /* Compact padding */
    border-bottom: 1px solid var(--border-subtle);
    color: var(--text-primary);
    font-size: 0.875rem;
    line-height: 1.4;
    /* Tighter line height */
}

.results-table tr:last-child td {
    border-bottom: none;
}

.pattern-row:hover {
    background: rgba(0, 0, 0, 0.04);
}


.btn-icon {
    background: transparent;
    border: none;
    color: var(--text-secondary);
    padding: 4px;
    border-radius: 50%;
    font-size: 1rem;
    /* Icon size */
    cursor: pointer;
    transition: all 0.2s;
    display: flex;
    align-items: center;
    justify-content: center;
}

.btn-icon:hover {
    background-color: rgba(0, 0, 0, 0.04);
    color: var(--text-primary);
}

.icon-chevron {
    display: inline-block;
    transition: transform 0.2s ease;
    font-size: 0.75rem;
    /* Smaller chevron */
}

/* Expanded Details */
.details-row td {
    background: #f5f5f5;
    padding: 0;
    border-bottom: 1px solid var(--border-subtle);
}

.url-list-container {
    padding: 12px 16px;
    /* Compact padding */
    max-height: 300px;
    overflow-y: auto;
}

.url-list-container ul {
    list-style: none;
    padding: 0;
    margin: 0;
}

.url-list-container li {
    font-family: var(--font-sans);
    font-size: 0.85rem;
    color: var(--text-secondary);
    padding: 2px 0;
    /* Compact list items */
    border-bottom: 1px solid rgba(0, 0, 0, 0.05);
}

.url-list-container li:last-child {
    border-bottom: none;
}

.more-urls {
    margin-top: 0.5rem;
    font-size: 0.85rem;
    color: var(--text-muted);
    font-style: italic;
}

.badge {
    background: rgba(63, 81, 181, 0.1);
    color: var(--accent-primary);
    padding: 2px 8px;
    border-radius: 12px;
    font-size: 0.75rem;
    font-weight: 500;
}

/* Scrollbar for list */
.url-list-container::-webkit-scrollbar {
    width: 6px;
}

.url-list-container::-webkit-scrollbar-track {
    background: transparent;
}

.url-list-container::-webkit-scrollbar-thumb {
    background: rgba(0, 0, 0, 0.2);
    border-radius: 3px;
}

@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(10px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Collapsed Input */
.collapsed-input-section {
    background: var(--bg-panel);
    border: 1px solid var(--border-subtle);
    border-radius: var(--radius-md);
    padding: 1rem;
    margin-bottom: 2rem;
    animation: fadeIn 0.3s ease-out;
    box-shadow: var(--shadow-sm);
}

.collapsed-content {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.collapsed-info {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    color: var(--text-secondary);
    font-weight: 500;
}

.collapsed-info .icon {
    font-size: 1.5rem;
    color: var(--text-muted);
}

.btn-secondary {
    background: transparent;
    border: 1px solid var(--border-subtle);
    color: var(--accent-primary);
    padding: 5px 15px;
    border-radius: var(--radius-md);
    font-size: 0.875rem;
    font-weight: 500;
    text-transform: uppercase;
    cursor: pointer;
    transition: all 0.2s;
}

.btn-secondary:hover {
    background: rgba(63, 81, 181, 0.04);
    border-color: var(--accent-primary);
}

.hidden {
    display: none !important;
}

/* Footer */
footer {
    text-align: center;
    color: var(--text-muted);
    font-size: 0.875rem;
    margin-top: auto;
    padding-top: 2rem;
}

footer .footer-contact {
    margin-top: 0.5rem;
    font-size: 0.8rem;
}

footer a {
    color: var(--text-muted);
    text-decoration: none;
}

footer a:hover {
    color: var(--primary);
    text-decoration: underline;
}
/* Alignment Overrides */
.results-table th.col-count {
    text-align: right;
}

.col-pattern {
    width: auto;
}

.col-count {
    width: 1%;
    white-space: nowrap;
    text-align: right;
}

.col-actions {
    width: 1%;
    white-space: nowrap;
    text-align: right;
    padding-left: 0;
}


/* Pattern Code Styling */
.col-pattern code {
    font-family: var(--font-mono);
    color: #b71c1c;
    background: rgba(0, 0, 0, 0.08);
    padding: 2px 4px;
    border-radius: 2px;
    font-size: 0.9rem;
    font-weight: 500;
}

/* Nested Pattern Indentation */
.pattern-row.nested {
    background: rgba(0, 0, 0, 0.02);
}

.pattern-row.nested:hover {
    background: rgba(0, 0, 0, 0.06);
}

.col-pattern .indent {
    color: var(--text-tertiary);
    font-family: var(--font-mono);
    font-size: 0.85rem;
}

/* ===========================================
   Sitemap Feature Styles
   =========================================== */

/* Tab Navigation */
.input-tabs {
    display: flex;
    border-bottom: 1px solid var(--border-subtle);
    margin-bottom: 0;
    background: var(--bg-panel);
    border-radius: var(--radius-md) var(--radius-md) 0 0;
}

.tab-btn {
    background: transparent;
    border: none;
    padding: 12px 24px;
    font-size: 0.875rem;
    font-weight: 500;
    color: var(--text-secondary);
    cursor: pointer;
    position: relative;
    text-transform: uppercase;
    letter-spacing: 0.02857em;
    transition: color 0.2s, background-color 0.2s;
    font-family: var(--font-sans);
}

.tab-btn:hover {
    background: rgba(0, 0, 0, 0.04);
    color: var(--text-primary);
}

.tab-btn.active {
    color: var(--accent-primary);
}

.tab-btn.active::after {
    content: '';
    position: absolute;
    bottom: -1px;
    left: 0;
    right: 0;
    height: 2px;
    background: var(--accent-primary);
}

/* Tab panels */
.tab-panel {
    background: var(--bg-panel);
    border: 1px solid var(--border-subtle);
    border-top: none;
    border-radius: 0 0 var(--radius-md) var(--radius-md);
}

.tab-panel .input-wrapper {
    border: none;
    border-radius: 0 0 var(--radius-md) var(--radius-md);
}

.tab-panel.hidden {
    display: none;
}

/* Sitemap config section */
.sitemap-config {
    margin-bottom: 1rem;
}

.sitemap-config label {
    display: block;
    font-size: 0.75rem;
    font-weight: 500;
    color: var(--text-secondary);
    text-transform: uppercase;
    letter-spacing: 0.02857em;
    margin-bottom: 0.5rem;
}

/* Sitemap URL input row */
.sitemap-url-row {
    display: flex;
    gap: 8px;
    margin-bottom: 1rem;
}

.sitemap-url-input {
    flex: 1;
    padding: 10px 12px;
    border: 1px solid var(--border-subtle);
    border-radius: var(--radius-md);
    font-family: var(--font-sans);
    font-size: 1rem;
    color: var(--text-primary);
    background: var(--bg-input);
    outline: none;
    transition: border-color 0.2s;
}

.sitemap-url-input:focus {
    border-color: var(--border-focus);
    border-width: 2px;
    padding: 9px 11px;
}

.sitemap-url-input::placeholder {
    color: var(--text-muted);
}

.sitemap-config .sitemap-url-input {
    width: 100%;
    font-family: var(--font-mono);
    font-size: 0.875rem;
}

/* Status area */
.sitemap-status {
    display: flex;
    flex-wrap: wrap;
    align-items: flex-start;
    gap: 8px;
    margin: 1rem 0;
    padding: 12px 16px;
    border-radius: var(--radius-md);
    font-size: 0.875rem;
    background: rgba(0, 0, 0, 0.02);
}

.sitemap-status.loading {
    background: rgba(63, 81, 181, 0.05);
}

.sitemap-status.loading .status-icon::after {
    content: '';
    display: inline-block;
    width: 16px;
    height: 16px;
    border: 2px solid var(--accent-primary);
    border-top-color: transparent;
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
}

@keyframes spin {
    to { transform: rotate(360deg); }
}

.sitemap-status.success {
    background: rgba(76, 175, 80, 0.1);
    color: #2e7d32;
}

.sitemap-status.success .status-icon::after {
    content: '\2713';
    color: #2e7d32;
    font-weight: bold;
}

.sitemap-status.error {
    background: rgba(244, 67, 54, 0.1);
    color: #c62828;
}

.sitemap-status.error .status-icon::after {
    content: '\2717';
    color: #c62828;
    font-weight: bold;
}

.sitemap-status.warning {
    background: rgba(255, 152, 0, 0.1);
    color: #e65100;
}

.sitemap-status.warning .status-icon::after {
    content: '\26A0';
    color: #e65100;
}

.sitemap-status #statusMessage {
    flex: 1;
}

.error-list {
    width: 100%;
    margin: 8px 0 0 24px;
    padding: 0;
    font-size: 0.8rem;
    list-style: disc;
}

.error-list li {
    margin: 4px 0;
}

.error-list code {
    font-family: var(--font-mono);
    font-size: 0.75rem;
    background: rgba(0, 0, 0, 0.05);
    padding: 1px 4px;
    border-radius: 2px;
}
