/* Operation Extinction LMS */

:root {
    --bg-deep: #0d0d14;
    --bg-surface: #1a1a2e;
    --bg-card: #16213e;
    --brand-primary: #e2a93b;
    --brand-secondary: #8b3a3a;
    --text-primary: #e0e0e0;
    --text-muted: #8899aa;
    --accent-green: #2d8a4e;
    --accent-red: #c0392b;
    --border: #2a2a4a;
    --font-body: "Inter", "Segoe UI", -apple-system, Arial, sans-serif;
    --font-code: Consolas, "Courier New", monospace;
}

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

body {
    font-family: var(--font-body);
    background: var(--bg-deep);
    color: var(--text-primary);
    min-height: 100vh;
    font-size: 15px;
    line-height: 1.5;
    position: relative;
    overflow-x: hidden;
}

/* Subtle radial gradient background */
body::before {
    content: '';
    position: fixed;
    inset: 0;
    z-index: 0;
    background: radial-gradient(ellipse at 50% 40%, #0d0d14 0%, #0a0a10 100%);
    pointer-events: none;
}

a { color: var(--brand-primary); text-decoration: none; }
a:hover { color: #f0be5a; }

/* Ensure content sits above background */
.topbar, .container, footer { position: relative; z-index: 1; }

/* -- Topbar -- */
.topbar {
    position: sticky;
    top: 0;
    z-index: 100;
    background: rgba(13, 13, 20, 0.95);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    border-bottom: 1px solid var(--border);
    padding: 0 28px;
    height: 56px;
    display: flex;
    justify-content: space-between;
    align-items: center;
}
.topbar .brand {
    display: flex;
    align-items: center;
    gap: 10px;
    text-decoration: none;
    color: var(--text-primary);
}
.topbar .brand:hover { color: var(--text-primary); text-decoration: none; }
.topbar .brand-text {
    font-size: 14px;
    font-weight: 700;
    letter-spacing: 3px;
    color: var(--brand-primary);
}
.topbar .user { color: var(--text-muted); font-size: 14px; }
.topbar .user a { margin-left: 16px; color: var(--text-muted); }
.topbar .user a:hover { color: var(--brand-primary); }

/* -- Layout -- */
.container { max-width: 1100px; margin: 0 auto; padding: 28px 24px; }

/* -- Cards -- */
.card {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: 10px;
    padding: 24px;
    margin-bottom: 0;
}
.card h2 {
    font-size: 13px;
    text-transform: uppercase;
    letter-spacing: 1.5px;
    color: var(--text-muted);
    margin-bottom: 16px;
    font-weight: 600;
}
.card h3 {
    font-size: 18px;
    font-weight: 600;
    color: var(--text-primary);
    margin-bottom: 12px;
}
.card h4 {
    font-size: 14px;
    font-weight: 600;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.5px;
    margin-bottom: 8px;
}
.card--compact { padding: 20px; }
.card--compact h2 { margin-bottom: 12px; }

/* -- Buttons -- */
.btn {
    display: inline-block;
    padding: 10px 24px;
    border-radius: 6px;
    font-size: 14px;
    font-weight: 600;
    border: none;
    cursor: pointer;
    text-align: center;
    transition: all 0.2s;
    font-family: var(--font-body);
}
.btn-primary { background: var(--brand-primary); color: #0d0d14; }
.btn-primary:hover { background: #f0be5a; text-decoration: none; color: #0d0d14; }
.btn-secondary { background: var(--brand-secondary); color: white; }
.btn-secondary:hover { background: #a04545; text-decoration: none; color: white; }
.btn-danger { background: var(--accent-red); color: white; }
.btn-danger:hover { background: #e74c3c; text-decoration: none; color: white; }
.btn-ghost { background: transparent; border: 1px solid var(--border); color: var(--text-primary); }
.btn-ghost:hover { border-color: var(--brand-primary); color: var(--brand-primary); text-decoration: none; }
.btn-sm { padding: 5px 14px; font-size: 12px; }
.btn-lg { padding: 14px 36px; font-size: 16px; }

/* -- Forms -- */
.form-group { margin-bottom: 16px; }
.form-group label {
    display: block;
    font-size: 13px;
    color: var(--text-muted);
    margin-bottom: 5px;
    font-weight: 600;
}
.form-group input,
.form-group select,
.form-group textarea {
    width: 100%;
    padding: 12px 16px;
    background: var(--bg-surface);
    border: 1px solid var(--border);
    border-radius: 6px;
    color: var(--text-primary);
    font-size: 15px;
    font-family: var(--font-body);
}
.form-group input:focus,
.form-group select:focus,
.form-group textarea:focus {
    outline: none;
    border-color: var(--brand-primary);
    box-shadow: 0 0 0 3px rgba(226, 169, 59, 0.15);
}
.form-group textarea {
    resize: vertical;
    line-height: 1.6;
}
.form-group input::placeholder,
.form-group textarea::placeholder {
    color: var(--text-muted);
    opacity: 0.6;
}

/* -- Alerts -- */
.alert { padding: 14px 20px; border-radius: 8px; margin-bottom: 20px; font-size: 15px; }
.alert-success { background: rgba(45, 138, 78, 0.12); border: 1px solid var(--accent-green); color: var(--accent-green); }
.alert-error { background: rgba(192, 57, 43, 0.12); border: 1px solid var(--accent-red); color: var(--accent-red); }
.alert-warning { background: rgba(226, 169, 59, 0.12); border: 1px solid var(--brand-primary); color: var(--brand-primary); }
.alert-info { background: rgba(136, 153, 170, 0.12); border: 1px solid var(--text-muted); color: var(--text-primary); }

/* -- Login Page -- */
.login-container { max-width: 420px; margin: 80px auto; padding: 0 24px; }
.login-container .brand-title {
    text-align: center;
    font-size: 22px;
    font-weight: 700;
    color: var(--brand-primary);
    letter-spacing: 4px;
    margin-bottom: 4px;
}
.login-container .subtitle {
    text-align: center;
    color: var(--text-muted);
    margin-bottom: 32px;
    font-size: 14px;
}

/* -- Footer -- */
footer.site-footer {
    text-align: center;
    padding: 32px 24px 24px;
    color: var(--text-muted);
    font-size: 12px;
    opacity: 0.6;
}

/* -- Instructor Grid Table -- */
.grid-table { width: 100%; border-collapse: collapse; font-size: 13px; }
.grid-table th {
    background: var(--bg-surface);
    color: var(--text-muted);
    padding: 10px 14px;
    text-align: left;
    font-weight: 600;
    font-size: 12px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}
.grid-table td { padding: 8px 14px; border-bottom: 1px solid var(--border); }
.grid-table tr:hover { background: var(--bg-surface); }

/* -- Status Dots -- */
.status-dot { display: inline-block; width: 10px; height: 10px; border-radius: 50%; margin-right: 6px; vertical-align: middle; }
.status-dot.online { background: var(--accent-green); }
.status-dot.offline { background: var(--border); }
.status-dot.completed { background: var(--accent-green); }
.status-dot.in_progress { background: var(--brand-primary); }
.status-dot.not_started { background: var(--border); }
.status-dot.stuck { background: var(--accent-red); animation: pulse 1.5s infinite; }
@keyframes pulse { 0%,100%{opacity:1} 50%{opacity:.4} }

/* -- Stats Row (Instructor) -- */
.stats-row { display: flex; gap: 16px; margin-bottom: 24px; }
.stat-card {
    flex: 1;
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: 8px;
    padding: 16px;
    text-align: center;
}
.stat-card .value { font-size: 32px; font-weight: 700; color: var(--text-primary); }
.stat-card .label { font-size: 12px; color: var(--text-muted); margin-top: 4px; }

/* -- Content Grid -- */
.content-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
    gap: 10px;
    margin-bottom: 16px;
}
.content-link {
    display: block;
    background: var(--bg-surface);
    border: 1px solid var(--border);
    border-radius: 8px;
    padding: 14px 16px;
    transition: all 0.2s;
    color: var(--text-primary);
}
.content-link:hover {
    border-color: var(--brand-primary);
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3);
    text-decoration: none;
    color: var(--text-primary);
}
.content-title { font-weight: 600; font-size: 14px; margin-bottom: 3px; }
.content-meta { font-size: 12px; color: var(--text-muted); }

/* -- Day Headings -- */
.day-heading {
    font-size: 14px;
    font-weight: 700;
    color: var(--brand-primary);
    text-transform: uppercase;
    letter-spacing: 1px;
    margin-top: 20px;
    margin-bottom: 12px;
    padding-bottom: 8px;
    border-bottom: 1px solid var(--border);
}
.day-heading:first-of-type {
    margin-top: 0;
}

/* -- Status Badges -- */
.status-badge {
    display: inline-block;
    padding: 4px 12px;
    border-radius: 20px;
    font-size: 12px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}
.status-draft {
    background: rgba(136, 153, 170, 0.15);
    color: var(--text-muted);
    border: 1px solid var(--text-muted);
}
.status-submitted {
    background: rgba(226, 169, 59, 0.15);
    color: var(--brand-primary);
    border: 1px solid var(--brand-primary);
}
.status-reviewed {
    background: rgba(45, 138, 78, 0.15);
    color: var(--accent-green);
    border: 1px solid var(--accent-green);
}

/* -- Score Badge -- */
.score-badge {
    display: inline-block;
    font-size: 24px;
    font-weight: 700;
    color: var(--brand-primary);
    min-width: 48px;
    text-align: center;
}
.score-badge-lg {
    font-size: 48px;
    font-weight: 700;
    color: var(--brand-primary);
}

/* -- Brief Form -- */
.brief-form textarea {
    min-height: 120px;
}
.brief-form .form-group:nth-child(2) textarea,
.brief-form .form-group:nth-child(3) textarea {
    min-height: 180px;
}
.brief-actions {
    display: flex;
    gap: 12px;
    justify-content: flex-end;
    padding-top: 16px;
    border-top: 1px solid var(--border);
    margin-top: 8px;
}

/* -- Brief Sections (read-only display) -- */
.brief-section {
    margin-bottom: 20px;
    padding-bottom: 20px;
    border-bottom: 1px solid rgba(42, 42, 74, 0.5);
}
.brief-section:last-child {
    border-bottom: none;
    margin-bottom: 0;
    padding-bottom: 0;
}
.brief-content {
    color: var(--text-primary);
    font-size: 14px;
    line-height: 1.7;
    white-space: pre-wrap;
    word-wrap: break-word;
}

/* -- Review Panel -- */
.review-panel {
    border-color: var(--brand-primary);
    background: rgba(22, 33, 62, 0.8);
}
.review-panel h2 {
    color: var(--brand-primary);
}

/* -- Lab Frame -- */
.lab-frame {
    width: 100%;
    height: calc(100vh - 112px);
    border: none;
    display: block;
}

/* -- Responsive -- */
@media (max-width: 900px) {
    .stats-row { flex-wrap: wrap; }
    .stat-card { min-width: calc(50% - 8px); }
}
@media (max-width: 640px) {
    .stats-row { flex-direction: column; }
    .content-grid { grid-template-columns: 1fr; }
    .container { padding: 16px; }
    .topbar { padding: 0 16px; }
    .topbar .brand-text { font-size: 11px; letter-spacing: 2px; }
    .brief-actions { flex-direction: column; }
    .brief-actions .btn { width: 100%; }
    .grid-table { font-size: 12px; }
    .grid-table th, .grid-table td { padding: 6px 8px; }
}

/* -- Print -- */
@media print {
    body { background: white; color: black; }
    body::before { display: none; }
    .topbar, .site-footer, .btn, .brief-actions { display: none; }
    .card { background: white; border: 1px solid #ccc; box-shadow: none; }
    .card h2 { color: #333; }
    .brief-content { color: #000; }
    a { color: #000; text-decoration: underline; }
}
