:root {
    --accent: #0062ff;
    --glass-bg: rgba(255, 255, 255, 0.08);
    --glass-border: rgba(255, 255, 255, 0.15);
    --text-white: #ffffff;
    --text-dim: #cbd5e1;
    --accent-glow: rgba(59, 130, 246, 0.3);
}

* { 
    margin: 0; 
    padding: 0; 
    box-sizing: border-box; 
    font-family: 'Segoe UI', sans-serif; 
}

body {
    height: 100vh;
    width: 100vw;
    color: var(--text-white);
    overflow: hidden; 
}

/* BACKGROUND IMAGE HANDLER */
.bg-container {
    position: fixed;
    top: 0; left: 0;
    width: 100%; height: 100%;
    background: url('/images/bg.png') center/cover no-repeat;
    z-index: -1;
    filter: brightness(0.6);
}

.glass {
    background: var(--glass-bg);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border: 1px solid var(--glass-border);
    border-radius: 20px;
}

.glass-heavy {
    background: rgba(0, 0, 0, 0.8);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border: 1px solid rgba(255, 255, 255, 0.1);
}

/* --- APP LAYOUT STRUCTURE (DESKTOP DEFAULT) --- */

.app-container {
    display: flex;
    flex-direction: row;
    width: 100vw;
    height: 100vh;
    overflow: hidden;
    padding: 0; 
}

.sidebar {
    width: 260px;
    height: 100%;
    display: flex;
    flex-direction: column;
    padding: 30px 20px;
    flex-shrink: 0; 
    background: rgba(255, 255, 255, 0.02); 
    border-right: 1px solid var(--glass-border);
    z-index: 10;
}

.main-content {
    flex: 1; 
    height: 100%;
    overflow-y: auto; 
    padding: 20px 30px;
    position: relative;
    scroll-behavior: smooth;
}

/* Scrollbar Styling */
.main-content::-webkit-scrollbar {
    width: 8px;
}
.main-content::-webkit-scrollbar-track {
    background: rgba(255, 255, 255, 0.05);
}
.main-content::-webkit-scrollbar-thumb {
    background: rgba(255, 255, 255, 0.2);
    border-radius: 4px;
}
.main-content::-webkit-scrollbar-thumb:hover {
    background: rgba(255, 255, 255, 0.3);
}

/* MOBILE HEADER (Hidden on Desktop) */
.mobile-header {
    display: none; 
    position: fixed;
    top: 0; left: 0; right: 0;
    align-items: center;
    justify-content: space-between;
    padding: 15px 20px;
    background: rgba(105, 109, 117, 0.95);
    backdrop-filter: blur(10px);
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
    z-index: 1000;
}

.hamburger-btn {
    background: none;
    border: none;
    color: var(--text-white);
    font-size: 1.5rem;
    cursor: pointer;
    padding: 8px;
    border-radius: 10px;
    transition: background 0.3s;
}

.hamburger-btn:hover {
    background: rgba(255, 255, 255, 0.1);
}

.mobile-logo {
    display: flex;
    align-items: center;
    gap: 10px;
    font-size: 1.2rem;
    font-weight: 700;
    color: rgb(0, 0, 255);
}

.mobile-logout {
    background: rgba(239, 68, 68, 0.1);
    border: 1px solid rgba(239, 68, 68, 0.2);
    color: #f87171;
    padding: 8px 12px;
    border-radius: 10px;
    cursor: pointer;
    font-size: 1rem;
}

/* MOBILE SIDEBAR (Hidden on Desktop) */
.mobile-overlay {
    position: fixed;
    top: 0; left: 0; right: 0; bottom: 0;
    background: rgba(0, 0, 0, 0.5);
    backdrop-filter: blur(5px);
    z-index: 1100;
    display: none; /* KEY FIX: Must be none by default */
}

/* Add a class to show it via JS */
.mobile-overlay.active {
    display: block;
}

.sidebar-mobile {
    position: fixed;
    top: 0;
    left: -280px;
    width: 280px;
    height: 100vh;
    z-index: 1200;
    transition: left 0.3s ease;
    padding: 20px;
    display: flex;
    flex-direction: column;
    background: #11101d; 
}

.sidebar-mobile.active {
    left: 0;
}

.mobile-sidebar-header { margin-bottom: 30px; }
.mobile-sidebar-user { display: flex; align-items: center; gap: 15px; margin-bottom: 20px; position: relative; }

