:root {
    --wiki-primary: #2563eb;
    --wiki-secondary: #0ea5e9;
    --wiki-accent: #8b5cf6;
    --wiki-success: #10b981;
    --wiki-warning: #f59e0b;
    --wiki-danger: #ef4444;
    --wiki-light: #f0f9ff;
    --wiki-dark: #1e293b;
    --wiki-gray: #64748b;
    --wiki-border: #e2e8f0;
    --wiki-card-bg: #ffffff;
}

.page-main {
    min-height: 100vh;
    overflow-x: hidden;
}


.page-mian .container {
    max-width: 100%;
    overflow-x: hidden;
}


/* Modern Breadcrumb */
.breadcrumb-modern {
    background: white;
    border-radius: 12px;
    padding: 1rem;
    margin: 0 0 1.5rem 0;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.05);
    border: 1px solid var(--wiki-border);
}

.breadcrumb-modern .breadcrumb {
    margin: 0;
    padding: 0;
    background: transparent;
}

.breadcrumb-modern .breadcrumb-item {
    font-size: 0.875rem;
}

.breadcrumb-modern .breadcrumb-item a {
    color: var(--wiki-gray);
    text-decoration: none;
}

.breadcrumb-modern .breadcrumb-item.active {
    color: var(--wiki-dark);
    font-weight: 500;
}

/* Hero Section */
.hero {
    background: linear-gradient(135deg, #1e293b 0%, #0f172a 100%);
    color: white;
    padding: 1.5rem;
    margin: 0 0 1.5rem 0;
    border-radius: 20px;
    position: relative;
    overflow: hidden;
}

@media (min-width: 768px) {

    .hero {
        padding: 2.5rem 2rem;
        border-radius: 20px;
    }
}

.hero::before {
    content: '';
    position: absolute;
    top: -50px;
    right: -50px;
    width: 200px;
    height: 200px;
    background: radial-gradient(circle, rgba(37, 99, 235, 0.1) 0%, rgba(14, 165, 233, 0.05) 70%, transparent 100%);
}

@media (min-width: 768px) {
    .hero::before {
        width: 300px;
        height: 300px;
    }
}


.hero-header {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 1.5rem;
    margin-bottom: 1.5rem;
    text-align: center;
}

@media (min-width: 768px) {
    .hero-header {
        flex-direction: row;
        align-items: center;
        text-align: left;
        gap: 2rem;
    }
}

.country-flag-hero {
    width: 120px;
    height: 90px;
    border-radius: 12px;
    border: 3px solid rgba(255, 255, 255, 0.2);
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.2);
    object-fit: cover;
}

@media (min-width: 768px) {
    .country-flag-hero {
        width: 140px;
        height: 105px;
    }
}

@media (min-width: 992px) {
    .country-flag-hero {
        width: 160px;
        height: 120px;
    }
}


.country-info {
    flex: 1;
    max-width: 100%;
}



.title {
    font-size: 1.75rem;
    font-weight: 800;
    margin-bottom: 0.5rem;
    color: white;
    line-height: 1.2;
}

@media (min-width: 768px) {

    .title {
        font-size: 2.5rem;
    }
}

.subtitle {
    font-size: 1rem;
    color: #cbd5e1;
    margin-bottom: 1.5rem;
    line-height: 1.4;
}

@media (min-width: 768px) {

    .subtitle {
        font-size: 1.125rem;
    }
}

/* Search Card */
.search-card {
    background: rgba(255, 255, 255, 0.1);
    backdrop-filter: blur(10px);
    border: 1px solid rgba(255, 255, 255, 0.2);
    border-radius: 14px;
    padding: 1.5rem;
}

.search-card-title {
    font-size: 1.125rem;
    font-weight: 600;
    color: white;
    margin-bottom: 1rem;
}


/* Main Content Layout */
.content-modern {
    display: flex;
    flex-direction: column;
    gap: 2rem;
    margin-top: 2rem;
}

@media (min-width: 1200px) {
    .content-modern {
        flex-direction: row;
    }
}

/* Left Column */
.left-column {
    flex: 1;
    min-width: 0;
}



/* Card Styles */

.viz-card {
    background: white;
    border-radius: 16px;
    padding: 1.5rem;
    margin-bottom: 1.5rem;
    box-shadow: 0 2px 12px rgba(0, 0, 0, 0.06);
    border: 1px solid var(--wiki-border);
    width: 100%;
    overflow: hidden;
}


@media (min-width: 768px) {
    .viz-card {
        padding: 2rem;
        border-radius: 20px;
    }
}

.viz-header {
    display: flex;
    flex-direction: column;
    gap: 1rem;
    margin-bottom: 1.5rem;
}

@media (min-width: 576px) {
    .viz-header {
        flex-direction: row;
        justify-content: space-between;
        align-items: flex-start;
    }
}

.viz-title {
    font-size: 1.125rem;
    font-weight: 700;
    color: var(--wiki-dark);
    margin: 0;
    line-height: 1.3;
}

@media (min-width: 768px) {
    .viz-title {
        font-size: 1.25rem;
    }
}

.viz-subtitle {
    color: var(--wiki-gray);
    font-size: 0.875rem;
    margin-top: 0.25rem;
}


/* Sidebar */
.sidebar {
    width: 100%;
}

@media (min-width: 1200px) {
    .sidebar {
        width: 400px;
        min-width: 400px;
        position: sticky;
        top: 2rem;
    }
}


