/* ===================================
   CSS Custom Properties (Variables)
   =================================== */
:root {
    --primary-color: #2563eb;
    --primary-dark: #1d4ed8;
    --primary-light: #3b82f6;
    --secondary-color: #10b981;
    --text-dark: #1f2937;
    --text-gray: #6b7280;
    --text-light: #9ca3af;
    --bg-gray: #f9fafb;
    --bg-white: #ffffff;
    --border-color: #e5e7eb;
    --shadow-sm: 0 1px 2px 0 rgba(0, 0, 0, 0.05);
    --shadow-md: 0 4px 6px -1px rgba(0, 0, 0, 0.1);
    --shadow-lg: 0 10px 15px -3px rgba(0, 0, 0, 0.1);
    --shadow-xl: 0 20px 25px -5px rgba(0, 0, 0, 0.1);
    --transition: all 0.3s ease;
}

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

html {
    scroll-behavior: smooth;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
    line-height: 1.6;
    color: var(--text-dark);
    background-color: var(--bg-gray);
}

img {
    max-width: 100%;
    height: auto;
    display: block;
}

a {
    text-decoration: none;
    color: inherit;
    transition: var(--transition);
}

button {
    border: none;
    background: none;
    cursor: pointer;
    font-family: inherit;
    transition: var(--transition);
}

ul {
    list-style: none;
}

/* ===================================
   Utility Classes
   =================================== */
.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 1rem;
}

.section {
    padding: 4rem 0;
}

.section-gray {
    background-color: var(--bg-gray);
}

.grid-2 {
    display: grid;
    grid-template-columns: 1fr;
    gap: 3rem;
}

.grid-3 {
    display: grid;
    grid-template-columns: 1fr;
    gap: 2rem;
}

.text-center {
    text-align: center;
}

.text-white {
    color: white;
}

.font-semibold {
    font-weight: 600;
}

.highlight-text {
    color: var(--primary-color);
    font-weight: 600;
    margin: 1rem 0;
}

/* ===================================
   Header & Navigation
   =================================== */
.header {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    background-color: var(--primary-color);
    z-index: 1000;
    transition: var(--transition);
    box-shadow: var(--shadow-md);
}

.header.scrolled {
    background-color: var(--bg-white);
    box-shadow: var(--shadow-lg);
}

.header.scrolled .logo h1,
.header.scrolled .logo p,
.header.scrolled .nav-link {
    color: var(--text-dark);
}

.header.scrolled .mobile-menu-btn {
    color: var(--text-dark);
}

.header-content {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 1rem 0;
    min-height: 80px;
}

.logo {
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

.logo-icon {
    width: 50px;
    height: 50px;
    background-color: white;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: bold;
    color: var(--primary-color);
    font-size: 1.25rem;
}

.logo h1 {
    font-size: 1.125rem;
    color: white;
    margin-bottom: 0.25rem;
}

.logo p {
    font-size: 0.75rem;
    color: rgba(255, 255, 255, 0.9);
}

.nav-desktop {
    display: none;
    align-items: center;
    gap: 0.5rem;
}

.nav-link {
    padding: 0.5rem 0.75rem;
    border-radius: 0.375rem;
    font-size: 0.875rem;
    font-weight: 500;
    color: white;
    white-space: nowrap;
}

.nav-link:hover,
.nav-link.active {
    background-color: var(--primary-dark);
}

.header.scrolled .nav-link:hover,
.header.scrolled .nav-link.active {
    background-color: var(--bg-gray);
    color: var(--primary-color);
}

.mobile-menu-btn {
    display: block;
    font-size: 1.5rem;
    color: white;
    padding: 0.5rem;
}

.nav-mobile {
    display: none;
    padding-bottom: 1rem;
}

.nav-mobile.active {
    display: block;
}

.nav-mobile .nav-link {
    display: block;
    padding: 0.75rem 1rem;
    border-radius: 0.375rem;
    margin-bottom: 0.25rem;
}

/* ===================================
   Hero Slider
   =================================== */
.hero-slider {
    position: relative;
    height: 450px;
    margin-top: 20px;
    overflow: hidden;
}

.slide {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    opacity: 0;
    transition: opacity 1s ease-in-out;
}

.slide.active {
    opacity: 1;
}

.slide img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.slide-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: linear-gradient(to right, rgba(37, 99, 235, 0.9), rgba(59, 130, 246, 0.7));
}

.slide-content {
    position: absolute;
    top: 50%;
    left: 0;
    right: 0;
    transform: translateY(-50%);
    text-align: center;
    color: white;
    z-index: 2;
}

.slide-content h2 {
    font-size: 2.5rem;
    font-weight: 700;
    margin-bottom: 1rem;
    animation: fadeInUp 1s ease-out;
}

