:root {
    --primary: #1e3a8a;
    /* Biru Tua */
    --secondary: #3b82f6;
    /* Biru Muda */
    --bg: #f3f4f6;
    --text: #1f2937;
}

body {
    background-color: var(--bg);
    color: var(--text);
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    overflow-x: hidden;
}

/* Layout */
.sidebar {
    position: fixed;
    top: 0;
    left: 0;
    width: 260px;
    height: 100vh;
    background: white;
    box-shadow: 2px 0 10px rgba(0, 0, 0, 0.05);
    z-index: 1000;
    display: flex;
    flex-direction: column;
    overflow-y: auto;
}

.sidebar-header {
    padding: 20px;
    background: var(--primary);
    color: white;
    text-align: center;
}

.nav-item {
    padding: 15px 25px;
    color: #6b7280;
    text-decoration: none;
    font-weight: 500;
    border-left: 4px solid transparent;
    transition: 0.3s;
    display: flex;
    align-items: center;
    gap: 15px;
}

.nav-item:hover,
.nav-item.active {
    background: #eff6ff;
    color: var(--primary);
    border-left-color: var(--primary);
}

.main-content {
    margin-left: 260px;
    padding: 30px;
    min-height: 100vh;
}

/* Pages & Tabs */
.page {
    display: none;
    animation: fadeIn 0.3s;
}

.page.active {
    display: block;
}

@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(5px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.nav-tabs .nav-link {
    color: #6b7280;
    font-weight: 600;
    border: none;
    padding: 12px 20px;
}

.nav-tabs .nav-link.active {
    color: var(--primary);
    border-bottom: 3px solid var(--primary);
    background: transparent;
}

.tab-content {
    padding: 20px;
    background: white;
    border-radius: 0 0 10px 10px;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.05);
}

/* Custom Radio untuk Absensi */
.abs-radio {
    display: none;
}

.abs-label {
    display: inline-block;
    width: 35px;
    height: 35px;
    line-height: 35px;
    text-align: center;
    border-radius: 50%;
    border: 2px solid #ddd;
    cursor: pointer;
    font-weight: bold;
    margin: 0 5px;
    transition: 0.2s;
}

.abs-radio[value="H"]:checked+.abs-label {
    background: #22c55e;
    color: white;
    border-color: #22c55e;
}

.abs-radio[value="I"]:checked+.abs-label {
    background: #eab308;
    color: white;
    border-color: #eab308;
}

.abs-radio[value="S"]:checked+.abs-label {
    background: #3b82f6;
    color: white;
    border-color: #3b82f6;
}

.abs-radio[value="A"]:checked+.abs-label {
    background: #ef4444;
    color: white;
    border-color: #ef4444;
}

/* Input Nilai */
.input-nilai {
    width: 70px;
    text-align: center;
    font-weight: bold;
    border: 1px solid #ddd;
    border-radius: 5px;
    padding: 5px;
}

.input-nilai:focus {
    outline: none;
    border-color: var(--primary);
    box-shadow: 0 0 0 2px rgba(59, 130, 246, 0.2);
}

/* Toast Notifikasi */
#toast-container {
    position: fixed;
    bottom: 20px;
    right: 20px;
    z-index: 9999;
}

.save-toast {
    background: #1f2937;
    color: white;
    padding: 10px 20px;
    border-radius: 8px;
    margin-top: 10px;
    display: flex;
    align-items: center;
    gap: 10px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
    animation: slideIn 0.3s forwards, slideOut 0.3s 2s forwards;
}

@keyframes slideIn {
    from {
        transform: translateX(100%);
    }

    to {
        transform: translateX(0);
    }
}

@keyframes slideOut {
    from {
        transform: translateX(0);
        opacity: 1;
    }

    to {
        transform: translateX(100%);
        opacity: 0;
    }
}

/* Loader */
#loader {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(255, 255, 255, 0.9);
    z-index: 99999;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
}

.spinner-border {
    width: 3rem;
    height: 3rem;
    color: var(--primary);
}

/* Landing Page & Login */
.full-screen-center {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100vh;
    background: linear-gradient(135deg, #1e3a8a 0%, #3b82f6 100%);
    background-size: cover;
    background-position: center;
    background-repeat: no-repeat;
    z-index: 1040;
    display: flex;
    align-items: center;
    justify-content: center;
    overflow-y: auto;
}

.glass-card {
    background: rgba(255, 255, 255, 0.2);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border: 1px solid rgba(255, 255, 255, 0.4);
    border-radius: 20px;
    box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.3);
    padding: 40px;
    width: 100%;
    max-width: 450px;
    text-align: center;
    animation: popIn 0.5s ease-out;
    position: relative;
    z-index: 1;
}

.glass-card h2,
.glass-card h4,
.glass-card p,
.glass-card label {
    color: #fff !important;
    text-shadow: 0 2px 4px rgba(0, 0, 0, 0.3);
}

