@import url('https://fonts.googleapis.com/css2?family=Poppins:wght@400;500;600;700&display=swap');
@import url('https://cdnjs.cloudflare.com/ajax/libs/font-awesome/6.5.0/css/all.min.css');
@import url('sidebarkiri.css');
@import url('sidebarkanan.css');
@import url('main-content-responsive.css');

:root {
    --header-dark: #0f172a;
    --header-primary: #17806d;
    --header-secondary: #0a5a4a;
    --header-accent: #fcd34d;
    --header-bg: #ffffff;
    --muted: #6b7280;
    --saphira-content-width: 1180px;
    --saphira-gutter: 48px;
    --saphira-header-offset: 80px;
    --saphira-bg-muted: #eef5f1;
    --sidebar-left-width: 300px;
    --sidebar-right-width: 300px;
}

.site-header {
    font-family: 'Poppins', sans-serif;
}

.site-header * {
    box-sizing: border-box;
}

body {
    margin: 0;
    padding-top: 0;
}

body.has-global-sidebars {
    padding-left: 0;
    padding-right: 0;
    transition: padding 0.3s ease;
}

/* Large Desktop (1400px+) */
@media (min-width: 1400px) {
    :root {
        --sidebar-left-width: 320px;
        --sidebar-right-width: 320px;
    }
}

/* Desktop (1200px - 1399px) */
@media (min-width: 1200px) and (max-width: 1399px) {
    :root {
        --sidebar-left-width: 300px;
        --sidebar-right-width: 300px;
    }
}

/* Tablet Landscape (992px - 1199px) */
@media (min-width: 992px) and (max-width: 1199px) {
    :root {
        --sidebar-left-width: 240px;
        --sidebar-right-width: 240px;
    }
    
    body.has-global-sidebars {
        padding-left: var(--sidebar-left-width);
        padding-right: var(--sidebar-right-width);
    }
}

/* Tablet Portrait & Zoomed Layout (768px - 1499px) */
@media (min-width: 768px) and (max-width: 1499px) {
    body.has-global-sidebars {
        padding-left: 0;
        padding-right: 0;
    }
    
    .has-global-sidebars .sidebar-kiri,
    .has-global-sidebars .sidebar-kanan {
        position: static !important;
        width: 100% !important;
        max-width: 100%;
        margin: 0 0 24px !important;
        border-radius: 16px;
        padding: 20px;
        top: auto !important;
        bottom: auto !important;
        left: auto !important;
        right: auto !important;
    }
}

/* Mobile, Tablet, & Zoomed Desktop */
@media (max-width: 1499px) {
    body.has-global-sidebars {
        padding-left: 0;
        padding-right: 0;
    }
    
    /* Sembunyikan sidebar fixed di tablet dan mobile */
    .has-global-sidebars .sidebar-kiri,
    .has-global-sidebars .sidebar-kanan {
        position: static !important;
        width: 100% !important;
        max-width: 100%;
        margin: 0 0 20px !important;
        border-radius: 18px;
        padding: 20px;
        top: auto !important;
        bottom: auto !important;
        left: auto !important;
        right: auto !important;
    }
}

/* Mobile specific (max-width: 768px) */
@media (max-width: 768px) {
    body {
        padding-top: var(--saphira-header-offset);
    }
    
    body.has-global-sidebars {
        padding-left: 0;
        padding-right: 0;
        padding-top: var(--saphira-header-offset);
    }
    
    /* Pastikan konten utama tidak terpotong */
    .container-max,
    .container {
        padding-left: 16px;
        padding-right: 16px;
    }
    
    /* Top bar mobile */
    .top-bar {
        font-size: 0.75rem;
    }
    
    .top-bar .container-max {
        flex-direction: column;
        align-items: flex-start;
        gap: 8px;
        padding: 8px 16px;
    }
    
    .top-bar .contact-info {
        flex-direction: column;
        gap: 6px;
        width: 100%;
    }
    
    .top-bar .quick-links {
        flex-wrap: wrap;
        gap: 8px;
        width: 100%;
    }
    
    .top-bar .quick-links a {
        font-size: 0.75rem;
        padding: 4px 8px;
    }
    
    /* Nav bar mobile */
    .nav-bar {
        padding: 12px 0;
    }
    
    .brand-inline {
        font-size: 0.9rem;
    }
    
    .brand-icon {
        width: 36px;
        height: 36px;
        font-size: 1rem;
    }
    
    .brand-text strong {
        font-size: 0.95rem;
    }
    
    .brand-text small {
        font-size: 0.75rem;
    }
    
    /* Nav CTA mobile */
    .nav-cta {
        padding: 4px;
    }
    
    .nav-cta-icon {
        width: 36px;
        height: 36px;
        font-size: 1rem;
    }
}

