/* ============================================
   Sistem Informasi Kelulusan - SMP Bina Dharma
   Custom CSS
   ============================================ */

@import url('https://fonts.googleapis.com/css2?family=Plus+Jakarta+Sans:wght@300;400;500;600;700;800&display=swap');

/* ——— CSS Variables ——— */
:root {
    --primary:      #2563EB;
    --primary-dark: #1E40AF;
    --primary-light:#DBEAFE;
    --secondary:    #0EA5E9;
    --success:      #10B981;
    --danger:       #EF4444;
    --warning:      #F59E0B;
    --bg:           #F8FAFC;
    --card-bg:      #FFFFFF;
    --text:         #1E293B;
    --text-muted:   #64748B;
    --border:       #E2E8F0;
    --sidebar-w:    260px;
    --shadow-sm:    0 1px 3px rgba(0,0,0,.08), 0 1px 2px rgba(0,0,0,.06);
    --shadow-md:    0 4px 6px -1px rgba(0,0,0,.1), 0 2px 4px -1px rgba(0,0,0,.06);
    --shadow-lg:    0 10px 15px -3px rgba(0,0,0,.1), 0 4px 6px -2px rgba(0,0,0,.05);
    --radius:       .75rem;
    --radius-sm:    .5rem;
    --transition:   all .2s ease;
}

/* ——— Dark Mode ——— */
[data-theme="dark"] {
    --bg:       #0F172A;
    --card-bg:  #1E293B;
    --text:     #F1F5F9;
    --text-muted:#94A3B8;
    --border:   #334155;
    --primary-light: #1E3A8A;
}

/* ——— Base ——— */
*, *::before, *::after { box-sizing: border-box; }

body {
    font-family: 'Plus Jakarta Sans', sans-serif;
    background-color: var(--bg);
    color: var(--text);
    transition: var(--transition);
    font-size: .9375rem;
    line-height: 1.6;
}

/* ——— Sidebar ——— */
.sidebar {
    position: fixed;
    top: 0; left: 0;
    width: var(--sidebar-w);
    height: 100vh;
    background: linear-gradient(180deg, var(--primary-dark) 0%, var(--primary) 100%);
    overflow-y: auto;
    z-index: 1000;
    transition: transform .3s ease;
    scrollbar-width: thin;
    scrollbar-color: rgba(255,255,255,.2) transparent;
}
.sidebar::-webkit-scrollbar { width: 4px; }
.sidebar::-webkit-scrollbar-thumb { background: rgba(255,255,255,.2); border-radius: 2px; }

