@import url("https://fonts.googleapis.com/css2?family=Inter:ital,opsz,wght@0,14..32,100..900;1,14..32,100..900&family=Nunito:ital,wght@0,200..1000;1,200..1000&display=swap");

/* --- Variabel warna untuk mudah edit --- */
:root {
    --accent-1: #4f46e5;
    /* indigo */
    --accent-2: #06b6d4;
    /* cyan */
    --muted: #6b7280;
    --bg-card: #ffffff;
    --radius: 12px;
}

body {
    font-family: "Inter", sans-serif;
    overflow-x: hidden;
}


.sidebar {
    height: 100vh;
    background-color: #fff;
    border-right: 1px solid #ddd;
    position: fixed;
    top: 0;
    left: 0;
    padding-top: 92px;
    padding-bottom: 92px;
    padding-left: 10px;
    padding-right: 10px;
    z-index: 1;
    /* sidebar di bawah */
    overflow: visible !important;
    /* jangan potong anak yang keluar */
    transition: width 0.3s ease;

    /* perbaikan scroll */
    overflow-y: auto;
    /* biar bisa scroll ke bawah */
    overflow-x: hidden;
    /* cegah scroll horizontal */
}

/* Default collapsed */
.sidebar.collapsed {
    width: 80px;
}

.sidebar.expanded {
    width: 260px;
}

.sidebar .nav-link {
    color: #333;
    padding: 0.6rem;
    border-radius: 0.4rem;
    display: flex;
    align-items: center;
    font-size: 14px;
    font-weight: 500;
    transition: all 0.3s ease;
}

/* Saat collapsed: icon di tengah */
.sidebar.collapsed .nav-link {
    justify-content: center;
    gap: 0;
    /* Hilangkan gap antara icon dan text */
}

/* Saat collapsed: bagian kiri (icon) di center */
.sidebar.collapsed .nav-link>div {
    display: flex;
    justify-content: center;
    align-items: center;
    width: 100%;
}

.nav-sidebar .nav-link:hover,
.nav-sidebar .nav-link.active {
    background-color: #f1f3f5;
    color: #000;
}

/* Text menu */
.sidebar .menu-text {
    white-space: nowrap;
    transition: opacity 0.3s ease, width 0.3s ease;
}

/* Saat collapsed: sembunyikan text total tanpa mempengaruhi layout */
.sidebar.collapsed .menu-text {
    display: none;
}

/* ===================== */
/* SUBMENU HOVER STYLING */
/* ===================== */

/* Styling link dalam submenu */
.submenu .nav-link {
    display: block;
    /* jangan flex seperti induk */
    text-align: left;
    /* rata kiri */
    padding: 0.5rem 1rem;
    font-size: 13px;
    font-weight: 500;
    color: #333;
    border-radius: 0;
    justify-content: flex-start !important;
    /* override parent */
}

.nav-item {
    position: relative;
    overflow: visible;
}

.nav-item .submenu {
    display: none;
    position: absolute;
    top: 0;
    /* mulai dari atas nav-item */
    left: 80%;
    /* keluar ke kanan sidebar */
    margin-top: 0;
    /* pastikan ga turun */
    background: #fff;
    min-width: 200px;
    border: 1px solid #ddd;
    border-radius: 0.4rem;
    padding: 0.5rem 0;
    box-shadow: 0 4px 10px rgba(0, 0, 0, 0.15);

    z-index: 5000;
    opacity: 0;
    transform: translateX(10px);
    transition: all 0.2s ease-in-out;
}

.nav-item:hover .submenu {
    display: block;
    opacity: 1;
    transform: translateX(0);
}

/* ===================== */
/* END SUBMENU HOVER STYLING */

/* Sembunyikan sidebar di layar kecil secara default */
@media (max-width: 767.98px) {
    .sidebar {
        left: -260px;
        width: 260px;
        transition: left 0.3s ease;
    }

    .sidebar.show {
        left: 0;
        box-shadow: 0 0 15px rgba(0, 0, 0, 0.3);
    }

    /* Saat sidebar terbuka, cegah konten di belakang ikut di-scroll */
    body.sidebar-open {
        overflow: hidden;
    }
}

.overlay {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.4);
    z-index: 0;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.3s ease;
}

.sidebar.show+.overlay {
    opacity: 1;
    pointer-events: auto;
}

/* End Sidebar */

@media (min-width: 768px) {
    .main-content {
        transition: margin-left 0.3s ease;
    }

    .sidebar.expanded~.main-content {
        margin-left: 260px;
        /* ubah dari 200 ke 260 */
    }

    .sidebar.collapsed~.main-content {
        margin-left: 80px;
        /* ubah dari 60 ke 80 */
    }
}

@media (max-width: 767.98px) {
    .main-content {
        margin-left: 0;
    }
}

.topbar {
    padding: 1rem 1.5rem;
    height: 72px;
    background-color: #fff;
    border-bottom: 1px solid #ddd;
    display: flex;
    justify-content: space-between;
    align-items: center;
    position: sticky;
    top: 0;
    z-index: 1000;
}

.main-content {
    transition: margin-left 0.3s;
    z-index: 0;
}


