/* ============================================
   SIPERMAN 2.0 - Landing Page Styles
   File: bulesek.css
   Version: 2.0
   ============================================ */

/* ===== CSS VARIABLES ===== */
:root {
    /* Primary Palette - Emerald Green */
    --primary: #10b981;
    --primary-light: #34d399;
    --primary-dark: #059669;
    --primary-gradient: linear-gradient(135deg, #10b981 0%, #059669 100%);
    
    /* Secondary Palette - Indigo */
    --secondary: #6366f1;
    --secondary-light: #818cf8;
    
    /* Neutral Colors */
    --surface: #ffffff;
    --surface-alt: #f8fafc;
    --surface-dark: #0f172a;
    --text: #1e293b;
    --text-muted: #64748b;
    --text-light: #94a3b8;
    --border: #e2e8f0;
    
    /* Status Colors */
    --success: #22c55e;
    --warning: #f59e0b;
    --danger: #ef4444;
    --info: #3b82f6;
    
    /* Shadows */
    --shadow-sm: 0 2px 4px rgba(0,0,0,0.06);
    --shadow: 0 4px 8px rgba(0,0,0,0.08);
    --shadow-md: 0 8px 16px rgba(0,0,0,0.1);
    --shadow-lg: 0 16px 32px rgba(0,0,0,0.12);
    --shadow-glow: 0 0 40px rgba(16, 185, 129, 0.3);
    
    /* Border Radius */
    --radius: 16px;
    --radius-sm: 12px;
    --radius-lg: 24px;
    --radius-full: 9999px;
    
    /* Transitions */
    --transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    --transition-fast: all 0.2s ease;
}

/* ===== RESET & BASE ===== */
* { box-sizing: border-box; margin: 0; padding: 0; }

html { scroll-behavior: smooth; }

body {
    font-family: 'Plus Jakarta Sans', system-ui, -apple-system, sans-serif;
    background: var(--surface-alt);
    color: var(--text);
    line-height: 1.6;
    overflow-x: hidden;
}

/* ===== SCROLLBAR ===== */
::-webkit-scrollbar { width: 8px; }
::-webkit-scrollbar-track { background: var(--surface-alt); }
::-webkit-scrollbar-thumb { 
    background: var(--border); 
    border-radius: var(--radius-full);
}
::-webkit-scrollbar-thumb:hover { background: var(--text-muted); }

/* ===== NAVBAR - DARK PREMIUM ===== */
.navbar {
    background: linear-gradient(135deg, rgba(15, 23, 42, 0.98) 0%, rgba(30, 41, 59, 0.95) 100%);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border-bottom: 1px solid rgba(255,255,255,0.1);
    padding: 1rem 0;
    transition: var(--transition);
    position: fixed;
    width: 100%;
    top: 0;
    z-index: 1000;
}

.navbar.scrolled {
    padding: 0.65rem 0;
    box-shadow: var(--shadow-md);
    background: linear-gradient(135deg, rgba(15, 23, 42, 0.98) 0%, rgba(30, 41, 59, 0.98) 100%);
}

.navbar-brand {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    font-weight: 800;
    color: var(--surface) !important;
    font-size: 1.25rem;
    letter-spacing: -0.02em;
}

.navbar-brand img {
    width: 36px;
    height: 36px;
    border-radius: var(--radius-sm);
    box-shadow: 0 0 20px rgba(16, 185, 129, 0.4);
}

.navbar-brand span {
    background: var(--primary-gradient);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.navbar .nav-link {
    color: var(--text-light) !important;
    font-weight: 500;
    padding: 0.5rem 1rem !important;
    border-radius: var(--radius-sm);
    transition: var(--transition);
    font-size: 0.9rem;
    position: relative;
}

.navbar .nav-link::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 50%;
    transform: translateX(-50%);
    width: 0;
    height: 2px;
    background: var(--primary);
    transition: var(--transition);
    border-radius: var(--radius-full);
}

.navbar .nav-link:hover,
.navbar .nav-link.active {
    color: var(--surface) !important;
}

.navbar .nav-link:hover::after,
.navbar .nav-link.active::after {
    width: 80%;
}

.btn-login {
    background: var(--primary-gradient);
    color: white !important;
    border: none;
    padding: 0.5rem 1.25rem;
    border-radius: var(--radius-full);
    font-weight: 600;
    font-size: 0.875rem;
    transition: var(--transition);
    box-shadow: 0 4px 14px rgba(16, 185, 129, 0.4);
}

.btn-login:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(16, 185, 129, 0.5);
}

