/* ========== NAVBAR DESKTOP ========== */
.navbar-custom {
    background-color: #1D416D;
    border-bottom: 3px solid rgb(68, 146, 255);
}

.navbar-custom .nav-link {
    color: #ffffff;
    font-weight: 500;
    font-size: 16px;
    margin: 0 10px;
    position: relative;
    transition: color 0.3s ease;
    padding-bottom: 4px;
}

.navbar-custom .nav-link:hover {
    color: #4371bb;
}

.navbar-custom .nav-link::after {
    content: "";
    position: absolute;
    bottom: 0;
    left: 50%;
    transform: translateX(-50%) scaleX(0);
    transform-origin: center;
    width: 40%;
    height: 2px;
    background-color: #ffffff;
    border-radius: 5px;
    transition: transform 0.3s ease;
}

.navbar-custom .nav-link:hover::after {
    transform: translateX(-50%) scaleX(1);
}

.navbar-custom .nav-link.active {
    color: #ffffff;
    font-weight: 600;
}

.navbar-custom .nav-link.active::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 50%;
    transform: translateX(-50%) scaleX(1);
    width: 40%;
    height: 2px;
    background-color: #ffffff;
    border-radius: 5px;
}

.navbar-nav {
    margin: 0 auto;
}

.navbar-brand {
    margin-left: 20px;
}

.navbar-logo {
    height: 45px;
    width: auto;
    filter: drop-shadow(0 2px 4px rgba(0, 0, 0, 0.2));
    transition: transform 0.3s ease;
}

.navbar-logo:hover {
    transform: scale(1.05);
}

