:root {
    /* Core Colors */
    --bg-body: #f8f9fa;
    --bg-card: #ffffff;
    --text-main: #1a1a1a;
    --text-muted: #6c757d;
    --primary-accent: #2563eb;
    --border-color: #e5e7eb;

    /* Operator Colors */
    --color-orange: #ff7900;
    --color-sfr: #e2001a;
    --color-bouygues: #009dcc;
    --color-free: #cc0000;

    /* Spacing & Radius */
    --radius-lg: 16px;
    --radius-md: 8px;
    --shadow-sm: 0 1px 3px rgba(0, 0, 0, 0.1);
    --shadow-md: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -1px rgba(0, 0, 0, 0.06);
    --shadow-lg: 0 10px 15px -3px rgba(0, 0, 0, 0.1), 0 4px 6px -2px rgba(0, 0, 0, 0.05);
}

/* Reset & Base */
* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

body {
    font-family: 'Outfit', sans-serif;
    background-color: var(--bg-body);
    color: var(--text-main);
    line-height: 1.5;
    -webkit-font-smoothing: antialiased;
}

.container {
    max-width: 1400px;
    margin: 0 auto;
    padding: 0 20px;
}

/* Layout */
.app-container {
    display: flex;
    min-height: calc(100vh - 80px);
    /* Account for header */
    gap: 0;
}

.sidebar {
    position: fixed;
    left: 0;
    top: 0;
    width: 280px;
    height: 100vh;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    overflow-y: auto;
    padding: 2rem 1.5rem;
    box-shadow: 4px 0 12px rgba(0, 0, 0, 0.1);
    z-index: 100;
}

.sidebar-header {
    margin-bottom: 1.5rem;
}

.sidebar-header h2 {
    font-size: 1.5rem;
    font-weight: 700;
    margin: 0;
    color: white;
}

.sidebar-close {
    display: none;
    /* Hidden on desktop */
    position: absolute;
    top: 1.5rem;
    right: 1.5rem;
    background: rgba(255, 255, 255, 0.2);
    border: none;
    color: white;
    font-size: 1.5rem;
    width: 40px;
    height: 40px;
    border-radius: 50%;
    cursor: pointer;
    transition: all 0.3s ease;
}

.sidebar-close:hover {
    background: rgba(255, 255, 255, 0.3);
    transform: rotate(90deg);
}

.mobile-sidebar-toggle {
    display: none;
    /* Hidden on desktop */
    position: fixed;
    bottom: 1.5rem;
    left: 50%;
    transform: translateX(-50%);
    z-index: 1001;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    border: none;
    padding: 1rem 2rem;
    border-radius: 50px;
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.3);
    transition: all 0.3s ease;
}

.mobile-sidebar-toggle:hover {
    transform: translateX(-50%) translateY(-2px);
    box-shadow: 0 6px 24px rgba(0, 0, 0, 0.4);
}

/* Category Navigation */
.category-nav {
    position: sticky;
    top: 0;
    z-index: 99;
    background: white;
    border-bottom: 2px solid #e5e7eb;
    margin-left: 280px;
    /* Align with main content */
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.05);
}

.category-nav-container {
    display: flex;
    gap: 0;
    justify-content: center;
    padding: 0;
}

.category-nav-link {
    flex: 1;
    max-width: 200px;
    text-align: center;
    padding: 1rem 2rem;
    font-size: 1rem;
    font-weight: 600;
    color: #64748b;
    text-decoration: none;
    border-bottom: 3px solid transparent;
    transition: all 0.3s ease;
    background: white;
}

.category-nav-link:hover {
    color: #667eea;
    background: #f8f9fa;
    border-bottom-color: #667eea;
}

.category-nav-link.active {
    color: #667eea;
    border-bottom-color: #667eea;
}

/* Palmarès Section */
.palmares-section {
    margin-top: 0;
    padding: 2rem 0;
    margin-bottom: 1rem;
}

#palmares-zone-name {
    color: #667eea;
}

.palmares-description {
    color: #64748b;
    margin-bottom: 2rem;
    text-align: center;
    font-size: 1rem;
}

.palmares-table-container {
    overflow-x: auto;
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-md);
}

