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

:root {
    --bg-dark: #050505;
    --bg-panel: rgba(18, 18, 18, 0.85);
    --primary-red: #E50914; /* Deep vibrant red */
    --primary-red-hover: #ff2a2a;
    --accent-red: #ff4d4d;
    --text-main: #f4f4f5;
    --text-muted: #a1a1aa;
    --border-color: rgba(229, 9, 20, 0.25);
    --border-hover: rgba(229, 9, 20, 0.6);
    --glow-red: 0 0 20px rgba(229, 9, 20, 0.4);
    --glass-blur: blur(12px);
    --transition-fast: 0.2s ease;
    --transition-smooth: 0.4s cubic-bezier(0.16, 1, 0.3, 1);
}

* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

body {
    font-family: 'Outfit', sans-serif;
    background-color: var(--bg-dark);
    color: var(--text-main);
    min-height: 100vh;
    background-image: 
        radial-gradient(circle at 15% 50%, rgba(229, 9, 20, 0.08), transparent 25%),
        radial-gradient(circle at 85% 30%, rgba(229, 9, 20, 0.05), transparent 25%);
    background-attachment: fixed;
    overflow-x: hidden;
}

/* Typography */
h1, h2, h3 { font-weight: 700; letter-spacing: -0.02em; }
h1 { font-size: 2.5rem; margin-bottom: 1rem; color: #fff; }
h2 { font-size: 1.5rem; margin-bottom: 1rem; color: #fff; }
.text-red { color: var(--primary-red); }

/* Layout */
.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 2rem;
}

header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 1.5rem 0;
    border-bottom: 1px solid var(--border-color);
    margin-bottom: 3rem;
}

.brand {
    font-size: 1.75rem;
    font-weight: 800;
    letter-spacing: -0.05em;
    text-transform: uppercase;
}

.brand span {
    color: var(--primary-red);
    text-shadow: var(--glow-red);
}

/* Cards & Glassmorphism */
.glass-panel {
    background: var(--bg-panel);
    backdrop-filter: var(--glass-blur);
    -webkit-backdrop-filter: var(--glass-blur);
    border: 1px solid var(--border-color);
    border-radius: 16px;
    padding: 2rem;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.5);
    transition: var(--transition-smooth);
}

.glass-panel:hover {
    border-color: var(--border-hover);
    transform: translateY(-2px);
    box-shadow: 0 15px 40px rgba(0, 0, 0, 0.6), var(--glow-red);
}

/* Grid Layouts */
.dashboard-grid {
    display: grid;
    grid-template-columns: 2fr 1fr;
    gap: 2rem;
}

@media (max-width: 900px) {
    .dashboard-grid { grid-template-columns: 1fr; }
}

