/* ==========================================================================
   MATCHA EDU - STYLESHEET
   Tema: Liquid Glass (iOS Style) & Hijau Matcha
   Font: Poppins
   ========================================================================== */

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

/* --- 1. CSS VARIABLES --- */
:root {
    --matcha-primary: #81C784;
    --matcha-light: #B8E0D2;
    --matcha-dark: #509556;
    --bg-color: #F4F9F6; /* Putih keabu-abuan dengan hint hijau */
    --text-dark: #2D3748;
    --text-muted: #718096;
    --white: #FFFFFF;
    
    /* Efek Glassmorphism */
    --glass-bg: rgba(255, 255, 255, 0.7);
    --glass-border: rgba(255, 255, 255, 0.5);
    --shadow-soft: 0 8px 32px 0 rgba(129, 199, 132, 0.15);
    
    /* Radius ala iOS */
    --radius-sm: 12px;
    --radius-md: 20px;
    --radius-lg: 32px;
    --radius-pill: 50px;
}

/* --- 2. RESET & BASE --- */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    font-family: 'Poppins', sans-serif;
    -webkit-tap-highlight-color: transparent;
}

body {
    background-color: var(--bg-color);
    color: var(--text-dark);
    line-height: 1.6;
    overflow-x: hidden;
    /* Soft gradient background ala iOS */
    background-image: radial-gradient(circle at top left, var(--matcha-light) 0%, transparent 40%),
                      radial-gradient(circle at bottom right, rgba(129, 199, 132, 0.2) 0%, transparent 40%);
    background-attachment: fixed;
}

a {
    text-decoration: none;
    color: var(--matcha-dark);
}

/* --- 3. GLASSMORPHISM UTILITIES --- */
.glass-card {
    background: var(--glass-bg);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border: 1px solid var(--glass-border);
    border-radius: var(--radius-md);
    box-shadow: var(--shadow-soft);
    padding: 24px;
}

/* --- 4. BUTTONS & INPUTS --- */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 12px 24px;
    border-radius: var(--radius-pill);
    border: none;
    font-weight: 600;
    font-size: 1rem;
    cursor: pointer;
    transition: all 0.3s ease;
}

.btn-primary {
    background: var(--matcha-primary);
    color: var(--white);
    box-shadow: 0 4px 15px rgba(129, 199, 132, 0.4);
}

.btn-primary:hover {
    background: var(--matcha-dark);
    transform: translateY(-2px);
}

.form-control {
    width: 100%;
    padding: 14px 20px;
    border-radius: var(--radius-sm);
    border: 1px solid rgba(129, 199, 132, 0.3);
    background: rgba(255, 255, 255, 0.8);
    font-size: 1rem;
    color: var(--text-dark);
    transition: all 0.3s ease;
}

.form-control:focus {
    outline: none;
    border-color: var(--matcha-primary);
    box-shadow: 0 0 0 4px rgba(129, 199, 132, 0.2);
    background: var(--white);
}

/* --- 5. LAYOUT & NAVIGATION (SISWA) --- */
.content-wrapper {
    padding: 90px 20px 100px 20px; /* Ruang untuk header dan bottom nav */
    max-width: 800px;
    margin: 0 auto;
}

/* Sticky Header ala iOS */
.sticky-header {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 70px;
    background: var(--glass-bg);
    backdrop-filter: blur(15px);
    -webkit-backdrop-filter: blur(15px);
    border-bottom-left-radius: var(--radius-lg);
    border-bottom-right-radius: var(--radius-lg);
    border-bottom: 1px solid var(--glass-border);
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.03);
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 24px;
    z-index: 1000;
}

.header-profile {
    display: flex;
    align-items: center;
    gap: 12px;
}

.header-profile img {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    object-fit: cover;
    border: 2px solid var(--matcha-light);
}

/* Mobile Bottom Navigation */
.bottom-nav {
    position: fixed;
    bottom: 20px;
    left: 50%;
    transform: translateX(-50%);
    width: 90%;
    max-width: 400px;
    height: 65px;
    background: var(--glass-bg);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border: 1px solid var(--glass-border);
    border-radius: var(--radius-pill);
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.1);
    display: flex;
    justify-content: space-around;
    align-items: center;
    z-index: 1000;
}

.nav-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    color: var(--text-muted);
    font-size: 0.75rem;
    gap: 4px;
    transition: color 0.3s ease;
}

.nav-item i {
    font-size: 1.5rem;
}

.nav-item.active {
    color: var(--matcha-primary);
    font-weight: 600;
}

/* --- 6. UJIAN (CBT) --- */
.timer-pulse {
    color: #E53E3E;
    font-weight: bold;
    animation: pulse 1s infinite;
}

@keyframes pulse {
    0% { transform: scale(1); }
    50% { transform: scale(1.05); }
    100% { transform: scale(1); }
}

.question-nav-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(40px, 1fr));
    gap: 8px;
    margin-top: 16px;
}

.nav-btn {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    border: 1px solid var(--glass-border);
    background: var(--white);
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 500;
    cursor: pointer;
    box-shadow: 0 2px 5px rgba(0,0,0,0.05);
}

.nav-btn.answered { background: var(--matcha-primary); color: var(--white); }
.nav-btn.active { border: 2px solid var(--matcha-dark); background: var(--matcha-light); }

/* --- 7. ADMIN LAYOUT --- */
.admin-wrapper {
    display: flex;
    min-height: 100vh;
}

.sidebar {
    width: 250px;
    background: var(--white);
    box-shadow: 4px 0 20px rgba(0,0,0,0.02);
    padding: 24px;
    display: flex;
    flex-direction: column;
}

.admin-content {
    flex: 1;
    padding: 32px;
    overflow-y: auto;
}

/* Responsive Admin Sidebar */
@media (max-width: 768px) {
    .sidebar {
        position: fixed;
        left: -100%;
        height: 100%;
        z-index: 2000;
        transition: left 0.3s ease;
    }
    .sidebar.show {
        left: 0;
    }
    .admin-content {
        padding: 20px;
    }
}

/* --- 8. PRINT CSS (EKSPOR PDF RINGAN) --- */
@media print {
    body {
        background: none !important;
        background-color: white !important;
        color: black !important;
    }
    .sticky-header, .bottom-nav, .sidebar, .btn {
        display: none !important; /* Sembunyikan elemen navigasi saat cetak */
    }
    .content-wrapper, .admin-content {
        padding: 0;
        margin: 0;
        width: 100%;
    }
    .glass-card {
        border: 1px solid #ccc !important;
        box-shadow: none !important;
        background: transparent !important;
        break-inside: avoid; /* Mencegah elemen terpotong antar halaman PDF */
    }
    /* Pastikan tabel rapih */
    table {
        width: 100%;
        border-collapse: collapse;
    }
    th, td {
        border: 1px solid #000;
        padding: 8px;
    }
}
