:root {
    --bg-main: #090d16;
    --card-bg: #131927;
    --card-hover: #1c253b;
    --primary: #e11d48;
    --primary-hover: #be123c;
    --text-main: #f8fafc;
    --text-muted: #94a3b8;
    --border-color: rgba(255, 255, 255, 0.08);
    --input-bg: #0f172a;
    --shadow-sm: 0 4px 12px rgba(0, 0, 0, 0.3);
    --shadow-lg: 0 20px 30px rgba(0, 0, 0, 0.5);
    --success-color: #10b981;
    --warning-color: #f59e0b;
    --danger-color: #ef4444;
    --info-color: #3b82f6;
}

* { 
    box-sizing: border-box; 
    margin: 0; 
    padding: 0; 
    font-family: 'Plus Jakarta Sans', -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif; 
    -webkit-tap-highlight-color: transparent; 
}

body {
    background-color: var(--bg-main);
    color: var(--text-main);
    min-height: 100vh;
    display: flex;
    justify-content: center;
    align-items: center;
    padding: 0;
}

/* --- SPLASH SCREEN --- */
#splashScreen {
    position: fixed; top: 0; left: 0; width: 100%; height: 100%;
    background: linear-gradient(135deg, #090d16 0%, #030712 100%);
    display: flex; flex-direction: column; justify-content: center; align-items: center;
    z-index: 99999; transition: opacity 0.4s ease, visibility 0.4s ease;
}
.splash-logo-circle {
    width: 84px; height: 84px; background: rgba(225, 29, 72, 0.15);
    border: 2px solid var(--primary); border-radius: 28px;
    display: flex; justify-content: center; align-items: center;
    font-size: 2.2rem; color: var(--primary); font-weight: bold; margin-bottom: 20px;
    box-shadow: 0 0 35px rgba(225, 29, 72, 0.4); animation: pulseLogo 1.5s infinite alternate;
}
@keyframes pulseLogo {
    0% { transform: scale(1); box-shadow: 0 0 20px rgba(225, 29, 72, 0.2); }
    100% { transform: scale(1.05); box-shadow: 0 0 40px rgba(225, 29, 72, 0.5); }
}
.splash-title { color: #ffffff; font-size: 1.25rem; font-weight: bold; margin-bottom: 6px; }
.splash-subtitle { color: var(--text-muted); font-size: 0.8rem; text-transform: uppercase; letter-spacing: 2px; }

.container { width: 100%; max-width: 480px; margin: 0 auto; }

@media (min-width: 768px) {
    body { padding: 24px 0; }
    .container { max-width: 1000px; }
}

/* --- LOGIN CARD --- */
.login-card { 
    background: var(--card-bg); border: 1px solid var(--border-color); border-radius: 28px; 
    padding: 36px 28px; box-shadow: var(--shadow-lg); width: 90%; max-width: 440px; margin: 50px auto; 
}
.login-header { text-align: center; margin-bottom: 28px; }
.logo-badge { 
    display: inline-block; background: rgba(225, 29, 72, 0.15); color: #fda4af; padding: 6px 16px; 
    border-radius: 50px; font-size: 0.7rem; font-weight: 800; text-transform: uppercase; 
    letter-spacing: 1.5px; margin-bottom: 12px; border: 1px solid rgba(225, 29, 72, 0.3);
}
.login-header h2 { font-size: 1.4rem; font-weight: 800; color: var(--text-main); }

.form-group { margin-bottom: 18px; }
.form-group label { display: block; font-size: 0.75rem; font-weight: 700; color: var(--text-muted); margin-bottom: 8px; text-transform: uppercase; letter-spacing: 0.5px;}
.form-group input { width: 100%; padding: 14px 16px; background: var(--input-bg); border: 1.5px solid var(--border-color); border-radius: 14px; color: var(--text-main); font-size: 0.95rem; transition: all 0.2s; }
.form-group input:focus { outline: none; border-color: var(--primary); box-shadow: 0 0 0 4px rgba(225, 29, 72, 0.15); }

.password-wrapper { position: relative; display: flex; align-items: center; }
.password-wrapper input { padding-right: 48px; }
.toggle-password { position: absolute; right: 12px; background: none; border: none; cursor: pointer; font-size: 1.1rem; color: var(--text-muted); padding: 8px; }

.btn { width: 100%; padding: 14px; background: var(--primary); color: #ffffff; border: none; border-radius: 14px; font-weight: 700; font-size: 0.95rem; cursor: pointer; transition: all 0.2s; margin-top: 10px; box-shadow: 0 6px 20px rgba(225, 29, 72, 0.3); }
.btn:active { transform: scale(0.98); }
.btn:hover { background: var(--primary-hover); }
.error-msg { color: #f87171; font-size: 0.85rem; text-align: center; margin-top: 14px; font-weight: bold; }

/* --- LOADING OVERLAY --- */
.loading-overlay { display: none; position: fixed; top: 0; left: 0; width: 100%; height: 100%; background: rgba(9, 13, 22, 0.85); backdrop-filter: blur(8px); z-index: 9999; justify-content: center; align-items: center; flex-direction: column; gap: 14px; }
.spinner { width: 44px; height: 44px; border: 3.5px solid rgba(255, 255, 255, 0.1); border-top: 3.5px solid var(--primary); border-radius: 50%; animation: spin 0.8s linear infinite; }
.loading-text { font-size: 0.9rem; font-weight: 700; color: #ffffff; }
@keyframes spin { 0% { transform: rotate(0deg); } 100% { transform: rotate(360deg); } }

/* --- TAB CONTENT & VIEW ROUTING --- */
.tab-content { display: none; animation: fadeIn 0.3s ease-in-out; padding-bottom: 90px; }
.tab-content.active { display: block; }
@keyframes fadeIn { from { opacity: 0; transform: translateY(5px); } to { opacity: 1; transform: translateY(0); } }

/* CONTENT PAGE HEADER BAR */
.content-header { display: flex; align-items: center; justify-content: space-between; padding: 16px 20px; background: var(--card-bg); border-bottom: 1px solid var(--border-color); margin-bottom: 20px; }
.back-btn { background: var(--input-bg); border: 1px solid var(--border-color); color: var(--text-main); padding: 8px 16px; border-radius: 10px; font-size: 0.8rem; font-weight: 700; cursor: pointer; }
.content-header h3 { font-size: 1.05rem; font-weight: 800; color: var(--text-main); }

/* --- TAB 1: RUANG BELAJAR --- */
.main-content-grid { display: flex; flex-direction: column; gap: 16px; padding: 0 16px; }
@media (min-width: 900px) { .main-content-grid { display: grid; grid-template-columns: 320px 1fr; align-items: start; } }

.playlist-card { background: var(--card-bg); border: 1px solid var(--border-color); border-radius: 22px; padding: 20px; box-shadow: var(--shadow-sm); }
.playlist-header { display: flex; justify-content: space-between; align-items: center; margin-bottom: 14px; }
.playlist-header label { font-size: 0.75rem; font-weight: 800; color: var(--text-muted); text-transform: uppercase; letter-spacing: 0.5px; }
.playlist-counter { font-size: 0.72rem; font-weight: 700; color: var(--text-muted); background: var(--input-bg); padding: 3px 10px; border-radius: 6px; border: 1px solid var(--border-color); }
.playlist-container { display: flex; flex-direction: column; gap: 10px; max-height: 550px; overflow-y: auto; padding-right: 4px; }
.folder-root { border: 1px solid var(--border-color); border-radius: 14px; overflow: hidden; background: var(--input-bg); margin-bottom: 8px; }
.folder-header { display: flex; justify-content: space-between; align-items: center; padding: 12px 14px; cursor: pointer; background: rgba(255, 255, 255, 0.03); transition: background 0.2s; user-select: none; }
.folder-header:hover { background: var(--card-hover); }
.folder-title { display: flex; align-items: center; gap: 8px; font-weight: 800; font-size: 0.85rem; color: var(--text-main); }
.folder-icon { font-size: 1rem; transition: transform 0.2s; }
.folder-header.open .folder-icon { transform: rotate(90deg); }
.folder-count { font-size: 0.68rem; font-weight: 700; color: var(--text-muted); background: rgba(255,255,255,0.06); padding: 2px 8px; border-radius: 12px; }
.folder-items { display: flex; flex-direction: column; gap: 6px; padding: 8px 10px; border-top: 1px solid var(--border-color); background: var(--card-bg); }
.playlist-item { display: flex; align-items: center; gap: 10px; background: rgba(255, 255, 255, 0.02); border: 1px solid var(--border-color); border-radius: 10px; padding: 10px; cursor: pointer; transition: all 0.2s; }
.playlist-item:hover { background: var(--card-hover); border-color: rgba(255,255,255,0.15); }
.playlist-item.active { background: rgba(225, 29, 72, 0.15); border-color: var(--primary); }
.playlist-thumb { width: 30px; height: 30px; border-radius: 8px; background: var(--input-bg); display: flex; justify-content: center; align-items: center; font-size: 0.8rem; flex-shrink: 0; color: var(--text-muted); font-weight: 700; }
.playlist-item.active .playlist-thumb { background: var(--primary); color: #ffffff; box-shadow: 0 2px 8px rgba(225, 29, 72, 0.4); }
.playlist-info { flex: 1; overflow: hidden; }
.playlist-title { font-size: 0.8rem; font-weight: 700; color: var(--text-main); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; margin-bottom: 2px; }
.playlist-item.active .playlist-title { color: #ffffff; }
.playlist-status { font-size: 0.65rem; font-weight: 600; color: var(--text-muted); }
.playlist-status.watched { color: var(--success-color); }

.right-content-area { display: flex; flex-direction: column; gap: 16px; }
.video-container-box { background: var(--card-bg); border: 1px solid var(--border-color); border-radius: 22px; padding: 20px; box-shadow: var(--shadow-lg); }
.section-title-small { font-size: 0.75rem; font-weight: 800; color: var(--text-muted); text-transform: uppercase; letter-spacing: 0.5px; margin-bottom: 12px; }

/* MEDIA WRAPPER & PROTEKSI OVERLAY DRIVES */
.media-wrapper, .pdf-wrapper { 
    position: relative; 
    width: 100%; 
    background: #000000; 
    border-radius: 16px; 
    overflow: hidden; 
    box-shadow: 0 8px 24px rgba(0,0,0,0.5); 
    border: 1px solid var(--border-color); 
}
.media-wrapper { aspect-ratio: 16/9; }
.pdf-wrapper { height: 480px; background: #0f172a; }

.media-wrapper iframe, .pdf-wrapper iframe { width: 100%; height: 100%; border: none; }

/* OVERLAY UNTUK MEMBLOKIR KLIK TAMPILAN POP-OUT DRIVES */
.drive-header-blocker {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 56px; 
    z-index: 20;
    background: rgba(0,0,0,0.001); 
    cursor: default;
}

.fullscreen-bar { margin-top: 12px; display: flex; justify-content: flex-end; }
.fs-btn { background: var(--input-bg); color: var(--text-main); border: 1px solid var(--border-color); padding: 8px 16px; border-radius: 10px; font-size: 0.78rem; font-weight: 700; cursor: pointer; transition: all 0.2s; }
.fs-btn:hover { background: var(--card-hover); border-color: rgba(255,255,255,0.2); }
.pdf-section-wrapper { margin-top: 20px; display: none; border-top: 1px solid var(--border-color); padding-top: 20px; }
.pdf-empty-notice { text-align: center; color: var(--text-muted); font-size: 0.82rem; padding: 20px; background: rgba(255,255,255,0.02); border-radius: 14px; border: 2px dashed var(--border-color); font-weight: 700; margin-top: 12px; }
.video-meta-bar { display: flex; justify-content: space-between; align-items: center; margin-top: 16px; padding-bottom: 16px; border-bottom: 1px solid var(--border-color); flex-wrap: wrap; gap: 10px; }
.status-badge { font-size: 0.75rem; font-weight: 700; padding: 6px 14px; border-radius: 50px; background: var(--input-bg); color: var(--text-muted); border: 1px solid var(--border-color); display: inline-flex; align-items: center; gap: 6px; }
.status-badge.watched { background: rgba(16, 185, 129, 0.12); color: var(--success-color); border-color: rgba(16, 185, 129, 0.25); }
.action-buttons { display: flex; gap: 8px; }
.action-btn { background: var(--input-bg); border: 1px solid var(--border-color); padding: 8px 16px; border-radius: 50px; font-size: 0.8rem; font-weight: 700; color: var(--text-main); cursor: pointer; display: flex; align-items: center; gap: 6px; transition: all 0.2s; }
.action-btn:hover { background: var(--card-hover); }
.action-btn.liked { background: rgba(225, 29, 72, 0.15); color: #fda4af; border-color: rgba(225, 29, 72, 0.3); }

/* FORUM STYLES */
.comment-section { margin-top: 20px; }
.comment-section h4 { font-size: 0.88rem; font-weight: 800; margin-bottom: 10px; color: var(--text-main); }
.comment-box { display: flex; gap: 10px; margin-bottom: 20px; align-items: center; }
.comment-box input { flex: 1; padding: 12px 16px; background: var(--input-bg); border: 1.5px solid var(--border-color); border-radius: 12px; font-size: 0.85rem; color: var(--text-main); outline: none; }
.comment-box input:focus { border-color: var(--primary); }
.comment-btn-wrapper { display: flex; align-items: center; gap: 8px; }
.comment-btn { background: var(--primary); color: #fff; border: none; padding: 12px 20px; border-radius: 12px; font-weight: 700; cursor: pointer; white-space: nowrap; transition: 0.2s; }
.comment-btn:hover { background: var(--primary-hover); }
.comment-loading { display: none; align-items: center; gap: 6px; font-size: 0.75rem; font-weight: 700; color: var(--text-muted); }
.history-list { display: flex; flex-direction: column; gap: 10px; max-height: 260px; overflow-y: auto; padding-right: 2px; }
.history-card { background: rgba(255, 255, 255, 0.02); border: 1px solid var(--border-color); border-radius: 14px; padding: 14px; font-size: 0.8rem; }
.history-card .time { font-size: 0.65rem; font-weight: 700; color: var(--text-muted); margin-bottom: 4px; }
.history-card .question { font-weight: 700; margin-bottom: 8px; line-height: 1.4; color: var(--text-main); }
.history-card .reply { background: rgba(16, 185, 129, 0.1); border-left: 3px solid var(--success-color); padding: 10px 12px; border-radius: 0 10px 10px 0; color: #a7f3d0; font-size: 0.78rem; }
.history-card .reply strong { display: block; font-weight: 700; margin-bottom: 2px; color: var(--success-color); }
.history-card .pending-reply { background: rgba(245, 158, 11, 0.1); border-left: 3px solid var(--warning-color); padding: 10px 12px; border-radius: 0 10px 10px 0; color: #fde68a; font-size: 0.78rem; font-weight: 700; }
.no-history { text-align: center; color: var(--text-muted); font-size: 0.8rem; padding: 16px; background: rgba(255, 255, 255, 0.02); border-radius: 14px; border: 2px dashed var(--border-color); font-weight: 700; }

/* --- TAB 2 & 3: AKADEMIK & INFORMASI --- */
.akademik-grid { display: flex; flex-direction: column; gap: 20px; padding: 0 16px; }
.akademik-card { background: var(--card-bg); border: 1px solid var(--border-color); border-radius: 22px; padding: 24px; box-shadow: var(--shadow-sm); }
.akademik-title { font-size: 1.1rem; font-weight: 800; margin-bottom: 16px; color: var(--text-main); display: flex; align-items: center; gap: 8px; }

.stat-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(130px, 1fr)); gap: 12px; margin-bottom: 20px; }
.stat-card { background: var(--input-bg); border: 1px solid var(--border-color); padding: 16px; border-radius: 16px; text-align: center; }
.stat-val { font-size: 1.8rem; font-weight: 800; margin-bottom: 4px; }
.stat-label { font-size: 0.75rem; font-weight: 700; color: var(--text-muted); text-transform: uppercase; letter-spacing: 0.5px; }
.val-hadir { color: var(--success-color); }
.val-izin { color: var(--info-color); }
.val-sakit { color: var(--warning-color); }
.val-alpa { color: var(--danger-color); }

.table-responsive { overflow-x: auto; }
.grades-table { width: 100%; border-collapse: collapse; min-width: 500px; }
.grades-table th, .grades-table td { padding: 14px 16px; text-align: left; border-bottom: 1px solid var(--border-color); font-size: 0.85rem; }
.grades-table th { background: rgba(255,255,255,0.03); color: var(--text-muted); font-weight: 800; text-transform: uppercase; letter-spacing: 0.5px; font-size: 0.75rem; border-top: 1px solid var(--border-color); }
.grades-table tr:hover td { background: rgba(255,255,255,0.02); }
.grades-table .subject { font-weight: 700; color: var(--text-main); }
.grade-badge { padding: 4px 10px; border-radius: 8px; font-weight: 800; font-size: 0.8rem; }
.grade-a { background: rgba(16, 185, 129, 0.15); color: #34d399; }
.grade-b { background: rgba(59, 130, 246, 0.15); color: #60a5fa; }
.grade-c { background: rgba(245, 158, 11, 0.15); color: #fbbf24; }
.grade-d { background: rgba(239, 68, 68, 0.15); color: #f87171; }

.info-grid { display: flex; flex-direction: column; gap: 16px; padding: 0 16px; }
.info-card { background: var(--card-bg); border: 1px solid var(--border-color); border-radius: 18px; padding: 20px; position: relative; overflow: hidden; }
.info-card::before { content: ''; position: absolute; left: 0; top: 0; width: 4px; height: 100%; background: var(--primary); }
.info-card.urgent::before { background: var(--warning-color); }
.info-header { display: flex; justify-content: space-between; margin-bottom: 10px; align-items: center; }
.info-date { font-size: 0.7rem; font-weight: 800; color: var(--primary); background: rgba(225, 29, 72, 0.1); padding: 4px 10px; border-radius: 50px; }
.info-title { font-size: 1rem; font-weight: 800; color: var(--text-main); margin-bottom: 8px; line-height: 1.4; }
.info-body { font-size: 0.85rem; color: var(--text-muted); line-height: 1.6; }

.footer-note { text-align: center; font-size: 0.72rem; color: var(--text-muted); margin-top: 30px; font-weight: 700; padding-bottom: 20px;}

/* --- DASHBOARD MENU UTAMA HOME --- */
#dashboardSection { background: #090d16; padding: 0; min-height: 100vh; position: relative; }
.mobile-header { background: #2E75B6; padding: 40px 20px 30px; border-radius: 0 0 35px 35px; text-align: center; color: #fff; box-shadow: 0 4px 15px rgba(0,0,0,0.3); position: relative; }
.mobile-header h2 { font-size: 1.1rem; font-weight: 500; margin-bottom: 15px; }
.profile-img { width: 90px; height: 90px; border-radius: 50%; border: 4px solid #fff; margin-bottom: 10px; background: #eee; }
.mobile-header h3 { font-size: 1.3rem; font-weight: 700; margin-bottom: 5px; }
.mobile-header p { font-size: 0.8rem; text-transform: uppercase; color: rgba(255,255,255,0.8); letter-spacing: 1px; }

.time-section { text-align: center; margin: 25px 0 15px; }
.time-section h4 { font-size: 1.1rem; color: var(--text-main); margin-bottom: 5px; font-weight: 600; }
.time-section p { font-size: 0.9rem; color: var(--text-muted); }

.rekap-absen { display: flex; justify-content: space-between; padding: 15px 40px; background: var(--card-bg); border-top: 1px solid var(--border-color); border-bottom: 1px solid var(--border-color); margin-bottom: 25px; }
.rekap-item { display: flex; flex-direction: column; align-items: center; }
.rekap-item span { font-size: 0.7rem; color: var(--text-muted); font-weight: 700; letter-spacing: 1px; margin-bottom: 5px; }
.rekap-item strong { font-size: 1.1rem; color: var(--text-main); font-weight: 800; }

.menu-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 20px 10px; padding: 0 20px; }
.menu-btn { display: flex; flex-direction: column; align-items: center; background: none; border: none; cursor: pointer; transition: transform 0.2s; }
.menu-btn:active { transform: scale(0.95); }
.icon-circle { width: 60px; height: 60px; border-radius: 20px; display: flex; justify-content: center; align-items: center; font-size: 1.6rem; color: #fff; margin-bottom: 8px; box-shadow: 0 4px 15px rgba(0,0,0,0.4); border: 1px solid rgba(255,255,255,0.1); }
.bg-green { background: #10b981; } .bg-blue { background: #3b82f6; } .bg-red { background: #ef4444; }
.menu-btn span { font-size: 0.78rem; color: var(--text-main); font-weight: 700; text-align: center; }

.bottom-nav-mobile { position: fixed; bottom: 0; left: 0; width: 100%; background: var(--card-bg); display: flex; justify-content: space-around; padding: 10px 0; border-top: 1px solid var(--border-color); z-index: 1000; box-shadow: 0 -4px 15px rgba(0,0,0,0.5); }
.nav-item { display: flex; flex-direction: column; align-items: center; font-size: 0.68rem; color: var(--text-muted); cursor: pointer; gap: 3px; border: none; background: none; font-weight: 600; }
.nav-item.active { color: var(--primary); font-weight: 800; }

/* --- STYLING TAMBAHAN NOTIFIKASI --- */
.notif-container {
    position: absolute;
    top: 15px;
    right: 20px;
    display: inline-block;
    cursor: pointer;
    z-index: 100;
}

#notifBadge {
    position: absolute;
    top: -5px;
    right: -8px;
    background-color: #ff4757;
    color: white;
    border-radius: 50%;
    padding: 2px 6px;
    font-size: 10px;
    font-weight: bold;
    box-shadow: 0 2px 4px rgba(0,0,0,0.2);
}

#notifList {
    display: none;
    position: absolute;
    right: 0;
    top: 40px;
    width: 280px;
    background: #ffffff;
    border: 1px solid #e0e0e0;
    box-shadow: 0 8px 16px rgba(0, 0, 0, 0.15);
    border-radius: 10px;
    z-index: 1000;
    max-height: 320px;
    overflow-y: auto;
    text-align: left;
}

.notif-item {
    padding: 12px 15px;
    border-bottom: 1px solid #f1f1f1;
    font-size: 13px;
    color: #333333;
}

.notif-item:last-child {
    border-bottom: none;
}

.notif-item:hover {
    background-color: #f8f9fa;
}