.palmares-table {
    width: 100%;
    border-collapse: collapse;
    background: white;
    border-radius: var(--radius-lg);
    overflow: hidden;
}

.palmares-table thead {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
}

.palmares-table th {
    padding: 1rem;
    text-align: left;
    font-weight: 600;
    font-size: 1rem;
}

.palmares-table th:first-child {
    border-radius: 8px 0 0 0;
}

.palmares-table th:not(:first-child) {
    text-align: center;
}

.palmares-table th:last-child {
    border-radius: 0 8px 0 0;
}

.palmares-table td {
    padding: 1rem;
    border-bottom: 1px solid #e5e7eb;
    font-size: 1.1rem;
    font-weight: 600;
}

.palmares-table td:not(:first-child) {
    text-align: center;
}

.palmares-table tbody tr:hover {
    background: #f8f9fa;
}

.palmares-table tbody tr:last-child td {
    border-bottom: none;
}

.palmares-table tbody tr:last-child td:first-child {
    border-radius: 0 0 0 var(--radius-lg);
}

.palmares-table tbody tr:last-child td:last-child {
    border-radius: 0 0 var(--radius-lg) 0;
}

.operator-name-cell {
    font-weight: 700;
    font-size: 1.1rem;
}

.op-orange {
    color: #ff6b00;
}

.op-bouygues {
    color: #009ee0;
}

.op-sfr {
    color: #e20714;
}

.op-free {
    color: #000000;
}

.main-content {
    margin-left: 280px;
    /* Same as sidebar width */
    flex: 1;
    padding: 2rem;
    background: var(--bg-body);
    /* Changed from var(--bg-primary) to var(--bg-body) as --bg-primary is not defined */
}

/* Header */
.app-header {
    background: linear-gradient(135deg, #1e293b 0%, #0f172a 100%);
    color: white;
    padding: 3rem 0;
    text-align: center;
    margin-left: 280px;
    /* Align with main content, excluding sidebar */
}

.app-header h1 {
    font-size: 2.5rem;
    font-weight: 700;
    margin-bottom: 0.5rem;
    letter-spacing: -0.02em;
}

.subtitle {
    color: #94a3b8;
    font-size: 1.1rem;
    font-weight: 300;
}

/* Filters */
.filters-section {
    display: flex;
    justify-content: center;
    margin-bottom: 3rem;
    background: var(--bg-card);
    padding: 2rem;
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-md);
}

.filter-group.full-width {
    width: 100%;
}

.filter-group label {
    display: block;
    font-weight: 600;
    margin-bottom: 1rem;
    color: var(--text-muted);
    font-size: 0.9rem;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    text-align: center;
}

.zone-buttons-wrapper {
    display: flex;
    flex-direction: row;
    /* Side by side */
    gap: 2rem;
    /* Space between columns */
    align-items: flex-start;
    justify-content: center;
}

/* Zone Buttons */
.zone-buttons-container {
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
}

.zone-group {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.zone-group-label {
    font-size: 0.85rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    color: rgba(255, 255, 255, 0.7);
    margin-bottom: 0.25rem;
}

.zone-btn {
    background: rgba(255, 255, 255, 0.1);
    color: white;
    border: 2px solid rgba(255, 255, 255, 0.2);
    padding: 0.75rem 1rem;
    border-radius: 8px;
    cursor: pointer;
    font-size: 0.9rem;
    font-weight: 500;
    transition: all 0.3s ease;
    text-align: left;
    width: 100%;
}

/* Responsive: Stack on mobile */
@media (max-width: 768px) {
    .zone-buttons-wrapper {
        flex-direction: column;
        gap: 1.5rem;
    }
}

.zone-btn:hover {
    background: rgba(255, 255, 255, 0.2);
    border-color: rgba(255, 255, 255, 0.4);
    transform: translateX(4px);
}

.zone-btn.active {
    background: white;
    color: #667eea;
    border-color: white;
    font-weight: 600;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
}

/* Results Layout */
.results-container {
    display: flex;
    flex-direction: column;
    gap: 3rem;
    margin-bottom: 4rem;
}

.usage-section {
    animation: fadeIn 0.5s ease-out;
    padding-bottom: 2rem;
    /* Added spacing between sections */
}

.section-header-group {
    margin-bottom: 1.5rem;
    padding-left: 10px;
    border-left: 4px solid var(--primary-accent);
}

.section-title {
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--text-main);
    margin-bottom: 0.25rem;
}