.sidebar-card {
    background: white;
    border-radius: 16px;
    padding: 1.5rem;
    margin-bottom: 1.25rem;
    box-shadow: 0 2px 12px rgba(0, 0, 0, 0.06);
    border: 1px solid var(--wiki-border);
    transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.sidebar-card:hover {
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.08);
    transform: translateY(-2px);
}

@media (min-width: 768px) {
    .sidebar-card {
        border-radius: 20px;
    }
}




.sidebar-title {
    font-size: 1rem;
    font-weight: 700;
    color: var(--wiki-dark);
    margin-bottom: 1.25rem;
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding-bottom: 0.75rem;
    border-bottom: 2px solid #f8fafc;
}

.sidebar-title i {
    color: var(--wiki-primary);
    font-size: 1.125em;
}

/* Export & Share - Fixed Button Width */
.sidebar-card .d-flex {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
}

.sidebar-card .btn {
    flex: 1;
    min-width: 120px;
}

.sidebar-card .btn-sm {
    min-width: 80px;
}

/* Ad Space */
.sidebar-card+.mt-4 {
    margin-top: 1.5rem;
    width: 100%;
}

/* Enhanced Sidebar Cards */


/* Mobile fixes */
@media (max-width: 767px) {
    .hero {
        margin-left: -1rem;
        margin-right: -1rem;
        border-radius: 0;
    }

    .viz-card,
    .sidebar-card {
        margin-left: -0.5rem;
        margin-right: -0.5rem;
        border-radius: 0;
        border-left: none;
        border-right: none;
    }
}

/* Facts Grid */
.facts-grid {
    display: flex;
    flex-direction: column;
    gap: 0;
}

.fact-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0.75rem 0;
    border-bottom: 1px solid var(--wiki-border);
}

.fact-row:last-child {
    border-bottom: none;
}

.fact-label {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-size: 0.875rem;
    color: var(--wiki-gray);
}

.fact-data {
    font-weight: 600;
    color: var(--wiki-dark);
    font-size: 0.875rem;
    text-align: right;
}

/* Table Styles */
.data-table {
    width: 100%;
    border-collapse: collapse;
}

.data-table thead {
    background: var(--wiki-light);
}

.data-table th {
    padding: 1rem;
    text-align: left;
    font-weight: 600;
    color: var(--wiki-dark);
    font-size: 0.875rem;
    border-bottom: 2px solid var(--wiki-border);
}

.data-table td {
    padding: 1rem;
    border-bottom: 1px solid var(--wiki-border);
}

.data-table tr {
    transition: all 0.2s ease;
    cursor: pointer;
}

.data-table tr:hover {
    background: var(--wiki-light);
    transform: translateX(4px);
}

.indicator-icon {
    width: 40px;
    height: 40px;
    background: var(--wiki-light);
    border-radius: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--wiki-primary);
    font-size: 1.25rem;
}

.indicator-name {
    font-weight: 600;
    color: var(--wiki-dark);
    text-decoration: none;
}

.indicator-name:hover {
    color: var(--wiki-primary);
}

.indicator-meta {
    font-size: 0.75rem;
    color: var(--wiki-gray);
    margin-top: 0.25rem;
}

.country-flag {
    width: 20px;
    height: 15px;
    border-radius: 2px;
    object-fit: cover;
    margin-right: 0.5rem;
}

.country-name {
    display: flex;
    align-items: center;
    font-weight: 500;
    color: var(--wiki-dark);
    text-decoration: none;
}

.country-name:hover {
    color: var(--wiki-primary);
}



/* Enhanced Table Card */
.table-card-modern {
    background: white;
    border-radius: 16px;
    margin-bottom: 1.5rem;
    box-shadow: 0 2px 12px rgba(0, 0, 0, 0.06);
    border: 1px solid var(--wiki-border);
    overflow: hidden;
    transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.table-card-modern:hover {
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.08);
}

@media (min-width: 768px) {
    .table-card-modern {
        border-radius: 20px;
    }
}

