/* ══════════════════════════════════════════════════════════════
   oke-sappo-home.css
   Section Statistik Pengaduan Oke Sappo — halaman beranda PPID
   Load: <link rel="stylesheet" href="{{ asset('css/oke-sappo-home.css') }}">
══════════════════════════════════════════════════════════════ */

/* ── Section wrapper ── */
.ppid-sappo-section {
    padding: 80px 0 88px;
    background: #ffffff;
    position: relative;
    overflow: hidden;
}

/* Garis aksen atas — menyatu dengan section sebelumnya */
.ppid-sappo-section::before {
    content: '';
    position: absolute;
    top: 0; left: 0; right: 0;
    height: 1px;
    background: #e2e8f0;
}

/* Dekorasi blob latar belakang — halus, tidak mengganggu */
.ppid-sappo-section::after {
    content: '';
    position: absolute;
    top: -120px;
    right: -160px;
    width: 520px;
    height: 520px;
    border-radius: 50%;
    background: radial-gradient(circle, rgba(99,102,241,.055) 0%, transparent 70%);
    pointer-events: none;
    z-index: 0;
}
.ppid-sappo-section .container {
    position: relative;
    z-index: 1;
}

/* ── Intro row ── */
.sappo-intro {
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: 16px;
    margin-bottom: 36px;
    padding: 22px 28px;
    background: linear-gradient(135deg, #f8faff 0%, #f0f4ff 100%);
    border: 1px solid #dde3f5;
    border-radius: 14px;
    box-shadow: 0 2px 16px rgba(99,102,241,.07);
}
.sappo-intro-text {
    font-size: .875rem;
    color: #475569;
    font-family: 'Plus Jakarta Sans', sans-serif;
    margin: 0;
    flex: 1;
    min-width: 200px;
    line-height: 1.7;
}

/* ── Tombol WA inline ── */
.sappo-wa-btn {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 11px 22px;
    background: linear-gradient(135deg, #25d366 0%, #128c7e 100%);
    color: #fff;
    font-size: .82rem;
    font-weight: 700;
    font-family: 'Plus Jakarta Sans', sans-serif;
    border-radius: 10px;
    text-decoration: none;
    white-space: nowrap;
    transition: filter .2s, transform .2s, box-shadow .2s;
    box-shadow: 0 4px 16px rgba(37,211,102,.3);
    flex-shrink: 0;
}
.sappo-wa-btn:hover {
    filter: brightness(1.08);
    transform: translateY(-2px);
    box-shadow: 0 8px 24px rgba(37,211,102,.4);
    color: #fff;
    text-decoration: none;
}

/* ── Stat cards (4 kolom) ── */
.sappo-stat-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 16px;
    margin-bottom: 28px;
}
.sappo-stat-card {
    display: flex;
    align-items: center;
    gap: 14px;
    padding: 20px 22px;
    border-radius: 14px;
    border: 1px solid transparent;
    box-shadow:
        0 2px 4px rgba(0,0,0,.04),
        0 6px 20px rgba(0,0,0,.06);
    transition: transform .2s, box-shadow .2s;
    position: relative;
    overflow: hidden;
}
/* Efek gloss sudut kanan atas */
.sappo-stat-card::after {
    content: '';
    position: absolute;
    top: -30px;
    right: -30px;
    width: 80px;
    height: 80px;
    border-radius: 50%;
    background: rgba(255,255,255,.35);
    pointer-events: none;
}
.sappo-stat-card:hover {
    transform: translateY(-4px);
    box-shadow:
        0 4px 8px rgba(0,0,0,.06),
        0 12px 32px rgba(0,0,0,.1);
}
.sappo-stat-icon-wrap {
    width: 48px;
    height: 48px;
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.15rem;
    flex-shrink: 0;
    box-shadow: 0 4px 12px rgba(0,0,0,.1);
}
.sappo-stat-info {
    display: flex;
    flex-direction: column;
    gap: 3px;
}
.sappo-stat-label {
    font-size: .68rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: .06em;
    font-family: 'Plus Jakarta Sans', sans-serif;
    opacity: .72;
}
.sappo-stat-value {
    font-size: 1.65rem;
    font-weight: 800;
    font-family: 'Plus Jakarta Sans', sans-serif;
    line-height: 1;
}

/* Warna per kartu */
.sappo-card-total    { background: linear-gradient(135deg, #eff6ff 0%, #dbeafe 100%); border-color: #bfdbfe; color: #1d4ed8; }
.sappo-card-total    .sappo-stat-icon-wrap { background: linear-gradient(135deg, #3b82f6, #2563eb); color: #fff; }
.sappo-card-baru     { background: linear-gradient(135deg, #fffbeb 0%, #fef3c7 100%); border-color: #fde68a; color: #92400e; }
.sappo-card-baru     .sappo-stat-icon-wrap { background: linear-gradient(135deg, #fbbf24, #d97706); color: #fff; }
.sappo-card-progress { background: linear-gradient(135deg, #eff6ff 0%, #dbeafe 100%); border-color: #93c5fd; color: #1e40af; }
.sappo-card-progress .sappo-stat-icon-wrap { background: linear-gradient(135deg, #60a5fa, #3b82f6); color: #fff; }
.sappo-card-selesai  { background: linear-gradient(135deg, #f0fdf4 0%, #dcfce7 100%); border-color: #86efac; color: #14532d; }
.sappo-card-selesai  .sappo-stat-icon-wrap { background: linear-gradient(135deg, #4ade80, #16a34a); color: #fff; }

/* ── Chart layout (2 kolom: 60/40) ── */
.sappo-chart-wrap {
    display: grid;
    grid-template-columns: 3fr 2fr;
    gap: 20px;
}
.sappo-chart-card {
    background: #ffffff;
    border: 1px solid #e8edf5;
    border-radius: 16px;
    box-shadow:
        0 1px 3px rgba(0,0,0,.04),
        0 8px 28px rgba(99,102,241,.08);
    overflow: hidden;
    display: flex;
    flex-direction: column;
    transition: box-shadow .2s;
}
.sappo-chart-card:hover {
    box-shadow:
        0 2px 6px rgba(0,0,0,.06),
        0 14px 40px rgba(99,102,241,.13);
}
.sappo-chart-head {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: 10px;
    padding: 20px 22px 0;
    border-bottom: 1px solid #f1f5f9;
    padding-bottom: 16px;
}
.sappo-chart-title {
    font-size: .92rem;
    font-weight: 800;
    color: #1e293b;
    font-family: 'Plus Jakarta Sans', sans-serif;
    margin: 0 0 3px;
}
.sappo-chart-sub {
    font-size: .74rem;
    color: #64748b;
    font-family: 'Plus Jakarta Sans', sans-serif;
    margin: 0;
}
.sappo-canvas-wrap {
    padding: 18px 18px 20px;
    flex: 1;
    min-height: 300px;
    position: relative;
}
.sappo-donut-canvas {
    min-height: 220px;
    max-height: 260px;
    display: flex;
    align-items: center;
    justify-content: center;
}

/* ── Toggle chart type ── */
.sappo-toggle-wrap {
    display: flex;
    gap: 4px;
    background: #f1f5f9;
    border-radius: 8px;
    padding: 3px;
    flex-shrink: 0;
}
.sappo-toggle-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 32px;
    height: 30px;
    border: none;
    background: transparent;
    border-radius: 6px;
    color: #94a3b8;
    cursor: pointer;
    font-size: .82rem;
    transition: background .15s, color .15s;
}
.sappo-toggle-btn:hover { color: #6366f1; }
.sappo-toggle-active {
    background: #fff !important;
    color: #6366f1 !important;
    box-shadow: 0 1px 4px rgba(0,0,0,.1);
}

/* ── Legenda donut ── */
.sappo-legend {
    padding: 16px 22px 22px;
    display: flex;
    flex-direction: column;
    gap: 10px;
    border-top: 1px solid #f1f5f9;
}
.sappo-legend-item {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 8px 12px;
    border-radius: 8px;
    background: #f8fafc;
    transition: background .15s;
}
.sappo-legend-item:hover { background: #f1f5f9; }
.sappo-legend-dot {
    width: 10px;
    height: 10px;
    border-radius: 50%;
    flex-shrink: 0;
    box-shadow: 0 2px 6px rgba(0,0,0,.2);
}
.sappo-legend-label {
    font-size: .78rem;
    font-weight: 600;
    color: #1e293b;
    font-family: 'Plus Jakarta Sans', sans-serif;
    flex: 1;
}
.sappo-legend-num {
    font-size: .85rem;
    font-weight: 800;
    color: #334155;
    font-family: 'Plus Jakarta Sans', sans-serif;
    min-width: 32px;
    text-align: right;
}

/* ══════════════════════════════════════════════════════════════
   TOMBOL WA FLOATING
══════════════════════════════════════════════════════════════ */
.sappo-wa-float {
    position: fixed;
    bottom: 28px;
    right: 28px;
    z-index: 9999;
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 12px 20px;
    background: linear-gradient(135deg, #25d366 0%, #128c7e 100%);
    color: #fff;
    border-radius: 50px;
    text-decoration: none;
    font-family: 'Plus Jakarta Sans', sans-serif;
    font-size: .8rem;
    font-weight: 700;
    box-shadow:
        0 4px 12px rgba(37,211,102,.35),
        0 0 0 0 rgba(37,211,102,.4);
    transition: transform .2s, box-shadow .2s, filter .2s;
    white-space: nowrap;
}
.sappo-wa-float:hover {
    filter: brightness(1.08);
    transform: translateY(-3px) scale(1.03);
    box-shadow:
        0 8px 24px rgba(37,211,102,.45),
        0 0 0 0 rgba(37,211,102,.4);
    color: #fff;
    text-decoration: none;
}
.sappo-wa-float-label { display: inline; }

/* Pulse ring */
.sappo-wa-float::before {
    content: '';
    position: absolute;
    inset: -4px;
    border-radius: 50px;
    border: 2px solid rgba(37,211,102,.5);
    animation: waPulse 2.2s ease-out infinite;
}
@keyframes waPulse {
    0%   { transform: scale(1);    opacity: 1; }
    70%  { transform: scale(1.14); opacity: 0; }
    100% { transform: scale(1.14); opacity: 0; }
}

/* ══════════════════════════════════════════════════════════════
   RESPONSIVE
══════════════════════════════════════════════════════════════ */
@media (max-width: 1024px) {
    .sappo-stat-grid  { grid-template-columns: repeat(2, 1fr); }
    .sappo-chart-wrap { grid-template-columns: 1fr; }
}
@media (max-width: 640px) {
    .ppid-sappo-section { padding: 56px 0 64px; }
    .sappo-stat-grid    { grid-template-columns: 1fr 1fr; gap: 12px; }
    .sappo-intro        { flex-direction: column; align-items: flex-start; }
    .sappo-wa-btn       { width: 100%; justify-content: center; }
    .sappo-wa-float-label { display: none; }
    .sappo-wa-float     { padding: 14px; border-radius: 50%; }
    .sappo-wa-float::before { border-radius: 50%; }
}
@media (max-width: 400px) {
    .sappo-stat-grid { grid-template-columns: 1fr; }
}