@import url('https://fonts.googleapis.com/css2?family=Inter:wght@400;700&family=JetBrains+Mono:wght@400;700&family=Space+Grotesk:wght@400;700&display=swap');

:root {
    --matrix-emerald: #00FF41;
    --cyber-void: #050A07;
    --glass-hex: #13261C;
    --arcane-text: #E0F2E9;
    --python-blue: #3776AB;
    --python-yellow: #FFD43B;
    
    --primary: var(--matrix-emerald);
    --bg-color: var(--cyber-void);
    --surface: var(--glass-hex);
    --text-color: var(--arcane-text);
    --border: rgba(0, 255, 65, 0.2);
}

[data-theme="light"] {
    --cyber-void: #F5F7FA;
    --glass-hex: #FFFFFF;
    --arcane-text: #2D3748;
    --matrix-emerald: #008F23; /* Darker green for readability on light */
    --border: rgba(0, 143, 35, 0.2);
    
    --primary: var(--matrix-emerald);
    --bg-color: var(--cyber-void);
    --surface: var(--glass-hex);
    --text-color: var(--arcane-text);
}

[data-theme="light"] .glass-card {
    background: rgba(255, 255, 255, 0.8);
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.05);
}

[data-theme="light"] .nav-item.selected {
    background: rgba(0, 143, 35, 0.1);
}

[data-theme="light"] .accordion-header {
    background: rgba(0, 143, 35, 0.05);
}

body { 
    margin: 0; 
    display: flex; 
    flex-direction: column; 
    height: 100vh; 
    font-family: 'Inter', sans-serif; 
    background-color: var(--bg-color);
    color: var(--text-color);
    transition: background-color 0.3s ease, color 0.3s ease;
}

header { 
    background: var(--surface); 
    color: var(--text-color); 
    padding: 0 20px; 
    display: flex; 
    justify-content: space-between; 
    align-items: center; 
    height: 60px; 
    border-bottom: 1px solid var(--border);
    backdrop-filter: blur(10px);
    position: relative;
    z-index: 2000;
    transition: background-color 0.3s ease, border-bottom 0.3s ease;
}

h1, h2, h3, h4, h5, h6 {
    font-family: 'Space Grotesk', sans-serif;
    color: var(--matrix-emerald);
}

.logo {
    display: flex;
    align-items: center;
    gap: 10px;
    font-family: 'Space Grotesk', sans-serif;
    font-weight: bold;
    color: var(--matrix-emerald);
    font-size: 1.2rem;
    text-decoration: none;
}

.logo img {
    height: 40px;
    width: auto;
    filter: drop-shadow(0 0 5px var(--matrix-emerald));
}

.auth-logo {
    display: block;
    margin: 0 auto 1.5rem auto;
    height: 120px;
    width: auto;
    filter: drop-shadow(0 0 15px var(--matrix-emerald));
}

/* Auth Pages */
.auth-page {
    display: flex;
    flex-direction: column;
    min-height: 100vh;
    height: auto !important;
    overflow-y: auto;
}

.auth-card {
    width: 100%;
    max-width: 420px;
    padding: 30px;
    margin: auto;
    z-index: 1;
}

.auth-card h2 { text-align: center; margin-bottom: 0.5rem; }

.tagline {
    text-align: center;
    font-family: 'Space Grotesk', sans-serif;
    font-size: 0.9rem;
    color: var(--arcane-text);
    margin-bottom: 2rem;
    opacity: 0.8;
}