.sidebar-brand {
    padding: 1.5rem 1.25rem;
    border-bottom: 1px solid rgba(255,255,255,.12);
}
.sidebar-brand h6 { color: #fff; font-weight: 700; font-size: .8rem; text-transform: uppercase; letter-spacing: .08em; opacity: .7; margin: 0; }
.sidebar-brand h5 { color: #fff; font-weight: 800; font-size: 1rem; margin: .15rem 0 0; line-height: 1.3; }

.sidebar-menu { padding: 1rem 0; }
.sidebar-label { font-size: .7rem; text-transform: uppercase; letter-spacing: .1em; color: rgba(255,255,255,.5); padding: .75rem 1.25rem .25rem; font-weight: 600; }

.sidebar-link {
    display: flex; align-items: center; gap: .75rem;
    padding: .625rem 1.25rem;
    color: rgba(255,255,255,.75);
    text-decoration: none;
    font-size: .875rem;
    font-weight: 500;
    border-radius: 0;
    transition: var(--transition);
    position: relative;
}
.sidebar-link i { font-size: 1.1rem; width: 1.2rem; text-align: center; flex-shrink: 0; }
.sidebar-link:hover { background: rgba(255,255,255,.1); color: #fff; }
.sidebar-link.active {
    background: rgba(255,255,255,.18);
    color: #fff;
    font-weight: 600;
}
.sidebar-link.active::before {
    content: '';
    position: absolute; left: 0; top: 0; bottom: 0;
    width: 3px;
    background: #fff;
    border-radius: 0 3px 3px 0;
}

/* ——— Main Content ——— */
.main-content {
    margin-left: var(--sidebar-w);
    min-height: 100vh;
    padding: 0;
    transition: margin .3s ease;
}

/* ——— Topbar ——— */
.topbar {
    background: var(--card-bg);
    border-bottom: 1px solid var(--border);
    padding: .875rem 1.5rem;
    display: flex;
    align-items: center;
    justify-content: space-between;
    position: sticky; top: 0;
    z-index: 900;
    box-shadow: var(--shadow-sm);
}
.topbar-title { font-weight: 700; font-size: 1.1rem; color: var(--text); margin: 0; }
.topbar-right { display: flex; align-items: center; gap: .75rem; }

/* ——— Cards ——— */
.card {
    background: var(--card-bg);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    box-shadow: var(--shadow-sm);
    transition: var(--transition);
}
.card:hover { box-shadow: var(--shadow-md); }
.card-header {
    background: transparent;
    border-bottom: 1px solid var(--border);
    padding: 1rem 1.25rem;
    font-weight: 600;
    font-size: .9375rem;
}

/* ——— Stats Card ——— */
.stat-card {
    border-radius: var(--radius);
    padding: 1.25rem;
    display: flex;
    align-items: center;
    gap: 1rem;
    background: var(--card-bg);
    border: 1px solid var(--border);
    box-shadow: var(--shadow-sm);
    transition: var(--transition);
}
.stat-card:hover { transform: translateY(-2px); box-shadow: var(--shadow-md); }
.stat-icon {
    width: 3rem; height: 3rem;
    border-radius: var(--radius-sm);
    display: flex; align-items: center; justify-content: center;
    font-size: 1.4rem;
    flex-shrink: 0;
}
.stat-label { font-size: .8rem; color: var(--text-muted); font-weight: 500; margin-bottom: .15rem; }
.stat-value { font-size: 1.6rem; font-weight: 800; line-height: 1; color: var(--text); }

/* ——— Buttons ——— */
.btn { font-family: 'Plus Jakarta Sans', sans-serif; font-weight: 600; border-radius: var(--radius-sm); }
.btn-primary { background: var(--primary); border-color: var(--primary); }
.btn-primary:hover { background: var(--primary-dark); border-color: var(--primary-dark); }

/* ——— Forms ——— */
.form-control, .form-select {
    border-radius: var(--radius-sm);
    border-color: var(--border);
    background: var(--card-bg);
    color: var(--text);
    font-family: 'Plus Jakarta Sans', sans-serif;
    transition: var(--transition);
}
.form-control:focus, .form-select:focus {
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(37,99,235,.15);
    background: var(--card-bg);
    color: var(--text);
}
[data-theme="dark"] .form-control,
[data-theme="dark"] .form-select { background: #1E293B; color: #F1F5F9; border-color: #334155; }
[data-theme="dark"] .form-control::placeholder { color: #64748B; }

/* ——— Badge ——— */
.badge-lulus { background: #D1FAE5; color: #065F46; border: 1px solid #A7F3D0; font-size: .75rem; font-weight: 600; padding: .3em .65em; border-radius: 100px; }
.badge-tidak-lulus { background: #FEE2E2; color: #991B1B; border: 1px solid #FCA5A5; font-size: .75rem; font-weight: 600; padding: .3em .65em; border-radius: 100px; }

/* ——— Table ——— */
.table { color: var(--text); }
.table thead th { font-weight: 700; font-size: .8125rem; text-transform: uppercase; letter-spacing: .04em; color: var(--text-muted); background: var(--bg); border-bottom-color: var(--border); }
.table tbody td { vertical-align: middle; border-color: var(--border); font-size: .875rem; }
[data-theme="dark"] .table thead th { background: #0F172A; }

/* ——— Dark Mode Toggle ——— */
.btn-theme {
    width: 2.25rem; height: 2.25rem;
    border: 1px solid var(--border);
    border-radius: 50%;
    display: flex; align-items: center; justify-content: center;
    cursor: pointer;
    background: var(--bg);
    color: var(--text);
    font-size: 1rem;
    transition: var(--transition);
}
.btn-theme:hover { background: var(--primary-light); border-color: var(--primary); color: var(--primary); }

/* ——— Countdown ——— */
.countdown-box {
    display: flex; gap: 1rem; justify-content: center; flex-wrap: wrap;
}
.countdown-item {
    background: rgba(255,255,255,.15);
    backdrop-filter: blur(10px);
    border: 1px solid rgba(255,255,255,.25);
    border-radius: var(--radius);
    padding: 1rem 1.25rem;
    text-align: center;
    min-width: 80px;
}
.countdown-num { font-size: 2.5rem; font-weight: 800; color: #fff; line-height: 1; }
.countdown-lbl { font-size: .7rem; text-transform: uppercase; letter-spacing: .1em; color: rgba(255,255,255,.75); margin-top: .25rem; }

/* ——— Mobile Responsive ——— */
.sidebar-toggle {
    display: none;
    background: none; border: none;
    font-size: 1.4rem;
    color: var(--text);
    cursor: pointer;
    padding: .25rem;
}

@media (max-width: 992px) {
    .sidebar { transform: translateX(-100%); }
    .sidebar.open { transform: translateX(0); }
    .sidebar-overlay { display: none; position: fixed; inset: 0; background: rgba(0,0,0,.5); z-index: 999; }
    .sidebar-overlay.show { display: block; }
    .main-content { margin-left: 0; }
    .sidebar-toggle { display: block; }
}

/* ——— Glassmorphism (Landing) ——— */
.glass-card {
    background: rgba(255,255,255,.12);
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
    border: 1px solid rgba(255,255,255,.25);
    border-radius: var(--radius);
}

/* ——— Hero Landing ——— */
.hero-section {
    background: linear-gradient(135deg, #1E40AF 0%, #2563EB 50%, #0EA5E9 100%);
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    position: relative;
    overflow: hidden;
}
.hero-section::before {
    content: '';
    position: absolute; inset: 0;
    background: url("data:image/svg+xml,%3Csvg width='60' height='60' viewBox='0 0 60 60' xmlns='http://www.w3.org/2000/svg'%3E%3Cg fill='none' fill-rule='evenodd'%3E%3Cg fill='%23ffffff' fill-opacity='0.04'%3E%3Cpath d='M36 34v-4h-2v4h-4v2h4v4h2v-4h4v-2h-4zm0-30V0h-2v4h-4v2h4v4h2V6h4V4h-4zM6 34v-4H4v4H0v2h4v4h2v-4h4v-2H6zM6 4V0H4v4H0v2h4v4h2V6h4V4H6z'/%3E%3C/g%3E%3C/g%3E%3C/svg%3E");
}

/* ——— Result Card ——— */
.result-lulus {
    background: linear-gradient(135deg, #ECFDF5 0%, #D1FAE5 100%);
    border: 2px solid #10B981;
    border-radius: var(--radius);
}
.result-tidak-lulus {
    background: linear-gradient(135deg, #FFF7F7 0%, #FEE2E2 100%);
    border: 2px solid #EF4444;
    border-radius: var(--radius);
}

/* ——— Confetti ——— */
#confetti-canvas {
    position: fixed; top: 0; left: 0;
    width: 100%; height: 100%;
    pointer-events: none;
    z-index: 9999;
}

/* ——— Page Content Padding ——— */
.page-content { padding: 1.5rem; }

/* ——— Animations ——— */
@keyframes fadeInUp {
    from { opacity: 0; transform: translateY(20px); }
    to   { opacity: 1; transform: translateY(0); }
}
.animate-fade-up { animation: fadeInUp .4s ease forwards; }

@keyframes pulse-ring {
    0%   { transform: scale(1); opacity: 1; }
    100% { transform: scale(1.5); opacity: 0; }
}

/* ——— Login Page ——— */
.login-wrapper {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    background: linear-gradient(135deg, #1E40AF 0%, #2563EB 60%, #0EA5E9 100%);
    padding: 1rem;
}
.login-card {
    background: #fff;
    border-radius: calc(var(--radius) * 1.5);
    padding: 2.5rem 2rem;
    width: 100%;
    max-width: 420px;
    box-shadow: var(--shadow-lg);
}
[data-theme="dark"] .login-card { background: #1E293B; }

/* ——— Scrollbar ——— */
::-webkit-scrollbar { width: 6px; height: 6px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: var(--border); border-radius: 3px; }
::-webkit-scrollbar-thumb:hover { background: var(--text-muted); }
