/* GLOBAL RESET */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}
html, body {
    height: 100%;
    overflow: auto;
}
body {
    background-color: #e5e5e5;
    font-family: "Segoe UI", Tahoma, Geneva, Verdana, sans-serif;
    font-size: 14px;
    color: #2c3e50;
}
body.show-berita {
    background-color: #f9fafb !important;
}


/* NAVBAR */
.custom-navbar {
    position: fixed;
    top: 0; left: 0; right: 0;
    height: 64px;
    line-height: 64px;
    background-color: #2c3e50 !important;
    z-index: 1000;
}
.custom-navbar .max-w-7xl {
    padding: 0 2rem;
}

/* Nav link */
.navbar-brand {
    font-size: 18px;
    font-weight: bold;
    color: #ecf0f1 !important;
}

.navbar-nav .nav-link {
    margin-left: 10px;   /* sebelumnya 15px */
    padding: 0 6px;      /* rapatkan padding */
    font-size: 13px;     /* biar pas dengan tinggi navbar */
    line-height: 64px;   /* ikut tinggi navbar */
}

.navbar-nav .nav-link.active {
    color: #3498db !important;
    font-weight: bold;
}


/* DROPDOWN OVERRIDES */
[x-show="open"],
div.bg-white.rounded-md.ring-1,
.dropdown-menu {
    background-color: #2c3e50 !important;
    color: white !important;
}
[x-show="open"] a,
div.bg-white.rounded-md.ring-1 a,
.dropdown-menu .dropdown-item {
    color: white !important;
}
[x-show="open"] a:hover,
div.bg-white.rounded-md.ring-1 a:hover,
.dropdown-menu .dropdown-item:hover {
    background-color: #34495e !important;
    color: #3498db !important;
}

/* Dropdown scrollbar */
.dropdown-scroll {
    max-height: 300px;
    overflow-y: auto;
    scrollbar-width: thin;
    scrollbar-color: #4b5563 #1f2937;
}
.dropdown-scroll::-webkit-scrollbar {
    width: 6px;
}
.dropdown-scroll::-webkit-scrollbar-thumb {
    background-color: #4b5563;
    border-radius: 4px;
}
.dropdown-scroll::-webkit-scrollbar-track {
    background-color: #1f2937;
}


/* SEARCH BOX (DESKTOP) */
.search-container {
    position: relative;
    width: 100%;
    max-width: 220px;
    margin-right: 24px;
}
.search-container svg,
.search-container i {
    position: absolute;
    top: 50%;
    left: 12px;
    transform: translateY(-50%);
    width: 18px;
    height: 18px;
    color: #9ca3af;
    pointer-events: none;
}

.search-container input {
    padding: 0.45rem 1rem 0.45rem 2.2rem; /* rapatkan */
    height: 36px;                         /* fix tinggi */
    font-size: 13px;
}

.search-container input::placeholder {
    color: #a0aec0;
}
.search-container input:focus {
    outline: none;
    border-color: #3498db;
    box-shadow: 0 0 4px rgba(52, 152, 219, 0.4);
    background-color: #1f2937;
}

/* Search results desktop */
#searchResults {
    position: absolute;
    background-color: #1f2937;
    color: white;
    border: 1px solid #374151;
    border-radius: 12px;
    box-shadow: 0 6px 16px rgba(0,0,0,0.45);
    z-index: 9999;
    max-height: 320px;
    overflow-y: auto;
    min-width: 280px;
    width: auto;
    max-width: 100%;
    animation: fadeIn 0.2s ease-in-out;
}
#searchResults a {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 0.75rem 1rem;
    font-size: 14px;
    color: #ecf0f1;
    text-decoration: none;
    border-bottom: 1px solid #374151;
    transition: all 0.25s ease;
}
#searchResults a:hover {
    background: linear-gradient(to right, #2563eb, #1e40af);
    transform: scale(1.02);
}
#searchResults div {
    padding: .75rem 1rem;
    color: #d1d5db;
    font-size: 13px;
}


/* SEARCH BOX (MOBILE) */
@media (max-width: 768px) {
    .search-container {
        position: relative;
        width: 100%;
        max-width: 100%;
        margin: 0;
        padding: 0;
        background: transparent;
        border: none;
    }

    .search-container svg {
    left: 10px;
    width: 16px;
    height: 16px;
    }

    .search-container input {
        width: 100%;
        padding: 0.6rem 1rem 0.6rem 2.5rem;
        border: 1px solid #4b5563;
        border-radius: 10px;
        background-color: #2d3748;
        color: #ecf0f1;
        font-size: 14px;
    }
    .search-container input:focus {
        border-color: #3498db;
        box-shadow: 0 0 4px rgba(52, 152, 219, 0.4);
    }
    #searchResultsMobile {
        position: absolute;
        top: 110%; /* tepat di bawah input */
        left: 0;
        right: 0;
        width: 100%;
        background-color: #1f2937;
        border: 1px solid #374151;
        border-radius: 10px;
        box-shadow: 0 6px 16px rgba(0,0,0,0.45);
        z-index: 9999;
        max-height: 320px;
        overflow-y: auto;
    }
}
#searchResultsMobile a {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 0.75rem 1rem;
    font-size: 14px;
    color: #ecf0f1;
    text-decoration: none;
    border-bottom: 1px solid #374151;
    transition: all 0.25s ease;
}
#searchResultsMobile a:hover {
    background: linear-gradient(to right, #2563eb, #1e40af);
    transform: scale(1.02);
}
#searchResultsMobile div {
    padding: .75rem 1rem;
    color: #d1d5db;
    font-size: 13px;
}


