/* ============================================
   STATISTIK PAGE STYLES
   Tema: Hijau Pamekasan (#116b3f, #1f6f3f, #14673c)
   ============================================ */

/* Hero Section dengan Background */
.stats-hero {
    background: linear-gradient(
            135deg,
            rgba(17, 107, 63, 0.95),
            rgba(0, 0, 0, 0.85)
        ),
        url("../img/peta.jpg") no-repeat center center;
    background-size: cover;
    color: #fff;
    padding: 60px 0;
    position: relative;
    overflow: hidden;
}

.stats-hero::before {
    content: "";
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: radial-gradient(
            circle at 20% 80%,
            rgba(31, 111, 63, 0.3) 0%,
            transparent 50%
        ),
        radial-gradient(
            circle at 80% 20%,
            rgba(20, 103, 60, 0.2) 0%,
            transparent 50%
        );
    pointer-events: none;
}

.stats-hero .container {
    position: relative;
    z-index: 1;
}

.hero-content {
    text-align: center;
    max-width: 800px;
    margin: 0 auto;
}

.hero-actions {
    margin-top: 24px;
    display: flex;
    gap: 16px;
    justify-content: center;
    flex-wrap: wrap;
}

.hero-icon {
    font-size: 48px;
    margin-bottom: 16px;
    animation: float 3s ease-in-out infinite;
}

@keyframes float {
    0%,
    100% {
        transform: translateY(0);
    }
    50% {
        transform: translateY(-10px);
    }
}

.hero-title {
    font-size: 36px;
    font-weight: 800;
    margin: 0 0 12px;
    text-shadow: 2px 2px 4px rgba(0, 0, 0, 0.3);
    letter-spacing: -0.5px;
}

.hero-subtitle {
    font-size: 18px;
    color: rgba(255, 255, 255, 0.85);
    margin: 0;
    font-weight: 400;
}

/* Container */
.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 20px;
}

