:root {
    --primary-green: #145A32; /* Kejaksaan Green */
    --light-green: #27AE60;
    --accent-yellow: #F1C40F; /* Gold / Yellow */
    --dark-gold: #D4AC0D;
    --white-gradient: linear-gradient(135deg, #ffffff 0%, #f9fdf9 50%, #e8f5e9 100%);
    --navbar-bg: rgba(20, 90, 50, 0.95);
    --font-family: 'Outfit', sans-serif;
}

html, body {
    overflow-x: hidden !important;
    max-width: 100% !important;
    width: 100%;
}

main {
    overflow-x: hidden;
    position: relative;
    width: 100%;
}

body {
    font-family: var(--font-family);
    background: var(--white-gradient);
    color: #2C3E50;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    padding-top: 80px !important;
}

.navbar-brand img {
    max-height: 50px;
}

.navbar {
    background-color: var(--primary-green) !important;
    border-bottom: 4px solid var(--accent-yellow);
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.1);
    position: fixed !important;
    top: 0 !important;
    left: 0 !important;
    right: 0 !important;
    width: 100% !important;
    z-index: 1030 !important;
}

.nav-link {
    color: rgba(255, 255, 255, 0.9) !important;
    font-weight: 500;
    margin: 0 8px;
    position: relative;
    transition: all 0.3s ease;
}

.nav-link::after {
    content: '';
    position: absolute;
    width: 0;
    height: 2px;
    bottom: -5px;
    left: 0;
    background-color: var(--accent-yellow);
    transition: width 0.3s ease;
}

.nav-link:hover::after,
.nav-link.active::after {
    width: 100%;
}

.nav-link.dropdown-toggle::after,
.nav-link.dropdown-toggle:hover::after,
.nav-link.dropdown-toggle.active::after,
.dropdown-toggle::after {
    width: 0 !important;
    height: 0 !important;
    display: none !important;
    content: none !important;
    border: none !important;
}

.nav-link:hover,
.nav-link.active {
    color: var(--accent-yellow) !important;
    transform: translateY(-2px);
}

/* Hover Dropdown Effect for Desktop (lg and up) */
@media (min-width: 992px) {
    .navbar-nav .nav-item.dropdown:hover .dropdown-menu {
        display: block !important;
        margin-top: 0; /* Menghilangkan celah agar hover tidak terputus */
    }
}

.btn-gold {
    background: linear-gradient(135deg, var(--accent-yellow) 0%, var(--dark-gold) 100%);
    color: #145A32 !important;
    font-weight: 600;
    border: none;
    border-radius: 30px;
    padding: 8px 24px;
    box-shadow: 0 4px 10px rgba(241, 196, 15, 0.3);
    transition: all 0.3s ease;
}

.btn-gold:hover {
    transform: translateY(-3px) scale(1.03);
    box-shadow: 0 6px 15px rgba(241, 196, 15, 0.5);
    background: linear-gradient(135deg, var(--dark-gold) 0%, var(--accent-yellow) 100%);
}

.hero-section {
    background: linear-gradient(135deg, rgba(20, 90, 50, 0.9) 0%, rgba(39, 174, 96, 0.8) 100%), url('/images/carousel1.jpg');
    background-size: cover;
    background-position: center;
    color: white;
    padding: 100px 0;
    position: relative;
    border-bottom: 5px solid var(--accent-yellow);
}

.footer {
    margin-top: auto;
    background-color: #113f24;
    color: #d1e7dd;
    border-top: 4px solid var(--accent-yellow);
    max-width: 100% !important;
    overflow-x: hidden !important;
}

.footer a {
    color: var(--accent-yellow);
    text-decoration: none;
    transition: color 0.3s ease;
}

.footer a:hover {
    color: white;
}

.card {
    border: none;
    border-radius: 15px;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.05);
    transition: all 0.3s cubic-bezier(0.165, 0.84, 0.44, 1);
    background: rgba(255, 255, 255, 0.9);
    backdrop-filter: blur(10px);
    border: 1px solid rgba(255, 255, 255, 0.3);
}