/* Lists */
.item-list {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.item-card {
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid rgba(255, 255, 255, 0.1);
    padding: 1.25rem;
    border-radius: 12px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    transition: var(--transition-fast);
}

.item-card:hover {
    background: rgba(255, 255, 255, 0.06);
    border-color: var(--border-color);
}

.item-details h3 { margin-bottom: 0.25rem; font-size: 1.1rem; }
.item-details p { color: var(--text-muted); font-size: 0.9rem; }

/* Buttons */
.btn {
    display: inline-block;
    background: transparent;
    color: var(--text-main);
    border: 1px solid var(--text-muted);
    padding: 0.75rem 1.5rem;
    border-radius: 8px;
    font-weight: 600;
    font-family: 'Outfit', sans-serif;
    cursor: pointer;
    transition: var(--transition-fast);
    text-decoration: none;
    text-align: center;
}

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

.btn-primary {
    background: var(--primary-red);
    border-color: var(--primary-red);
    color: #fff;
    box-shadow: var(--glow-red);
}

.btn-primary:hover {
    background: var(--primary-red-hover);
    border-color: var(--primary-red-hover);
    transform: translateY(-1px);
    box-shadow: 0 0 25px rgba(229, 9, 20, 0.6);
}

/* Forms */
.form-group {
    margin-bottom: 1.5rem;
}

.form-group label {
    display: block;
    margin-bottom: 0.5rem;
    color: var(--text-muted);
    font-size: 0.9rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.form-control {
    width: 100%;
    background: rgba(0, 0, 0, 0.5);
    border: 1px solid var(--border-color);
    color: #fff;
    padding: 1rem;
    border-radius: 8px;
    font-family: 'Outfit', sans-serif;
    font-size: 1rem;
    transition: var(--transition-fast);
}

.form-control:focus {
    outline: none;
    border-color: var(--primary-red);
    box-shadow: 0 0 0 2px rgba(229, 9, 20, 0.2);
}

/* Modals */
.modal-overlay {
    position: fixed;
    top: 0; left: 0; right: 0; bottom: 0;
    background: rgba(0, 0, 0, 0.8);
    backdrop-filter: blur(5px);
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 1000;
    opacity: 0;
    pointer-events: none;
    transition: var(--transition-fast);
}

.modal-overlay.active {
    opacity: 1;
    pointer-events: all;
}

.modal-content {
    width: 100%;
    max-width: 400px;
    transform: translateY(20px);
    transition: var(--transition-smooth);
}

.modal-overlay.active .modal-content {
    transform: translateY(0);
}

.close-btn {
    position: absolute;
    top: 1rem; right: 1rem;
    background: none; border: none;
    color: var(--text-muted);
    font-size: 1.5rem; cursor: pointer;
}

.close-btn:hover { color: #fff; }

/* Alerts */
.alert {
    padding: 1rem;
    border-radius: 8px;
    margin-bottom: 1rem;
    display: none;
}
.alert.error {
    background: rgba(229, 9, 20, 0.1);
    border: 1px solid var(--primary-red);
    color: #ffb3b3;
    display: block;
}
.alert.success {
    background: rgba(46, 204, 113, 0.1);
    border: 1px solid #2ecc71;
    color: #a8f0c6;
    display: block;
}

/* Quiz Specific UI */
.quiz-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 2rem;
    padding-bottom: 1rem;
    border-bottom: 1px solid var(--border-color);
}

.timer {
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--primary-red);
    text-shadow: var(--glow-red);
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

/* Camera Module */
.camera-module {
    position: fixed;
    top: 20px;
    right: 20px;
    width: 200px;
    height: 150px;
    background: #000;
    border: 2px solid var(--primary-red);
    border-radius: 12px;
    overflow: hidden;
    box-shadow: var(--glow-red);
    z-index: 100;
}

.camera-module video {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transform: scaleX(-1); /* Mirror */
}

.camera-overlay {
    position: absolute;
    top: 5px; right: 5px;
    background: rgba(229, 9, 20, 0.8);
    color: #fff;
    font-size: 0.7rem;
    font-weight: 800;
    padding: 2px 6px;
    border-radius: 4px;
    letter-spacing: 1px;
    animation: pulse 2s infinite;
}

@keyframes pulse {
    0% { opacity: 1; }
    50% { opacity: 0.5; }
    100% { opacity: 1; }
}

/* Questions */
.question-block {
    margin-bottom: 3rem;
}

.question-text {
    font-size: 1.25rem;
    margin-bottom: 1.5rem;
    line-height: 1.6;
}

.options-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 1rem;
}

@media (max-width: 600px) {
    .options-grid { grid-template-columns: 1fr; }
}

.option-label {
    display: flex;
    align-items: center;
    padding: 1rem 1.5rem;
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 8px;
    cursor: pointer;
    transition: var(--transition-fast);
}

.option-label:hover {
    background: rgba(255, 255, 255, 0.08);
    border-color: rgba(255, 255, 255, 0.3);
}

.option-label input[type="radio"] {
    margin-right: 1rem;
    accent-color: var(--primary-red);
    transform: scale(1.2);
}

.option-label:has(input:checked) {
    border-color: var(--primary-red);
    background: rgba(229, 9, 20, 0.1);
    box-shadow: inset 0 0 10px rgba(229, 9, 20, 0.2);
}

/* Cheating overlay */
#cheatingOverlay {
    position: fixed;
    top: 0; left: 0; right: 0; bottom: 0;
    background: rgba(229, 9, 20, 0.95);
    z-index: 9999;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    color: #fff;
    text-align: center;
    padding: 2rem;
}

#cheatingOverlay h1 {
    font-size: 4rem;
    margin-bottom: 1rem;
    text-shadow: 0 0 20px #000;
}
