/* Sidebar Kanan */
.sidebar.right {
    position: fixed;
    top: 0px;
    right: 0;
    width: 80px;
    height: 100%;
    background-color: maroon;
    color: white;
    display: flex;
    flex-direction: column;
    align-items: center;
    padding-top: 20px;
    z-index: 999;
}

/* Saat hover seluruh sidebar, semua label muncul */
.sidebar.right:hover .sidebar-label,
.sidebar.right.active .sidebar-label {
    display: flex;
}

/* Menu Vertikal */
.sidebar-menu {
    position: relative;
    width: 100%;
    height: 100%;
    top: 80px;
}

/* Sidebar Label */
.sidebar-label-bg {
    position: fixed;
    top: 90px;
    right: 80px;
    width: 80px;
    height: calc(100vh - 60px);
    background-color: maroon;
    z-index: 998;
    display: none;
}

.sidebar.right:hover .sidebar-label-bg,
.sidebar.right.active .sidebar-label-bg {
    display: block;
}

.sidebar-label {
    position: absolute;
    right: 100%;
    top: 0;
    height: 100%;
    color: white;
    width: 80px;
    padding: 0 10px;
    font-size: 13px;
    white-space: nowrap;
    z-index: 1001;
    display: none;
    align-items: center;
    justify-content: end;
    text-align: right;
    border-bottom: 1px solid rgba(255, 255, 255, 0.2);
    transition: background-color 0.3s, color 0.3s; /* ⬅️ Tambahkan ini */
}

/* Menu item style */
.menu-item {
    position: relative;
    width: 100%;
    text-align: center;
    cursor: pointer;
    transition: background-color 0.3s, color 0.3s;
    padding: 20px 0;
    border-bottom: 1px solid rgba(255, 255, 255, 0.2);
}

.menu-item .icon {
    font-size: 24px !important;
    margin-bottom: 25px;
}

.menu-item:hover .sidebar-label,
.menu-item.clicked .sidebar-label {
    display: flex;
    background-color: ivory;
    color: maroon;
}

.menu-item:hover,
.menu-item.clicked {
    background-color: ivory;
    color: maroon;
}

.menu-item .sidebar-label {
    display: none;
    position: absolute;
    right: 100%;
    top: 50%;
    transform: translateY(-50%);
    background-color: maroon;
    color: white;
    padding: 6px 12px;
    height: 25px;
    line-height: 24px;
    font-size: 13px;
    border-radius: 4px 0 0 4px;
    white-space: nowrap;
    z-index: 1001; /* pastikan lebih tinggi dari sidebar-collapsible */
    border-bottom: 1px solid rgba(255, 255, 255, 0.2);
    height: 100%;
}

/* Konten yang muncul setelah klik */
.sidebar-collapsible {
    position: fixed;
    top: 90px;
    right: 160px;
    width: 300px;
    height: calc(100vh - 60px);
    background-color: ivory;
    display: none;
    z-index: 998;
    overflow-y: auto;
    border-left: 1px solid rgba(0, 0, 0, 0.1);
    padding: 20px;
}

.sidebar-collapsible.show {
    display: block;
}

/* Panel Konten Aktif */
.content-panel {
    display: none;
    padding: 20px;
    min-height: 100vh;
    border-bottom: 1px solid rgba(0, 0, 0, 0.05);
    transition: background 0.3s;
}

.content-panel.active {
    display: block;
    background-color: ivory !important;
}