.slide-content p {
    font-size: 1.25rem;
    margin-bottom: 2rem;
    animation: fadeInUp 1s ease-out 0.2s;
    animation-fill-mode: backwards;
}

.slider-indicators {
    position: absolute;
    bottom: 2rem;
    left: 50%;
    transform: translateX(-50%);
    display: flex;
    gap: 0.5rem;
    z-index: 3;
}

.indicator {
    width: 12px;
    height: 12px;
    border-radius: 50%;
    background-color: rgba(255, 255, 255, 0.5);
    cursor: pointer;
    transition: var(--transition);
}

.indicator.active {
    background-color: white;
}

@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* ===================================
   Buttons
   =================================== */
.btn {
    display: inline-block;
    padding: 0.75rem 1.5rem;
    border-radius: 0.5rem;
    font-weight: 600;
    text-align: center;
    transition: var(--transition);
    cursor: pointer;
}

.btn-primary {
    background-color: var(--primary-color);
    color: white;
}

.btn-primary:hover {
    background-color: var(--primary-dark);
}

.btn-outline {
    border: 2px solid var(--primary-color);
    color: var(--primary-color);
    background-color: transparent;
}

.btn-outline:hover {
    background-color: rgba(37, 99, 235, 0.1);
}

.btn-small {
    padding: 0.5rem 1rem;
    font-size: 0.875rem;
}

/* ===================================
   About Section
   =================================== */
.about-section h2 {
    font-size: 2rem;
    margin-bottom: 1.5rem;
    color: var(--text-dark);
}

.about-content p {
    color: var(--text-gray);
    margin-bottom: 1rem;
    line-height: 1.8;
}

.about-image {
    position: relative;
}

.about-image img {
    border-radius: 0.5rem;
    box-shadow: var(--shadow-xl);
}

.stat-badge {
    position: absolute;
    bottom: -1.5rem;
    right: -1.5rem;
    background-color: var(--primary-color);
    color: white;
    padding: 1.5rem;
    border-radius: 0.5rem;
    box-shadow: var(--shadow-xl);
    text-align: center;
}

.stat-value {
    font-size: 2rem;
    font-weight: 700;
    margin-bottom: 0.25rem;
}

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

/* ===================================
   Section Headers
   =================================== */
.section h2 {
    font-size: 2rem;
    margin-bottom: 2rem;
    color: var(--text-dark);
}

.section-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 1rem;
    margin-bottom: 2rem;
}

.view-all {
    color: var(--primary-color);
    font-weight: 600;
    font-size: 0.875rem;
}

.view-all:hover {
    color: var(--primary-dark);
}

.subsection-title {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-size: 1.25rem;
    margin-bottom: 1rem;
}

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

/* ===================================
   Filters & Selects
   =================================== */
.filters {
    display: flex;
    gap: 1rem;
    flex-wrap: wrap;
}

.filter-select {
    padding: 0.5rem 1rem;
    border: 1px solid var(--border-color);
    border-radius: 0.5rem;
    background-color: white;
    font-size: 0.875rem;
    cursor: pointer;
    transition: var(--transition);
}

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

.filter-buttons {
    display: flex;
    gap: 0.75rem;
    margin-bottom: 2rem;
    flex-wrap: wrap;
}

.filter-btn {
    padding: 0.5rem 1.5rem;
    border-radius: 0.5rem;
    font-weight: 500;
    background-color: white;
    color: var(--text-gray);
    border: 1px solid var(--border-color);
    transition: var(--transition);
}

.filter-btn:hover,
.filter-btn.active {
    background-color: var(--primary-color);
    color: white;
    border-color: var(--primary-color);
}

/* ===================================
   KPI Leaderboard
   =================================== */
.table-container {
    overflow-x: auto;
    background-color: white;
    border-radius: 0.5rem;
    box-shadow: var(--shadow-md);
}

.kpi-table {
    width: 100%;
    min-width: 800px;
    border-collapse: collapse;
}

.kpi-table thead {
    background-color: var(--bg-gray);
}

.kpi-table th {
    padding: 0.75rem 1.5rem;
    text-align: left;
    font-size: 0.75rem;
    font-weight: 600;
    text-transform: uppercase;
    color: var(--text-gray);
    letter-spacing: 0.05em;
}

.kpi-table td {
    padding: 1rem 1.5rem;
    border-bottom: 1px solid var(--border-color);
    font-size: 0.875rem;
}

.kpi-table tbody tr:hover {
    background-color: var(--bg-gray);
}

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

.rank-badge {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 32px;
    height: 32px;
    border-radius: 50%;
    background-color: var(--primary-color);
    color: white;
    font-weight: 700;
    font-size: 0.875rem;
}