.card:hover {
    transform: translateY(-10px);
    box-shadow: 0 20px 40px rgba(20, 90, 50, 0.12);
}

.text-green {
    color: var(--primary-green) !important;
}

.text-yellow {
    color: var(--accent-yellow) !important;
}

.badge-green {
    background-color: rgba(20, 90, 50, 0.1);
    color: var(--primary-green);
    font-weight: 600;
}

.badge-yellow {
    background-color: rgba(241, 196, 15, 0.2);
    color: var(--dark-gold);
    font-weight: 600;
}

/* Subtitle / section headers */
.section-header {
    position: relative;
    margin-bottom: 50px;
    font-weight: 700;
    color: var(--primary-green);
}

.section-header::after {
    content: '';
    position: absolute;
    width: 80px;
    height: 4px;
    background-color: var(--accent-yellow);
    bottom: -15px;
    left: 50%;
    transform: translateX(-50%);
    border-radius: 2px;
}

.section-header-left {
    position: relative;
    margin-bottom: 30px;
    font-weight: 700;
    color: var(--primary-green);
}

.section-header-left::after {
    content: '';
    position: absolute;
    width: 60px;
    height: 4px;
    background-color: var(--accent-yellow);
    bottom: -10px;
    left: 0;
    border-radius: 2px;
}

/* Page transitions and dynamic styling */
.fade-in {
    animation: fadeIn 1s ease-in-out;
}

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

/* Scroll To Top Button */
.scroll-to-top {
    position: fixed;
    bottom: 90px;
    right: 30px;
    width: 45px;
    height: 45px;
    background: linear-gradient(135deg, var(--accent-yellow) 0%, var(--dark-gold) 100%);
    color: var(--primary-green) !important;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.6rem;
    cursor: pointer;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.15);
    z-index: 999;
    opacity: 0;
    visibility: hidden;
    transform: translateY(20px);
    transition: all 0.3s cubic-bezier(0.165, 0.84, 0.44, 1);
}

.scroll-to-top.show {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
}

.scroll-to-top:hover {
    transform: translateY(-5px) scale(1.1);
    background: linear-gradient(135deg, var(--primary-green) 0%, var(--light-green) 100%);
    color: var(--accent-yellow) !important;
    box-shadow: 0 6px 20px rgba(20, 90, 50, 0.3);
}