/* ===== HERO SLIDER BANNER ===== */
.hero-slider {
    margin-top: 76px;
    position: relative;
    overflow: hidden;
}

.hero-slider .carousel-item {
    min-height: 280px;
    background: var(--primary-gradient);
    position: relative;
}

.hero-slider .carousel-item::before {
    content: '';
    position: absolute;
    inset: 0;
    background: url("data:image/svg+xml,%3Csvg width='60' height='60' viewBox='0 0 60 60' xmlns='http://www.w3.org/2000/svg'%3E%3Cg fill='none' fill-rule='evenodd'%3E%3Cg fill='%23ffffff' fill-opacity='0.08'%3E%3Cpath d='M36 34v-4h-2v4h-4v2h4v4h2v-4h4v-2h-4zm0-30V0h-2v4h-4v2h4v4h2V6h4V4h-4zM6 34v-4H4v4H0v2h4v4h2v-4h4v-2H6zM6 4V0H4v4H0v2h4v4h2V6h4V4H6z'/%3E%3C/g%3E%3C/g%3E%3C/svg%3E");
    opacity: 0.5;
}

.hero-slider-content {
    position: relative;
    z-index: 2;
    padding: 3rem 0;
    color: white;
}

.hero-slider-title {
    font-size: clamp(1.5rem, 4vw, 2.25rem);
    font-weight: 800;
    margin-bottom: 0.5rem;
    letter-spacing: -0.03em;
}

.hero-slider-subtitle {
    font-size: 1rem;
    opacity: 0.95;
    max-width: 600px;
    margin: 0 auto;
    font-weight: 400;
}

.hero-slider .carousel-indicators {
    bottom: 1rem;
}

.hero-slider .carousel-indicators [data-bs-target] {
    width: 8px;
    height: 8px;
    border-radius: var(--radius-full);
    background: rgba(255,255,255,0.5);
    border: none;
}

.hero-slider .carousel-indicators .active {
    background: var(--surface);
    width: 24px;
}

.hero-slider .carousel-control-prev-icon,
.hero-slider .carousel-control-next-icon {
    width: 2rem;
    height: 2rem;
    background-size: 60%;
    filter: brightness(0) invert(1);
}

/* ===== STATS ===== */
.stats-wrapper {
    position: relative;
    z-index: 10;
    margin-top: -40px;
}

.stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
    gap: 1rem;
    padding: 0 0.5rem;
}

.stat-card {
    background: var(--surface);
    border-radius: var(--radius);
    padding: 1.25rem 1rem;
    text-align: center;
    box-shadow: var(--shadow-md);
    border: 1px solid var(--border);
    transition: var(--transition);
    position: relative;
    overflow: hidden;
}

.stat-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 3px;
    background: var(--primary-gradient);
    transform: scaleX(0);
    transition: var(--transition);
}

.stat-card:hover {
    transform: translateY(-6px);
    box-shadow: var(--shadow-lg);
    border-color: var(--primary-light);
}

.stat-card:hover::before {
    transform: scaleX(1);
}

.stat-value {
    font-size: 1.5rem;
    font-weight: 800;
    color: var(--text);
    line-height: 1.2;
    margin: 0.5rem 0;
}

.stat-label {
    font-size: 0.7rem;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.05em;
    font-weight: 600;
}

.stat-icon {
    width: 48px;
    height: 48px;
    border-radius: var(--radius-sm);
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 auto;
    font-size: 1.25rem;
    transition: var(--transition);
}

.stat-card:hover .stat-icon {
    transform: scale(1.1) rotate(5deg);
}

.stat-icon.rl { background: rgba(34,197,94,0.12); color: var(--success); }
.stat-icon.rtl { background: rgba(239,68,68,0.12); color: var(--danger); }
.stat-icon.primary { background: rgba(16,185,129,0.12); color: var(--primary); }
.stat-icon.info { background: rgba(99,102,241,0.12); color: var(--secondary); }
.stat-icon.warning { background: rgba(245,158,11,0.12); color: var(--warning); }

/* ===== SECTION ===== */
.section { padding: 3.5rem 0; }

.section-header {
    text-align: center;
    margin-bottom: 2.5rem;
}

.section-badge {
    display: inline-block;
    padding: 0.35rem 0.75rem;
    background: rgba(16, 185, 129, 0.1);
    color: var(--primary);
    border-radius: var(--radius-full);
    font-size: 0.75rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    margin-bottom: 0.75rem;
}