.site-header {
    margin-bottom: 0;
    width: 100%;
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    z-index: 1000;
    background: var(--header-bg);
    box-shadow: 0 12px 30px rgba(15, 23, 42, 0.07);
}

.site-header .container-max {
    max-width: 1200px;
    margin: auto;
    padding: 0 24px;
}

.top-bar {
    background: var(--header-dark);
    color: #fff;
    font-size: 0.8rem;
    padding: 8px 0;
}

.top-bar .container-max {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 20px;
    padding: 0 24px;
}

.top-bar .contact-info {
    display: flex;
    gap: 20px;
    flex-wrap: wrap;
    align-items: center;
}

.top-bar .contact-info span {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    opacity: 0.85;
    font-size: 0.8rem;
    white-space: nowrap;
}

.top-bar .quick-links {
    display: flex;
    gap: 12px;
    align-items: center;
    flex-shrink: 0;
}

.top-bar .quick-links a {
    color: #fff;
    text-decoration: none;
    font-weight: 500;
    opacity: 0.9;
    padding: 4px 10px;
    border-radius: 6px;
    transition: opacity 0.2s ease, background 0.2s ease;
    font-size: 0.8rem;
    white-space: nowrap;
}

.top-bar .quick-links a:hover {
    opacity: 1;
    background: rgba(255,255,255,0.1);
}

.nav-bar {
    background: #fff;
    border-top: 1px solid rgba(15, 23, 42, 0.05);
}

.nav-bar .container-max {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 24px;
    padding: 0 24px;
}

.brand-inline {
    display: flex;
    align-items: center;
    gap: 14px;
    padding: 12px 0;
    text-decoration: none;
    color: var(--header-dark);
}

.brand-icon {
    width: 48px;
    height: 48px;
    border-radius: 14px;
    background: linear-gradient(135deg, var(--header-primary), var(--header-secondary));
    display: inline-flex;
    align-items: center;
    justify-content: center;
    color: #fff;
    font-size: 1.3rem;
    box-shadow: 0 8px 20px rgba(23, 128, 109, 0.25);
    flex-shrink: 0;
}