/* Mobile Offcanvas Drawer Custom Styles */
@media (max-width: 991.98px) {
    .navbar {
        position: fixed !important;
        top: 0 !important;
        left: 0 !important;
        right: 0 !important;
        width: 100% !important;
        z-index: 1030 !important;
    }
    body {
        padding-top: 76px !important;
    }
    #offcanvasNavbar {
        width: 85% !important;
        max-width: 340px !important;
        background: rgba(255, 255, 255, 0.95) !important;
        backdrop-filter: blur(15px);
        border-right: 1px solid rgba(255, 255, 255, 0.4);
        border-top-right-radius: 24px;
        border-bottom-right-radius: 24px;
        box-shadow: 10px 0 40px rgba(0, 0, 0, 0.08) !important;
        transition: transform 0.4s cubic-bezier(0.16, 1, 0.3, 1) !important;
    }
    #offcanvasNavbar .nav-item {
        width: 100%;
        border-bottom: 1px solid rgba(0, 0, 0, 0.04);
        opacity: 0;
        transform: translateX(-20px);
        animation: slideInItem 0.4s cubic-bezier(0.16, 1, 0.3, 1) forwards;
    }
    /* Stagger animation for nav items */
    #offcanvasNavbar .nav-item:nth-child(1) { animation-delay: 0.1s; }
    #offcanvasNavbar .nav-item:nth-child(2) { animation-delay: 0.15s; }
    #offcanvasNavbar .nav-item:nth-child(3) { animation-delay: 0.2s; }
    #offcanvasNavbar .nav-item:nth-child(4) { animation-delay: 0.25s; }
    #offcanvasNavbar .nav-item:nth-child(5) { animation-delay: 0.3s; }
    #offcanvasNavbar .nav-item:nth-child(6) { animation-delay: 0.35s; }

    @keyframes slideInItem {
        to {
            opacity: 1;
            transform: translateX(0);
        }
    }

    #offcanvasNavbar .nav-link {
        color: #2c3e50 !important;
        font-weight: 600;
        text-transform: uppercase;
        padding: 16px 24px !important;
        margin: 0 !important;
        font-size: 0.85rem;
        letter-spacing: 0.8px;
        display: flex;
        align-items: center;
        gap: 12px;
        transition: all 0.3s ease;
        border-left: 4px solid transparent;
    }
    #offcanvasNavbar .nav-link i {
        font-size: 1.1rem;
        color: #7f8c8d;
        transition: color 0.3s ease;
    }
    #offcanvasNavbar .nav-link::after {
        display: none !important;
    }
    #offcanvasNavbar .nav-link:hover,
    #offcanvasNavbar .nav-link.active {
        color: var(--primary-green) !important;
        background-color: rgba(20, 90, 50, 0.04);
        border-left-color: var(--accent-yellow);
        padding-left: 28px !important;
    }
    #offcanvasNavbar .nav-link:hover i,
    #offcanvasNavbar .nav-link.active i {
        color: var(--primary-green) !important;
    }
    #offcanvasNavbar .dropdown-menu,
    #offcanvasNavbar .dropdown-menu-dark {
        background-color: transparent !important;
        border: none !important;
        margin: 0 !important;
        padding: 0 !important;
        display: block !important;
        position: static !important;
        float: none !important;
        box-shadow: none !important;
    }
    #offcanvasNavbar .dropdown-item,
    #offcanvasNavbar .dropdown-menu-dark .dropdown-item {
        color: rgba(255, 255, 255, 0.8) !important;
        font-weight: 500 !important;
        font-size: 0.85rem !important;
        padding: 12px 24px 12px 60px !important; /* Disesuaikan agar teks sub-menu sejajar tepat dengan teks menu utama di atasnya */
        display: flex !important;
        align-items: center !important;
        background: transparent !important;
        transition: all 0.3s ease;
    }
    #offcanvasNavbar .dropdown-item.active,
    #offcanvasNavbar .dropdown-menu-dark .dropdown-item.active {
        color: var(--accent-yellow) !important;
        background-color: rgba(255, 255, 255, 0.05) !important;
        font-weight: 600 !important;
    }
    #offcanvasNavbar .dropdown-item:hover,
    #offcanvasNavbar .dropdown-menu-dark .dropdown-item:hover {
        color: var(--accent-yellow) !important;
        background-color: rgba(255, 255, 255, 0.05) !important;
        padding-left: 64px !important;
    }
    #offcanvasNavbar .btn-close {
        transition: transform 0.3s ease;
    }
    #offcanvasNavbar .btn-close:hover {
        transform: rotate(90deg);
    }
}

/* Toggler button focus fix */
.navbar-toggler:focus {
    box-shadow: none !important;
    outline: none !important;
}

/* ==========================================================================
   EXTRACTED INLINE STYLES & SUB-PAGE STYLES
   ========================================================================== */