.section-description {
    font-size: 0.95rem;
    color: var(--text-muted);
    font-style: italic;
}

.cards-grid {
    display: grid;
    /* Force 4 columns on desktop so cards always have the same width (1/4 of container) */
    grid-template-columns: repeat(4, 1fr);
    gap: 1.25rem;
}

/* Result Card */
.result-card {
    background: var(--bg-card);
    border-radius: var(--radius-lg);
    padding: 1.25rem;
    box-shadow: var(--shadow-md);
    transition: transform 0.2s, box-shadow 0.2s;
    border: 1px solid transparent;
    /* Ensure full height in grid cell */
    height: 100%;
    display: flex;
    flex-direction: column;
}

/* Highlighted Card (Tous Usages) */
.result-card.highlight {
    border: 2px solid #fbbf24;
    /* Gold border */
    background: linear-gradient(to bottom right, #ffffff, #fffbeb);
    box-shadow: 0 10px 25px -5px rgba(251, 191, 36, 0.15), 0 8px 10px -6px rgba(251, 191, 36, 0.1);
    position: relative;
    overflow: hidden;
}

.result-card.highlight::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 4px;
    background: #fbbf24;
}

.card-header {
    display: flex;
    align-items: flex-start;
    /* Align top for multi-line text */
    gap: 10px;
    margin-bottom: 1.25rem;
    padding-bottom: 0.75rem;
    border-bottom: 1px solid var(--border-color);
}

.situation-icon {
    font-size: 1.5rem;
    flex-shrink: 0;
    /* Prevent icon from shrinking */
    margin-top: 2px;
}

.card-title {
    font-size: 1.1rem;
    font-weight: 700;
    color: var(--text-main);
    line-height: 1.3;
}

.result-card.highlight .card-title {
    color: #b45309;
    /* Dark gold text */
}

.card-body {
    margin-top: auto;
    /* Push body to bottom if header varies in height */
}

/* Operator Rows */
.operator-row {
    margin-bottom: 0.9rem;
}

.operator-info {
    display: flex;
    justify-content: space-between;
    margin-bottom: 0.25rem;
    font-weight: 600;
    font-size: 0.9rem;
}

.operator-name {
    display: flex;
    align-items: center;
    gap: 6px;
}

.operator-value {
    font-family: monospace;
    font-size: 0.95rem;
}

.progress-bg {
    height: 6px;
    background-color: #f1f5f9;
    border-radius: 3px;
    overflow: hidden;
}

.progress-bar {
    height: 100%;
    border-radius: 3px;
    width: 0%;
    transition: width 1s cubic-bezier(0.4, 0, 0.2, 1);
}

/* Operator Specific Colors */
.op-orange .progress-bar {
    background-color: var(--color-orange);
}

.op-sfr .progress-bar {
    background-color: var(--color-sfr);
}

.op-bouygues .progress-bar {
    background-color: var(--color-bouygues);
}

.op-free .progress-bar {
    background-color: var(--color-free);
}

.op-orange .operator-name {
    color: var(--color-orange);
}

.op-sfr .operator-name {
    color: var(--color-sfr);
}

.op-bouygues .operator-name {
    color: var(--color-bouygues);
}

.op-free .operator-name {
    color: var(--color-free);
}

/* Loading State */
.loading-state {
    text-align: center;
    padding: 4rem;
    color: var(--text-muted);
}

.spinner {
    width: 40px;
    height: 40px;
    border: 4px solid #e2e8f0;
    border-top-color: var(--primary-accent);
    border-radius: 50%;
    margin: 0 auto 1rem;
    animation: spin 1s linear infinite;
}

@keyframes spin {
    to {
        transform: rotate(360deg);
    }
}