.login-card {
    max-width: 450px;
}

@keyframes popIn {
    0% {
        opacity: 0;
        transform: scale(0.9) translateY(20px);
    }

    100% {
        opacity: 1;
        transform: scale(1) translateY(0);
    }
}

.logo-row img {
    height: 90px;
    object-fit: contain;
    background: transparent;
    margin: 0 10px;
    border-radius: 10px;
    filter: drop-shadow(0 4px 6px rgba(0, 0, 0, 0.3));
}

.hero-title {
    font-size: 2rem;
    font-weight: 800;
    color: var(--primary);
    margin-top: 20px;
    margin-bottom: 5px;
}

.hero-subtitle {
    font-size: 1.2rem;
    color: #4b5563;
    margin-bottom: 30px;
    font-weight: 500;
}

.btn-modern {
    background: linear-gradient(to right, #2563eb, #3b82f6);
    color: white;
    border: none;
    padding: 12px 30px;
    border-radius: 50px;
    font-weight: 600;
    font-size: 1.1rem;
    transition: all 0.3s;
    box-shadow: 0 4px 15px rgba(59, 130, 246, 0.4);
}

.btn-modern:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 25px rgba(59, 130, 246, 0.5);
    color: white;
}

.teacher-avatar {
    width: 140px;
    height: 140px;
    border-radius: 50%;
    object-fit: cover;
    border: 4px solid rgba(255, 255, 255, 0.7);
    box-shadow: 0 10px 20px rgba(0, 0, 0, 0.2);
    margin: -70px auto 15px auto;
    display: block;
    background: transparent;
}

@keyframes float {
    0% {
        transform: translateY(0px);
    }

    50% {
        transform: translateY(-15px);
    }

    100% {
        transform: translateY(0px);
    }
}

@keyframes pulse-avatar {
    0% {
        transform: scale(1);
    }

    50% {
        transform: scale(1.08);
    }

    100% {
        transform: scale(1);
    }
}

.animate-float {
    animation: float 4s ease-in-out infinite;
}

.animate-pulse {
    animation: pulse-avatar 3s ease-in-out infinite;
}

/* Kartu Gradien & Efek Float */
.bg-gradient-primary {
    background: linear-gradient(135deg, #1e3a8a 0%, #3b82f6 100%);
}

.bg-gradient-success {
    background: linear-gradient(135deg, #166534 0%, #22c55e 100%);
}

.bg-gradient-warning {
    background: linear-gradient(135deg, #9a3412 0%, #f97316 100%);
}

.bg-gradient-danger {
    background: linear-gradient(135deg, #991b1b 0%, #ef4444 100%);
}

.bg-gradient-info {
    background: linear-gradient(135deg, #075985 0%, #0ea5e9 100%);
}

.hover-float {
    transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.hover-float:hover {
    transform: translateY(-5px);
    box-shadow: 0 10px 25px rgba(0, 0, 0, 0.15) !important;
}

/* Mobile Header & Bottom Navigation */
.mobile-header {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 60px;
    background: white;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.05);
    z-index: 1000;
    align-items: center;
    justify-content: space-between;
    padding: 0 15px;
}

.bottom-nav {
    display: none;
    position: fixed;
    bottom: 0;
    left: 0;
    width: 100%;
    height: 65px;
    background: white;
    box-shadow: 0 -2px 10px rgba(0, 0, 0, 0.05);
    z-index: 1000;
    justify-content: space-around;
    align-items: center;
    padding-bottom: env(safe-area-inset-bottom, 0);
    margin: 0;
    box-sizing: content-box;
}

.bottom-nav-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    text-decoration: none;
    color: #6b7280;
    font-size: 0.75rem;
    font-weight: 600;
    flex: 1;
    height: 100%;
    transition: color 0.3s;
}

.bottom-nav-item i {
    font-size: 1.25rem;
    margin-bottom: 4px;
}

.bottom-nav-item:hover,
.bottom-nav-item.active {
    color: var(--primary);
}

/* Khusus item tengah (Home/Dashboard) dibuat sedikit lebih besar/menonjol */
.bottom-nav-item.center-btn i {
    font-size: 1.5rem;
    background: var(--primary);
    color: white;
    width: 40px;
    height: 40px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    margin-top: -15px;
    box-shadow: 0 4px 10px rgba(30, 58, 138, 0.3);
}

.bottom-nav-item.center-btn.active i {
    background: var(--secondary);
}

@media (max-width: 768px) {
    .sidebar {
        display: none;
    }

    .main-content {
        margin-left: 0;
        padding: 75px 15px 80px 15px;
        /* Spasi untuk Header dan Bottom Nav */
    }

    .mobile-header {
        display: flex;
    }

    .bottom-nav {
        display: flex;
    }

    .page-title-responsive {
        display: none;
        /* Sembunyikan judul halaman di mobile agar tidak dobel dengan header */
    }
}