/* ANIMATION */
@keyframes fadeIn {
    from { opacity: 0; transform: translateY(-6px); }
    to { opacity: 1; transform: translateY(0); }
}


/* SEARCH ITEM CUSTOM */
.search-item {
    transition: all 0.25s ease-in-out;
}
.search-item:hover {
    background: linear-gradient(to right, #2563eb, #1e40af);
    transform: scale(1.02);
    box-shadow: 0 4px 12px rgba(0,0,0,0.3);
}
.search-item span.text-blue-400 {
    font-size: 13px;
}
.search-item span.text-gray-200 {
    font-size: 14px;
}


/* RESPONSIVE OVERRIDES */
@media (max-width: 768px) {
    nav .flex-wrap {
        flex-direction: column;
        align-items: stretch;
        gap: .5rem;
    }
    nav .flex-wrap > div,
    nav .flex-grow {
        width: 100%;
        max-width: 100%;
    }
    nav .shrink-0 {
        justify-content: center;
    }
    .dropdown-menu {
        max-width: 90vw !important;
        left: auto !important;
        right: 0 !important;
    }
    .navbar-nav {
        background-color: #34495e;
        margin-top: 10px;
        border-radius: 5px;
        padding: 10px;
    }
}

/* Fix Tailwind responsive nav link */
.responsive-nav-link {
    color: white !important;
}
.responsive-nav-link:hover {
    color: #3498db !important;
    background-color: #34495e !important;
}

/* MAIN CONTENT */
.main-content {
    margin-left: 230px;
    padding: 80px 2rem 2rem;
    min-height: 100vh;
    width: 100%;
}
body.without-sidebar .main-content {
    margin: 0 auto;
    max-width: 1200px;
    padding: 3px 2rem 2rem;
}


/* CARDS & FOOTER */
.card, .card-kegiatan {
    border-radius: 10px;
    overflow: hidden;
    transition: transform .3s ease, box-shadow .3s ease;
    font-size: 14px;
}
.card:hover {
    transform: translateY(-5px);
    box-shadow: 0 4px 15px rgba(0,0,0,0.2);
}
.card-kegiatan {
    height: 13rem;
}
.card-kegiatan img {
    height: 6rem;
    object-fit: cover;
    width: 100%;
}
.card-kegiatan:hover {
    transform: translateY(-4px);
    box-shadow: 0 4px 12px rgba(0,0,0,0.15);
}
.card-body {
    padding: 15px;
}
.card-title {
    font-size: 16px;
    font-weight: bold;
    margin-bottom: 10px;
    color: #2c3e50;
}
.card-text {
    font-size: 13px;
    color: #555;
    line-height: 1.5;
}
footer a, footer p {
    font-size: 13px;
    line-height: 1.4;
}

/* CAROUSEL BUTTONS */
.custom-carousel-btn {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    width: 45px;
    height: 45px;
    background-color: rgba(30,51,71,0.8);
    border: none;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 5;
}
.carousel-control-prev.custom-carousel-btn {
    left: 15px;
}
.carousel-control-next.custom-carousel-btn {
    right: 15px;
}
.custom-carousel-btn:hover {
    background-color: rgba(44,62,80,0.9);
}


/* FIX MODAL TERTIMPA CAROUSEL */
.modal.show {
    z-index: 1060 !important;
    position: fixed !important;
}
.modal-backdrop.show {
    z-index: 1055 !important;
}
.carousel,
.carousel-inner,
.carousel-item {
    z-index: 1 !important;
    position: relative;
}

.custom-modal {
    max-width: 420px; /* lebih lebar dari modal-sm (300px), tapi masih ramping */
    width: 95%;
}

/* CONFIRM BUTTON */
.swal-confirm-btn {
    background-color: #D02929;
    color: #fff;
    font-weight: 600;
    border: none;
    border-radius: 8px;
    padding: 8px 18px;
    box-shadow: 0 2px 6px rgba(0,0,0,0.2);
    transition: all 0.2s ease-in-out;
}
.swal-confirm-btn:hover {
    background-color: #b51f1f; /* warna lebih gelap saat hover */
    transform: scale(1.05);
}

/* === CAROUSEL MEDIA (FOTO & VIDEO) === */
.carousel-media {
    object-fit: cover;
    width: 100%;
    height: 550px;   /* fix height biar sama */
    border-radius: 8px;
    background-color: #000; /* biar kalau rasio beda, pinggirannya hitam */
}

/* Responsive: biar pas di layar kecil */
@media (max-width: 768px) {
    .carousel-media {
        height: 300px; /* fix height mobile */
    }
}