@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(10px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Footer */
.app-footer {
    text-align: center;
    padding: 2rem;
    color: var(--text-muted);
    font-size: 0.9rem;
    border-top: 1px solid var(--border-color);
    margin-left: 280px;
    /* Align with main content, excluding sidebar */
}

.app-footer a {
    color: var(--primary-accent);
    text-decoration: none;
    font-weight: 600;
    transition: color 0.3s ease;
}

.app-footer a:hover {
    color: #1d4ed8;
    text-decoration: underline;
}

/* Responsive Design */
@media (max-width: 1024px) {
    .sidebar {
        width: 240px;
    }

    .main-content {
        margin-left: 240px;
    }

    .app-footer {
        margin-left: 240px;
    }
}

@media (max-width: 768px) {
    .app-container {
        flex-direction: column;
    }

    .mobile-sidebar-toggle {
        display: block;
        /* Show toggle button on mobile */
    }

    .sidebar {
        position: fixed;
        top: 0;
        left: -100%;
        /* Hidden by default */
        width: 100%;
        height: 100vh;
        padding: 1.5rem;
        z-index: 1000;
        transition: left 0.3s ease;
    }

    .sidebar.open {
        left: 0;
        /* Slide in when open */
    }

    .sidebar-close {
        display: block;
        /* Show close button on mobile */
    }

    .main-content {
        margin-left: 0;
        padding: 1rem;
    }

    .app-header {
        margin-left: 0;
        /* Reset header margin on mobile */
    }

    .category-nav {
        margin-left: 0;
        /* Reset nav margin on mobile */
    }

    .app-footer {
        margin-left: 0;
        /* Reset footer margin on mobile */
    }

    .cards-grid {
        grid-template-columns: 1fr;
    }
}

/* Responsive */
@media (max-width: 1200px) {
    .cards-grid {
        grid-template-columns: repeat(3, 1fr);
    }
}

@media (max-width: 900px) {
    .cards-grid {
        grid-template-columns: repeat(2, 1fr);
    }
}

@media (max-width: 600px) {
    .cards-grid {
        grid-template-columns: 1fr;
    }

    .filters-section {
        padding: 1rem;
    }
}

/* Info & FAQ Section */
.info-section {
    margin-top: 6rem;
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 3rem;
    padding-top: 3rem;
    border-top: 1px solid var(--border-color);
}

.info-block {
    background: white;
    padding: 2rem;
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-sm);
}

.info-block h2 {
    font-size: 1.5rem;
    font-weight: 700;
    margin-bottom: 1.5rem;
    color: var(--text-main);
    display: flex;
    align-items: center;
    gap: 10px;
}

.info-block p {
    color: var(--text-muted);
    margin-bottom: 1rem;
    line-height: 1.7;
}

.info-link {
    display: inline-block;
    margin-top: 1rem;
    color: var(--primary-accent);
    font-weight: 600;
    text-decoration: none;
}

.info-link:hover {
    text-decoration: underline;
}

/* FAQ Items */
.faq-item {
    margin-bottom: 1.5rem;
    padding-bottom: 1.5rem;
    border-bottom: 1px solid #f1f5f9;
}

.faq-item:last-child {
    border-bottom: none;
    margin-bottom: 0;
    padding-bottom: 0;
}

.faq-item h3 {
    font-size: 1.1rem;
    font-weight: 600;
    color: var(--text-main);
    margin-bottom: 0.5rem;
}

/* Responsive Info Section */
@media (max-width: 900px) {
    .info-section {
        grid-template-columns: 1fr;
        gap: 2rem;
    }
}

/* Category Headers */
.category-section {
    margin-top: 2rem;
    margin-bottom: 2rem;
}

.category-title {
    font-size: 2.5rem;
    font-weight: 800;
    color: #e2e8f0;
    /* Very light grey for background effect */
    text-transform: uppercase;
    letter-spacing: 0.1em;
    margin-bottom: 2rem;
    padding-bottom: 1rem;
    border-bottom: 2px solid #f1f5f9;
    position: relative;
}

.category-title::after {
    content: attr(data-label);
    /* Can be used for overlay effects */
    position: absolute;
    left: 0;
    top: 0;
    color: var(--text-main);
    opacity: 0.1;
}

/* Make the actual text visible and styled */
.category-title {
    color: var(--text-main);
    opacity: 1;
}