/* LOGIN BUTTON */
.btn-login {
    background: linear-gradient(45deg, #e2e2e2 0%, hsl(187, 100%, 98%) 100%);
    border: none;
    border-radius: 25px;
    transition: all 0.3s ease;
}

.btn-login:hover {
    transform: scale(1.05);
    box-shadow: rgba(133, 189, 215, 0.7) 0 6px 12px -3px;
    color: #0f5da6;
}

.btn-login:active {
    transform: scale(0.95);
}

.nav-link.active {
    color: #dbe9ff !important;
    font-weight: bold;
}

.welcome-text-login {
    font-size: 1rem;
    letter-spacing: 0.5px;
    font-family: 'Bebas Neue', sans-serif;
    color: aliceblue;
    margin-right: 8px;
}

.confirm-peminjaman {
    color: #ffffff !important;
}

/* ========== MOBILE SIDEBAR ========== */

/* Sidebar Container */
.mobile-sidebar {
    position: fixed;
    top: 0;
    left: -280px;
    width: 280px;
    height: 100vh;
    background: linear-gradient(180deg, #1D416D 0%, #2a5ba8 100%);
    color: white;
    padding: 0;
    z-index: 2000;
    transition: left 0.3s ease;
    overflow-y: auto;
    box-shadow: 4px 0 20px rgba(0, 0, 0, 0.4);
}

.mobile-sidebar.active {
    left: 0;
}

/* Header Sidebar */
.mobile-sidebar::before {
    content: 'MENU';
    display: block;
    padding: 25px 20px;
    font-size: 1.3rem;
    font-weight: 700;
    color: #ffffff;
    letter-spacing: 2px;
    text-align: center;
    border-bottom: 3px solid rgba(68, 146, 255, 0.5);
    background: linear-gradient(135deg, rgba(68, 146, 255, 0.3) 0%, rgba(29, 65, 109, 0.3) 100%);
}

/* Menu List */
.sidebar-menu {
    padding: 20px 15px;
    margin: 0;
}

.sidebar-menu li {
    list-style: none;
    margin-bottom: 8px;
}

.sidebar-menu li a {
    color: white;
    font-size: 15px;
    text-decoration: none;
    font-weight: 500;
    display: block;
    padding: 14px 18px;
    border-radius: 8px;
    border-left: 4px solid transparent;
    background-color: rgba(255, 255, 255, 0.05);
    transition: all 0.3s ease;
}

.sidebar-menu li a:hover {
    background-color: rgba(68, 146, 255, 0.3);
    color: #ffffff;
    border-left-color: #4492ff;
    transform: translateX(5px);
}

.sidebar-menu li a.active {
    background: linear-gradient(135deg, rgba(68, 146, 255, 0.4) 0%, rgba(68, 146, 255, 0.2) 100%);
    border-left-color: #4492ff;
    font-weight: 600;
    box-shadow: 0 2px 8px rgba(68, 146, 255, 0.3);
}

/* Pembatas sebelum Logout */
.sidebar-menu::after {
    content: '';
    display: block;
    width: 100%;
    height: 2px;
    background: linear-gradient(90deg, transparent 0%, rgba(255, 255, 255, 0.3) 50%, transparent 100%);
    margin: 25px 0 20px 0;
}

/* Login Button di Sidebar */
.sidebar-login {
    display: block;
    background: linear-gradient(45deg, #4492ff 0%, #2a5ba8 100%);
    color: #ffffff !important;
    padding: 12px;
    border-radius: 8px;
    text-align: center;
    font-weight: 700;
    text-decoration: none;
    margin: 0 15px 20px;
    transition: all 0.3s ease;
    box-shadow: 0 4px 12px rgba(68, 146, 255, 0.3);
}

.sidebar-login:hover {
    background: linear-gradient(45deg, #2a5ba8 0%, #1D416D 100%);
    transform: translateY(-2px);
    box-shadow: 0 6px 16px rgba(68, 146, 255, 0.4);
}

/* Logout Button - MERAH */
.sidebar-logout {
    width: calc(100% - 30px);
    background: linear-gradient(135deg, #dc3545 0%, #c82333 100%);
    border: none;
    padding: 12px;
    border-radius: 8px;
    color: white;
    font-weight: 700;
    font-size: 15px;
    cursor: pointer;
    transition: all 0.3s ease;
    margin: 0 15px 20px;
    box-shadow: 0 4px 12px rgba(220, 53, 69, 0.3);
}

.sidebar-logout:hover {
    background: linear-gradient(135deg, #c82333 0%, #bd2130 100%);
    transform: translateY(-2px);
    box-shadow: 0 6px 16px rgba(220, 53, 69, 0.4);
}

.sidebar-logout:active {
    transform: translateY(0);
}

/* Overlay */
.sidebar-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.6);
    opacity: 0;
    visibility: hidden;
    transition: all 0.3s ease;
    z-index: 1500;
}

.sidebar-overlay.active {
    opacity: 1;
    visibility: visible;
}

/* Tombol Hamburger (Kiri) */
.mobile-menu-btn {
    width: 40px;
    height: 32px;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    cursor: pointer;
    background: rgba(68, 146, 255, 0.2);
    border: 2px solid rgba(255, 255, 255, 0.4);
    border-radius: 8px;
    padding: 6px 8px;
    transition: all 0.3s ease;
}

.mobile-menu-btn:hover {
    background: rgba(68, 146, 255, 0.4);
    border-color: #4492ff;
}

.mobile-menu-btn span {
    height: 3px;
    background-color: white;
    border-radius: 4px;
    transition: 0.3s;
}

/* ========= HOVER MENU =========== */

.dropdown-master {
    position: relative;
}

.master-menu {
    position: absolute;
    top: 100%;
    left: 50%;
    transform: translateX(-50%) translateY(-10px);
    background: white;
    padding: 8px 0;
    border-radius: 12px;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.12);
    border: 2px solid #1d416d32;
    opacity: 0;
    visibility: hidden;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    z-index: 999;
    min-width: 220px;
}

.dropdown-master:hover .master-menu {
    opacity: 1;
    visibility: visible;
    transform: translateX(-50%) translateY(0);
}

.master-menu ul {
    list-style: none;
    margin: 0;
    padding: 0;
}

.master-menu li {
    padding: 0;
    transition: all 0.2s ease;
    margin: 2px 8px;
    border-radius: 8px;
}

.master-menu li:hover {
    background: #1D416D;
    border-left: 4px solid #3482e1;
}

.master-menu li a {
    text-decoration: none;
    color: #334155;
    font-weight: 500;
    font-size: 14px;
    display: block;
    padding: 12px 16px;
    border-radius: 8px;
    transition: all 0.2s ease;
}

.master-menu li:hover a {
    color: white;
}

/* SIDE MENU (sub dropdown) */
.has-side-menu-master {
    position: relative;
}

.side-menu-master {
    position: absolute;
    top: 0;
    left: 100%;
    margin-left: 8px;
    background: white;
    padding: 8px 0;
    border-radius: 12px;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.12);
    border: 1px solid rgba(0, 0, 0, 0.05);
    opacity: 0;
    visibility: hidden;
    transform: translateX(-10px);
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    min-width: 200px;
    z-index: 9999;
}

.has-side-menu-master:hover > .side-menu-master {
    opacity: 1;
    visibility: visible;
    transform: translateX(0);
}

.side-menu-master ul {
    list-style: none;
    margin: 0;
    padding: 0;
}

.side-menu-master li {
    margin: 2px 8px;
    border-radius: 8px;
    transition: all 0.2s ease;
}

.side-menu-master li:hover {
    background: #1D416D;
    border-left: 4px solid #3482e1;
}

/* =======================================
   FIX: Warna teks default side-menu (hitam)
   MENGALAHKAN .master-menu li a
   ======================================= */
.master-menu .side-menu-master li a {
    text-decoration: none;
    color: #334155; /* warna teks normal */
    padding: 12px 16px;
    display: block;
    font-size: 14px;
    font-weight: 500;
    border-radius: 8px;
    transition: all 0.2s ease;
}

/* Warna teks saat hover */
.master-menu .side-menu-master li:hover a {
    color: white;
}

/* ========== RESPONSIVE ========== */

/* SEMBUNYIKAN hamburger Bootstrap (yang kanan) di mobile */
@media (max-width: 991px) {
    .navbar-toggler {
        display: none !important;
    }

    .navbar-brand {
        margin-left: 10px;
    }

    .navbar-logo {
        height: 40px;
    }
}

/* Desktop - sembunyikan hamburger kiri */
@media (min-width: 992px) {
    .mobile-menu-btn {
        display: none !important;
    }

    .mobile-sidebar {
        display: none !important;
    }

    .sidebar-overlay {
        display: none !important;
    }
}

/* Tablet */
@media (max-width: 768px) {
    .mobile-sidebar {
        width: 260px;
        left: -260px;
    }

    .navbar-brand {
        margin-left: 8px;
    }

    .navbar-logo {
        height: 36px;
    }

    .sidebar-menu li a {
        font-size: 14px;
        padding: 12px 16px;
    }
}

/* Small Mobile */
@media (max-width: 480px) {
    .mobile-sidebar {
        width: 240px;
        left: -240px;
    }

    .navbar-logo {
        height: 32px;
    }

    .sidebar-menu li a {
        font-size: 13px;
        padding: 10px 14px;
    }

    .sidebar-logout,
    .sidebar-login {
        font-size: 14px;
        padding: 10px;
    }
}