.sso-btns { margin-top: 20px; border-top: 1px solid var(--border); padding-top: 20px; text-align: center; }
.sso-btn { display: block; margin-bottom: 10px; text-decoration: none; padding: 10px; border-radius: 4px; font-size: 14px; transition: all 0.3s; }
.google { border: 1px solid #db4437; color: #db4437; }
.google:hover { background: #db4437; color: white; }
.microsoft { border: 1px solid #00a1f1; color: #00a1f1; }
.microsoft:hover { background: #00a1f1; color: white; }

.blinking-cursor::after {
    content: '_';
    animation: blink 1s step-end infinite;
}

@keyframes blink {
    from, to { color: transparent }
    50% { color: var(--matrix-emerald) }
}

.app-container { display: flex; flex: 1; overflow: hidden; }

/* Main layout blocks */
main {
    flex: 1;
    display: flex;
    flex-direction: column;
    overflow-y: auto;
    position: relative;
}

.auth-main {
    justify-content: center;
    align-items: center;
    padding: 40px 0;
    overflow: visible !important;
}

/* User dropdown improvements */
.user-dropdown-nav { margin-right: 20px; }
.nav-label { font-size: 14px; font-weight: bold; color: var(--matrix-emerald); cursor: pointer; display: flex; align-items: center; gap: 5px; }
.nav-chevron { font-size: 10px; }

.teacher-dropdown-content { padding: 10px 0; min-width: 250px; }
.no-border { border: none !important; }
.teacher-name-item { padding: 8px 16px; display: flex; align-items: center; gap: 10px; color: var(--arcane-text); font-size: 13px; }
.teacher-icon { color: var(--matrix-emerald); opacity: 0.7; }

.summon-section { padding: 15px 16px; border-top: 1px solid var(--border); margin-top: 5px; }
.summon-form-mini { display: flex; flex-direction: column; gap: 8px; }
.summon-label { font-size: 11px; color: var(--matrix-emerald); font-weight: bold; text-transform: uppercase; letter-spacing: 0.5px; }
.summon-input-group { display: flex; gap: 5px; }
.mini-input { padding: 6px 10px; font-size: 12px; width: 160px; margin: 0; background: rgba(0,0,0,0.2); border: 1px solid var(--border); color: var(--text-color); border-radius: 4px; }
.mini-input:focus { outline: none; border-color: var(--matrix-emerald); }
.btn-summon-mini { padding: 5px 10px; font-size: 11px; margin: 0; width: auto; height: 28px; line-height: 1; }

.summon-teacher-inline { margin-right: 20px; }
.summon-form-inline { display: flex; gap: 5px; }
.mini-input-inline { padding: 5px 10px; font-size: 12px; width: 150px; margin: 0; background: rgba(0,0,0,0.2); border: 1px solid var(--border); color: var(--text-color); border-radius: 4px; }
.btn-summon-inline { padding: 5px 10px; font-size: 12px; margin: 0; width: auto; }

.sidebar { 
    width: 280px; 
    border-right: 1px solid var(--border); 
    overflow-y: auto; 
    background: var(--surface); 
    backdrop-filter: blur(10px);
}

.main-content { 
    flex: 1; 
    overflow: hidden; 
    background: var(--bg-color); 
    position: relative; 
}

.glass-card {
    background: rgba(19, 38, 28, 0.7);
    backdrop-filter: blur(10px);
    border: 1px solid var(--border);
    border-radius: 8px;
    padding: 20px;
}

.accordion-header { 
    background: rgba(0, 255, 65, 0.1); 
    padding: 12px; 
    font-weight: bold; 
    border-bottom: 1px solid var(--border); 
    color: var(--matrix-emerald);
    font-family: 'Space Grotesk', sans-serif;
    cursor: pointer;
    transition: background 0.3s;
    user-select: none;
}

.accordion-header:hover {
    background: rgba(0, 255, 65, 0.2);
}

.accordion-header.locked {
    cursor: not-allowed;
    background: rgba(5, 10, 7, 0.4);
    border-color: rgba(0, 255, 65, 0.1);
    color: rgba(224, 242, 233, 0.4);
}

.accordion-header.locked:hover {
    background: rgba(5, 10, 7, 0.4);
}

.accordion-body {
    display: none;
}

.accordion-body.active {
    display: block;
}

.nav-item { 
    padding: 10px 15px; 
    cursor: pointer; 
    border-bottom: 1px solid var(--border); 
    font-size: 14px; 
    transition: background 0.3s;
}

.nav-item:hover { background: rgba(0, 255, 65, 0.05); }

.nav-item.selected { 
    background: rgba(0, 255, 65, 0.15); 
    border-left: 4px solid var(--matrix-emerald); 
    font-weight: bold; 
    color: var(--matrix-emerald);
}

.btn-primary { 
    background: transparent; 
    color: var(--matrix-emerald); 
    padding: 10px 20px; 
    border: 2px solid var(--matrix-emerald); 
    border-radius: 4px; 
    cursor: pointer; 
    font-family: 'Space Grotesk', sans-serif;
    font-weight: bold;
    text-transform: uppercase;
    transition: all 0.3s ease;
}

.btn-primary:hover {
    background: var(--matrix-emerald);
    color: var(--cyber-void);
    box-shadow: 0 0 15px var(--matrix-emerald);
}

code, pre, .terminal {
    font-family: 'JetBrains Mono', monospace;
}

.nav-link-yellow { 
    color: var(--python-yellow); 
    font-weight: bold; 
    text-decoration: none; 
    margin-right: 15px; 
    font-size: 18px; 
    transition: all 0.3s;
}

.nav-link-yellow:hover {
    text-shadow: 0 0 10px var(--python-yellow);
}

.theme-toggle {
    color: var(--matrix-emerald);
    cursor: pointer;
    font-size: 1.2rem;
    padding: 10px;
    transition: all 0.3s ease;
}

.theme-toggle:hover {
    text-shadow: 0 0 10px var(--matrix-emerald);
    transform: rotate(15deg);
}

.user-profile {
    display: flex;
    align-items: center;
    gap: 15px;
}

.avatar-circle {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    object-fit: cover;
    border: 1px solid var(--matrix-emerald);
}

.user-dropdown {
    position: relative;
    display: flex;
    align-items: center;
    gap: 10px;
    cursor: pointer;
    height: 100%;
}

.user-dropdown span {
    font-size: 14px;
    color: var(--arcane-text);
}

.user-dropdown:hover .dropdown-content {
    display: block;
}

/* Tooltip Styles */
[data-tooltip]::after {
    background: var(--surface);
    color: var(--matrix-emerald);
    border: 1px solid var(--border);
    backdrop-filter: blur(5px);
}

/* Dropdown Menu Styles */
.dropdown-content { 
    display: none;
    position: absolute;
    right: 0;
    top: 100%;
    min-width: 240px;
    z-index: 5000;
    background-color: var(--surface); 
    backdrop-filter: blur(10px);
    border: 1px solid var(--border);
    box-shadow: 0px 8px 16px 0px rgba(0, 255, 65, 0.2); 
    white-space: nowrap;
}

.dropdown-section {
    border-bottom: 1px solid var(--border);
    padding: 5px 0;
}

.dropdown-content a { 
    color: var(--arcane-text); 
    padding: 12px 16px;
    text-decoration: none;
    display: flex;
    align-items: center;
    gap: 10px;
}

.dropdown-content a:hover { 
    background-color: rgba(0, 255, 65, 0.1); 
    color: var(--matrix-emerald);
}

/* Header Alerts */
.header-alerts {
    flex: 1;
    display: flex;
    justify-content: center;
    gap: 15px;
    margin: 0 20px;
}

.header-alert {
    background: rgba(255, 212, 59, 0.1);
    border: 1px solid var(--python-yellow);
    color: var(--python-yellow);
    padding: 5px 15px;
    border-radius: 4px;
    font-size: 13px;
    display: flex;
    align-items: center;
    gap: 10px;
    backdrop-filter: blur(5px);
}

.btn-mini {
    background: var(--python-yellow);
    color: var(--cyber-void);
    padding: 2px 8px;
    border-radius: 3px;
    text-decoration: none;
    font-weight: bold;
    font-size: 11px;
}

.btn-mini-danger {
    border: 1px solid #dc3545;
    color: #dc3545;
    padding: 1px 7px;
    border-radius: 3px;
    text-decoration: none;
    font-size: 11px;
}

.btn-secondary {
    background: transparent;
    color: var(--python-yellow);
    padding: 10px 20px;
    border: 2px solid var(--python-yellow);
    border-radius: 4px;
    cursor: pointer;
    font-family: 'Space Grotesk', sans-serif;
    font-weight: bold;
    text-transform: uppercase;
    transition: all 0.3s ease;
}

.btn-secondary:hover:not(:disabled) {
    background: var(--python-yellow);
    color: var(--cyber-void);
    box-shadow: 0 0 15px var(--python-yellow);
}

.btn-secondary:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

/* Modal Styles */
.modal {
    display: none;
    position: fixed;
    z-index: 10000;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    overflow: auto;
    background-color: rgba(0,0,0,0.8);
    backdrop-filter: blur(5px);
}

.modal-content {
    background: var(--surface);
    margin: 5% auto;
    padding: 0;
    border-radius: 8px;
    border: 1px solid var(--border);
    width: 90%;
    max-width: 600px;
    position: relative;
    box-shadow: 0 0 30px rgba(0, 255, 65, 0.1);
    display: flex;
    flex-direction: column;
}

.modal-header {
    padding: 15px 20px;
    border-bottom: 1px solid var(--border);
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.modal-header h3 {
    margin: 0;
}

.modal-body {
    padding: 20px;
    overflow-y: auto;
}

.close-btn {
    color: var(--arcane-text);
    font-size: 24px;
    cursor: pointer;
    transition: color 0.2s;
}

.close-btn:hover {
    color: var(--matrix-emerald);
}

/* Chat Styles */
.chat-container {
    display: flex;
    flex-direction: column;
    gap: 10px;
    padding: 15px;
    background: rgba(0, 0, 0, 0.2);
    border-radius: 6px;
    max-height: 400px;
    overflow-y: auto;
    border: 1px solid var(--border);
}

.chat-message {
    padding: 10px 14px;
    border-radius: 12px;
    max-width: 85%;
    font-size: 14px;
    line-height: 1.5;
    position: relative;
}

.chat-message.student {
    background: rgba(0, 255, 65, 0.1);
    border: 1px solid var(--border);
    align-self: flex-start;
    border-bottom-left-radius: 2px;
}

.chat-message.teacher {
    background: rgba(255, 212, 59, 0.1);
    border: 1px solid rgba(255, 212, 59, 0.3);
    align-self: flex-end;
    border-bottom-right-radius: 2px;
    color: var(--python-yellow);
}

.chat-message .sender {
    font-weight: bold;
    font-size: 11px;
    margin-bottom: 4px;
    display: block;
    opacity: 0.8;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.chat-message .time {
    font-size: 10px;
    opacity: 0.6;
    display: block;
    margin-top: 6px;
    text-align: right;
}

.help-badge {
    background: #dc3545;
    color: white;
    border-radius: 10px;
    padding: 2px 8px;
    font-size: 10px;
    font-weight: bold;
    margin-left: 8px;
    box-shadow: 0 0 5px rgba(220, 53, 69, 0.5);
}

/* Assignments Modal specific */
#assignmentsList input[type="checkbox"] {
    appearance: none;
    -webkit-appearance: none;
    width: 18px;
    height: 18px;
    border: 1px solid var(--border);
    background: rgba(0, 255, 65, 0.05);
    border-radius: 4px;
    cursor: pointer;
    position: relative;
    transition: all 0.2s;
}

#assignmentsList input[type="checkbox"]:checked {
    background: var(--matrix-emerald);
    border-color: var(--matrix-emerald);
    box-shadow: 0 0 8px var(--matrix-emerald);
}

#assignmentsList input[type="checkbox"]:checked::after {
    content: '\f00c';
    font-family: 'Font Awesome 6 Free';
    font-weight: 900;
    font-size: 10px;
    color: var(--cyber-void);
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
}

#assignmentsList input[type="checkbox"]:disabled {
    opacity: 0.3;
    cursor: not-allowed;
}
/* --- Admin Dashboard --- */
.admin-container { padding: 30px; max-width: 1200px; margin: 0 auto; }

/* Test Cases UI */
.test-cases-list {
    display: flex;
    flex-direction: column;
    gap: 10px;
    margin-bottom: 10px;
}

.test-case-item {
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid var(--border);
    border-radius: 4px;
    padding: 10px;
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    align-items: flex-end;
}

.test-case-field {
    display: flex;
    flex-direction: column;
    gap: 5px;
    flex: 1;
    min-width: 120px;
}

.test-case-field label {
    font-size: 11px;
    color: var(--border);
    margin: 0;
}

.test-case-field input[type="text"] {
    background: #1e1e1e;
    border: 1px solid var(--border);
    color: var(--arcane-text);
    padding: 5px;
    font-family: monospace;
}

.test-case-hidden {
    display: flex;
    align-items: center;
    gap: 5px;
    margin-bottom: 8px;
    cursor: pointer;
    font-size: 12px;
}

.test-case-hidden input {
    width: auto !important;
}
.topic-card { margin-bottom: 25px; overflow: hidden; }
.topic-header { background: rgba(0, 255, 65, 0.1); padding: 15px 20px; border-bottom: 1px solid var(--border); display: flex; justify-content: space-between; align-items: center; cursor: move; }
.topic-body { padding: 10px 0; }
.item-row { display: flex; align-items: center; padding: 12px 20px; border-bottom: 1px solid var(--border); background: transparent; cursor: move; transition: all 0.3s; }
.item-row:last-child { border-bottom: none; }
.item-row:hover { background: rgba(0, 255, 65, 0.05); }
.item-info { flex: 1; display: flex; align-items: center; gap: 15px; }
.item-actions { display: flex; gap: 10px; }
.modal { display: none; position: fixed; z-index: 1000; left: 0; top: 0; width: 100%; height: 100%; background: rgba(5, 10, 7, 0.85); backdrop-filter: blur(8px); overflow-y: auto; }
.modal-content { background: var(--surface); margin: 2% auto; padding: 30px; border-radius: 8px; border: 1px solid var(--border); width: 95%; max-width: 1000px; box-shadow: 0 0 30px rgba(0, 255, 65, 0.2); }
/* Form Elements */
input[type="text"], 
input[type="email"], 
input[type="password"], 
input[type="url"],
input[type="number"],
select, 
textarea {
    width: 100%;
    padding: 12px;
    background: rgba(0, 255, 65, 0.05);
    border: 1px solid var(--border);
    border-radius: 4px;
    box-sizing: border-box;
    color: var(--arcane-text);
    font-family: 'Inter', sans-serif;
    font-size: 14px;
    margin-bottom: 15px;
}

select option {
    background: var(--surface);
    color: var(--arcane-text);
}

/* Searchable Dropdown Styles */
.searchable-dropdown {
    position: relative;
    width: 100%;
    margin-bottom: 15px;
}

.dropdown-search-input {
    width: 100%;
    padding: 12px;
    background: rgba(0, 255, 65, 0.05);
    border: 1px solid var(--border);
    border-radius: 4px;
    color: var(--arcane-text);
    font-family: 'Inter', sans-serif;
    font-size: 14px;
    box-sizing: border-box;
}

.dropdown-search-input:focus {
    outline: none;
    border-color: var(--matrix-emerald);
    background: rgba(0, 255, 65, 0.1);
}

.dropdown-list {
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: 0 0 4px 4px;
    max-height: 250px;
    overflow-y: auto;
    z-index: 1000;
    display: none;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.5);
}

.dropdown-item {
    padding: 10px 15px;
    cursor: pointer;
    font-size: 14px;
    color: var(--arcane-text);
    transition: all 0.2s;
}

.dropdown-item:hover {
    background: rgba(0, 255, 65, 0.1);
    color: var(--matrix-emerald);
}

.dropdown-item.selected {
    background: rgba(0, 255, 65, 0.2);
    color: var(--matrix-emerald);
    font-weight: bold;
}

.dropdown-item.new-option {
    border-top: 1px solid var(--border);
    color: var(--python-yellow);
}

input:focus, select:focus, textarea:focus {
    outline: none;
    border-color: var(--matrix-emerald);
    background: rgba(0, 255, 65, 0.1);
}

.form-group { margin-bottom: 20px; }
.form-group label { display: block; margin-bottom: 8px; font-weight: bold; color: var(--matrix-emerald); font-family: 'Space Grotesk', sans-serif; }
.form-group input, .form-group select, .form-group textarea { 
    margin-bottom: 0; /* Override general margin when in group */
}
.form-group input:focus, .form-group select:focus, .form-group textarea:focus {
    outline: none;
    border-color: var(--matrix-emerald);
}
.btn-sm { padding: 6px 10px; font-size: 11px; }
.visibility-badge { font-size: 10px; padding: 2px 6px; border-radius: 4px; background: rgba(224, 242, 233, 0.1); color: var(--arcane-text); border: 1px solid var(--border); }
.drag-over { border: 2px dashed var(--matrix-emerald); }

/* Fix for TinyMCE in modals */
.tox-tinymce-aux { z-index: 10001 !important; }

/* --- Teacher Dashboard --- */
.dashboard-container { padding: 30px; }
.stats-table { width: 100%; border-collapse: collapse; background: var(--surface); color: var(--arcane-text); border: 1px solid var(--border); }
.stats-table th, .stats-table td { border: 1px solid var(--border); padding: 12px; text-align: left; font-size: 13px; }
.stats-table th { background: rgba(0, 255, 65, 0.1); color: var(--matrix-emerald); position: sticky; top: 0; font-family: 'Space Grotesk', sans-serif; text-transform: uppercase; letter-spacing: 1px; }
.percentage-badge { padding: 4px 8px; border-radius: 4px; color: var(--cyber-void); font-weight: bold; font-size: 11px; display: inline-block; }
.percentage-badge.high { background: var(--matrix-emerald); box-shadow: 0 0 10px var(--matrix-emerald); }
.percentage-badge.mid { background: var(--python-yellow); box-shadow: 0 0 10px var(--python-yellow); }
.percentage-badge.low { background: #dc3545; color: white; }
.percentage-badge.none { background: rgba(224, 242, 233, 0.1); color: var(--arcane-text); border: 1px solid var(--border); }

.controls-section { display: flex; gap: 20px; margin-bottom: 30px; flex-wrap: wrap; }
.control-group { padding: 20px; flex: 1; min-width: 300px; }
.control-group h4 { margin: 0 0 15px 0; font-size: 16px; color: var(--matrix-emerald); font-family: 'Space Grotesk', sans-serif; }

.filter-chip { display: inline-block; padding: 6px 14px; border-radius: 20px; background: rgba(0, 255, 65, 0.05); border: 1px solid var(--border); margin: 4px; font-size: 12px; cursor: pointer; text-decoration: none; color: var(--arcane-text); transition: all 0.3s; }
.filter-chip.active { background: var(--matrix-emerald); color: var(--cyber-void); font-weight: bold; box-shadow: 0 0 10px var(--matrix-emerald); }
.filter-chip:hover:not(.active) { background: rgba(0, 255, 65, 0.15); border-color: var(--matrix-emerald); }

.alert-badge { background: #dc3545; color: white; padding: 2px 6px; border-radius: 10px; font-size: 10px; vertical-align: top; margin-left: 5px; }

.student-name { font-family: 'Space Grotesk', sans-serif; font-weight: bold; color: var(--matrix-emerald); cursor: pointer; text-decoration: underline dotted rgba(0, 255, 65, 0.3); transition: all 0.2s; }
.student-name:hover { color: var(--python-yellow); text-shadow: 0 0 8px var(--python-yellow); }
.student-email { font-size: 11px; opacity: 0.6; margin-top: 4px; }

/* Work Explorer Modal */
.work-modal { display: none; position: fixed; z-index: 10000; left: 0; top: 0; width: 100%; height: 100%; background: rgba(0, 0, 0, 0.85); backdrop-filter: blur(5px); }
.work-modal-content { background: var(--cyber-void); margin: 2% auto; width: 95%; max-width: 1200px; height: 90vh; border: 1px solid var(--border); border-radius: 8px; display: flex; flex-direction: column; position: relative; box-shadow: 0 0 30px rgba(0, 255, 65, 0.1); }
.work-modal-header { padding: 15px 25px; border-bottom: 1px solid var(--border); display: flex; justify-content: space-between; align-items: center; background: rgba(0, 255, 65, 0.05); }
.work-modal-body { flex: 1; display: flex; overflow: hidden; }
.work-sidebar { width: 300px; border-right: 1px solid var(--border); overflow-y: auto; background: rgba(0, 0, 0, 0.2); }
.work-main { flex: 1; display: flex; flex-direction: column; overflow: hidden; position: relative; }
.work-item-header { padding: 15px 25px; border-bottom: 1px solid var(--border); display: flex; justify-content: space-between; align-items: center; }
.work-editor-container { flex: 1; overflow: hidden; position: relative; }
.close-modal { color: var(--arcane-text); font-size: 24px; cursor: pointer; transition: color 0.2s; }
.close-modal:hover { color: var(--matrix-emerald); }

.work-topic { padding: 12px 20px; border-bottom: 1px solid var(--border); cursor: pointer; transition: all 0.2s; }
.work-topic:hover { background: rgba(0, 255, 65, 0.05); }
.work-topic.active { background: rgba(0, 255, 65, 0.1); border-left: 3px solid var(--matrix-emerald); }
.work-topic-title { font-weight: bold; font-size: 13px; color: var(--matrix-emerald); }
.work-topic-stats { font-size: 11px; opacity: 0.7; margin-top: 4px; }

.work-items-list { display: none; padding: 5px 0 10px 0; background: rgba(0, 0, 0, 0.1); }
.work-items-list.active { display: block; }
.work-item-link { padding: 8px 25px; font-size: 12px; cursor: pointer; transition: all 0.2s; display: flex; justify-content: space-between; align-items: center; }
.work-item-link:hover { color: var(--matrix-emerald); background: rgba(0, 255, 65, 0.05); }
.work-item-link.active { color: var(--python-yellow); font-weight: bold; background: rgba(0, 255, 65, 0.1); }
.work-item-score { font-size: 10px; opacity: 0.8; }

#work-editor { height: 100%; width: 100%; }
.work-placeholder { display: flex; flex-direction: column; align-items: center; justify-content: center; height: 100%; opacity: 0.5; text-align: center; padding: 40px; }
.work-placeholder i { font-size: 48px; margin-bottom: 20px; color: var(--matrix-emerald); }

/* --- Profile Page --- */
.profile-container { max-width: 700px; margin: 40px auto; padding: 20px; }
.profile-card { padding: 2.5rem; }
.profile-card h2 { margin-top: 0; border-bottom: 1px solid var(--border); padding-bottom: 15px; margin-bottom: 25px; }
.form-row { display: flex; gap: 20px; margin-bottom: 15px; }
.avatar-section { display: flex; align-items: center; gap: 25px; margin-bottom: 30px; background: rgba(0, 255, 65, 0.05); padding: 20px; border-radius: 8px; border: 1px solid var(--border); }
.current-avatar { width: 100px; height: 100px; border-radius: 50%; object-fit: cover; border: 3px solid var(--matrix-emerald); box-shadow: 0 0 15px rgba(0, 255, 65, 0.3); }
.back-link { display: inline-block; margin-bottom: 25px; color: var(--matrix-emerald); text-decoration: none; font-weight: bold; font-family: 'Space Grotesk', sans-serif; transition: all 0.3s; }
.back-link:hover { text-shadow: 0 0 8px var(--matrix-emerald); transform: translateX(-5px); }
.admin-box { background: rgba(255, 212, 59, 0.05); padding: 20px; border-radius: 8px; border: 1px solid rgba(255, 212, 59, 0.2); margin-bottom: 30px; }

/* --- Problem/Content View --- */
.view-container { display: none; height: 100%; width: 100%; flex-direction: column; overflow: hidden; }
.problem-view-body { padding: 25px; overflow-y: auto; flex: 1; display: flex; flex-direction: column; }
.problem-header { display: flex; justify-content: space-between; align-items: center; margin-bottom: 15px; flex-wrap: wrap; gap: 10px; }
.problem-title { margin: 0; }
.score-display { font-size: 16px; font-weight: bold; color: var(--arcane-text); white-space: nowrap; }
.problem-description { padding: 20px; border-left: 4px solid var(--matrix-emerald); margin-bottom: 20px; }
.editor-container { border: 1px solid var(--border); border-radius: 4px; overflow: hidden; height: 350px; min-height: 200px; }
.output-label { margin-top: 20px; font-weight: bold; font-size: 13px; color: var(--matrix-emerald); font-family: 'Space Grotesk', sans-serif; }
.output-pre { background: var(--surface); color: var(--matrix-emerald); padding:15px; border: 1px solid var(--border); border-radius:6px; font-family: 'JetBrains Mono', monospace; min-height: 100px; max-height: 300px; overflow-y: auto; margin-top: 5px; margin-bottom: 20px; }

/* --- Assignments Modal --- */
.assignment-topic-card { margin-bottom: 20px; padding: 15px; background: rgba(0, 255, 65, 0.05); border: 1px solid var(--border); border-radius: 4px; }
.assignment-topic-header { display: flex; justify-content: space-between; align-items: center; margin-bottom: 15px; border-bottom: 1px solid var(--border); padding-bottom: 10px; }
.assignment-item-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(250px, 1fr)); gap: 10px; }
.assignment-item-card { font-size: 12px; padding: 8px 12px; background: rgba(0, 0, 0, 0.2); border: 1px solid var(--border); border-radius: 4px; display: flex; justify-content: space-between; align-items: center; }
.assignment-item-title { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; margin-right: 10px; }