.section-title {
    font-size: 1.75rem;
    font-weight: 800;
    color: var(--text);
    margin-bottom: 0.5rem;
    letter-spacing: -0.02em;
}

.section-subtitle {
    color: var(--text-muted);
    max-width: 500px;
    margin: 0 auto;
    font-size: 0.95rem;
}

/* ===== CARD ===== */
.card-modern {
    background: var(--surface);
    border-radius: var(--radius-lg);
    border: 1px solid var(--border);
    box-shadow: var(--shadow);
    overflow: hidden;
    transition: var(--transition);
}

.card-modern:hover {
    box-shadow: var(--shadow-md);
}

.card-body { padding: 1.5rem; }

/* ===== OFFICIALS ===== */
.officials-grid {
    display: grid;
    grid-template-columns: 1fr;
    gap: 1.5rem;
}

@media (min-width: 992px) {
    .officials-grid { grid-template-columns: 1.8fr 1fr; }
}

.official-card {
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
}

/* Foto Kepala Daerah - HORIZONTAL/LANDSCAPE */
.official-avatar {
    width: 100%;
    max-width: 340px;
    height: 220px; /* Lebih lebar dari tinggi (landscape) */
    object-fit: cover;
    object-position: center center; /* Fokus tengah, crop atas-bawah */
    border-radius: var(--radius);
    border: 4px solid var(--surface-alt);
    margin-bottom: 1rem;
    box-shadow: var(--shadow-md);
    transition: var(--transition);
}

.official-avatar:hover {
    transform: scale(1.02);
    box-shadow: var(--shadow-lg);
}

/* Khusus untuk card Kepala Daerah (bukan slider) */
.card-modern:first-child .official-avatar {
    height: 240px; /* Sedikit lebih tinggi untuk bupati */
    max-width: 360px;
}

.official-info h5 {
    font-weight: 700;
    margin-bottom: 0.25rem;
    font-size: 1.1rem;
}

.official-role {
    color: var(--primary);
    font-weight: 600;
    font-size: 0.9rem;
}

.official-period {
    color: var(--text-muted);
    font-size: 0.8rem;
    margin-top: 0.25rem;
}


/* ===== PEJABAT SLIDER - FIXED ===== */
#pejabatSlider {
    position: relative;
    overflow: hidden;
}

#pejabatSlider .carousel-inner {
    min-height: 320px; /* Fixed height untuk konsistensi */
}

#pejabatSlider .carousel-item {
    padding: 0.5rem;
    min-height: 320px;
    display: flex;
    align-items: center;
    justify-content: center;
}

#pejabatSlider .official-card {
    width: 100%;
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
}

#pejabatSlider .official-avatar {
    width: 100%;
    max-width: 240px;
    height: 260px; /* Lebih memanjang */
    object-fit: cover;
    border-radius: var(--radius);
    border: 4px solid var(--surface-alt);
    margin: 0 auto 1rem;
    box-shadow: var(--shadow-md);
    transition: var(--transition);
}

#pejabatSlider .official-avatar:hover {
    transform: scale(1.03);
    box-shadow: var(--shadow-lg);
}

#pejabatSlider .official-info {
    width: 100%;
    padding: 0 1rem;
}

#pejabatSlider .official-info h6 {
    font-weight: 700;
    margin-bottom: 0.25rem;
    font-size: 1.05rem;
    color: var(--text);
}

#pejabatSlider .official-role {
    font-size: 0.9rem;
    color: var(--primary);
    font-weight: 600;
}

/* Carousel Controls - More Visible */
#pejabatSlider .carousel-control-prev,
#pejabatSlider .carousel-control-next {
    width: 10%;
    opacity: 0.7;
    transition: var(--transition);
}

#pejabatSlider .carousel-control-prev:hover,
#pejabatSlider .carousel-control-next:hover {
    opacity: 1;
}

#pejabatSlider .carousel-control-prev-icon,
#pejabatSlider .carousel-control-next-icon {
    width: 2.5rem;
    height: 2.5rem;
    background-size: 70%;
    filter: invert(0.3) brightness(0.5);
}

/* Carousel Indicators - Bottom Inside Card */
#pejabatSlider .carousel-indicators {
    position: absolute;
    bottom: 0.75rem;
    left: 0;
    right: 0;
    margin: 0;
    padding: 0;
    z-index: 10;
}

#pejabatSlider .carousel-indicators [data-bs-target] {
    width: 10px;
    height: 10px;
    border-radius: var(--radius-full);
    margin: 0 5px;
    background: var(--border);
    border: none;
    opacity: 1;
    transition: var(--transition);
}