.mobile-avatar-circle {
    width: 50px; height: 50px;
    background: var(--accent);
    border-radius: 50%;
    display: flex; align-items: center; justify-content: center;
    font-size: 1.5rem;
}

.mobile-sidebar-close {
    position: absolute; top: 0; right: 0;
    background: none; border: none;
    color: var(--text-dim);
    font-size: 1.2rem;
    cursor: pointer; padding: 5px;
}

.mobile-nav-menu { flex: 1; }

.mobile-nav-item {
    display: flex; align-items: center; gap: 15px;
    padding: 15px;
    color: var(--text-dim);
    text-decoration: none;
    border-radius: 12px;
    transition: 0.3s;
    margin-bottom: 5px;
}

.mobile-nav-item.active, .mobile-nav-item:hover {
    background: rgba(255, 255, 255, 0.1);
    color: white;
}

.mobile-nav-label {
    font-size: 0.7rem; text-transform: uppercase;
    color: var(--accent); margin: 20px 0 10px;
    letter-spacing: 1.5px; font-weight: 800;
}

.mobile-sidebar-footer { margin-top: auto; }
.mobile-level-manager { padding: 15px; border-radius: 15px; }


/* SIDEBAR CONTENT STYLES */
.logo {
    font-size: 1.8rem;
    font-weight: 800;
    margin-bottom: 40px;
    display: flex; align-items: center; gap: 15px;
    color: var(--accent);
}

.nav-menu { flex: 1; }

.nav-item {
    display: flex; align-items: center; gap: 15px;
    padding: 15px;
    color: var(--text-dim);
    text-decoration: none;
    border-radius: 12px;
    transition: 0.3s;
    margin-bottom: 5px;
    cursor: pointer;
}

.nav-item.active, .nav-item:hover {
    background: rgba(255, 255, 255, 0.1);
    color: white;
}

.nav-label {
    font-size: 0.7rem; text-transform: uppercase;
    color: var(--accent); margin: 20px 0 10px 20px;
    letter-spacing: 1.5px; font-weight: 800;
}

.sidebar-footer { margin-top: auto; }

.level-manager {
    padding: 15px;
    border-radius: 15px;
    background: rgba(255, 255, 255, 0.03);
}

.level-manager p {
    font-size: 0.9rem; margin-bottom: 10px;
    color: var(--text-dim);
}


/* TOP NAV */
.top-nav {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 15px 30px;
    margin-bottom: 25px;
    flex-wrap: wrap;
    gap: 15px;
    background: var(--glass-bg); 
    border-radius: 15px; 
}

.search-box {
    background: rgba(0, 0, 0, 0.2);
    padding: 12px 20px;
    border-radius: 15px;
    width: 100%;
    max-width: 400px;
    border: 1px solid var(--glass-border);
    color: white;
    font-size: 1rem;
}

.search-box:focus {
    outline: none;
    border-color: var(--accent);
    box-shadow: 0 0 0 2px var(--accent-glow);
}

/* QUESTIONS GRID */
#courseHeading {
    margin: 0 0 25px 0; 
    font-size: 1.8rem;
}

.questions-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); 
    gap: 20px;
    padding-bottom: 30px;
}

.stat-card {
    padding: 25px;
    display: flex;
    align-items: center;
    gap: 20px;
    cursor: pointer;
    transition: transform 0.3s, box-shadow 0.3s;
}

.stat-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 10px 25px rgba(0, 0, 0, 0.2);
    border-color: var(--accent);
}

.icon-box {
    width: 50px; height: 50px;
    border-radius: 12px;
    display: grid; place-items: center;
    font-size: 1.4rem;
    flex-shrink: 0;
}