/* ===================================
   Accordion (State List)
   =================================== */
.states-list {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
}

.accordion-item {
    border: 1px solid var(--border-color);
    border-radius: 0.5rem;
    overflow: hidden;
}

.accordion-header {
    width: 100%;
    padding: 1rem 1.5rem;
    background-color: white;
    display: flex;
    justify-content: space-between;
    align-items: center;
    cursor: pointer;
    transition: var(--transition);
}

.accordion-header:hover {
    background-color: var(--bg-gray);
}

.accordion-title {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    font-weight: 600;
}

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

.badge {
    padding: 0.25rem 0.75rem;
    background-color: rgba(37, 99, 235, 0.1);
    color: var(--primary-color);
    border-radius: 9999px;
    font-size: 0.75rem;
    font-weight: 600;
}

.accordion-icon {
    color: var(--text-light);
    transition: var(--transition);
}

.accordion-item.active .accordion-icon {
    transform: rotate(180deg);
}

.accordion-content {
    max-height: 0;
    overflow: hidden;
    transition: max-height 0.3s ease-out;
}

.accordion-item.active .accordion-content {
    max-height: 500px;
}

.accordion-content ul {
    padding: 1rem 1.5rem;
    background-color: var(--bg-gray);
    border-top: 1px solid var(--border-color);
}

.accordion-content li {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.5rem 0;
    color: var(--text-gray);
}

.accordion-content li i {
    color: var(--primary-color);
    font-size: 0.75rem;
}

.map-container img {
    width: 100%;
    border-radius: 0.5rem;
    box-shadow: var(--shadow-lg);
}

/* ===================================
   Resource Cards (Knowledge Hub)
   =================================== */
.resource-card {
    background-color: white;
    border-radius: 0.5rem;
    overflow: hidden;
    box-shadow: var(--shadow-md);
    transition: var(--transition);
}

.resource-card:hover {
    box-shadow: var(--shadow-xl);
}

.resource-image {
    height: 192px;
    background: linear-gradient(135deg, var(--primary-color), var(--primary-light));
    display: flex;
    align-items: center;
    justify-content: center;
}

.resource-image i {
    font-size: 4rem;
    color: rgba(255, 255, 255, 0.75);
}

.resource-content {
    padding: 1.5rem;
}

.resource-tag {
    display: inline-block;
    padding: 0.25rem 0.75rem;
    background-color: rgba(37, 99, 235, 0.1);
    color: var(--primary-color);
    border-radius: 9999px;
    font-size: 0.75rem;
    font-weight: 600;
    margin-bottom: 0.75rem;
}

.resource-content h3 {
    font-size: 1.125rem;
    margin-bottom: 0.5rem;
    color: var(--text-dark);
}

.resource-domain {
    font-size: 0.875rem;
    color: var(--text-gray);
    margin-bottom: 0.25rem;
}

.resource-meta {
    font-size: 0.75rem;
    color: var(--text-light);
    margin-bottom: 1rem;
}

.resource-actions {
    display: flex;
    gap: 0.5rem;
}

.resource-actions .btn {
    flex: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
}

/* ===================================
   Events
   =================================== */
.events-list {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.event-card {
    background-color: white;
    border: 1px solid var(--border-color);
    border-radius: 0.5rem;
    padding: 1rem;
    transition: var(--transition);
}

.event-card.upcoming {
    background: linear-gradient(135deg, rgba(37, 99, 235, 0.05), white);
    border-color: rgba(37, 99, 235, 0.2);
}

.event-card:hover {
    box-shadow: var(--shadow-md);
}

.event-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    gap: 1rem;
    margin-bottom: 0.5rem;
}

.event-card h4 {
    font-size: 1rem;
    font-weight: 600;
    color: var(--text-dark);
}

.event-type {
    padding: 0.25rem 0.75rem;
    background-color: var(--primary-color);
    color: white;
    border-radius: 0.25rem;
    font-size: 0.75rem;
    white-space: nowrap;
}

.event-detail {
    font-size: 0.875rem;
    color: var(--text-gray);
    margin-bottom: 0.25rem;
}

.event-card .btn {
    margin-top: 0.75rem;
}

/* ===================================
   Ranking Metrics
   =================================== */
.ranking-section {
    background: linear-gradient(135deg, var(--primary-color), var(--primary-light));
}

.metrics-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 1.5rem;
}

.metric-card {
    background-color: rgba(255, 255, 255, 0.1);
    backdrop-filter: blur(10px);
    border-radius: 0.5rem;
    padding: 2rem 1.5rem;
    text-align: center;
    transition: var(--transition);
}

.metric-card:hover {
    background-color: rgba(255, 255, 255, 0.2);
}