.header {
    background: url(https://diandidaktika.sch.id/assets/images/il-header.jpg) no-repeat;
    background-size: cover;
    background-position: center;
}

/* Components */

.btn {
    border-radius: 8px;
    padding: 10px 20px;
}

.btn-primary {
    background-color: #1fa2ff;
    color: white;
    border: none;
}

.btn-success {
    background-color: #48b3af;
    color: white;
    border: none;
}

.btn-danger {
    background-color: #f75270;
    color: white;
    border: none;
}

.btn-warning {
    background-color: #faa533;
    color: white;
    border: none;
}

/* Sticky  */
.btn-check:checked+.btn,
.btn.active,
.btn.show,
.btn:first-child:active,
:not(.btn-check)+.btn:active {
    color: white;
    font-weight: 700;
    background-color: #ff820d;
    border-color: #ff820d;
}

.form-control,
.form-select {
    border-radius: 8px;
    padding: 10px 15px;
    border: 1px solid #ddd;
}

/* Warna background */
.gradBlueGreen {
    background: linear-gradient(90deg, #28a745, #1fa2ff);
}

/* StickyMenu */
@media only screen and (min-width: 992px) {
    .posisi-menu {
        top: 6rem;
        z-index: 2;
    }
}

@media only screen and (max-width: 600px) {
    .posisi-menu {
        top: 6rem;
        z-index: 2;
    }
}

/* Dropzone custom */
#subphoto-dropzone {
    border: 2px dashed #0d6efd;
    border-radius: 0.75rem;
    background: #f8f9fa;
    transition: all 0.3s ease;
    padding: 30px;
}

#subphoto-dropzone:hover {
    background: #eef5ff;
    border-color: #0a58ca;
}

.dz-message {
    margin: 2em 0;
    font-size: 16px;
    color: #6c757d;
}

/* Scanner */
.scanner-card {
    transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.scanner-card:hover {
    transform: translateY(-4px);
    box-shadow: 0 10px 25px rgba(0, 0, 0, 0.1);
}

.scanner-box {
    width: 100%;
    max-width: 360px;
    aspect-ratio: 1 / 1;
    border: 3px dashed #0d6efd;
    border-radius: 16px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: #f8f9fa;
    position: relative;
}

/* Animasi garis scanner */
.scanner-box::after {
    content: "";
    position: absolute;
    top: 0;
    left: 0;
    height: 3px;
    width: 100%;
    background: linear-gradient(90deg, transparent, #0d6efd, transparent);
    animation: scanline 2s linear infinite;
}

@keyframes scanline {
    0% {
        top: 0;
    }

    100% {
        top: 100%;
    }
}

/* Responsif untuk HP kecil */
@media (max-width: 576px) {
    .scanner-card h3 {
        font-size: 1.25rem;
        /* perkecil judul */
    }

    .scanner-box {
        max-width: 260px;
        /* lebih kecil di layar HP */
        border-width: 2px;
        border-radius: 12px;
    }
}

/* Dashboard */
.dashboard-card {
    transition: all 0.3s ease-in-out;
}

.dashboard-card:hover {
    transform: translateY(-5px);
    box-shadow: 0px 8px 20px rgba(0, 0, 0, 0.1);
}

.icon-box {
    width: 50px;
    height: 50px;
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 22px;
}

/* End Dashboard */


/* Navtab */


.card-modern {
    border: 0;
    border-radius: calc(var(--radius) + 4px);
    box-shadow: 0 8px 30px rgba(24, 39, 75, 0.06);
    background: var(--bg-card);
    overflow: hidden;
}

/* Wrapper for nav to center and add padding */
.nav-modern {
    display: flex;
    gap: 8px;
    padding: 12px;
    background: linear-gradient(180deg, rgba(79, 70, 229, 0.03), rgba(6, 182, 212, 0.01));
    border-bottom: 1px solid rgba(15, 23, 42, 0.04);
}

/* Tab buttons look like pills */
.nav-modern .nav-link {
    position: relative;
    border-radius: 999px;
    padding: 8px 16px;
    color: var(--muted);
    font-weight: 600;
    transition: color .18s ease, transform .12s ease;
    background: transparent;
    border: none;
    display: inline-flex;
    align-items: center;
    gap: .5rem;
}

.nav-modern .nav-link:hover {
    color: var(--accent-1);
    transform: translateY(-2px);
    text-decoration: none;
}

/* active style */
.nav-modern .nav-link.active {
    color: white;
    background: linear-gradient(90deg, var(--accent-1), var(--accent-2));
    box-shadow: 0 6px 18px rgba(79, 70, 229, 0.18);
    transform: none;
}

/* subtle indicator under the active group (for non-pill look) */
.nav-modern.indicator-under {
    position: relative;
    padding-bottom: 18px;
}

.nav-modern.indicator-under::after {
    content: "";
    position: absolute;
    left: 12px;
    right: 12px;
    bottom: 8px;
    height: 4px;
    background: linear-gradient(90deg, rgba(79, 70, 229, 0.12), rgba(6, 182, 212, 0.12));
    border-radius: 999px;
    pointer-events: none;
}

/* responsive: stack on small screens */
@media (max-width: 575.98px) {
    .nav-modern {
        flex-wrap: wrap;
        gap: 6px;
    }

    .nav-modern .nav-link {
        flex: 1 1 calc(50% - 8px);
        justify-content: center;
    }
}

/* content padding */
.tab-pane {
    padding: 24px;
}

/* small helper for icons */
.nav-icon {
    width: 18px;
    height: 18px;
    display: inline-block;
    border-radius: 4px;
    background: rgba(0, 0, 0, 0.06);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: 12px;
    color: white;
}

/* Navtab */
#inactive:checked + label {
    background-color: #e92a2a; /* abu-abu */
    color: white;
    border-color: #e92a2a;
}

/* Saat tombol active dipilih */
#active:checked + label {
    background-color: #198754; /* hijau */
    color: white;
    border-color: #198754;
}

/* Modal Tambah presensi manual */
@media (max-width: 768px) {
    #classSelect {
        min-width: 100% !important;
    }

    .d-flex.align-items-end.gap-2 {
        flex-direction: column !important;
        align-items: stretch !important;
    }
}