.blue { background: rgba(59, 130, 246, 0.2); color: #60a5fa; }
.orange { background: rgba(249, 115, 22, 0.2); color: #fb923c; }
.green { background: rgba(34, 197, 94, 0.2); color: #4ade80; }

.stat-card h3 { font-size: 1.2rem; margin-bottom: 5px; }
.stat-card p { color: var(--text-dim); font-size: 0.9rem; }

/* AUTH MODAL */
.modal-overlay {
    position: fixed; inset: 0; z-index: 9999;
    display: flex; align-items: center; justify-content: center;
    width: 100%; height: 100%;
    background: url('/images/bg.png') center/cover no-repeat;
    filter: brightness(0.6);
}

.auth-card { width: 90%; max-width: 450px; padding: 30px; text-align: center; }
.auth-header { margin-bottom: 25px; }
.auth-header i { font-size: 3rem; color: var(--accent); margin-bottom: 15px; }

.mode-toggle {
    display: flex; gap: 10px; margin-bottom: 25px;
    background: rgba(255, 255, 255, 0.05);
    padding: 5px; border-radius: 12px;
}

.tab-btn {
    flex: 1; padding: 12px; background: transparent;
    border: none; border-radius: 8px; color: var(--text-dim);
    cursor: pointer; font-weight: 600; transition: all 0.3s;
}

.tab-btn.active { background: var(--accent); color: white; }

.input-group { text-align: left; margin-bottom: 15px; }
.input-group label { display: block; margin-bottom: 8px; font-size: 0.9rem; color: var(--text-dim); }

.input-group input, .input-group select, .input-group textarea {
    width: 100%; padding: 12px 15px;
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid var(--glass-border);
    border-radius: 10px; color: white; font-size: 1rem;
}

.input-group select {
    appearance: none;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' fill='none' viewBox='0 0 24 24' stroke='%23cbd5e1'%3E%3Cpath stroke-linecap='round' stroke-linejoin='round' stroke-width='2' d='M19 9l-7 7-7-7'%3E%3C/path%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 15px center;
    background-size: 15px;
}

.input-group textarea { min-height: 80px; resize: vertical; }

.input-group input:focus, .input-group select:focus, .input-group textarea:focus {
    outline: none; border-color: var(--accent); box-shadow: 0 0 0 2px var(--accent-glow);
}

.input-row { display: flex; gap: 15px; }

.btn-primary {
    width: 100%; padding: 15px; background: var(--accent);
    border: none; border-radius: 12px; color: white;
    font-weight: 600; font-size: 1rem; cursor: pointer;
    margin-top: 15px; transition: all 0.3s;
}

.btn-primary:hover {
    background: #2563eb; transform: translateY(-2px); box-shadow: 0 5px 15px var(--accent-glow);
}

/* LOGOUT BUTTON */
.logout-btn {
    display: flex; align-items: center; gap: 8px;
    background: rgba(239, 68, 68, 0.1);
    border: 1px solid rgba(239, 68, 68, 0.2);
    color: #f87171; padding: 10px 20px;
    border-radius: 12px; cursor: pointer;
    font-weight: 600; font-size: 0.95rem;
    transition: all 0.3s; white-space: nowrap;
}

.logout-btn:hover {
    background: #ef4444; color: white; box-shadow: 0 4px 15px rgba(239, 68, 68, 0.3);
}

.btn-promote {
    width: 100%; padding: 12px;
    background: linear-gradient(135deg, var(--accent), #1d4ed8);
    border: none; border-radius: 10px; color: white;
    font-weight: 700; font-size: 0.9rem; cursor: pointer; transition: all 0.3s;
}

.btn-promote:hover { transform: translateY(-2px); box-shadow: 0 5px 15px var(--accent-glow); }

/* ADMIN PANEL */
.viewer-overlay {
    position: fixed; inset: 0; width: 100vw; height: 100vh;
    z-index: 9999; background: rgba(0, 0, 0, 0.95);
    backdrop-filter: blur(20px); overflow-y: auto; display: none;
}

.viewer-content {
    position: relative; z-index: 10000;
    max-width: 1200px; margin: 40px auto; padding: 20px;
}

.viewer-header {
    display: flex; justify-content: space-between;
    align-items: center; margin-bottom: 30px;
    flex-wrap: wrap; gap: 15px;
}

.admin-grid { display: grid; grid-template-columns: 350px 1fr; gap: 30px; }
.admin-form, .admin-workspace { padding: 25px; }
.admin-workspace { overflow-y: auto; max-height: 70vh; }

.q-item { margin-bottom: 20px; padding: 20px; }
.q-text { width: 100%; margin-bottom: 15px; }

.btn-secondary {
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid var(--glass-border);
    border-radius: 10px; color: white; padding: 12px 20px;
    cursor: pointer; font-weight: 600; transition: all 0.3s;
}

.btn-secondary:hover { background: rgba(255, 255, 255, 0.1); }

/* PAPER VIEWER */
.paper-body { padding: 30px; margin-top: 20px; }
.paper-body hr { margin: 20px 0; border: none; border-top: 1px solid rgba(255, 255, 255, 0.1); }
.opt-label {
    display: inline-block; background: rgba(255, 255, 255, 0.05);
    padding: 8px 15px; margin: 5px 10px 5px 0;
    border-radius: 8px; font-size: 0.9rem;
}


/* ===== QUESTION BUILDER STYLES ===== */
.question-builder-container {
    display: flex; flex-direction: column; gap: 25px; margin-top: 25px;
}

.builder-section { padding: 25px; border-radius: 18px; }
.builder-section h3 {
    display: flex; align-items: center; gap: 10px;
    margin-bottom: 20px; color: var(--accent); font-size: 1.2rem;
}
.builder-section h3 i { font-size: 1.1rem; }

/* Question Item Styles */
.question-item-container {
    background: rgba(255, 255, 255, 0.03);
    border-radius: 12px; padding: 20px; margin-bottom: 20px;
    border-left: 4px solid var(--accent);
}

.question-header {
    display: flex; justify-content: space-between; align-items: center; margin-bottom: 15px;
}

.question-number { display: flex; align-items: center; gap: 10px; }
.question-number label { color: var(--text-dim); font-size: 0.9rem; }
.question-number input {
    width: 60px; padding: 8px 12px;
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid var(--glass-border);
    border-radius: 8px; color: white; text-align: center;
}

.question-text-editor {
    width: 100%; min-height: 100px;
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid var(--glass-border);
    border-radius: 10px; color: white; padding: 15px;
    font-size: 1rem; line-height: 1.6; resize: vertical;
    font-family: 'Courier New', monospace;
}

.question-text-editor:focus {
    outline: none; border-color: var(--accent); box-shadow: 0 0 0 2px var(--accent-glow);
}

/* Options Container */
.options-container { margin-top: 20px; }

.option-row {
    display: flex; align-items: center; gap: 15px;
    margin-bottom: 12px; padding: 12px 15px;
    background: rgba(255, 255, 255, 0.02);
    border-radius: 10px; border: 1px solid transparent; transition: all 0.3s;
}

.option-row:hover { background: rgba(255, 255, 255, 0.05); border-color: var(--glass-border); }

.option-label {
    width: 40px; height: 40px;
    display: flex; align-items: center; justify-content: center;
    background: rgba(59, 130, 246, 0.15);
    border-radius: 8px; font-weight: 700; color: var(--accent); flex-shrink: 0;
}

.option-input {
    flex: 1; padding: 10px 15px;
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid var(--glass-border);
    border-radius: 8px; color: white; font-size: 0.95rem;
}

.correct-option {
    width: 30px; height: 30px;
    display: flex; align-items: center; justify-content: center;
    background: rgba(34, 197, 94, 0.15);
    border: 1px solid rgba(34, 197, 94, 0.3);
    border-radius: 6px; cursor: pointer; color: #10b981; transition: all 0.3s;
}

.correct-option:hover { background: rgba(34, 197, 94, 0.25); }
.correct-option.selected { background: #10b981; color: white; }

.remove-option {
    width: 30px; height: 30px;
    display: flex; align-items: center; justify-content: center;
    background: rgba(239, 68, 68, 0.15);
    border: 1px solid rgba(239, 68, 68, 0.2);
    border-radius: 6px; cursor: pointer; color: #f87171; transition: all 0.3s;
}

.remove-option:hover { background: rgba(239, 68, 68, 0.25); }

.add-option-btn {
    display: flex; align-items: center; gap: 8px;
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid var(--glass-border);
    border-radius: 10px; color: var(--text-dim);
    padding: 10px 15px; cursor: pointer; font-size: 0.9rem;
    transition: all 0.3s; margin-top: 10px;
}

.add-option-btn:hover { background: rgba(255, 255, 255, 0.1); color: white; }

/* Section Styles */
.section-container {
    background: rgba(255, 255, 255, 0.02);
    border-radius: 15px; padding: 20px;
    margin-bottom: 20px; border: 1px solid var(--glass-border);
}

.section-header {
    display: flex; justify-content: space-between; align-items: center; margin-bottom: 20px;
}

.section-title { display: flex; align-items: center; gap: 10px; }
.section-title h4 { color: white; font-size: 1.1rem; }
.section-title input {
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid var(--glass-border);
    border-radius: 8px; color: white; padding: 8px 12px; width: 200px;
}

.remove-section {
    background: rgba(239, 68, 68, 0.1);
    border: 1px solid rgba(239, 68, 68, 0.2);
    color: #f87171; padding: 8px 15px;
    border-radius: 8px; cursor: pointer; font-size: 0.9rem; transition: all 0.3s;
}

.remove-section:hover { background: rgba(239, 68, 68, 0.2); }

/* Questions in Section */
.section-questions { margin-top: 20px; }

.add-question-btn {
    width: 100%; padding: 12px;
    background: rgba(59, 130, 246, 0.1);
    border: 1px solid rgba(59, 130, 246, 0.2);
    border-radius: 10px; color: var(--accent);
    cursor: pointer; font-weight: 600; transition: all 0.3s; margin-top: 15px;
}

.add-question-btn:hover { background: rgba(59, 130, 246, 0.2); }

/* Preview Styles */
.question-preview {
    padding: 25px; min-height: 200px; max-height: 400px;
    overflow-y: auto; font-family: 'Times New Roman', serif;
}

.preview-placeholder {
    text-align: center; padding: 40px 20px; color: var(--text-dim);
}
.preview-placeholder i { font-size: 3rem; margin-bottom: 15px; opacity: 0.3; }

/* Exam Paper Preview */
.exam-header {
    text-align: center; margin-bottom: 30px;
    border-bottom: 2px solid rgba(255, 255, 255, 0.1); padding-bottom: 20px;
}

.exam-header h1 { font-size: 1.5rem; font-weight: 700; margin-bottom: 10px; text-transform: uppercase; }
.exam-header h2 { font-size: 1.2rem; font-weight: 600; margin-bottom: 5px; color: var(--accent); }

.exam-details {
    margin-bottom: 30px; padding: 20px;
    background: rgba(255, 255, 255, 0.02); border-radius: 10px;
}

.course-info {
    display: flex; justify-content: space-between; align-items: center;
    margin-bottom: 20px; flex-wrap: wrap; gap: 15px;
}

.course-code-title { display: flex; align-items: center; gap: 15px; }

.exam-instructions {
    font-style: italic; color: var(--accent); margin: 20px 0; padding: 15px;
    background: rgba(59, 130, 246, 0.05);
    border-left: 4px solid var(--accent); border-radius: 5px;
}

/* Section Preview */
.section-preview { margin-bottom: 30px; }
.section-title-preview {
    font-size: 1.3rem; font-weight: 700; margin-bottom: 20px;
    padding-bottom: 10px; border-bottom: 2px solid rgba(255, 255, 255, 0.1); color: white;
}

/* Question Preview */
.question-preview-item { margin-bottom: 25px; page-break-inside: avoid; }
.question-number-preview { font-weight: 700; margin-bottom: 10px; color: white; }
.question-text-preview { margin-bottom: 15px; line-height: 1.6; font-size: 1.05rem; }

.options-preview { margin-left: 20px; }
.option-preview { margin-bottom: 8px; display: flex; align-items: flex-start; gap: 10px; }
.option-letter { font-weight: 700; color: var(--accent); min-width: 25px; }
.option-text { flex: 1; line-height: 1.5; }

/* Code Block Styling */
.code-block {
    background: rgba(0, 0, 0, 0.3); border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 8px; padding: 15px; margin: 10px 0;
    font-family: 'Courier New', monospace; font-size: 0.95rem;
    overflow-x: auto; white-space: pre-wrap;
}

/* Single Question Viewer */
.single-question-content { padding: 30px; font-family: 'Times New Roman', serif; }

.single-question-header {
    margin-bottom: 20px; padding-bottom: 15px; border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}
.single-question-header h3 { color: var(--accent); margin-bottom: 10px; }
.single-question-meta { display: flex; gap: 20px; color: var(--text-dim); font-size: 0.9rem; }

/* Question Display in Grid */
.question-card-display { cursor: pointer; transition: all 0.3s; }
.question-card-display:hover { transform: translateY(-5px); border-color: var(--accent); }

.question-card-header {
    display: flex; justify-content: space-between; align-items: flex-start; margin-bottom: 15px;
}

.question-card-code {
    font-size: 0.9rem; color: var(--accent); font-weight: 600;
    background: rgba(59, 130, 246, 0.1); padding: 4px 10px; border-radius: 20px;
}

.question-card-type {
    font-size: 0.8rem; color: var(--text-dim);
    background: rgba(255, 255, 255, 0.05); padding: 3px 8px; border-radius: 10px;
}

.question-card-text {
    margin-bottom: 15px; line-height: 1.5;
    display: -webkit-box; -webkit-line-clamp: 3;
    -webkit-box-orient: vertical; overflow: hidden;
}

.question-card-options { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; margin-top: 15px; }

.option-card {
    background: rgba(255, 255, 255, 0.02); padding: 10px;
    border-radius: 8px; font-size: 0.9rem; border: 1px solid transparent; transition: all 0.2s;
}

.option-card:hover { background: rgba(255, 255, 255, 0.05); border-color: var(--glass-border); }
.option-card.correct { background: rgba(34, 197, 94, 0.1); border-color: rgba(34, 197, 94, 0.3); }

/* --- OTHER UTILITIES AND ADMIN LIST --- */

.admin-list-container { max-width: 1200px; margin: 0 auto; padding: 20px; }
.admin-dept-group { margin-bottom: 40px; }
.dept-label {
    color: var(--accent); border-bottom: 2px solid var(--glass-border);
    padding-bottom: 10px; margin-bottom: 20px;
}

.admin-course-item {
    display: flex; justify-content: space-between; align-items: center;
    padding: 15px 25px; margin-bottom: 10px; border-radius: 12px;
}

.course-actions { display: flex; gap: 15px; }
.btn-edit { color: #4ade80; background: none; border: none; cursor: pointer; font-size: 1.1rem; }
.btn-delete { color: #f87171; background: none; border: none; cursor: pointer; font-size: 1.1rem; }

.admin-dept-section { margin-bottom: 30px; width: 100%; }
.dept-title { color: var(--accent); border-bottom: 1px solid var(--glass-border); padding-bottom: 10px; margin-bottom: 15px; }
.admin-level-group { padding-left: 20px; margin-bottom: 20px; }
.level-label { color: var(--text-dim); text-transform: uppercase; font-size: 0.8rem; margin-bottom: 10px; }

.admin-management-card {
    display: flex; justify-content: space-between; align-items: center;
    padding: 15px 20px; margin-bottom: 10px; border-radius: 12px;
}

.paper-details { display: flex; align-items: center; gap: 15px; }
.status-dot { width: 10px; height: 10px; border-radius: 50%; }
.status-dot.blue { background: #3b82f6; box-shadow: 0 0 10px #3b82f6; }
.status-dot.green { background: #10b981; box-shadow: 0 0 10px #10b981; }

.management-actions { display: flex; gap: 10px; }
.btn-icon {
    background: rgba(255,255,255,0.05); border: 1px solid var(--glass-border);
    color: white; padding: 8px; border-radius: 8px; cursor: pointer; transition: 0.3s;
}
.btn-icon.edit:hover { color: #10b981; border-color: #10b981; }
.btn-icon.delete:hover { color: #ef4444; border-color: #ef4444; }

.semester-select-container .stat-card { transition: transform 0.3s ease, background 0.3s ease; }
.semester-select-container .stat-card:hover { transform: translateY(-10px); background: rgba(255, 255, 255, 0.15); }

/* TOASTS */
#toast-container {
    position: fixed; top: 20px; left: 50%; transform: translateX(-50%);
    z-index: 10000; display: flex; flex-direction: column;
    gap: 15px; align-items: center;
}
.toast {
    min-width: 300px; padding: 16px 20px;
    background: rgba(20, 20, 20, 0.9); backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px); border: 1px solid rgba(255, 255, 255, 0.1);
    border-left: 5px solid; border-radius: 12px; color: white;
    font-size: 0.95rem; box-shadow: 0 8px 20px rgba(0, 0, 0, 0.4);
    display: flex; align-items: center; gap: 15px;
    animation: slideIn 0.4s forwards; opacity: 0; transform: translateX(100%);
}
.toast.success { border-left-color: #00e676; }
.toast.error   { border-left-color: #ff1744; }
.toast.info    { border-left-color: #2979ff; }
.toast i { font-size: 1.2rem; }
.toast.success i { color: #00e676; }
.toast.error i   { color: #ff1744; }
.toast.info i    { color: #2979ff; }

@keyframes slideIn { to { opacity: 1; transform: translateX(0); } }
@keyframes slideOut { to { opacity: 0; transform: translateX(100%); } }

/* IMAGE PREVIEW */
.image-preview-strip { display: flex; gap: 10px; overflow-x: auto; padding: 10px 0; }
.image-preview-strip img { height: 100px; border-radius: 8px; border: 2px solid var(--accent); }

/* CONFIRM MODAL */
#confirmModal .auth-card { max-width: 400px; border: 1px solid rgba(239, 68, 68, 0.2); }
#confirmOkBtn:hover { background: #dc2626 !important; box-shadow: 0 5px 15px rgba(180, 23, 23, 0.4); }


/* --- RESPONSIVE MEDIA QUERIES --- */

/* TABLET (768px - 1024px) */
@media (max-width: 1024px) {
    .app-container { flex-direction: column; overflow: auto; padding: 70px 15px 15px; }
    
    .sidebar { display: none; }
    
    .mobile-header { display: flex; }
    
    .main-content {
        width: 100%; height: auto;
        overflow: visible; padding: 0;
    }
    
    /* Reveal sidebar but keep overlay HIDDEN by default */
    .sidebar-mobile { display: flex; } 
    .mobile-overlay { display: none; } /* FIXED: Ensure this is none */
    
    .mobile-user { display: flex; align-items: center; }
    .logout-btn { display: none !important; }
}

/* MOBILE (Below 768px) */
@media (max-width: 768px) {
    .questions-grid { grid-template-columns: 1fr; }
    
    .admin-grid { grid-template-columns: 1fr; }
    .admin-form { max-width: 100%; }
    
    .viewer-header { flex-direction: column; align-items: stretch; }
    
    .question-builder-container { grid-template-columns: 1fr; }
    
    .builder-section { padding: 20px; }
    .question-card-options { grid-template-columns: 1fr; }
}

/* SMALL MOBILE */
@media (max-width: 480px) {
    .mobile-header { padding: 12px 15px; }
    .app-container { padding: 60px 10px 10px; }
    .questions-grid { padding-bottom: 15px; }
    .stat-card { flex-direction: column; text-align: center; padding: 20px 15px; }
    .viewer-content { margin: 10px; padding: 10px; }
    
    #toast-container { width: 90%; top: 10px; }
    .toast { width: 100%; min-width: auto; }
}

/* LARGE DESKTOP ADJUSTMENTS */
@media (min-width: 1024px) {
    #adminPanel .viewer-content { max-width: 95%; width: 1400px; margin: 20px auto; }
    
    .question-builder-container {
        display: grid; grid-template-columns: 400px 1fr; gap: 30px; align-items: start;
    }
    .builder-section { margin-bottom: 20px; width: 100%; }
    
    .admin-workspace-header {
        display: flex; justify-content: space-between; align-items: center;
        background: rgba(255, 255, 255, 0.05); padding: 20px;
        border-radius: 15px; margin-bottom: 20px; border: 1px solid var(--glass-border);
    }
    
    .mobile-user { display: none; }
}


/* 🟢 Glassmorphism Success Pop-up */
        .glass-success-popup {
            position: fixed;
            top: -100px;
            left: 50%;
            transform: translateX(-50%);
            background: rgba(16, 185, 129, 0.15); /* Translucent emerald green */
            backdrop-filter: blur(16px);
            -webkit-backdrop-filter: blur(16px);
            border: 1px solid rgba(52, 211, 153, 0.4);
            box-shadow: 0 10px 30px rgba(16, 185, 129, 0.2);
            color: #fff;
            padding: 15px 25px;
            border-radius: 12px;
            display: flex;
            align-items: center;
            gap: 12px;
            z-index: 99999;
            transition: top 0.4s cubic-bezier(0.68, -0.55, 0.265, 1.55);
            min-width: 300px;
            max-width: 90%;
        }
        .glass-success-popup.show {
            top: 30px;
        }
        .glass-success-icon {
            background: rgba(52, 211, 153, 0.2);
            color: #34d399;
            width: 30px;
            height: 30px;
            border-radius: 50%;
            display: flex;
            align-items: center;
            justify-content: center;
            font-size: 1rem;
        }