/* Layout & Common Extensions */
.header-bg-gradient {
    background: linear-gradient(135deg, #145A32 0%, #27AE60 100%);
    border-bottom: 4px solid var(--accent-yellow);
}

/* Home Page Hero Carousel Layout */
#heroCarousel {
    overflow: hidden;
    position: relative;
}
.carousel-image-wrapper {
    height: 520px;
    position: relative;
    overflow: hidden;
    width: 100%;
}
.carousel-image-wrapper img {
    transition: transform 6.5s cubic-bezier(0.1, 0.2, 0.3, 1);
}
.carousel-item.active .carousel-image-wrapper img {
    transform: scale(1.06);
}
.carousel-indicators {
    bottom: 15px !important;
    margin-bottom: 0 !important;
    z-index: 15;
}
.carousel-indicators [data-bs-target] {
    width: 10px;
    height: 6px;
    border-radius: 3px;
    background-color: rgba(255, 255, 255, 0.5);
    border: none;
    transition: all 0.3s ease;
}
.carousel-indicators .active {
    width: 28px;
    background-color: #f1c40f;
}
.carousel-control-prev,
.carousel-control-next {
    width: 6%;
    height: 100%;
    opacity: 0;
    transition: all 0.3s ease;
    z-index: 16;
}
#heroCarousel:hover .carousel-control-prev,
#heroCarousel:hover .carousel-control-next {
    opacity: 0.95;
}
.carousel-control-prev-icon,
.carousel-control-next-icon {
    background-color: rgba(20, 90, 50, 0.75) !important;
    background-size: 45% !important;
    border-radius: 50% !important;
    width: 40px !important;
    height: 40px !important;
    border: 1px solid rgba(255, 255, 255, 0.2) !important;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.2) !important;
    transition: all 0.2s ease !important;
}
.carousel-control-prev-icon:hover,
.carousel-control-next-icon:hover {
    background-color: rgba(20, 90, 50, 0.95) !important;
    transform: scale(1.1);
    border-color: #f1c40f !important;
}

/* Overlay Caption Style - Apple Liquid Glass Kejaksaan Theme */
.carousel-caption-overlay {
    background: rgba(20, 90, 50, 0.55); /* Translucent Kejaksaan green */
    backdrop-filter: blur(24px) saturate(190%);
    -webkit-backdrop-filter: blur(24px) saturate(190%);
    z-index: 10;
    border-top: 2px solid rgba(241, 196, 15, 0.4); /* Translucent gold highlight edge */
    box-shadow: inset 0 1px 0 0 rgba(255, 255, 255, 0.1), 0 8px 32px 0 rgba(0, 0, 0, 0.25);
}
.carousel-caption-overlay .carousel-title {
    color: var(--accent-yellow) !important; /* Premium Yellow title */
    font-size: 1.6rem;
    font-weight: 700;
    text-shadow: 0 2px 4px rgba(0, 0, 0, 0.15);
}
.carousel-caption-overlay p {
    color: rgba(255, 255, 255, 0.95) !important;
    text-shadow: 0 1px 2px rgba(0, 0, 0, 0.1);
}