#pejabatSlider .carousel-indicators .active {
    background: var(--primary);
    width: 28px;
}


.carousel-control-prev-icon,
.carousel-control-next-icon {
    width: 2rem;
    height: 2rem;
    background-size: 60%;
    filter: invert(0.2);
}

.carousel-indicators {
    position: static;
    margin: 1rem 0 0;
    padding: 0;
}

.carousel-indicators [data-bs-target] {
    width: 8px;
    height: 8px;
    border-radius: var(--radius-full);
    margin: 0 4px;
    background: var(--border);
    border: none;
    opacity: 1;
    transition: var(--transition);
}

.carousel-indicators .active {
    background: var(--primary);
    width: 24px;
}

/* ===== SEARCH ===== */
.search-wrapper {
    position: relative;
    max-width: 550px;
    margin: 0 auto 1.5rem;
}

.search-input {
    width: 100%;
    padding: 1rem 1.25rem 1rem 3rem;
    border: 2px solid var(--border);
    border-radius: var(--radius-full);
    font-size: 0.95rem;
    background: var(--surface);
    transition: var(--transition);
    font-family: inherit;
}

.search-input:focus {
    outline: none;
    border-color: var(--primary);
    box-shadow: 0 0 0 4px rgba(16, 185, 129, 0.1);
}

.search-icon {
    position: absolute;
    left: 1.25rem;
    top: 50%;
    transform: translateY(-50%);
    color: var(--text-muted);
    font-size: 1.1rem;
    transition: var(--transition);
}

.search-input:focus + .search-icon {
    color: var(--primary);
}

.search-results {
    background: var(--surface);
    border-radius: var(--radius);
    border: 1px solid var(--border);
    margin-top: 0.5rem;
    max-height: 400px;
    overflow-y: auto;
    display: none;
    box-shadow: var(--shadow-lg);
    position: absolute;
    width: 100%;
    z-index: 100;
}

.search-results.show { display: block; animation: slideDown 0.2s ease; }

@keyframes slideDown {
    from { opacity: 0; transform: translateY(-10px); }
    to { opacity: 1; transform: translateY(0); }
}

.search-item {
    padding: 1rem 1.25rem;
    border-bottom: 1px solid var(--border);
    cursor: pointer;
    font-size: 0.9rem;
    transition: var(--transition-fast);
}

.search-item:hover { 
    background: rgba(16, 185, 129, 0.06);
    padding-left: 1.5rem;
}

.search-item:last-child { border-bottom: none; }

.search-item strong { color: var(--text); font-weight: 600; }
.search-item small { color: var(--text-muted); }

.search-status {
    display: inline-block;
    padding: 0.2rem 0.6rem;
    border-radius: var(--radius-full);
    font-size: 0.7rem;
    font-weight: 700;
    margin-left: 0.5rem;
    text-transform: uppercase;
}

.search-status.rl { background: rgba(34,197,94,0.15); color: var(--success); }
.search-status.rtl { background: rgba(239,68,68,0.15); color: var(--danger); }

/* ===== DATA TABLE ===== */
.table-modern {
    width: 100%;
    border-collapse: separate;
    border-spacing: 0;
    font-size: 0.9rem;
}

.table-modern thead th {
    background: var(--surface-alt);
    font-weight: 700;
    color: var(--text-muted);
    font-size: 0.75rem;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    padding: 1rem 1.25rem;
    border-bottom: 2px solid var(--border);
}

.table-modern tbody td {
    padding: 1rem 1.25rem;
    border-bottom: 1px solid var(--border);
}

.table-modern tbody tr {
    transition: var(--transition-fast);
}

.table-modern tbody tr:hover {
    background: rgba(16, 185, 129, 0.04);
}

.table-modern tbody tr:last-child td {
    border-bottom: none;
}

/* ===== BADGES ===== */
.badge-status {
    padding: 0.3rem 0.75rem;
    border-radius: var(--radius-full);
    font-size: 0.75rem;
    font-weight: 700;
    color: white;
    text-transform: uppercase;
}

.badge-rlh { background: var(--success); }
.badge-rtlh { background: var(--danger); }

.badge-soft {
    padding: 0.3rem 0.875rem;
    border-radius: var(--radius-full);
    font-size: 0.8rem;
    font-weight: 600;
}

.badge-soft.success { background: rgba(34,197,94,0.15); color: var(--success); }
.badge-soft.warning { background: rgba(245,158,11,0.15); color: var(--warning); }