.table-header-modern {
    padding: 1.25rem 1.5rem;
    border-bottom: 1px solid var(--wiki-border);
    background: linear-gradient(90deg, #f8fafc 0%, white 100%);
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

@media (min-width: 576px) {
    .table-header-modern {
        flex-direction: row;
        justify-content: space-between;
        align-items: center;
    }
}

.table-title-modern {
    font-size: 1.125rem;
    font-weight: 700;
    color: var(--wiki-dark);
    margin: 0;
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

.table-title-modern i {
    color: var(--wiki-primary);
    font-size: 1.25em;
}

.table-responsive {
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
}

.table-modern {
    width: 100%;
    border-collapse: separate;
    border-spacing: 0;
    min-width: 800px;
}

.table-modern thead {
    position: sticky;
    top: 0;
    z-index: 10;
}

.table-modern thead th {
    background: #f8fafc;
    padding: 1rem 1.25rem;
    font-weight: 600;
    color: var(--wiki-dark);
    font-size: 0.75rem;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    border-bottom: 2px solid var(--wiki-border);
    white-space: nowrap;
}

.table-modern thead th a {
    color: inherit;
    text-decoration: none;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.5rem;
    transition: color 0.2s;
}

.table-modern thead th a:hover {
    color: var(--wiki-primary);
}

.table-modern tbody tr {
    transition: background-color 0.2s ease;
}

.table-modern tbody tr:hover {
    background: #f8fafc;
}

.table-modern td {
    padding: 1rem 1.25rem;
    border-bottom: 1px solid var(--wiki-border);
    vertical-align: middle;
    font-size: 0.875rem;
    color: var(--wiki-dark);
}

.country-cell {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    min-width: 180px;
}

.country-flag-modern {
    width: 32px;
    height: 24px;
    border-radius: 4px;
    object-fit: cover;
    border: 1px solid var(--wiki-border);
    flex-shrink: 0;
    transition: transform 0.2s ease;
}

.country-cell:hover .country-flag-modern {
    transform: scale(1.1);
}

.country-name-modern {
    font-weight: 600;
    color: var(--wiki-dark);
    text-decoration: none;
    transition: color 0.2s;
    font-size: 0.875rem;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.country-name-modern:hover {
    color: var(--wiki-primary);
    text-decoration: underline;
    text-underline-offset: 2px;
}

.trend-badge {
    display: inline-flex;
    align-items: center;
    gap: 0.375rem;
    padding: 0.375rem 0.75rem;
    border-radius: 50px;
    font-size: 0.75rem;
    font-weight: 600;
    white-space: nowrap;
    border: 1px solid transparent;
}

.trend-up {
    background: rgba(16, 185, 129, 0.1);
    color: var(--wiki-success);
    border-color: rgba(16, 185, 129, 0.2);
}

.trend-down {
    background: rgba(239, 68, 68, 0.1);
    color: var(--wiki-danger);
    border-color: rgba(239, 68, 68, 0.2);
}

/* Show More Button */
.show-more-modern {
    text-align: center;
    padding: 1.5rem;
    border-top: 1px solid var(--wiki-border);
    background: #f8fafc;
}

.show-more-btn-modern {
    padding: 0.75rem 1.5rem;
    background: white;
    color: var(--wiki-primary);
    border: 2px solid var(--wiki-primary);
    border-radius: 12px;
    font-weight: 600;
    font-size: 0.875rem;
    cursor: pointer;
    transition: all 0.3s ease;
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
}

.show-more-btn-modern:hover {
    background: var(--wiki-primary);
    color: white;
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(37, 99, 235, 0.2);
}




/* Show More Button */
.show-more-container {
    text-align: center;
    padding: 1rem;
}


/* Chart Container */
.chart-container {
    height: 300px;
    position: relative;
}


/* Pagination */
.pagination-modern {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 0.5rem;
    margin-top: 2rem;
}

.page-item-modern {
    display: flex;
    align-items: center;
    justify-content: center;
    min-width: 40px;
    height: 40px;
    border-radius: 10px;
    background: white;
    border: 1px solid var(--wiki-border);
    font-size: 0.875rem;
    font-weight: 500;
    color: var(--wiki-dark);
    text-decoration: none;
    transition: all 0.2s ease;
}

.page-item-modern:hover {
    background: var(--wiki-light);
    border-color: var(--wiki-primary);
}

.page-item-modern.active {
    background: var(--wiki-primary);
    color: white;
    border-color: var(--wiki-primary);
}

.page-item-modern.disabled {
    opacity: 0.5;
    cursor: not-allowed;
    pointer-events: none;
}

/* Clear Search */
.clear-search {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.5rem 1rem;
    background: var(--wiki-light);
    border-radius: 8px;
    color: var(--wiki-primary);
    text-decoration: none;
    font-size: 0.875rem;
    font-weight: 500;
    transition: all 0.2s ease;
}

.clear-search:hover {
    background: var(--wiki-primary);
    color: white;
}


/* Indicators Special Styles */
/* Modern Indicators Page*/

/* Newsletter Card */
.newsletter-card {
    background: linear-gradient(135deg, var(--wiki-primary) 0%, var(--wiki-accent) 100%);
    color: white;
    border: none;
}


/* Category Badge */
.category-badge {
    padding: 0.25rem 0.75rem;
    background: var(--wiki-light);
    color: var(--wiki-primary);
    border-radius: 20px;
    font-size: 0.75rem;
    font-weight: 500;
}

/* Value Display */
.indicator-value {
    font-size: 1rem;
    font-weight: 700;
    color: var(--wiki-dark);
    margin-bottom: 0.25rem;
}

.indicator-unit {
    font-size: 0.75rem;
    color: var(--wiki-gray);
}

/* No Results */
.no-results {
    text-align: center;
    padding: 3rem 1rem;
}

.no-results-icon {
    font-size: 3rem;
    color: var(--wiki-gray);
    margin-bottom: 1rem;
}

/* Results Info */
.results-info {
    text-align: center;
    color: var(--wiki-gray);
    font-size: 0.875rem;
    margin-bottom: 1rem;
}


/* Categories List */
.categories-list {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.category-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0.75rem 1rem;
    background: var(--wiki-light);
    border-radius: 10px;
    text-decoration: none;
    transition: all 0.2s ease;
    border: 1px solid transparent;
}

.category-item:hover {
    background: white;
    border-color: var(--wiki-primary);
    transform: translateX(4px);
}

.category-item.active {
    background: var(--wiki-primary);
    color: white;
}

.category-item.active .category-count {
    background: rgba(255, 255, 255, 0.2);
    color: white;
}

.category-name {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    font-weight: 500;
}

.category-count {
    padding: 0.25rem 0.75rem;
    background: white;
    border-radius: 20px;
    font-size: 0.75rem;
    font-weight: 600;
    color: var(--wiki-primary);
}

.category-item.active .category-count {
    background: rgba(255, 255, 255, 0.2);
    color: white;
}

/* Data Sources Grid */
.sources-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 0.75rem;
}

.source-item {
    text-align: center;
    padding: 1rem;
    background: var(--wiki-light);
    border-radius: 10px;
    border: 1px solid var(--wiki-border);
    transition: all 0.2s ease;
}

.source-item:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
}

.source-logo {
    height: 30px;
    margin-bottom: 0.5rem;
    filter: grayscale(100%);
    opacity: 0.7;
    transition: all 0.2s ease;
}

.source-item:hover .source-logo {
    filter: grayscale(0%);
    opacity: 1;
}

.source-name {
    font-size: 0.75rem;
    color: var(--wiki-gray);
}




/* Compact Metrics Styles */
.compact-metrics-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 0.75rem;
}

.compact-metric-item {
    background: var(--wiki-light);
    border-radius: 12px;
    padding: 1rem;
    text-decoration: none;
    color: inherit;
    transition: all 0.2s ease;
    border: 1px solid transparent;
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
}

.compact-metric-item:hover {
    background: white;
    border-color: var(--wiki-border);
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.08);
}