@media (max-width: 767.98px) {
    .carousel-image-wrapper {
        height: 280px !important;
    }
    .carousel-caption-overlay {
        position: relative !important; /* Stack caption below image on mobile */
        background: rgba(20, 90, 50, 0.65) !important; /* Translucent Kejaksaan green */
        backdrop-filter: blur(24px) saturate(190%) !important;
        -webkit-backdrop-filter: blur(24px) saturate(190%) !important;
        border-top: 2px solid rgba(241, 196, 15, 0.4) !important;
        box-shadow: inset 0 1px 0 0 rgba(255, 255, 255, 0.1), 0 8px 32px 0 rgba(0, 0, 0, 0.25) !important;
        padding: 20px 16px !important;
    }
    .carousel-caption-overlay .carousel-title {
        font-size: 1.15rem !important;
    }
    .carousel-caption-overlay p {
        font-size: 0.82rem !important;
    }
    .carousel-indicators {
        bottom: auto !important;
        top: 245px !important; /* Keep indicators at the bottom of the image wrapper */
        z-index: 20;
    }
    .carousel-control-prev,
    .carousel-control-next {
        height: 280px !important;
        opacity: 0.85 !important; /* Make controls visible on touch screens */
    }
}
.welcome-shadow-bg {
    top: 15px;
    left: 15px;
    z-index: -1;
}
.welcome-img {
    max-height: 400px;
    object-fit: cover;
    border: 4px solid white;
}
.welcome-speech {
    line-height: 1.8;
}
.stats-bg-gradient {
    background: linear-gradient(135deg, #145A32 0%, #27AE60 100%);
    border-top: 4px solid var(--accent-yellow);
    border-bottom: 4px solid var(--accent-yellow);
}
.bidang-desc {
    line-height: 1.6;
}
.insta-aspect {
    aspect-ratio: 1/1;
}
.insta-overlay-bg {
    background-color: rgba(20, 90, 50, 0.9);
}
.insta-caption {
    font-size: 0.75rem;
    line-height: 1.4;
}
.instagram-item img {
    transition: transform 0.4s ease;
}
.instagram-item:hover img {
    transform: scale(1.1);
}
.instagram-overlay {
    transition: opacity 0.3s ease;
}
.instagram-item:hover .instagram-overlay {
    opacity: 1 !important;
}
.text-truncate-3 {
    display: -webkit-box;
    -webkit-line-clamp: 3;
    -webkit-box-orient: vertical;  
    overflow: hidden;
}

/* Profil Page */
.history-text {
    line-height: 1.8;
    text-align: justify;
    font-size: 1.05rem;
}
.vision-text {
    line-height: 1.7;
    font-size: 0.95rem;
}
.mission-text {
    line-height: 1.7;
    font-size: 0.95rem;
    white-space: pre-line;
}
.doctrine-logo {
    height: 180px;
    width: auto;
}
.doctrine-number {
    width: 50px;
    height: 50px;
    font-size: 1.4rem;
    font-weight: 700;
}
.doctrine-desc {
    line-height: 1.6;
}
.leader-shadow-bg {
    top: 8px;
    left: 8px;
    z-index: -1;
}
.leader-img {
    width: 200px;
    height: 200px;
    object-fit: cover;
    border: 4px solid white;
}
.leader-speech {
    line-height: 1.6;
    font-style: italic;
}
.map-card-border {
    border-radius: 16px;
}
.map-container-style {
    height: 480px;
    border-radius: 12px;
    border: 1px solid rgba(20, 90, 50, 0.1);
    box-shadow: inset 0 0 10px rgba(0,0,0,0.05);
}
.map-info-panel-min-height {
    min-height: 250px;
}
.map-info-footer-text {
    font-size: 0.75rem;
}
.legend {
    line-height: 18px;
    color: #333;
    background: white;
    padding: 10px 15px;
    border-radius: 8px;
    box-shadow: 0 4px 15px rgba(0,0,0,0.1);
    border: 1px solid rgba(20, 90, 50, 0.1);
    font-size: 0.8rem;
}
.legend i {
    width: 15px;
    height: 15px;
    float: left;
    margin-right: 8px;
    opacity: 0.85;
    border-radius: 3px;
}
.info-panel-title {
    color: var(--primary-green);
    font-weight: 700;
}

/* Tentang Page */
.tentang-info-height {
    min-height: 350px;
}

/* Jadwal Sidang Page */
.jadwal-search-bar {
    max-width: 500px;
}
.jadwal-date-input {
    max-width: 200px;
}
.table-header-green {
    background-color: var(--primary-green);
}
.col-w-5 { width: 5%; }
.col-w-15 { width: 15%; }
.col-w-20 { width: 20%; }
.col-w-25 { width: 25%; }
.jadwal-badge-active {
    font-size: 0.75rem;
}

/* Layanan Page */
.layanan-tab-nav {
    border-bottom: 2px solid rgba(20, 90, 50, 0.1);
}
.layanan-nav-link {
    color: #555 !important;
    font-weight: 600;
    border: none !important;
    background: transparent !important;
    padding: 12px 20px !important;
    position: relative;
    transition: all 0.3s ease;
}
.layanan-nav-link::after {
    content: '';
    position: absolute;
    width: 0;
    height: 3px;
    bottom: -2px;
    left: 0;
    background-color: var(--primary-green);
    transition: width 0.3s ease;
}
.layanan-nav-link:hover {
    color: var(--primary-green) !important;
}
.layanan-nav-link.active {
    color: var(--primary-green) !important;
}
.layanan-nav-link.active::after {
    width: 100%;
}
.layanan-badge-category {
    font-size: 0.75rem;
}
.layanan-img-style {
    height: 160px;
    object-fit: cover;
    border-top-left-radius: 15px;
    border-top-right-radius: 15px;
}
.layanan-card {
    border-radius: 16px;
    border: 1px solid rgba(20, 90, 50, 0.1) !important;
}
.layanan-img-hover {
    object-fit: cover;
    transition: transform 0.5s ease;
}
.layanan-badge-top {
    font-size: 0.7rem;
}

/* Instagram Lightbox Modal Styles */
.ig-modal {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.7);
    z-index: 2000;
    justify-content: center;
    align-items: center;
}
.ig-modal.show {
    display: flex;
}
.ig-modal-content {
    background-color: #fff;
    width: 90%;
    max-width: 900px;
    height: 80vh;
    max-height: 600px;
    display: flex;
    border-radius: 12px;
    overflow: hidden;
    position: relative;
    box-shadow: 0 10px 40px rgba(0,0,0,0.5);
}
.ig-modal-media {
    width: 60%;
    background-color: #000;
    display: flex;
    align-items: center;
    justify-content: center;
    position: relative;
}
.ig-modal-media img {
    max-width: 100%;
    max-height: 100%;
    object-fit: contain;
}
.ig-modal-info {
    width: 40%;
    display: flex;
    flex-direction: column;
    background-color: #fff;
    border-left: 1px solid #efefef;
    padding: 24px;
}
.ig-modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding-bottom: 15px;
    border-bottom: 1px solid #efefef;
    margin-bottom: 15px;
}
.ig-modal-user {
    font-weight: 600;
    color: #262626;
    font-size: 0.9rem;
}
.ig-modal-platform {
    font-size: 0.8rem;
    color: #8e8e8e;
}
.ig-modal-body {
    flex-grow: 1;
    overflow-y: auto;
    font-size: 0.85rem;
    line-height: 1.6;
    color: #262626;
    padding-right: 5px;
}
.ig-modal-close {
    position: absolute;
    top: 20px;
    right: 20px;
    background: none;
    border: none;
    color: #fff;
    font-size: 2rem;
    cursor: pointer;
    z-index: 2100;
    transition: transform 0.2s ease;
}
.ig-modal-close:hover {
    transform: scale(1.1);
}
.ig-modal-nav {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    background: rgba(255,255,255,0.1);
    color: #fff;
    border: none;
    width: 50px;
    height: 50px;
    border-radius: 50%;
    font-size: 1.5rem;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    z-index: 2050;
    transition: background 0.2s ease, transform 0.2s ease;
}
.ig-modal-nav:hover {
    background: rgba(255,255,255,0.25);
    transform: translateY(-50%) scale(1.05);
}
.ig-modal-prev {
    left: 30px;
}
.ig-modal-next {
    right: 30px;
}

@media (max-width: 767.98px) {
    .ig-modal-content {
        flex-direction: column;
        height: 90vh;
        max-height: 580px;
        width: 92%;
        margin: auto;
    }
    .ig-modal-media {
        width: 100%;
        height: 55%;
        min-height: 220px;
    }
    .ig-modal-info {
        width: 100%;
        height: 45%;
        border-left: none;
        border-top: 1px solid #efefef;
        padding: 16px;
    }
    .ig-modal-header {
        padding-bottom: 8px;
        margin-bottom: 8px;
    }
    .ig-modal-body {
        max-height: 120px;
    }
    .ig-modal-nav {
        width: 38px;
        height: 38px;
        font-size: 1.1rem;
        background: rgba(0, 0, 0, 0.6);
    }
    .ig-modal-prev {
        left: 4px;
    }
    .ig-modal-next {
        right: 4px;
    }
    .ig-modal-close {
        top: 10px;
        right: 15px;
        font-size: 1.8rem;
    }
}