/* ===== DATA SUMMARY CARDS ===== */
.summary-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
    gap: 1.25rem;
    margin-bottom: 2rem;
}

.summary-card {
    background: var(--surface);
    border-radius: var(--radius);
    padding: 1.5rem;
    border: 1px solid var(--border);
    box-shadow: var(--shadow);
    transition: var(--transition);
    position: relative;
    overflow: hidden;
}

.summary-card::after {
    content: '';
    position: absolute;
    top: -50%;
    right: -50%;
    width: 100%;
    height: 100%;
    background: radial-gradient(circle, rgba(16,185,129,0.1) 0%, transparent 70%);
    opacity: 0;
    transition: var(--transition);
}

.summary-card:hover {
    transform: translateY(-4px);
    box-shadow: var(--shadow-md);
}

.summary-card:hover::after {
    opacity: 1;
}

.summary-card h6 {
    font-size: 0.8rem;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.05em;
    margin-bottom: 0.75rem;
    font-weight: 600;
}

.summary-card .value {
    font-size: 2rem;
    font-weight: 800;
    color: var(--text);
    line-height: 1.2;
}

.summary-card .trend {
    font-size: 0.8rem;
    margin-top: 0.5rem;
    font-weight: 500;
}

.summary-card .trend.up { color: var(--success); }
.summary-card .trend.down { color: var(--danger); }

/* ===== FOOTER ===== */
footer {
    background: linear-gradient(135deg, var(--surface-dark) 0%, #1e293b 100%);
    color: rgba(255,255,255,0.85);
    padding: 2.5rem 0;
    margin-top: 3rem;
    text-align: center;
    font-size: 0.9rem;
    position: relative;
    overflow: hidden;
}

footer::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 3px;
    background: var(--primary-gradient);
}

/* ===== ANIMATIONS ===== */
.fade-in-up {
    animation: fadeInUp 0.6s ease forwards;
    opacity: 0;
    transform: translateY(20px);
}

@keyframes fadeInUp {
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.delay-1 { animation-delay: 0.1s; }
.delay-2 { animation-delay: 0.2s; }
.delay-3 { animation-delay: 0.3s; }
.delay-4 { animation-delay: 0.4s; }

/* ===== RESPONSIVE ===== */
@media (max-width: 768px) {
    .stats-grid {
        grid-template-columns: repeat(3, 1fr);
        gap: 0.75rem;
    }
    .stat-card { padding: 1rem 0.5rem; }
    .stat-value { font-size: 1.25rem; }
    .stat-label { font-size: 0.6rem; }
    .stat-icon { width: 40px; height: 40px; font-size: 1rem; }
    
    .section { padding: 2.5rem 0; }
    .official-avatar { height: 220px; }
    #pejabatSlider .official-avatar { height: 160px; max-width: 170px; }
    
    .navbar-brand { font-size: 1.1rem; }
    .navbar-brand img { width: 32px; height: 32px; }
    
    .summary-grid { grid-template-columns: repeat(2, 1fr); }
    
    .hero-slider .carousel-item { min-height: 220px; }
    .hero-slider-title { font-size: 1.5rem; }
    .hero-slider-subtitle { font-size: 0.9rem; }
    
     #pejabatSlider .carousel-inner {
        min-height: 280px;
    }
    
    #pejabatSlider .official-avatar {
        max-width: 200px;
        height: 220px;
    }
    
    #pejabatSlider .carousel-control-prev-icon,
    #pejabatSlider .carousel-control-next-icon {
        width: 2rem;
        height: 2rem;
    }
    
  
}



@media (max-width: 480px) {
    .stats-grid { grid-template-columns: repeat(2, 1fr); }
    .summary-grid { grid-template-columns: 1fr; }
    .section-title { font-size: 1.5rem; }
    
    #pejabatSlider .carousel-inner {
        min-height: 280px;
    }
    
    #pejabatSlider .official-avatar {
        max-width: 200px;
        height: 220px;
    }
    
    #pejabatSlider .carousel-control-prev-icon,
    #pejabatSlider .carousel-control-next-icon {
        width: 2rem;
        height: 2rem;
}

/* ===== UTILITIES ===== */
.text-gradient {
    background: var(--primary-gradient);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.divider {
    height: 1px;
    background: linear-gradient(90deg, transparent, var(--border), transparent);
    margin: 2rem 0;
}

.bg-surface { background: var(--surface); }
.bg-surface-alt { background: var(--surface-alt); }