/* Form dalam Konten */
.content-panel form {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.content-panel input[type="text"],
.content-panel input[type="password"] {
    padding: 8px;
    border: 1px solid #ccc;
    border-radius: 4px;
}

.content-panel button,
.content-panel input[type="submit"] {
    padding: 10px;
    background-color: maroon;
    color: white;
    border: none;
    border-radius: 4px;
    cursor: pointer;
    transition: background 0.3s;
}

.content-panel button:hover,
.content-panel input[type="submit"]:hover {
    background-color: darkred;
}

.content-panel a {
    color: maroon;
    text-decoration: none;
}

.content-panel a:hover {
    text-decoration: underline;
}

.hidden {
    display: none !important;
}



/* Tombol Close hanya untuk mobile */
.d-mobile-only {
    display: none;
}

/* ========== RESPONSIVE: MOBILE (Android & iPhone) ========== */
@media only screen and (max-width: 768px) {

    /* Tombol Close hanya untuk mobile */
    .d-mobile-only {
        display: block;
    }    

    /* Sidebar di bawah */
    .sidebar.right {
        flex-direction: row;
        justify-content: space-around;
        align-items: center;
        position: fixed;
        bottom: 0;
        right: 0;
        left: 0;
        width: 100%;
        height: 70px;
        padding: 0;
        background-color: maroon;
        z-index: 999;
        top: unset;
    }

    /* Sidebar-Label */
    .sidebar-label-bg {
        display: none !important; /* atau atur ulang ukurannya */
    }

    .sidebar-label {
        pointer-events: none;
    }

    /* Jika sidebar aktif, tampilkan label */
    .sidebar.right.active .sidebar-label {
        display: block !important;
        position: static !important;
        width: 100%;
        height: 0px;
        text-align: center;
        font-size: 11px;
        padding: 2px 0;
        color: white;
        opacity: 0.85;
    }

    /* Warna maroon untuk item yang sedang aktif (diklik) */
    .menu-item.clicked .sidebar-label {
        color: maroon !important;
        font-weight: bold;
    }

    .sidebar-menu {
        position: relative;
        width: 100%;
        height: 100%;
        top: 0;
        display: flex;
        flex-direction: row;
        justify-content: space-evenly;
        align-items: center;
    }

    .menu-item {
        display: flex;
        flex-direction: column;
        align-items: center;
        justify-content: center;
    }

    .menu-item:last-child {
        border-right: none;
    }

    .menu-item .icon {
        font-size: calc(6vw + 6px); /* skala berdasarkan lebar layar */
        margin-bottom: 0;
    }

    .menu-item.close-btn {
        position: fixed;
        top: 75px;
        right: 10px;
        background: maroon;
        color: white;
        width: 30px;       /* ⬅️ lebar latar belakang */
        height: 30px;      /* ⬅️ tinggi latar belakang */
        display: flex;
        align-items: center;
        justify-content: center;
        border-radius: 50%; /* agar bulat */
        font-size: 12px;
        z-index: 1002;
    }
    

    /* Konten collapsible full screen dari bawah */
    .sidebar-collapsible {
        position: fixed;
        top: 70px; /* misalnya navbar tingginya 90px */
        left: 0;
        right: 0;
        width: 100%;
        height: calc(100vh - 90px - 105px); /* navbar + bottom bar */
        border-top: none;
        border-left: none;
        padding: 15px;
        background: white; /* opsional, agar jelas */
        z-index: 1001;
    }

    /* Panel Konten Aktif */
    .content-panel {
        position: absolute; /* atau fixed, tergantung konteks */
        top: 30px; /* misalnya di bawah navbar */
        left: 0;
        right: 0;
        bottom: 80px; /* kalau kamu ingin menyisakan area sidebar bawah */
        overflow-y: auto;
        padding: 20px;
        background: ivory;
        z-index: 1001;
        color: black;
    }

    .content-panel.active {
        display: block;
    }

    /* Form dalam Konten */
    .content-panel form {
        display: flex;
        flex-direction: column;
        gap: 10px;
    }

    .content-panel input[type="text"],
    .content-panel input[type="password"] {
        padding: 8px;
        border: 1px solid #ccc;
        border-radius: 4px;
    }

    .content-panel button,
    .content-panel input[type="submit"] {
        padding: 10px;
        background-color: maroon;
        color: white;
        border: none;
        border-radius: 4px;
        cursor: pointer;
        transition: background 0.3s;
    }

    .content-panel button:hover,
    .content-panel input[type="submit"]:hover {
        background-color: darkred;
    }

    .content-panel a {
        color: maroon;
        text-decoration: none;
    }

    .content-panel a:hover {
        text-decoration: underline;
    }
    
    
}