.compact-metric-header {
    display: flex;
    flex-direction: column;
    align-items: center;
    margin-bottom: 0.5rem;
    width: 100%;
}

.compact-metric-icon {
    width: 40px;
    height: 40px;
    border-radius: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-size: 1.25rem;
    margin-bottom: 0.5rem;
}

.compact-metric-title {
    font-size: 0.75rem;
    font-weight: 600;
    color: var(--wiki-dark);
    line-height: 1.2;
    margin-bottom: 0.25rem;
}

.compact-metric-value {
    font-size: 1rem;
    font-weight: 700;
    color: var(--wiki-dark);
    margin-bottom: 0.25rem;
    line-height: 1.2;
}

.compact-metric-year {
    font-size: 0.7rem;
    color: var(--wiki-gray);
}

 /* Modern Indicator Page - Mobile First */


 /* Indicator Meta */
 .indicator-meta-modern {
     display: flex;
     flex-wrap: wrap;
     gap: 0.75rem;
     margin-bottom: 1.5rem;
 }

 .indicator-meta-badge {
     display: flex;
     align-items: center;
     gap: 0.5rem;
     padding: 0.5rem 0.75rem;
     background: rgba(255, 255, 255, 0.1);
     backdrop-filter: blur(10px);
     border-radius: 10px;
     border: 1px solid rgba(255, 255, 255, 0.2);
     font-size: 0.875rem;
     font-weight: 500;
 }

 /* Stats Cards */
 .stats-grid {
     display: grid;
     grid-template-columns: 1fr;
     gap: 1rem;
     margin-top: 1.5rem;
 }

 @media (min-width: 576px) {
     .stats-grid {
         grid-template-columns: repeat(2, 1fr);
     }
 }

 @media (min-width: 768px) {
     .stats-grid {
         grid-template-columns: repeat(4, 1fr);
     }
 }

 .stat-card {
     background: rgba(255, 255, 255, 0.1);
     backdrop-filter: blur(10px);
     border: 1px solid rgba(255, 255, 255, 0.2);
     border-radius: 14px;
     padding: 1.25rem;
     text-align: center;
 }

 .stat-icon {
     width: 40px;
     height: 40px;
     background: linear-gradient(135deg, var(--stat-color, var(--wiki-primary)) 0%, var(--stat-gradient, var(--wiki-secondary)) 100%);
     border-radius: 10px;
     display: flex;
     align-items: center;
     justify-content: center;
     color: white;
     margin: 0 auto 1rem auto;
     font-size: 1.25rem;
 }

 .stat-value {
     font-size: 1.5rem;
     font-weight: 800;
     color: white;
     margin-bottom: 0.25rem;
     line-height: 1;
 }

 @media (min-width: 768px) {
     .stat-value {
         font-size: 1.75rem;
     }
 }

 .stat-label {
     font-size: 0.875rem;
     color: #cbd5e1;
 }


 /* Map Container */
 .map-container {
     height: 400px;
     border-radius: 12px;
     overflow: hidden;
     background: #f8fafc;
 }




  /* Modern Countries Page - Consistent with Profile */

  /* Enhanced Search Section */
  .search-section-modern {
    background: white;
    border-radius: 16px;
    padding: 1.5rem;
    margin-bottom: 1.5rem;
    box-shadow: 0 2px 12px rgba(0, 0, 0, 0.06);
    border: 1px solid var(--wiki-border);
    transition: transform 0.2s ease, box-shadow 0.2s ease;
  }

  .search-section-modern:hover {
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.08);
    transform: translateY(-2px);
  }

  @media (min-width: 768px) {
    .search-section-modern {
      padding: 1.75rem;
      border-radius: 20px;
    }
  }

  .search-header {
    margin-bottom: 1.25rem;
  }

  .search-title {
    font-size: 1.125rem;
    font-weight: 700;
    color: var(--wiki-dark);
    margin-bottom: 0.5rem;
    display: flex;
    align-items: center;
    gap: 0.5rem;
  }

  .search-title i {
    color: var(--wiki-primary);
  }

  .search-subtitle {
    color: var(--wiki-gray);
    font-size: 0.875rem;
    line-height: 1.4;
  }

  .search-form-modern {
    display: flex;
    gap: 0.75rem;
    flex-direction: column;
  }

  @media (min-width: 576px) {
    .search-form-modern {
      flex-direction: row;
    }
  }

  .search-input-modern {
    flex: 1;
    padding: 0.875rem 1.25rem;
    border: 2px solid var(--wiki-border);
    border-radius: 12px;
    font-size: 0.9375rem;
    background: white;
    transition: all 0.3s ease;
    width: 100%;
  }

  .search-input-modern:focus {
    outline: none;
    border-color: var(--wiki-primary);
    box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.1);
  }

  .search-btn-modern {
    padding: 0.875rem 1.75rem;
    background: linear-gradient(135deg, var(--wiki-primary) 0%, var(--wiki-secondary) 100%);
    color: white;
    border: none;
    border-radius: 12px;
    font-weight: 600;
    font-size: 0.9375rem;
    cursor: pointer;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    white-space: nowrap;
    width: 100%;
  }

  @media (min-width: 576px) {
    .search-btn-modern {
      width: auto;
    }
  }

  .search-btn-modern:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(37, 99, 235, 0.25);
  }

  /* Enhanced Filter Chips */
  .filter-chips {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
    margin-top: 1.5rem;
  }

  .filter-chip {
    padding: 0.5rem 1rem;
    background: white;
    border: 2px solid var(--wiki-border);
    border-radius: 50px;
    font-size: 0.8125rem;
    font-weight: 500;
    color: var(--wiki-gray);
    cursor: pointer;
    transition: all 0.3s ease;
    text-decoration: none;
    display: inline-block;
    white-space: nowrap;
    position: relative;
    overflow: hidden;
  }

  .filter-chip:hover {
    background: var(--wiki-primary);
    color: white;
    border-color: var(--wiki-primary);
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(37, 99, 235, 0.15);
    text-decoration: none;
  }

  .filter-chip.active {
    background: var(--wiki-primary);
    color: white;
    border-color: var(--wiki-primary);
    box-shadow: 0 4px 12px rgba(37, 99, 235, 0.15);
  }

  .filter-chip::after {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 5px;
    height: 5px;
    background: rgba(255, 255, 255, 0.3);
    opacity: 0;
    border-radius: 100%;
    transform: scale(1, 1) translate(-50%);
    transform-origin: 50% 50%;
  }

  .filter-chip:active::after {
    animation: ripple 0.6s ease-out;
  }

  @keyframes ripple {
    0% {
      transform: scale(0, 0);
      opacity: 0.5;
    }

    100% {
      transform: scale(30, 30);
      opacity: 0;
    }
  }

  /* Interactive Map Card */
  .map-card-modern {
    background: white;
    border-radius: 16px;
    margin-bottom: 1.5rem;
    box-shadow: 0 2px 12px rgba(0, 0, 0, 0.06);
    border: 1px solid var(--wiki-border);
    overflow: hidden;
    transition: transform 0.2s ease, box-shadow 0.2s ease;
  }

  .map-card-modern:hover {
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.08);
    transform: translateY(-2px);
  }

  @media (min-width: 768px) {
    .map-card-modern {
      border-radius: 20px;
    }
  }

  .map-header-modern {
    padding: 1.25rem 1.5rem;
    border-bottom: 1px solid var(--wiki-border);
    background: linear-gradient(90deg, #f8fafc 0%, white 100%);
  }

  .map-title-modern {
    font-size: 1.125rem;
    font-weight: 700;
    color: var(--wiki-dark);
    margin: 0;
    display: flex;
    align-items: center;
    gap: 0.75rem;
  }

  .map-title-modern i {
    color: var(--wiki-primary);
    font-size: 1.25em;
  }

  .map-container-modern {
    height: 300px;
    position: relative;
  }

  @media (min-width: 768px) {
    .map-container-modern {
      height: 400px;
    }
  }

  .map-footer {
    padding: 1rem 1.5rem;
    background: #f8fafc;
    border-top: 1px solid var(--wiki-border);
    font-size: 0.875rem;
    color: var(--wiki-gray);
  }

  .map-footer i {
    color: var(--wiki-primary);
    margin-right: 0.5rem;
  }

  /* Enhanced Quick Stats */
  .quick-stats-modern {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 0.75rem;
    margin-bottom: 1rem;
  }

  .quick-stat-modern {
    background: #f8fafc;
    border: 1px solid var(--wiki-border);
    border-radius: 12px;
    padding: 1rem;
    text-align: center;
    transition: all 0.3s ease;
  }

  .quick-stat-modern:hover {
    border-color: var(--wiki-primary);
    background: white;
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.08);
  }

  .quick-stat-value-modern {
    font-size: 1.25rem;
    font-weight: 800;
    color: var(--wiki-primary);
    margin-bottom: 0.25rem;
    line-height: 1;
  }

  .quick-stat-label-modern {
    font-size: 0.75rem;
    color: var(--wiki-gray);
    text-transform: uppercase;
    letter-spacing: 0.05em;
    font-weight: 500;
  }

  /* Enhanced FAQ */
  .faq-list-modern {
    display: flex;
    flex-direction: column;
    gap: 1rem;
  }

  .faq-item-modern {
    padding: 1rem;
    background: #f8fafc;
    border-radius: 10px;
    border: 1px solid transparent;
    transition: all 0.3s ease;
  }

  .faq-item-modern:hover {
    border-color: var(--wiki-primary);
    background: white;
  }

  .faq-question-modern {
    font-weight: 600;
    color: var(--wiki-dark);
    margin-bottom: 0.5rem;
    font-size: 0.875rem;
    display: flex;
    align-items: center;
    gap: 0.5rem;
  }

  .faq-question-modern::before {
    content: '•';
    color: var(--wiki-primary);
    font-size: 1.2em;
  }

  .faq-answer-modern {
    color: var(--wiki-gray);
    font-size: 0.8125rem;
    line-height: 1.6;
  }

  /* Enhanced Data Sources */
  .sources-modern {
    display: flex;
    flex-direction: column;
    gap: 0.875rem;
  }

  .source-modern {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 1rem;
    background: #f8fafc;
    border-radius: 12px;
    border: 1px solid transparent;
    transition: all 0.3s ease;
  }

  .source-modern:hover {
    border-color: var(--wiki-primary);
    background: white;
    transform: translateX(4px);
  }

  .source-icon {
    width: 36px;
    height: 36px;
    background: linear-gradient(135deg, var(--wiki-primary) 0%, var(--wiki-secondary) 100%);
    color: white;
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    font-size: 1rem;
  }

  /* Methodology Modern */
  .methodology-modern {
    background: white;
    border-radius: 16px;
    padding: 1.75rem;
    margin-top: 1.5rem;
    box-shadow: 0 2px 12px rgba(0, 0, 0, 0.06);
    border: 1px solid var(--wiki-border);
  }

  @media (min-width: 768px) {
    .methodology-modern {
      border-radius: 20px;
      padding: 2rem;
    }
  }

  /* Mobile Optimizations */
  @media (max-width: 768px) {
    
    .map-card-modern,
    .table-card-modern,
    .search-section-modern,
    .sidebar-cardn {
      margin-left: 0;
      margin-right: 0;
      border-radius: 12px;
      border-left: 1px solid var(--wiki-border);
      border-right: 1px solid var(--wiki-border);
    }

    .hero {
      border-radius: 0;
      margin-left: -1rem;
      margin-right: -1rem;
    }

    .filter-chips {
      overflow-x: auto;
      padding-bottom: 0.5rem;
      flex-wrap: nowrap;
      margin-left: -1rem;
      margin-right: -1rem;
      padding-left: 1rem;
      padding-right: 1rem;
    }

    .filter-chips::-webkit-scrollbar {
      display: none;
    }

    .table-header-modern {
      padding: 1rem;
    }

    .table-modern th,
    .table-modern td {
      padding: 0.75rem 1rem;
    }

    .country-cell {
      min-width: 160px;
    }
  }

  @media (max-width: 576px) {
    .search-section-modern {
      padding: 1.25rem;
    }

    .map-header-modern {
      padding: 1rem;
    }

    .sidebar-card{
      padding: 1.25rem;
    }

    .quick-stats-modern {
      grid-template-columns: 1fr;
    }
  }

  /* Touch-friendly improvements */
  .search-btn-modern,
  .show-more-btn-modern,
  .filter-chip {
    -webkit-tap-highlight-color: transparent;
    touch-action: manipulation;
  }

  /* Custom scrollbar */
  .table-responsive::-webkit-scrollbar {
    height: 6px;
  }

  .table-responsive::-webkit-scrollbar-track {
    background: #f1f5f9;
    border-radius: 3px;
  }

  .table-responsive::-webkit-scrollbar-thumb {
    background: var(--wiki-primary);
    border-radius: 3px;
  }

  .table-responsive::-webkit-scrollbar-thumb:hover {
    background: var(--wiki-secondary);
  }

  /* Row animation */
  @keyframes fadeInUp {
    from {
      opacity: 0;
      transform: translateY(10px);
    }

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

  .table-modern tbody tr {
    animation: fadeInUp 0.3s ease forwards;
    opacity: 0;
  }

  .table-modern tbody tr:nth-child(1) {
    animation-delay: 0.05s;
  }

  .table-modern tbody tr:nth-child(2) {
    animation-delay: 0.1s;
  }

  .table-modern tbody tr:nth-child(3) {
    animation-delay: 0.15s;
  }

  .table-modern tbody tr:nth-child(4) {
    animation-delay: 0.2s;
  }

  .table-modern tbody tr:nth-child(5) {
    animation-delay: 0.25s;
  }

  /* Loading state for table */
  .table-loading {
    position: relative;
    min-height: 200px;
  }

  .table-loading::after {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 40px;
    height: 40px;
    border: 3px solid var(--wiki-border);
    border-top-color: var(--wiki-primary);
    border-radius: 50%;
    animation: spin 1s linear infinite;
  }

  @keyframes spin {
    to {
      transform: translate(-50%, -50%) rotate(360deg);
    }
  }



 


  /* Country Meta - Mobile Optimized */
  .country-meta-modern {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
    justify-content: center;
  }

  @media (min-width: 768px) {
    .country-meta-modern {
      justify-content: flex-start;
    }
  }

  .country-meta-badge {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.5rem 0.75rem;
    background: rgba(255, 255, 255, 0.1);
    backdrop-filter: blur(10px);
    border-radius: 10px;
    border: 1px solid rgba(255, 255, 255, 0.2);
    font-size: 0.75rem;
    font-weight: 500;
    white-space: nowrap;
  }

  @media (min-width: 768px) {
    .country-meta-badge {
      font-size: 0.875rem;
      padding: 0.75rem 1rem;
    }
  }

  /* Stats Dashboard - Fixed Grid */
  .stats-dashboard {
    display: grid;
    grid-template-columns: 1fr;
    gap: 1rem;
    margin-top: 1.5rem;
  }

  @media (min-width: 576px) {
    .stats-dashboard {
      grid-template-columns: repeat(2, 1fr);
    }
  }

  @media (min-width: 992px) {
    .stats-dashboard {
      grid-template-columns: repeat(4, 1fr);
    }
  }

  .stat-card-modern {
    background: rgba(255, 255, 255, 0.1);
    backdrop-filter: blur(10px);
    border: 1px solid rgba(255, 255, 255, 0.2);
    border-radius: 14px;
    padding: 1.25rem 1rem;
    transition: all 0.3s ease;
    text-align: center;
  }

  @media (min-width: 768px) {
    .stat-card-modern {
      padding: 1.5rem;
      text-align: left;
    }
  }

  .stat-card-modern:hover {
    background: rgba(255, 255, 255, 0.15);
    transform: translateY(-2px);
  }

  .stat-icon-modern {
    width: 40px;
    height: 40px;
    background: linear-gradient(135deg, var(--stat-color, var(--wiki-primary)) 0%, var(--stat-gradient, var(--wiki-secondary)) 100%);
    border-radius: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    margin: 0 auto 1rem auto;
    font-size: 1.25rem;
  }

  @media (min-width: 768px) {
    .stat-icon-modern {
      margin: 0 0 1rem 0;
    }
  }

  .stat-value-modern {
    font-size: 1.5rem;
    font-weight: 800;
    color: white;
    margin-bottom: 0.25rem;
    line-height: 1;
    word-break: break-word;
  }

  @media (min-width: 768px) {
    .stat-value-modern {
      font-size: 1.75rem;
    }
  }

  .stat-label-modern {
    font-size: 0.75rem;
    color: #cbd5e1;
    margin-bottom: 0.5rem;
    line-height: 1.2;
  }

  @media (min-width: 768px) {
    .stat-label-modern {
      font-size: 0.875rem;
    }
  }

  .stat-comparison {
    font-size: 0.7rem;
    color: rgba(255, 255, 255, 0.7);
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.25rem;
  }

  @media (min-width: 768px) {
    .stat-comparison {
      justify-content: flex-start;
      font-size: 0.75rem;
    }
  }

  

  /* Economic Health Score - Fixed for Mobile */
  .health-score {
    text-align: center;
    padding: 1.5rem;
    background: linear-gradient(135deg, #f0f9ff 0%, #e0f2fe 100%);
    border-radius: 14px;
    margin-bottom: 1.5rem;
  }

  @media (min-width: 768px) {
    .health-score {
      padding: 2rem;
    }
  }

  .score-circle {
    width: 160px;
    height: 160px;
    margin: 0 auto 1.5rem auto;
    position: relative;
  }

  @media (min-width: 768px) {
    .score-circle {
      width: 200px;
      height: 200px;
    }
  }

  .score-ring {
    width: 100%;
    height: 100%;
    border-radius: 50%;
    background: conic-gradient(var(--score-color, var(--wiki-primary)) 0deg calc(var(--score-percent, 70) * 3.6deg),
        #e2e8f0 calc(var(--score-percent, 70) * 3.6deg) 360deg);
    position: relative;
  }

  .score-inner {
    position: absolute;
    top: 15px;
    left: 15px;
    right: 15px;
    bottom: 15px;
    background: white;
    border-radius: 50%;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
  }

  @media (min-width: 768px) {
    .score-inner {
      top: 20px;
      left: 20px;
      right: 20px;
      bottom: 20px;
    }
  }

  .score-number {
    font-size: 2rem;
    font-weight: 800;
    color: var(--wiki-dark);
    line-height: 1;
  }

  @media (min-width: 768px) {
    .score-number {
      font-size: 3rem;
    }
  }

  .score-label {
    color: var(--wiki-gray);
    font-size: 0.75rem;
    margin-top: 0.25rem;
  }

  @media (min-width: 768px) {
    .score-label {
      font-size: 0.875rem;
      margin-top: 0.5rem;
    }
  }

  /* Indicator Matrix - Fixed Grid */
  .indicator-matrix {
    display: grid;
    grid-template-columns: 1fr;
    gap: 1rem;
  }

  @media (min-width: 576px) {
    .indicator-matrix {
      grid-template-columns: repeat(2, 1fr);
    }
  }

  @media (min-width: 768px) {
    .indicator-matrix {
      grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
    }
  }

  .matrix-item {
    background: white;
    border: 1px solid var(--wiki-border);
    border-radius: 12px;
    padding: 1rem;
    transition: all 0.3s ease;
    width: 100%;
  }

  @media (min-width: 768px) {
    .matrix-item {
      padding: 1.25rem;
    }
  }

  .matrix-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    margin-bottom: 0.75rem;
  }

  .matrix-name {
    font-weight: 600;
    color: var(--wiki-dark);
    font-size: 0.875rem;
    line-height: 1.3;
  }

  @media (min-width: 768px) {
    .matrix-name {
      font-size: 0.9375rem;
    }
  }

  .matrix-value {
    font-size: 1.25rem;
    font-weight: 700;
    color: var(--wiki-dark);
    margin-bottom: 0.5rem;
    word-break: break-word;
  }

  @media (min-width: 768px) {
    .matrix-value {
      font-size: 1.5rem;
    }
  }

  .matrix-trend {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-size: 0.75rem;
    font-weight: 500;
  }

  /* Trend Badges */
  .trend-badge {
    padding: 0.25rem 0.5rem;
    border-radius: 4px;
    font-size: 0.7rem;
    font-weight: 600;
    white-space: nowrap;
  }

  .trend-good {
    background: rgba(16, 185, 129, 0.1);
    color: var(--wiki-success);
  }

  .trend-warning {
    background: rgba(245, 158, 11, 0.1);
    color: var(--wiki-warning);
  }

  .trend-poor {
    background: rgba(239, 68, 68, 0.1);
    color: var(--wiki-danger);
  }

  


  /* Comparison Widget - Fixed */
  .comparison-widget {
    background: linear-gradient(135deg, #faf5ff 0%, #f3e8ff 100%);
    border-radius: 14px;
    padding: 1.5rem;
    border: 1px solid #e9d5ff;
    width: 100%;
  }

  .comparison-selector {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
    margin-bottom: 1rem;
  }

  @media (min-width: 400px) {
    .comparison-selector {
      flex-direction: row;
      align-items: center;
    }
  }

  .country-select {
    flex: 1;
    padding: 0.75rem;
    border: 2px solid var(--wiki-border);
    border-radius: 8px;
    font-size: 0.875rem;
    background: white;
    min-width: 0;
    /* Allow select to shrink */
  }

  .compare-btn {
    padding: 0.75rem 1.25rem;
    background: linear-gradient(135deg, var(--wiki-accent) 0%, #a78bfa 100%);
    color: white;
    border: none;
    border-radius: 8px;
    font-weight: 600;
    cursor: pointer;
    white-space: nowrap;
  }

  @media (min-width: 400px) {
    .compare-btn {
      width: auto;
    }
  }

  /* Quick comparison buttons */
  .comparison-buttons {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 0.5rem;
  }

  @media (min-width: 400px) {
    .comparison-buttons {
      display: flex;
      flex-wrap: wrap;
    }
  }

  .comparison-buttons .btn {
    flex: 1;
    min-width: 120px;
  }

  /* Timeline Visualization - Fixed for Mobile */
  .timeline-viz {
    height: 150px;
    position: relative;
    margin: 1.5rem 0;
  }

  @media (min-width: 768px) {
    .timeline-viz {
      height: 200px;
    }
  }

  .timeline-line {
    position: absolute;
    top: 50%;
    left: 1rem;
    right: 1rem;
    height: 2px;
    background: var(--wiki-border);
    transform: translateY(-50%);
  }

  @media (min-width: 768px) {
    .timeline-line {
      left: 2rem;
      right: 2rem;
    }
  }

  .timeline-points {
    display: flex;
    justify-content: space-between;
    position: relative;
    z-index: 2;
    padding: 0 0.5rem;
  }

  @media (min-width: 768px) {
    .timeline-points {
      padding: 0 1rem;
    }
  }

  .timeline-point {
    width: 10px;
    height: 10px;
    background: var(--wiki-primary);
    border-radius: 50%;
    position: relative;
  }

  @media (min-width: 768px) {
    .timeline-point {
      width: 12px;
      height: 12px;
    }
  }

  .timeline-point::after {
    content: attr(data-year);
    position: absolute;
    top: 20px;
    left: 50%;
    transform: translateX(-50%);
    font-size: 0.7rem;
    color: var(--wiki-gray);
    white-space: nowrap;
  }

  /* Data Sources - Fixed Grid */
  .sources-modern {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(120px, 1fr));
    gap: 0.75rem;
  }

  @media (min-width: 400px) {
    .sources-modern {
      grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
    }
  }

  .source-modern {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.75rem;
    background: var(--wiki-light);
    border-radius: 8px;
    border: 1px solid var(--wiki-border);
    min-width: 0;
    /* Prevent flex item overflow */
  }

  .source-icon {
    width: 32px;
    height: 32px;
    background: white;
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--wiki-primary);
    font-size: 1rem;
    flex-shrink: 0;
  }

 

  /* Mobile-specific fixes */
  @media (max-width: 767px) {

    /* Prevent horizontal scroll */
    body {
      overflow-x: hidden;
    }

    /* Fix for long country names */
    .country-title {
      font-size: 1.5rem;
    }

    /* Better spacing on mobile */
    .viz-card {
      margin-left: -0.5rem;
      margin-right: -0.5rem;
      border-radius: 0;
      border-left: none;
      border-right: none;
    }

    /* Adjust sidebar cards on mobile */
    .sidebar-card {
      margin-left: -0.5rem;
      margin-right: -0.5rem;
      border-radius: 0;
      border-left: none;
      border-right: none;
    }

    /* Fix button overflow on mobile */
    .btn {
      white-space: normal;
      word-break: break-word;
    }
  }

  /* Desktop-specific adjustments */
  @media (min-width: 768px) {

    .viz-card,
    .sidebar-card {
      width: 100%;
    }
  }

  /* Prevent text overflow
  * {
    max-width: 100%;
  }
  

  
  /* Fix for form controls */
  /* select, input, button {
    max-width: 100%;
  }  */