.brand-text {
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.brand-text strong {
    font-size: 1.05rem;
    display: block;
    line-height: 1.3;
    font-weight: 700;
}

.brand-text small {
    color: var(--muted);
    font-size: 0.85rem;
    line-height: 1.2;
}

.nav-toggle {
    display: none;
    width: 48px;
    height: 48px;
    border-radius: 12px;
    border: 1px solid rgba(15, 23, 42, 0.1);
    background: #fff;
    align-items: center;
    justify-content: center;
}

.nav-toggle span {
    width: 22px;
    height: 2px;
    background: var(--header-dark);
    display: block;
    margin: 4px 0;
}

.main-nav {
    display: flex;
    gap: 22px;
    align-items: center;
}

.main-nav ul {
    list-style: none;
    margin: 0;
    padding: 0;
    display: flex;
    gap: 18px;
}

.main-nav > ul > li {
    position: relative;
}

.main-nav a,
.main-nav button {
    border: none;
    background: none;
    font-size: 0.95rem;
    font-weight: 600;
    color: var(--header-dark);
    text-decoration: none;
    padding: 14px 0;
    display: inline-flex;
    align-items: center;
    gap: 8px;
    cursor: pointer;
}

.main-nav a:hover,
.main-nav button:hover {
    color: var(--header-primary);
}

.main-nav .dropdown {
    position: absolute;
    top: calc(100% + 10px);
    left: 0;
    min-width: 240px;
    background: #fff;
    border-radius: 18px;
    box-shadow: 0 20px 40px rgba(15, 23, 42, 0.1);
    padding: 14px;
    display: none;
    flex-direction: column;
    gap: 8px;
    z-index: 1000;
}

.main-nav li:hover > .dropdown,
.main-nav li:focus-within > .dropdown,
.main-nav li.open > .dropdown {
    display: flex;
}

.dropdown a {
    padding: 10px 12px;
    border-radius: 10px;
    color: var(--header-dark);
    font-weight: 500;
}

.dropdown a i {
    width: 20px;
}

.dropdown a:hover {
    background: rgba(23, 128, 109, 0.08);
    color: var(--header-primary);
}

.nav-cta {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 6px;
    border-radius: 999px;
    background: linear-gradient(135deg, var(--header-primary), var(--header-secondary));
    box-shadow: 0 18px 40px rgba(23, 128, 109, 0.25);
    text-decoration: none;
}

.nav-cta-icon {
    width: 42px;
    height: 42px;
    border-radius: 999px;
    background: #fff;
    color: var(--header-primary);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: 1.15rem;
}

.nav-cta-icon i {
    color: inherit;
}

/* Shared hero/content alignment */
[class^="hero-"] > .container,
[class^="hero-"] > .container-max,
[class*=" hero-"] > .container,
[class*=" hero-"] > .container-max,
[class^="hero_"] > .container,
[class*=" hero_"] > .container,
.category-container,
.profil-content,
.layanan-content,
.ppid-content,
.pengaduan-content,
.umkm-content,
.potensi-content,
.lembaga-content,
.dokumen-content,
.produk-content,
.agenda-content,
.berita-content,
.galeri-content,
.kontak-content,
.pbb-content,
.bansos-content,
.apbdes-content,
.laporan-content,
.sdgs-content,
.idm-content,
.rkpdes-content,
.rpjmdes-content,
.video-content,
.penduduk-content,
.kategori-container,
.section-wrapper {
    width: min(var(--saphira-content-width), calc(100% - var(--saphira-gutter)));
    margin-left: auto;
    margin-right: auto;
}

[class^="hero-"],
[class*=" hero-"],
[class^="hero_"],
[class*=" hero_"] {
    padding-left: 0;
    padding-right: 0;
}

@media (max-width: 768px) {
    [class^="hero-"] > .container,
    [class^="hero-"] > .container-max,
    [class*=" hero-"] > .container,
    [class*=" hero-"] > .container-max,
    [class^="hero_"] > .container,
    [class*=" hero_"] > .container,
    .category-container,
    .profil-content,
    .layanan-content,
    .ppid-content,
    .pengaduan-content,
    .umkm-content,
    .potensi-content,
    .lembaga-content,
    .dokumen-content,
    .produk-content,
    .agenda-content,
    .berita-content,
    .galeri-content,
    .kontak-content,
    .pbb-content,
    .bansos-content,
    .apbdes-content,
    .laporan-content,
    .sdgs-content,
    .idm-content,
    .rkpdes-content,
    .rpjmdes-content,
    .video-content,
    .penduduk-content,
    .kategori-container,
    .section-wrapper {
        width: calc(100% - 32px);
    }
}

.section-card h1,
.section-card h2 {
    font-size: clamp(1.1rem, 2.2vw, 1.45rem);
}

.section-card h3 {
    font-size: clamp(1rem, 2vw, 1.25rem);
}

.mobile-nav-overlay {
    position: fixed;
    inset: 0;
    background: rgba(15, 23, 42, 0.7);
    backdrop-filter: blur(4px);
    z-index: 999;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.4s cubic-bezier(0.4, 0, 0.2, 1);
}

.mobile-nav-overlay.active {
    opacity: 1;
    pointer-events: auto;
}

.mobile-panel {
    position: fixed;
    bottom: -100%;
    left: 0;
    right: 0;
    width: 100%;
    max-height: 85vh;
    background: linear-gradient(180deg, #ffffff 0%, #f8fafc 100%);
    border-radius: 24px 24px 0 0;
    box-shadow: 0 -8px 40px rgba(15,23,42,0.2);
    z-index: 1000;
    display: flex;
    flex-direction: column;
    transition: bottom 0.4s cubic-bezier(0.4, 0, 0.2, 1);
    overflow: hidden;
}

.mobile-panel.active {
    bottom: 0;
}

.mobile-panel-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 20px 24px;
    border-bottom: 1px solid rgba(15,23,42,0.08);
    background: white;
    position: relative;
}

.mobile-panel-header::after {
    content: '';
    position: absolute;
    top: 8px;
    left: 50%;
    transform: translateX(-50%);
    width: 40px;
    height: 4px;
    background: rgba(15,23,42,0.2);
    border-radius: 2px;
}

.mobile-panel-header h3 {
    margin: 0;
    font-size: 1.25rem;
    font-weight: 700;
    color: var(--header-dark);
    background: linear-gradient(135deg, var(--header-primary), var(--header-secondary));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.mobile-panel-close {
    width: 40px;
    height: 40px;
    border: none;
    background: rgba(15,23,42,0.05);
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.3s ease;
    color: var(--header-dark);
    font-size: 1.2rem;
}

.mobile-panel-close:hover {
    background: rgba(15,23,42,0.1);
    transform: rotate(90deg);
}

.mobile-panel-close:active {
    transform: rotate(90deg) scale(0.95);
}

.mobile-panel-content {
    flex: 1;
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
    padding: 8px 16px 24px;
}

.mobile-panel .mobile-links {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 12px;
    padding: 8px 0;
}

.mobile-link-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 10px;
    padding: 16px 12px;
    background: white;
    border-radius: 16px;
    text-decoration: none;
    color: var(--header-dark);
    box-shadow: 0 2px 8px rgba(15,23,42,0.04);
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    position: relative;
    overflow: hidden;
    opacity: 0;
    transform: translateY(20px);
    animation: slideUpFade 0.4s ease forwards;
    min-height: 110px;
}

/* Animation delays will be set dynamically via JavaScript */

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

.mobile-link-item::before {
    content: '';
    position: absolute;
    top: -50%;
    left: -50%;
    width: 200%;
    height: 200%;
    background: radial-gradient(circle, rgba(20, 92, 74, 0.15) 0%, transparent 70%);
    opacity: 0;
    transition: opacity 0.4s ease;
    pointer-events: none;
}

.mobile-link-item:hover::before {
    opacity: 1;
}

.mobile-link-item:hover {
    transform: translateY(-4px);
    box-shadow: 0 8px 24px rgba(20, 92, 74, 0.2);
    background: linear-gradient(135deg, rgba(20, 92, 74, 0.05), rgba(26, 163, 118, 0.05));
}

.mobile-link-item:active {
    transform: translateY(-2px) scale(0.96);
}

.mobile-link-icon {
    width: 56px;
    height: 56px;
    border-radius: 16px;
    background: linear-gradient(135deg, var(--header-primary), var(--header-secondary));
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-size: 1.5rem;
    flex-shrink: 0;
    box-shadow: 0 4px 12px rgba(20, 92, 74, 0.2);
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    position: relative;
    overflow: hidden;
}

.mobile-link-icon::after {
    content: '';
    position: absolute;
    inset: 0;
    background: linear-gradient(135deg, rgba(255,255,255,0.3), transparent);
    opacity: 0;
    transition: opacity 0.3s ease;
}

.mobile-link-item:hover .mobile-link-icon {
    transform: scale(1.15) rotate(5deg);
    box-shadow: 0 8px 24px rgba(20, 92, 74, 0.35);
}

.mobile-link-item:hover .mobile-link-icon::after {
    opacity: 1;
}

.mobile-link-item:hover .mobile-link-icon i {
    transform: scale(1.1);
}

.mobile-link-text {
    font-weight: 600;
    font-size: 0.85rem;
    color: var(--header-dark);
    transition: color 0.3s ease;
    text-align: center;
    line-height: 1.3;
    word-break: break-word;
}

.mobile-link-item:hover .mobile-link-text {
    color: var(--header-primary);
}

.mobile-link-admin {
    background: linear-gradient(135deg, rgba(239, 68, 68, 0.05), rgba(239, 68, 68, 0.02)) !important;
    border: 1px solid rgba(239, 68, 68, 0.1);
}

.mobile-link-admin .mobile-link-icon {
    background: linear-gradient(135deg, #ef4444, #dc2626);
}

.mobile-link-admin:hover {
    background: linear-gradient(135deg, rgba(239, 68, 68, 0.1), rgba(239, 68, 68, 0.05)) !important;
    border-color: rgba(239, 68, 68, 0.2);
}

.mobile-panel .mobile-links .section-title {
    display: flex;
    align-items: center;
    gap: 10px;
    margin: 20px 0 12px;
    padding: 12px 16px;
    color: var(--header-primary);
    font-size: 0.85rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 1px;
    position: sticky;
    top: 0;
    background: linear-gradient(180deg, #f8fafc 0%, rgba(248, 250, 252, 0.95) 100%);
    backdrop-filter: blur(8px);
    z-index: 10;
    border-radius: 12px;
    grid-column: 1 / -1;
}

.mobile-panel .mobile-links .section-title i {
    font-size: 1rem;
    opacity: 0.8;
}

/* Tablet dan di bawah - sembunyikan main nav, tampilkan toggle */
@media (max-width: 1024px) {
    .main-nav {
        display: none !important;
    }

    .nav-toggle {
        display: inline-flex;
    }
}

/* Desktop - pastikan main nav muncul */
@media (min-width: 1025px) {
    .main-nav {
        display: flex !important;
    }
    
    .nav-toggle {
        display: none !important;
    }
}

/* Sembunyikan nav-toggle di mobile karena sudah ada bottom nav */
@media (max-width: 768px) {
    .main-nav {
        display: none !important;
    }
    
    .nav-toggle {
        display: none !important;
    }
}

/* Extra small mobile (max-width: 640px) */
@media (max-width: 640px) {
    .top-bar .container-max {
        flex-direction: column;
        align-items: flex-start;
    }

    .top-bar .quick-links {
        flex-wrap: wrap;
    }
    
    /* Mobile panel adjustments */
    .mobile-panel {
        max-height: 90vh;
    }
    
    .mobile-panel-header {
        padding: 16px 20px;
    }
    
    .mobile-panel-header h3 {
        font-size: 1.1rem;
    }
    
    .mobile-panel .mobile-links {
        grid-template-columns: repeat(3, 1fr);
        gap: 10px;
    }
    
    .mobile-link-item {
        padding: 14px 8px;
        min-height: 100px;
    }
    
    .mobile-link-icon {
        width: 50px;
        height: 50px;
        font-size: 1.3rem;
    }
    
    .mobile-link-text {
        font-size: 0.75rem;
    }
}

/* Very small mobile (max-width: 360px) */
@media (max-width: 360px) {
    .mobile-panel .mobile-links {
        grid-template-columns: repeat(2, 1fr);
        gap: 8px;
    }
    
    .mobile-link-item {
        min-height: 95px;
    }
    
    .mobile-link-icon {
        width: 48px;
        height: 48px;
        font-size: 1.2rem;
    }
    
    .mobile-link-text {
        font-size: 0.7rem;
    }
}

/* ============================================
   MOBILE BOTTOM NAVIGATION
   ============================================ */
.mobile-bottom-nav {
    display: none;
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    background: #ffffff;
    border-top: 1px solid rgba(15, 23, 42, 0.1);
    box-shadow: 0 -4px 20px rgba(15, 23, 42, 0.08);
    z-index: 1000;
    padding: 8px 0;
    padding-bottom: max(8px, calc(8px + env(safe-area-inset-bottom)));
    justify-content: space-around;
    align-items: center;
}

.bottom-nav-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 4px;
    padding: 8px 12px;
    text-decoration: none;
    color: #64748b;
    font-size: 0.7rem;
    font-weight: 500;
    border: none;
    background: transparent;
    cursor: pointer;
    transition: all 0.2s ease;
    min-width: 60px;
    flex: 1;
    position: relative;
    -webkit-tap-highlight-color: transparent;
}

.bottom-nav-item i {
    font-size: 1.3rem;
    transition: all 0.2s ease;
    color: inherit;
}

.bottom-nav-item span {
    font-size: 0.65rem;
    line-height: 1.2;
    white-space: nowrap;
    font-weight: 500;
}

.bottom-nav-item:hover,
.bottom-nav-item:focus,
.bottom-nav-item.active {
    color: var(--header-primary);
    outline: none;
}

.bottom-nav-item:hover i,
.bottom-nav-item:focus i,
.bottom-nav-item.active i {
    transform: scale(1.15);
    color: var(--header-primary);
}

.bottom-nav-item:active {
    transform: scale(0.95);
}

.bottom-nav-item.active::before {
    content: '';
    position: absolute;
    top: 0;
    left: 50%;
    transform: translateX(-50%);
    width: 40px;
    height: 3px;
    background: var(--header-primary);
    border-radius: 0 0 3px 3px;
}

.bottom-nav-menu-toggle.active i::before {
    content: '\f00d'; /* fa-times */
}

/* Sembunyikan di desktop */
@media (min-width: 769px) {
    .mobile-bottom-nav {
        display: none !important;
    }
    
    body {
        padding-bottom: 0 !important;
    }
}

/* Tampilkan di mobile dan tambahkan padding bottom pada body */
@media (max-width: 768px) {
    body {
        padding-bottom: 70px;
    }
    
    .mobile-bottom-nav {
        display: flex;
    }
    
    /* Highlight active menu berdasarkan current page */
    .bottom-nav-item.active {
        color: var(--header-primary);
    }
    
    .bottom-nav-item.active i {
        color: var(--header-primary);
    }
}

/* ============================================
   MAIN CONTENT RESPONSIVE LAYOUT
   ============================================ */

/* Base container styles */
.container,
.container-max {
    width: 100%;
    max-width: 100%;
    margin-left: auto;
    margin-right: auto;
    padding-left: 24px;
    padding-right: 24px;
    box-sizing: border-box;
}

/* Desktop: Full width with sidebars */
@media (min-width: 1201px) {
    body.has-global-sidebars .container,
    body.has-global-sidebars .container-max {
        max-width: var(--saphira-content-width);
        padding-left: 24px;
        padding-right: 24px;
    }
}

/* Tablet: Reduced padding */
@media (max-width: 1200px) and (min-width: 769px) {
    .container,
    .container-max {
        padding-left: 20px;
        padding-right: 20px;
    }
    
    body.has-global-sidebars .container,
    body.has-global-sidebars .container-max {
        max-width: 100%;
        padding-left: 20px;
        padding-right: 20px;
    }
}

/* Mobile: Minimal padding */
@media (max-width: 768px) {
    /* Prevent horizontal scroll */
    html, body {
        overflow-x: hidden;
        max-width: 100vw;
    }
    
    /* Ensure all containers are responsive */
    .container,
    .container-max {
        max-width: 100%;
        padding-left: 16px;
        padding-right: 16px;
    }
    
    body.has-global-sidebars .container,
    body.has-global-sidebars .container-max {
        max-width: 100%;
        padding-left: 16px;
        padding-right: 16px;
    }
    
    /* Typography adjustments */
    h1 { font-size: clamp(1.5rem, 5vw, 2rem); }
    h2 { font-size: clamp(1.25rem, 4vw, 1.75rem); }
    h3 { font-size: clamp(1.1rem, 3.5vw, 1.5rem); }
    h4 { font-size: clamp(1rem, 3vw, 1.25rem); }
    
    /* Better touch targets */
    button,
    .btn,
    a[role="button"],
    .nav-toggle,
    .nav-cta {
        min-height: 44px;
        min-width: 44px;
    }
    
    /* Smooth scrolling for mobile */
    * {
        -webkit-overflow-scrolling: touch;
    }
    
    /* Image responsiveness */
    img {
        max-width: 100%;
        height: auto;
    }
    
    /* Table responsiveness */
    table {
        display: block;
        overflow-x: auto;
        -webkit-overflow-scrolling: touch;
        white-space: nowrap;
    }
    
    /* Text wrapping */
    p, span, div, h1, h2, h3, h4, h5, h6 {
        word-wrap: break-word;
        overflow-wrap: break-word;
    }
}

/* Extra small mobile */
@media (max-width: 480px) {
    .container,
    .container-max {
        padding-left: 12px;
        padding-right: 12px;
    }
    
    body.has-global-sidebars .container,
    body.has-global-sidebars .container-max {
        padding-left: 12px;
        padding-right: 12px;
    }
}

/* Footer Saphira */
.saphira-footer {
    position: relative;
    background: radial-gradient(circle at top right, rgba(59, 130, 246, 0.15), transparent),
        linear-gradient(135deg, rgba(7, 19, 33, 0.95), rgba(10, 22, 40, 0.95));
    color: #e6f4ff;
    margin-top: 60px;
    padding: 40px 0 24px;
    overflow: hidden;
    border-top: 1px solid rgba(255, 255, 255, 0.08);
    width: 100%;
    box-sizing: border-box;
}

/* Background gelap untuk area di belakang footer - menutupi background putih */
body.has-global-sidebars .saphira-footer::before {
    content: '';
    position: absolute;
    bottom: 0;
    left: calc(-1 * (var(--sidebar-left-width) + 5px));
    right: calc(-1 * (var(--sidebar-right-width) + 5px));
    top: 0;
    background: linear-gradient(135deg, rgba(7, 19, 33, 0.98), rgba(10, 22, 40, 0.98));
    z-index: -2;
    pointer-events: none;
}

/* Footer width follows main content width when sidebars are present - menempel di sidebar */
body.has-global-sidebars .saphira-footer {
    width: calc(100vw - var(--sidebar-left-width, 300px) - var(--sidebar-right-width, 300px) - 10px) !important;
    max-width: calc(100vw - var(--sidebar-left-width, 300px) - var(--sidebar-right-width, 300px) - 10px) !important;
    margin-left: calc(var(--sidebar-left-width, 300px) + 5px) !important;
    margin-right: calc(var(--sidebar-right-width, 300px) + 5px) !important;
    background: radial-gradient(circle at top right, rgba(59, 130, 246, 0.15), transparent),
        linear-gradient(135deg, rgba(7, 19, 33, 0.98), rgba(10, 22, 40, 0.98)) !important;
    position: relative !important;
    box-sizing: border-box !important;
}

/* Background gelap untuk area di belakang footer */
body.has-global-sidebars .saphira-footer {
    position: relative;
}

body.has-global-sidebars .saphira-footer::before {
    content: '';
    position: absolute;
    bottom: 0;
    left: calc(-1 * (var(--sidebar-left-width) + 5px));
    right: calc(-1 * (var(--sidebar-right-width) + 5px));
    top: 0;
    background: linear-gradient(135deg, rgba(7, 19, 33, 0.98), rgba(10, 22, 40, 0.98));
    z-index: -2;
    pointer-events: none;
}

.saphira-footer::after {
    content: '';
    position: absolute;
    inset: 0;
    background: url('../images/icon-hero.jpeg') center/cover;
    opacity: 0.05;
    mix-blend-mode: screen;
    pointer-events: none;
    z-index: -1;
}

.saphira-footer .footer-blend {
    position: absolute;
    inset: 0;
    background: transparent;
    opacity: 0;
}

.saphira-footer .container-max {
    position: relative;
    width: 100%;
    max-width: 100%;
    margin: 0;
    padding: 0 24px;
    z-index: 2;
    box-sizing: border-box;
}

.footer-main {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    gap: 40px;
    flex-wrap: wrap;
    border-bottom: 1px solid rgba(255, 255, 255, 0.08);
    padding-bottom: 20px;
}

.footer-brand {
    display: flex;
    align-items: flex-start;
    gap: 12px;
    flex-shrink: 0;
}

.footer-brand > div {
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.footer-brand h3 {
    margin: 0;
    font-size: 1.25rem;
    font-weight: 700;
    line-height: 1.3;
}

.footer-icon {
    width: 48px;
    height: 48px;
    border-radius: 12px;
    background: linear-gradient(135deg, rgba(59, 130, 246, 0.3), rgba(37, 99, 235, 0.2));
    border: 1px solid rgba(59, 130, 246, 0.3);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: 1.2rem;
    color: #3b82f6;
    box-shadow: 0 8px 20px rgba(59, 130, 246, 0.2);
    flex-shrink: 0;
}

.footer-label {
    margin: 0;
    font-size: 0.75rem;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    opacity: 0.85;
    margin-bottom: 2px;
}

.footer-info {
    font-size: 0.9rem;
    display: flex;
    flex-direction: column;
    gap: 8px;
    line-height: 1.6;
}

.footer-info p {
    margin: 0;
    display: flex;
    align-items: center;
    gap: 8px;
}

.footer-info i {
    font-size: 0.85rem;
    opacity: 0.9;
    width: 16px;
    text-align: center;
}

.footer-bottom {
    text-align: center;
    padding: 16px 0 0;
    opacity: 0.9;
    font-size: 0.85rem;
    line-height: 1.6;
    color: rgba(230, 244, 255, 0.75);
}

.footer-bottom p {
    margin: 6px 0;
}

.footer-bottom p i.fa-heart {
    animation: heart-beat 1.5s ease-in-out infinite;
}

@keyframes heart-beat {
    0%, 100% { transform: scale(1); }
    50% { transform: scale(1.2); }
}

.footer-social {
    margin-top: 12px;
}

.footer-social-label {
    font-size: 0.75rem;
    letter-spacing: 0.5px;
    text-transform: uppercase;
    opacity: 0.85;
    margin-bottom: 8px;
}

.social-links {
    display: flex;
    gap: 12px;
}

.social-links a {
    width: 42px;
    height: 42px;
    border-radius: 8px;
    background: rgba(0, 0, 0, 0.3);
    border: 1px solid rgba(255, 255, 255, 0.08);
    color: #e6f4ff;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    text-decoration: none;
    transition: all 0.3s ease;
}

.social-links a:hover {
    background: rgba(59, 130, 246, 0.2);
    border-color: rgba(59, 130, 246, 0.4);
    color: #3b82f6;
    transform: translateY(-4px) scale(1.05);
    box-shadow: 0 8px 20px rgba(59, 130, 246, 0.3);
}

/* Footer Responsive */
@media (max-width: 1200px) {
    body.has-global-sidebars .saphira-footer {
        width: 100%;
        max-width: 100%;
        margin-left: 0;
        margin-right: 0;
    }
    
    body.has-global-sidebars .saphira-footer::before {
        left: 0;
        right: 0;
    }
    
    body.has-global-sidebars::after {
        content: none !important;
        display: none !important;
        visibility: hidden !important;
        opacity: 0 !important;
        pointer-events: none !important;
        z-index: -999 !important;
        left: 0;
        right: 0;
    }
}

@media (max-width: 768px) {
    .saphira-footer {
        padding: 32px 0 20px;
        width: 100% !important;
        max-width: 100% !important;
        margin-left: 0 !important;
        margin-right: 0 !important;
    }
    
    .saphira-footer .container-max {
        padding: 0 20px;
    }
    
    .footer-main {
        flex-direction: column;
        gap: 24px;
        padding-bottom: 20px;
    }
    
    .footer-brand {
        gap: 10px;
    }
    
    .footer-icon {
        width: 44px;
        height: 44px;
        font-size: 1.1rem;
    }
    
    .footer-brand h3 {
        font-size: 1.1rem;
    }
    
    .footer-label {
        font-size: 0.7rem;
    }
    
    .footer-info {
        font-size: 0.85rem;
        gap: 6px;
    }
    
    .footer-social {
        margin-top: 10px;
    }
    
    .footer-social-label {
        font-size: 0.7rem;
        margin-bottom: 6px;
    }
    
    .footer-bottom {
        padding: 14px 0 0;
        font-size: 0.8rem;
    }
    
    .footer-bottom p {
        margin: 4px 0;
    }
}