/* Overview Stats Section */
.overview-section {
    padding: 40px 0;
    background: linear-gradient(180deg, #f5f7f6 0%, #ffffff 100%);
}

.section-header {
    text-align: center;
    margin-bottom: 32px;
}

.section-badge {
    display: inline-block;
    background: linear-gradient(135deg, #eef7ef, #d4f0dc);
    color: #14673c;
    padding: 6px 16px;
    border-radius: 20px;
    font-size: 12px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 1px;
    margin-bottom: 12px;
}

.section-title {
    font-size: 28px;
    color: #133f2a;
    font-weight: 800;
    margin: 0 0 8px;
}

.section-desc {
    color: #71867f;
    font-size: 15px;
    margin: 0;
}

/* Stats Grid */
.stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 20px;
}

.stat-card {
    background: #fff;
    border-radius: 16px;
    padding: 24px;
    display: flex;
    gap: 18px;
    align-items: center;
    box-shadow: 0 4px 20px rgba(20, 80, 40, 0.08);
    border: 1px solid rgba(20, 103, 60, 0.08);
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    position: relative;
    overflow: hidden;
}

.stat-card::before {
    content: "";
    position: absolute;
    top: 0;
    left: 0;
    width: 4px;
    height: 100%;
    background: linear-gradient(180deg, #1f6f3f, #14673c);
    opacity: 0;
    transition: opacity 0.3s ease;
}

.stat-card:hover {
    transform: translateY(-4px);
    box-shadow: 0 12px 32px rgba(20, 80, 40, 0.15);
}

.stat-card:hover::before {
    opacity: 1;
}

.stat-icon {
    font-size: 32px;
    width: 64px;
    height: 64px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 14px;
    background: linear-gradient(135deg, #eef7ef, #d4f0dc);
    color: #116b3f;
    flex-shrink: 0;
}

.stat-body {
    flex: 1;
}

.stat-value {
    font-weight: 800;
    font-size: 28px;
    color: #133f2a;
    line-height: 1.2;
    margin-bottom: 4px;
}

.stat-label {
    color: #71867f;
    font-size: 14px;
    font-weight: 500;
}

.stat-trend {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    font-size: 12px;
    padding: 4px 8px;
    border-radius: 6px;
    margin-top: 8px;
}

.stat-trend.up {
    background: rgba(34, 197, 94, 0.1);
    color: #16a34a;
}

.stat-trend.down {
    background: rgba(239, 68, 68, 0.1);
    color: #dc2626;
}

/* Population Section */
.population-section {
    padding: 50px 0;
    background: #fff;
}

.population-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 32px;
    flex-wrap: wrap;
    gap: 16px;
}

.population-header .section-header {
    text-align: left;
    margin-bottom: 0;
}

.view-toggle {
    display: flex;
    gap: 8px;
    background: #f5f7f6;
    padding: 4px;
    border-radius: 10px;
}

.view-btn {
    padding: 8px 16px;
    border: none;
    background: transparent;
    border-radius: 8px;
    cursor: pointer;
    font-size: 14px;
    font-weight: 600;
    color: #71867f;
    transition: all 0.2s ease;
}

.view-btn.active {
    background: #fff;
    color: #14673c;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
}

.view-btn:hover:not(.active) {
    color: #14673c;
}

/* Population Grid */
.population-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
    gap: 16px;
}

.population-card {
    background: linear-gradient(135deg, #fff 0%, #f8fffa 100%);
    border-radius: 14px;
    padding: 20px;
    text-align: center;
    border: 1px solid #e6efe7;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    position: relative;
    overflow: hidden;
}

.population-card::after {
    content: "";
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    height: 3px;
    background: linear-gradient(90deg, #1f6f3f, #2aa05a);
    transform: scaleX(0);
    transition: transform 0.3s ease;
}

.population-card:hover {
    transform: translateY(-4px);
    box-shadow: 0 12px 28px rgba(20, 80, 40, 0.12);
}

.population-card:hover::after {
    transform: scaleX(1);
}

.population-rank {
    position: absolute;
    top: 12px;
    right: 12px;
    width: 28px;
    height: 28px;
    background: linear-gradient(135deg, #1f6f3f, #14673c);
    color: #fff;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 12px;
    font-weight: 700;
}

.population-icon {
    font-size: 36px;
    margin-bottom: 12px;
}

.population-region {
    font-weight: 700;
    font-size: 16px;
    margin-bottom: 8px;
    color: #14673c;
}

.population-value {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    font-size: 22px;
    font-weight: 800;
    color: #133f2a;
    background: linear-gradient(180deg, #eef7ef, #f8fffa);
    padding: 8px 16px;
    border-radius: 10px;
    border: 1px solid #e6efe7;
}

.population-value small {
    font-size: 12px;
    font-weight: 500;
    color: #71867f;
}

/* Chart Section */
.chart-section {
    padding: 50px 0;
    background: linear-gradient(180deg, #f5f7f6 0%, #eef6ef 100%);
}

.chart-container {
    background: #fff;
    border-radius: 16px;
    padding: 24px;
    box-shadow: 0 4px 20px rgba(20, 80, 40, 0.08);
    border: 1px solid rgba(20, 103, 60, 0.08);
}

.chart-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 24px;
    padding-bottom: 16px;
    border-bottom: 1px solid #eef6ef;
}

.chart-title {
    font-size: 18px;
    font-weight: 700;
    color: #133f2a;
    margin: 0;
}

.chart-legend {
    display: flex;
    gap: 16px;
}

.legend-item {
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: 13px;
    color: #71867f;
}

.legend-dot {
    width: 10px;
    height: 10px;
    border-radius: 50%;
}

.legend-dot.primary {
    background: linear-gradient(135deg, #1f6f3f, #2aa05a);
}

/* Bar Chart */
.bar-chart {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.bar-item {
    display: flex;
    align-items: center;
    gap: 16px;
}

.bar-label {
    width: 120px;
    font-size: 13px;
    font-weight: 600;
    color: #133f2a;
    text-align: right;
    flex-shrink: 0;
}

.bar-track {
    flex: 1;
    height: 32px;
    background: #f5f7f6;
    border-radius: 8px;
    overflow: hidden;
    position: relative;
}

.bar-fill {
    height: 100%;
    background: linear-gradient(90deg, #1f6f3f, #2aa05a);
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: flex-end;
    padding-right: 12px;
    transition: width 1s cubic-bezier(0.4, 0, 0.2, 1);
    min-width: 60px;
}

.bar-value {
    font-size: 12px;
    font-weight: 700;
    color: #fff;
}

/* Summary Cards */
.summary-section {
    padding: 50px 0;
    background: #fff;
}

.summary-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 20px;
}

.summary-card {
    background: linear-gradient(135deg, #116b3f, #0f5a35);
    border-radius: 16px;
    padding: 28px;
    color: #fff;
    position: relative;
    overflow: hidden;
}

.summary-card::before {
    content: "";
    position: absolute;
    top: -50%;
    right: -50%;
    width: 100%;
    height: 100%;
    background: radial-gradient(
        circle,
        rgba(255, 255, 255, 0.1) 0%,
        transparent 70%
    );
    pointer-events: none;
}

.summary-card .card-icon {
    font-size: 40px;
    margin-bottom: 16px;
}

.summary-card .card-title {
    font-size: 14px;
    font-weight: 600;
    opacity: 0.85;
    margin-bottom: 8px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.summary-card .card-value {
    font-size: 36px;
    font-weight: 800;
    margin-bottom: 8px;
}

.summary-card .card-desc {
    font-size: 14px;
    opacity: 0.75;
    line-height: 1.5;
}

.summary-card.alt {
    background: linear-gradient(135deg, #133f2a, #0a2a1c);
}

/* Info Section */
.info-section {
    padding: 50px 0;
    background: linear-gradient(180deg, #f5f7f6 0%, #fff 100%);
}

.info-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 20px;
}

.info-card {
    background: #fff;
    border-radius: 14px;
    padding: 24px;
    border: 1px solid #e6efe7;
    transition: all 0.3s ease;
}

.info-card:hover {
    box-shadow: 0 8px 24px rgba(20, 80, 40, 0.1);
}

.info-card .card-icon {
    width: 48px;
    height: 48px;
    background: linear-gradient(135deg, #eef7ef, #d4f0dc);
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 24px;
    margin-bottom: 16px;
}

.info-card .card-title {
    font-size: 16px;
    font-weight: 700;
    color: #133f2a;
    margin-bottom: 8px;
}

.info-card .card-text {
    font-size: 14px;
    color: #71867f;
    line-height: 1.6;
    margin: 0;
}

/* Animations */
@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.animate-in {
    animation: fadeInUp 0.6s ease forwards;
}

.delay-1 {
    animation-delay: 0.1s;
}
.delay-2 {
    animation-delay: 0.2s;
}
.delay-3 {
    animation-delay: 0.3s;
}
.delay-4 {
    animation-delay: 0.4s;
}
.delay-5 {
    animation-delay: 0.5s;
}
.delay-6 {
    animation-delay: 0.6s;
}

/* Responsive */
@media (max-width: 768px) {
    .hero-title {
        font-size: 28px;
    }

    .hero-subtitle {
        font-size: 16px;
    }

    .stats-grid {
        grid-template-columns: 1fr;
    }

    .stat-card {
        padding: 20px;
    }

    .stat-value {
        font-size: 24px;
    }

    .population-header {
        flex-direction: column;
        align-items: flex-start;
    }

    .population-header .section-header {
        text-align: center;
        width: 100%;
    }

    .view-toggle {
        width: 100%;
        justify-content: center;
    }

    .bar-label {
        width: 80px;
        font-size: 11px;
    }

    .summary-card .card-value {
        font-size: 28px;
    }

    .chart-header {
        flex-direction: column;
        align-items: flex-start;
        gap: 12px;
    }
}

@media (max-width: 480px) {
    .stats-hero {
        padding: 40px 0;
    }

    .hero-icon {
        font-size: 36px;
    }

    .hero-title {
        font-size: 24px;
    }

    .section-title {
        font-size: 22px;
    }

    .population-grid {
        grid-template-columns: 1fr;
    }

    .bar-item {
        flex-direction: column;
        align-items: flex-start;
        gap: 8px;
    }

    .bar-label {
        width: 100%;
        text-align: left;
    }

    .bar-track {
        width: 100%;
    }
}
