/* CSS untuk elemen Navbar dan Footer */
.navbar {
    background: #fff;
    box-shadow: 0 2px 10px rgba(0,0,0,0.08);
    position: sticky;
    top: 0;
    z-index: 1000;
}
.navbar-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 10px 20px;
}
.brand {
    display: flex;
    align-items: center;
    gap: 10px;
}
.brand .logo {
    height: 36px;
    transition: transform 0.3s ease;
}
.brand .logo:hover {
    transform: scale(1.1);
}
.toggle {
    display: none;
    font-size: 1.4rem;
    cursor: pointer;
    border: none;
    background: none;
    -webkit-tap-highlight-color: transparent;
    margin-left: auto;
}
.toggle i {
    pointer-events: none;
}
.toggle:focus {
    outline: none;
}
nav ul {
    list-style: none;
    margin: 0;
    padding: 0;
    display: flex;
    gap: 20px;
}
nav a {
    text-decoration: none;
    color: #555;
    font-weight: 600;
    display: flex;
    align-items: center;
    gap: 8px;
    transition: color 0.3s ease;
}
nav a:hover {
    color: #3f51b5;
}
.dropdown {
    position: relative;
}
.dropdown-menu {
    position: absolute;
    top: 100%;
    left: 0;
    min-width: 200px;
    background: #fff;
    border-radius: 8px;
    box-shadow: 0 4px 12px rgba(0,0,0,0.1);
    flex-direction: column;
    overflow: hidden;
    z-index: 999;
    opacity: 0;
    transform: translateY(-10px);
    transition: opacity 0.3s ease, transform 0.3s ease;
    pointer-events: none;
}

/* KODE PERBAIKAN: Menggabungkan :hover dan .open */
.dropdown:hover .dropdown-menu,
.dropdown.open .dropdown-menu {
    opacity: 1;
    transform: translateY(0);
    pointer-events: auto;
}

.dropdown-menu a {
    padding: 12px 16px;
    color: #555;
    justify-content: flex-start;
}
.dropdown-menu a:hover {
    background: #f5f5f5;
    color: #3f51b5;
}
footer {
    background: #333;
    color: #fff;
    margin-top: auto;
}
.footer-top {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 14px 20px;
}
.social-icons {
    display: flex;
    gap: 6px;
}
.social-icons a, .scroll-top {
    font-size: 14px;
    width: 28px;
    height: 28px;
    display: flex;
    justify-content: center;
    align-items: center;
    background: transparent;
    color: #fff;
    border: none;
    cursor: pointer;
    transition: transform 0.25s ease, color 0.25s ease, background 0.25s ease;
    text-decoration: none;
}
.social-icons a:hover {
    transform: scale(1.15);
    color: #ffd700;
}
.scroll-top {
    background: #666;
    border-radius: 6px;
}
.scroll-top:hover {
    background: #888;
    transform: scale(1.15);
}
.footer-bottom {
    text-align: center;
    padding: 6px 0 10px;
    background: #fff;
    color: #333;
    font-size: 14px;
}

/* MEDIA QUERIES UNTUK TAMPILAN SELULER */
@media (max-width: 768px) {
    .navbar-header {
        flex-wrap: wrap;
    }
    nav {
        width: 100%;
        order: 3;
    }
    nav ul {
        flex-direction: column;
        background: #fff;
        overflow: hidden;
        max-height: 0;
        width: 100%;
        transition: max-height 0.3s ease-out;
    }
    nav ul.open {
        max-height: 800px;
    }
    nav ul li {
        border-bottom: 1px solid #eee;
        transform: translateY(-15px);
        opacity: 0;
        transition: transform 0.25s ease-out, opacity 0.25s ease-out;
    }
    nav ul.open li {
        transform: translateY(0);
        opacity: 1;
    }
    nav ul li a {
        padding: 14px 20px;
        width: 100%;
        justify-content: center;
        color: #666;
        position: relative;
    }
    nav ul li a i {
        position: absolute;
        left: 20px;
    }
    nav ul li a:active {
        background: #f5f5f5;
        transform: scale(0.97);
    }
    .toggle {
        display: block;
    }

    /* KODE PERBAIKAN: Menyesuaikan aturan dropdown untuk tampilan seluler */
    .dropdown-menu {
        position: static;
        box-shadow: none;
        border-radius: 0;
        overflow: hidden;
        max-height: 0;
        display: flex;
        flex-direction: column;
        transition: max-height 0.3s ease-out;
        padding-top: 5px;
    }
    .dropdown.open .dropdown-menu {
        max-height: 300px;
    }

    /* Animasi geser untuk item menu utama (li) */
    nav ul.open li:nth-child(1) { transition-delay: 0.05s; }
    nav ul.open li:nth-child(2) { transition-delay: 0.1s; }
    nav ul.open li:nth-child(3) { transition-delay: 0.15s; }
    nav ul.open li:nth-child(4) { transition-delay: 0.2s; }
    nav ul.open li:nth-child(5) { transition-delay: 0.25s; }
    nav ul.open li:nth-child(6) { transition-delay: 0.3s; }
    nav ul.open li:nth-child(7) { transition-delay: 0.35s; }

    /* Aturan untuk animasi submenu muncul satu per satu */
    .dropdown-menu a {
        transform: translateY(-10px);
        opacity: 0;
        transition: transform 0.2s ease-out, opacity 0.2s ease-out;
        justify-content: center;
        background-color: #f0f0f0;
        margin-bottom: 1px;
        border-radius: 6px;
        padding: 10px 16px;
        font-size: 0.95rem;
    }

    .dropdown.open .dropdown-menu a {
        transform: translateY(0);
        opacity: 1;
    }

    .dropdown.open .dropdown-menu a:nth-child(1) { transition-delay: 0.05s; }
    .dropdown.open .dropdown-menu a:nth-child(2) { transition-delay: 0.1s; }
    .dropdown.open .dropdown-menu a:nth-child(3) { transition-delay: 0.15s; }
    .dropdown.open .dropdown-menu a:nth-child(4) { transition-delay: 0.2s; }
    .dropdown.open .dropdown-menu a:nth-child(5) { transition-delay: 0.25s; }
}

@media (min-width: 769px) {
    nav ul {
        display: flex;
        align-items: center;
        gap: 20px;
    }
    .toggle {
        display: none;
    }
}