.metric-icon {
    font-size: 2rem;
    margin-bottom: 1rem;
}

.metric-icon.fa-trophy { color: #fbbf24; }
.metric-icon.fa-users { color: #60a5fa; }
.metric-icon.fa-file-alt { color: #34d399; }
.metric-icon.fa-chart-line { color: #a78bfa; }
.metric-icon.fa-book { color: #f87171; }

.metric-value {
    font-size: 2rem;
    font-weight: 700;
    color: white;
    margin-bottom: 0.5rem;
}

.metric-label {
    font-size: 0.875rem;
    color: rgba(255, 255, 255, 0.9);
}

/* ===================================
   Footer
   =================================== */
.footer {
    background-color: #111827;
    color: white;
    padding: 3rem 0 1.5rem;
}

.footer-grid {
    display: grid;
    grid-template-columns: 1fr;
    gap: 2rem;
    margin-bottom: 2rem;
}

.footer h3 {
    font-size: 1.125rem;
    margin-bottom: 1rem;
}

.footer-contact p {
    display: flex;
    align-items: flex-start;
    gap: 0.5rem;
    margin-bottom: 0.75rem;
    font-size: 0.875rem;
    color: rgba(255, 255, 255, 0.8);
}

.footer-contact i {
    margin-top: 0.25rem;
}

.footer-links {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.footer-links a {
    font-size: 0.875rem;
    color: rgba(255, 255, 255, 0.8);
    transition: var(--transition);
}

.footer-links a:hover {
    color: var(--primary-light);
}

.social-links {
    display: flex;
    gap: 1rem;
}

.social-links a {
    width: 40px;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    background-color: var(--primary-color);
    transition: var(--transition);
}

.social-links a:hover {
    background-color: var(--primary-light);
    transform: translateY(-2px);
}

.footer-bottom {
    border-top: 1px solid rgba(255, 255, 255, 0.1);
    padding-top: 1.5rem;
    text-align: center;
    font-size: 0.875rem;
    color: rgba(255, 255, 255, 0.6);
}

.footer-bottom a {
    color: rgba(255, 255, 255, 0.8);
}

.footer-bottom a:hover {
    color: var(--primary-light);
}

/* ===================================
   Page Headers (for sub-pages)
   =================================== */
.page-header {
    height: 256px;
    background: linear-gradient(135deg, var(--primary-color), var(--primary-light));
    display: flex;
    align-items: center;
    justify-content: center;
    margin-top: 80px;
    color: white;
}

.page-header.green {
    background: linear-gradient(135deg, #059669, #10b981);
}

.page-header.purple {
    background: linear-gradient(135deg, #7c3aed, #8b5cf6);
}

.page-header.orange {
    background: linear-gradient(135deg, #ea580c, #f97316);
}

.page-header.indigo {
    background: linear-gradient(135deg, #4f46e5, #6366f1);
}

.page-header.yellow {
    background: linear-gradient(135deg, #d97706, #f59e0b);
}

.page-header.red {
    background: linear-gradient(135deg, #dc2626, #ef4444);
}

.page-header.teal {
    background: linear-gradient(135deg, #0d9488, #14b8a6);
}

.breadcrumb {
    font-size: 0.875rem;
    margin-bottom: 1rem;
    opacity: 0.9;
}

.page-header h1 {
    font-size: 2.5rem;
    font-weight: 700;
}

/* ===================================
   Responsive Design
   =================================== */
@media (min-width: 768px) {
    .grid-2 {
        grid-template-columns: repeat(2, 1fr);
    }
    
    .grid-3 {
        grid-template-columns: repeat(2, 1fr);
    }
    
    .metrics-grid {
        grid-template-columns: repeat(5, 1fr);
    }
    
    .footer-grid {
        grid-template-columns: repeat(2, 1fr);
    }
}

@media (min-width: 1024px) {
    .nav-desktop {
        display: flex;
    }
    
    .mobile-menu-btn {
        display: none;
    }
    
    .grid-3 {
        grid-template-columns: repeat(3, 1fr);
    }
    
    .footer-grid {
        grid-template-columns: repeat(4, 1fr);
    }
    
    .slide-content h2 {
        font-size: 3.75rem;
    }
    
    .slide-content p {
        font-size: 1.5rem;
    }
}

/* ===================================
   Accessibility
   =================================== */
.sr-only {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border-width: 0;
}

:focus-visible {
    outline: 2px solid var(--primary-color);
    outline-offset: 2px;
}

/* ===================================
   Loading & Performance
   =================================== */
img[loading="lazy"] {
    opacity: 0;
    transition: opacity 0.3s;
}

img[loading="lazy"].loaded {
    opacity: 1;
}