:root {
  --primary: #4F46E5;
  --primary-glow: rgba(79, 70, 229, 0.4);
  --secondary: #10B981;
  
  --bg-dark: #09090b;
  --bg-panel: rgba(24, 24, 27, 0.7);
  --text-main: #f8fafc;
  --text-muted: #a1a1aa;
  --border-color: rgba(255, 255, 255, 0.08);
  --glass-bg: rgba(9, 9, 11, 0.65);
  
  --c-blue: #3b82f6;
  --c-amber: #f59e0b;
  --c-green: #10b981;
  --c-orange: #f97316;
  --c-purple: #a855f7;
  --c-red: #ef4444;
}

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

body {
  background: 
    radial-gradient(circle at 12% 18%, rgba(79, 70, 229, 0.08), transparent 28%),
    radial-gradient(circle at 88% 82%, rgba(56, 189, 248, 0.08), transparent 30%),
    linear-gradient(135deg, #eef2ff 0%, #f8fafc 50%, #f1f5f9 100%);
  background-attachment: fixed;
  color: #0f172a;
  min-height: 100vh;
  display: flex;
  overflow-x: hidden;
  transition: background-color 0.3s ease, color 0.3s ease;
}

body:not(.light-theme) {
  --bg-dark: #09090b;
  --bg-panel: rgba(24, 24, 27, 0.7);
  --text-main: #f8fafc;
  --text-muted: #a1a1aa;
  --border-color: rgba(255, 255, 255, 0.08);
  --glass-bg: rgba(9, 9, 11, 0.65);
  background: radial-gradient(circle at top right, #1e1b4b, #09090b);
  background-attachment: fixed;
  color: #f8fafc;
}

body.light-theme {
  --bg-dark: #f8fafc;
  --bg-panel: rgba(255, 255, 255, 0.95);
  --text-main: #0f172a;
  --text-muted: #64748b;
  --border-color: rgba(226, 232, 240, 0.85);
  --glass-bg: rgba(255, 255, 255, 0.85);
  background: 
    radial-gradient(circle at 12% 18%, rgba(79, 70, 229, 0.08), transparent 28%),
    radial-gradient(circle at 88% 82%, rgba(56, 189, 248, 0.08), transparent 30%),
    linear-gradient(135deg, #eef2ff 0%, #f8fafc 50%, #f1f5f9 100%);
  background-attachment: fixed;
  color: #0f172a;
}

body.light-theme .search-bar input,
body.light-theme .form-group input, 
body.light-theme .form-group textarea {
  color: #0f172a;
  background: rgba(0,0,0,0.03);
}

body.light-theme .nav-item:hover {
  background: rgba(0, 0, 0, 0.04);
  border: 1px solid rgba(0, 0, 0, 0.05);
}

body.light-theme .item-card {
  background: rgba(0, 0, 0, 0.02);
  border: 1px solid rgba(0, 0, 0, 0.06);
}

body.light-theme .item-card:hover {
  background: rgba(0, 0, 0, 0.04);
}


/* Sidebar */
.sidebar {
  width: 260px;
  background: var(--glass-bg);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  border-right: 1px solid var(--border-color);
  padding: 28px 24px;
  display: flex;
  flex-direction: column;
}

.brand {
  font-family: 'Outfit', sans-serif;
  font-size: 1.6rem;
  font-weight: 800;
  background: linear-gradient(135deg, #a78bfa, #38bdf8);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  margin-bottom: 48px;
  display: flex;
  align-items: center;
  gap: 12px;
}

.brand::before {
  content: 'T';
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 36px;
  height: 36px;
  border-radius: 10px;
  background: linear-gradient(135deg, var(--primary), #818cf8);
  color: white;
  font-size: 1.2rem;
  -webkit-text-fill-color: white;
  box-shadow: 0 4px 12px var(--primary-glow);
}

.nav-links {
  display: flex;
  flex-direction: column;
  gap: 12px;
  flex-grow: 1;
}

.nav-item {
  padding: 14px 18px;
  border-radius: 12px;
  color: var(--text-muted);
  text-decoration: none;
  font-weight: 500;
  font-size: 1.05rem;
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 14px;
  border: 1px solid transparent;
}

.nav-item .material-icons {
  font-size: 22px;
  transition: transform 0.3s ease;
}

.nav-item:hover {
  background: rgba(255, 255, 255, 0.04);
  color: var(--text-main);
  border: 1px solid rgba(255, 255, 255, 0.05);
}

.nav-item:hover .material-icons {
  transform: scale(1.1);
}

.nav-item.active {
  border-left: 4px solid var(--primary);
  border-radius: 4px 12px 12px 4px;
  background: linear-gradient(90deg, rgba(79, 70, 229, 0.15), transparent);
  color: var(--text-main);
}

.logout-btn {
  margin-top: auto;
  background: transparent;
  color: var(--text-muted);
}
.logout-btn:hover {
  color: #ef4444;
  background: rgba(239, 68, 68, 0.1);
  border-color: rgba(239, 68, 68, 0.2);
}

/* Main Content */
.main-content {
  flex-grow: 1;
  padding: 48px;
  display: flex;
  flex-direction: column;
  height: 100vh;
  overflow-y: auto;
  scroll-behavior: smooth;
}

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

.header h1 {
  font-family: 'Outfit', sans-serif;
  font-size: 2.2rem;
  font-weight: 700;
  letter-spacing: -0.5px;
}

.user-profile {
  display: flex;
  align-items: center;
  gap: 16px;
  padding: 8px 16px;
  background: rgba(255,255,255,0.03);
  border: 1px solid var(--border-color);
  border-radius: 100px;
}

.user-name {
  font-weight: 600;
  font-size: 0.95rem;
}

.user-role {
  font-size: 0.8rem;
  color: var(--text-muted);
}

.avatar {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--primary), var(--c-purple));
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.1rem;
  font-weight: bold;
}

/* Tab Panels */
.tab-panel {
  display: none;
  animation: fadeUp 0.5s cubic-bezier(0.16, 1, 0.3, 1) forwards;
}

.tab-panel.active {
  display: block;
}

@keyframes fadeUp {
  from { opacity: 0; transform: translateY(15px); }
  to { opacity: 1; transform: translateY(0); }
}

/* Search Bar */
.search-bar {
  display: flex;
  align-items: center;
  background: rgba(255,255,255,0.05);
  border: 1px solid var(--border-color);
  border-radius: 16px;
  padding: 0 16px;
  height: 54px;
  margin-bottom: 32px;
  transition: all 0.3s ease;
}

.search-bar:focus-within {
  border-color: var(--primary);
  box-shadow: 0 0 0 2px rgba(79, 70, 229, 0.2);
  background: rgba(255,255,255,0.08);
}

.search-bar .material-icons {
  color: var(--text-muted);
}

.search-bar input {
  flex-grow: 1;
  background: transparent;
  border: none;
  color: white;
  padding: 0 16px;
  font-size: 1rem;
  font-family: 'Inter', sans-serif;
  outline: none;
}

.search-bar input::placeholder {
  color: var(--text-muted);
}

.icon-btn {
  background: none;
  border: none;
  color: var(--text-muted);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
}
.icon-btn:hover { color: white; }
.hidden { display: none !important; }

/* Dashboard Stat Cards */
.stats-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 24px;
  margin-bottom: 32px;
}

.stat-card {
  background: var(--bg-panel);
  backdrop-filter: blur(12px);
  border: 1px solid var(--border-color);
  padding: 28px;
  border-radius: 20px;
  box-shadow: 0 4px 20px rgba(0,0,0,0.15);
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  position: relative;
  overflow: hidden;
}

.stat-card:hover {
  transform: translateY(-5px) scale(1.01);
  box-shadow: 0 12px 30px rgba(0,0,0,0.3);
}

.stat-card::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 5px;
}

.color-blue::before { background: var(--c-blue); }
.color-amber::before { background: var(--c-amber); }
.color-green::before { background: var(--c-green); }
.color-orange::before { background: var(--c-orange); }
.color-purple::before { background: var(--c-purple); }

.stat-icon {
  font-size: 32px;
  margin-bottom: 16px;
  display: inline-block;
}

.color-blue .stat-icon { color: var(--c-blue); }
.color-amber .stat-icon { color: var(--c-amber); }
.color-green .stat-icon { color: var(--c-green); }
.color-orange .stat-icon { color: var(--c-orange); }
.color-purple .stat-icon { color: var(--c-purple); }

.stat-value {
  font-size: 2.5rem;
  font-weight: 700;
  font-family: 'Outfit', sans-serif;
  letter-spacing: -1px;
  margin-bottom: 8px;
}

.color-blue .stat-value { text-shadow: 0 0 20px rgba(59, 130, 246, 0.3); }
.color-amber .stat-value { text-shadow: 0 0 20px rgba(245, 158, 11, 0.3); }
.color-green .stat-value { text-shadow: 0 0 20px rgba(16, 185, 129, 0.3); }

.stat-title {
  color: var(--text-muted);
  font-size: 0.95rem;
  font-weight: 600;
  letter-spacing: 0.5px;
}

/* Panels */
.panel {
  background: var(--bg-panel);
  border: 1px solid var(--border-color);
  border-radius: 20px;
  padding: 32px;
  margin-bottom: 32px;
  backdrop-filter: blur(12px);
}

.transparent-panel {
  background: transparent;
  border: none;
  padding: 0;
  backdrop-filter: none;
}

.section-heading {
  font-family: 'Outfit', sans-serif;
  font-size: 1.6rem;
  font-weight: 700;
  margin-bottom: 24px;
}

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

.panel-header .section-heading {
  margin-bottom: 0;
}

/* List Items */
.item-list {
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.item-card {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 20px 24px;
  background: rgba(255, 255, 255, 0.02);
  border: 1px solid rgba(255, 255, 255, 0.04);
  border-radius: 16px;
  transition: all 0.2s ease;
}

.item-card:hover {
  background: rgba(255, 255, 255, 0.06);
  border-color: rgba(255, 255, 255, 0.1);
  transform: translateX(4px);
}

.student-info {
  display: flex;
  align-items: center;
  gap: 20px;
}

.student-avatar {
  width: 48px;
  height: 48px;
  border-radius: 12px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: bold;
  font-size: 1.2rem;
}
.student-avatar.purple { background: rgba(168, 85, 247, 0.2); color: #c084fc; border: 1px solid rgba(168, 85, 247, 0.3); }
.student-avatar.blue { background: rgba(59, 130, 246, 0.2); color: #60a5fa; border: 1px solid rgba(59, 130, 246, 0.3); }
.student-avatar.green { background: rgba(16, 185, 129, 0.2); color: #34d399; border: 1px solid rgba(16, 185, 129, 0.3); }

.item-title {
  font-size: 1.15rem;
  font-weight: 600;
  margin-bottom: 6px;
}

.item-meta {
  font-size: 0.9rem;
  color: var(--text-muted);
}

.loading-text {
  padding: 20px 0;
  text-align: center;
  animation: pulse 1.5s infinite;
}
@keyframes pulse {
  0%, 100% { opacity: 0.5; }
  50% { opacity: 1; }
}

/* Badges & Progress */
.badge {
  padding: 6px 12px;
  border-radius: 8px;
  font-weight: 700;
  font-size: 0.95rem;
}
.badge-green { background: rgba(16, 185, 129, 0.15); color: #10b981; border: 1px solid rgba(16, 185, 129, 0.3); }
.badge-orange { background: rgba(245, 158, 11, 0.15); color: #f59e0b; border: 1px solid rgba(245, 158, 11, 0.3); }
.badge-red { background: rgba(239, 68, 68, 0.15); color: #ef4444; border: 1px solid rgba(239, 68, 68, 0.3); }

.progress-container {
  display: flex;
  align-items: center;
  gap: 16px;
  min-width: 150px;
}
.progress-bar {
  flex-grow: 1;
  height: 8px;
  background: rgba(255,255,255,0.1);
  border-radius: 4px;
  overflow: hidden;
}
.progress-fill {
  height: 100%;
  border-radius: 4px;
}
.progress-text {
  font-weight: 700;
  font-size: 0.95rem;
  min-width: 40px;
  text-align: right;
}

/* Buttons */
.btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 10px 20px;
  border-radius: 10px;
  font-weight: 600;
  font-size: 0.95rem;
  cursor: pointer;
  transition: all 0.2s;
  border: none;
}

.btn-primary {
  background: var(--primary);
  color: white;
  box-shadow: 0 4px 14px var(--primary-glow);
}
.btn-primary:hover {
  background: #6366f1;
  box-shadow: 0 6px 20px rgba(79, 70, 229, 0.6);
  transform: translateY(-1px);
}

.btn-danger {
  background: rgba(239, 68, 68, 0.15);
  color: #ef4444;
  border: 1px solid rgba(239, 68, 68, 0.3);
}
.btn-danger:hover {
  background: rgba(239, 68, 68, 0.25);
  color: #f87171;
}

.btn-text {
  background: transparent;
  color: var(--text-muted);
}
.btn-text:hover { color: white; background: rgba(255,255,255,0.05); }

.actions-row {
  display: flex;
  gap: 12px;
}

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

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

.modal {
  background: var(--bg-dark);
  border: 1px solid var(--border-color);
  border-radius: 20px;
  padding: 32px;
  width: 100%;
  max-width: 500px;
  transform: scale(0.95);
  transition: transform 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275);
  box-shadow: 0 20px 40px rgba(0,0,0,0.4);
}

.modal-overlay.active .modal {
  transform: scale(1);
}

.modal h3 {
  font-family: 'Outfit', sans-serif;
  font-size: 1.5rem;
  margin-bottom: 24px;
}

.form-group {
  margin-bottom: 20px;
}
.form-group label {
  display: block;
  font-size: 0.9rem;
  color: var(--text-muted);
  margin-bottom: 8px;
  font-weight: 500;
}

.form-group input, .form-group textarea {
  width: 100%;
  background: rgba(255,255,255,0.05);
  border: 1px solid var(--border-color);
  border-radius: 10px;
  padding: 12px 16px;
  color: white;
  font-size: 1rem;
  transition: all 0.2s;
}

.form-group input:focus, .form-group textarea:focus {
  outline: none;
  border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(79, 70, 229, 0.2);
}

.modal-actions {
  display: flex;
  justify-content: flex-end;
  gap: 12px;
  margin-top: 32px;
}

.hidden { display: none !important; }

/* ==========================================================================
   ENHANCED TEACHER PORTAL LOGIN INTERFACE
   ========================================================================== */

.login-container { 
  display: flex; 
  justify-content: center; 
  align-items: center; 
  min-height: 100vh; 
  width: 100%; 
  padding: 32px 24px;
  background: transparent;
  box-sizing: border-box;
}

.teacher-login-view {
  width: min(1520px, calc(100% - 48px));
  max-width: 1520px;
  min-height: calc(100vh - 64px);
  margin: auto;
  display: grid;
  grid-template-columns: minmax(0, 1.35fr) minmax(420px, 490px);
  gap: 48px;
  align-items: center;
  border-radius: 32px;
  padding: 56px 60px;
  background: rgba(255, 255, 255, 0.96);
  box-shadow: 0 30px 70px -15px rgba(15, 23, 42, 0.12), 0 0 0 1px rgba(226, 232, 240, 0.85);
  backdrop-filter: blur(20px);
  box-sizing: border-box;
}

body:not(.light-theme) .teacher-login-view {
  background: rgba(24, 24, 27, 0.92);
  box-shadow: 0 30px 70px -15px rgba(0, 0, 0, 0.6), 0 0 0 1px rgba(255, 255, 255, 0.1);
}

.teacher-login-view .brand-strip {
  min-height: 560px;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  gap: 36px;
  padding: 54px 48px;
  border-radius: 26px;
  border: 1px solid rgba(226, 232, 240, 0.85);
  background: 
    radial-gradient(circle at 10% 12%, rgba(99, 102, 241, 0.09), transparent 45%),
    radial-gradient(circle at 90% 88%, rgba(56, 189, 248, 0.08), transparent 45%),
    linear-gradient(135deg, #f8fafc 0%, #f1f5f9 100%);
  position: relative;
  overflow: hidden;
  box-sizing: border-box;
}

body:not(.light-theme) .teacher-login-view .brand-strip {
  border-color: rgba(255, 255, 255, 0.08);
  background: 
    radial-gradient(circle at 10% 12%, rgba(99, 102, 241, 0.15), transparent 45%),
    linear-gradient(135deg, rgba(24, 24, 27, 0.8) 0%, rgba(39, 39, 42, 0.8) 100%);
}

.teacher-login-view .brand-strip::before {
  content: '';
  position: absolute;
  top: -40%;
  right: -25%;
  width: 360px;
  height: 360px;
  background: radial-gradient(circle, rgba(99, 102, 241, 0.12), transparent 70%);
  border-radius: 50%;
  pointer-events: none;
}

.teacher-login-view .brand-strip-content {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 10px;
}

.teacher-login-view .brand-logo {
  height: 92px;
  width: auto;
  object-fit: contain;
  margin-bottom: 20px;
  filter: drop-shadow(0 4px 12px rgba(0, 0, 0, 0.06));
}

.teacher-login-view .brand-badge {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 6px 14px;
  background: rgba(79, 70, 229, 0.08);
  border: 1px solid rgba(79, 70, 229, 0.18);
  border-radius: 999px;
  font-size: 12px;
  font-weight: 750;
  color: #4338ca;
  letter-spacing: 0.4px;
  text-transform: uppercase;
  margin-bottom: 10px;
  width: fit-content;
}

body:not(.light-theme) .teacher-login-view .brand-badge {
  background: rgba(99, 102, 241, 0.15);
  border-color: rgba(99, 102, 241, 0.3);
  color: #a5b4fc;
}

.pulse-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: #10b981;
  box-shadow: 0 0 0 0 rgba(16, 185, 129, 0.7);
  animation: pulse-green 2s infinite;
}

@keyframes pulse-green {
  0% {
    transform: scale(0.95);
    box-shadow: 0 0 0 0 rgba(16, 185, 129, 0.7);
  }
  70% {
    transform: scale(1);
    box-shadow: 0 0 0 6px rgba(16, 185, 129, 0);
  }
  100% {
    transform: scale(0.95);
    box-shadow: 0 0 0 0 rgba(16, 185, 129, 0);
  }
}

.teacher-login-view .brand-strip .eyebrow {
  color: #4f46e5;
  font-size: 13px;
  font-weight: 800;
  letter-spacing: 1.2px;
  text-transform: uppercase;
  margin: 0;
}

.teacher-login-view .brand-strip h1 {
  font-size: clamp(30px, 3.4vw, 42px);
  font-weight: 800;
  color: #0f172a;
  line-height: 1.2;
  letter-spacing: -0.5px;
  margin: 6px 0 12px;
}

body:not(.light-theme) .teacher-login-view .brand-strip h1 {
  color: #f8fafc;
}

.teacher-login-view .brand-desc {
  font-size: 15.5px;
  line-height: 1.65;
  color: #475569;
  margin: 0;
  max-width: 540px;
}

body:not(.light-theme) .teacher-login-view .brand-desc {
  color: #a1a1aa;
}

.teacher-login-view .brand-features {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  padding-top: 24px;
  border-top: 1px solid rgba(226, 232, 240, 0.85);
}

body:not(.light-theme) .teacher-login-view .brand-features {
  border-top-color: rgba(255, 255, 255, 0.08);
}

.teacher-login-view .brand-feature-item {
  display: flex;
  align-items: center;
  gap: 9px;
  padding: 10px 16px;
  background: #ffffff;
  border: 1px solid #e2e8f0;
  border-radius: 12px;
  font-size: 13.5px;
  font-weight: 650;
  color: #334155;
  box-shadow: 0 2px 5px rgba(0, 0, 0, 0.02);
}

body:not(.light-theme) .teacher-login-view .brand-feature-item {
  background: rgba(255, 255, 255, 0.05);
  border-color: rgba(255, 255, 255, 0.08);
  color: #e4e4e7;
}

.teacher-login-view .brand-feature-item svg {
  color: #4f46e5;
  flex-shrink: 0;
}

/* --- THE SIGN-IN BOX (CARD) --- */
.teacher-login-view .login-panel {
  display: flex;
  flex-direction: column;
  gap: 18px;
  padding: 42px 38px;
  background: #ffffff;
  border: 1.5px solid #e2e8f0;
  border-radius: 26px;
  box-shadow: 0 22px 50px -12px rgba(15, 23, 42, 0.12), 0 0 0 1px rgba(226, 232, 240, 0.6);
  min-width: 0;
  position: relative;
  box-sizing: border-box;
}

body:not(.light-theme) .teacher-login-view .login-panel {
  background: rgba(24, 24, 27, 0.95);
  border-color: rgba(255, 255, 255, 0.08);
  box-shadow: 0 22px 50px -12px rgba(0, 0, 0, 0.5);
}

.teacher-login-view .login-panel-header {
  display: flex;
  flex-direction: column;
  gap: 5px;
  margin-bottom: 4px;
}

.teacher-login-view .login-badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 5px 12px;
  border-radius: 7px;
  background: #eef2ff;
  border: 1px solid #e0e7ff;
  color: #4f46e5;
  font-size: 11.5px;
  font-weight: 750;
  letter-spacing: 0.5px;
  text-transform: uppercase;
  width: fit-content;
  margin-bottom: 4px;
}

body:not(.light-theme) .teacher-login-view .login-badge {
  background: rgba(99, 102, 241, 0.15);
  border-color: rgba(99, 102, 241, 0.3);
  color: #a5b4fc;
}

.teacher-login-view .login-panel-title {
  margin: 0;
  font-size: 26px;
  font-weight: 800;
  color: #0f172a;
  letter-spacing: -0.4px;
}

body:not(.light-theme) .teacher-login-view .login-panel-title {
  color: #f8fafc;
}

.teacher-login-view .login-panel-desc {
  margin: 0;
  font-size: 14px;
  color: #64748b;
  line-height: 1.45;
}

body:not(.light-theme) .teacher-login-view .login-panel-desc {
  color: #a1a1aa;
}

/* --- FORM FIELDS --- */
.teacher-login-view .form-group {
  display: flex;
  flex-direction: column;
  gap: 7px;
  margin-bottom: 0;
}

.teacher-login-view .form-label {
  display: flex;
  align-items: center;
  gap: 7px;
  font-size: 13.5px;
  font-weight: 650;
  color: #334155;
  margin-bottom: 0;
}

body:not(.light-theme) .teacher-login-view .form-label {
  color: #e4e4e7;
}

.teacher-login-view .form-label svg {
  color: #64748b;
  flex-shrink: 0;
}

.teacher-login-view .input-container {
  position: relative;
  display: flex;
  align-items: center;
  width: 100%;
}

.teacher-login-view .input-container input {
  width: 100%;
  height: 50px;
  min-height: 50px;
  padding: 0 16px;
  font-size: 15px;
  font-family: inherit;
  color: #0f172a;
  background: #f8fafc;
  border: 1.5px solid #cbd5e1;
  border-radius: 13px;
  outline: none;
  transition: all 160ms ease;
  box-sizing: border-box;
}

body:not(.light-theme) .teacher-login-view .input-container input {
  color: #f8fafc;
  background: rgba(255, 255, 255, 0.05);
  border-color: rgba(255, 255, 255, 0.12);
}

.teacher-login-view .input-container input::placeholder {
  color: #94a3b8;
  font-size: 14px;
}

.teacher-login-view .input-container input:hover {
  border-color: #94a3b8;
  background: #ffffff;
}

body:not(.light-theme) .teacher-login-view .input-container input:hover {
  border-color: rgba(255, 255, 255, 0.25);
  background: rgba(255, 255, 255, 0.08);
}

.teacher-login-view .input-container input:focus {
  background: #ffffff;
  border-color: #4f46e5;
  box-shadow: 0 0 0 3.5px rgba(79, 70, 229, 0.15);
}

body:not(.light-theme) .teacher-login-view .input-container input:focus {
  background: rgba(255, 255, 255, 0.08);
  border-color: #6366f1;
  box-shadow: 0 0 0 3.5px rgba(99, 102, 241, 0.25);
}

.teacher-login-view .input-container.has-action input {
  padding-right: 48px;
}

.teacher-login-view .btn-toggle-password {
  position: absolute;
  right: 8px;
  top: 50%;
  transform: translateY(-50%);
  width: 36px;
  height: 36px;
  min-height: 36px;
  padding: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  background: transparent;
  border: none;
  border-radius: 9px;
  color: #64748b;
  cursor: pointer;
  transition: color 150ms ease, background-color 150ms ease;
}

.teacher-login-view .btn-toggle-password:hover {
  color: #0f172a;
  background: #f1f5f9;
}

body:not(.light-theme) .teacher-login-view .btn-toggle-password:hover {
  color: #ffffff;
  background: rgba(255, 255, 255, 0.1);
}

.teacher-login-view .btn-toggle-password svg {
  display: block;
}

/* --- SIGN IN BUTTON --- */
.teacher-login-view .btn-signin {
  height: 50px;
  min-height: 50px;
  width: 100%;
  margin-top: 4px;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  background: linear-gradient(135deg, #4f46e5 0%, #3730a3 100%);
  color: #ffffff;
  border: none;
  border-radius: 13px;
  font-size: 15.5px;
  font-weight: 750;
  letter-spacing: 0.2px;
  cursor: pointer;
  box-shadow: 0 4px 16px rgba(79, 70, 229, 0.35);
  transition: all 180ms cubic-bezier(0.16, 1, 0.3, 1);
}

.teacher-login-view .btn-signin:hover {
  background: linear-gradient(135deg, #4338ca 0%, #312e81 100%);
  box-shadow: 0 6px 22px rgba(79, 70, 229, 0.45);
  transform: translateY(-1.5px);
}

.teacher-login-view .btn-signin:active {
  transform: translateY(0.5px);
  box-shadow: 0 2px 8px rgba(79, 70, 229, 0.25);
}

.teacher-login-view .btn-signin svg {
  transition: transform 180ms ease;
}

.teacher-login-view .btn-signin:hover svg {
  transform: translateX(3px);
}

/* --- DIVIDER --- */
.teacher-login-view .login-divider {
  display: flex;
  align-items: center;
  text-align: center;
  color: #94a3b8;
  font-size: 11.5px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.8px;
  margin: 3px 0;
}

.teacher-login-view .login-divider::before,
.teacher-login-view .login-divider::after {
  content: '';
  flex: 1;
  border-bottom: 1px solid #e2e8f0;
}

body:not(.light-theme) .teacher-login-view .login-divider::before,
body:not(.light-theme) .teacher-login-view .login-divider::after {
  border-bottom-color: rgba(255, 255, 255, 0.1);
}

.teacher-login-view .login-divider span {
  padding: 0 12px;
}

/* --- SWITCH PORTAL BUTTON (REDIRECT TO ADMIN) --- */
.btn-portal-switch {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 13px 16px;
  border-radius: 15px;
  border: 1.5px solid #e2e8f0;
  background: #f8fafc;
  color: #0f172a;
  text-decoration: none;
  transition: all 200ms cubic-bezier(0.16, 1, 0.3, 1);
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.03);
}

body:not(.light-theme) .btn-portal-switch {
  background: rgba(255, 255, 255, 0.03);
  border-color: rgba(255, 255, 255, 0.1);
  color: #f8fafc;
}

.btn-portal-switch:hover {
  background: #f1f5f9;
  border-color: #3b82f6;
  box-shadow: 0 6px 18px rgba(59, 130, 246, 0.12);
  transform: translateY(-1.5px);
}

body:not(.light-theme) .btn-portal-switch:hover {
  background: rgba(255, 255, 255, 0.08);
  border-color: #60a5fa;
}

.portal-switch-left {
  display: flex;
  align-items: center;
  gap: 13px;
  min-width: 0;
}

.portal-switch-icon-wrapper {
  width: 42px;
  height: 42px;
  border-radius: 11px;
  background: #dbeafe;
  color: #1d4ed8;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  transition: all 180ms ease;
}

body:not(.light-theme) .portal-switch-icon-wrapper {
  background: rgba(59, 130, 246, 0.2);
  color: #93c5fd;
}

.btn-portal-switch:hover .portal-switch-icon-wrapper {
  background: #2563eb;
  color: #ffffff;
  transform: scale(1.04);
}

.portal-switch-details {
  display: flex;
  flex-direction: column;
  text-align: left;
  line-height: 1.25;
}

.portal-switch-title {
  font-size: 14px;
  font-weight: 750;
  color: #0f172a;
}

body:not(.light-theme) .portal-switch-title {
  color: #f8fafc;
}

.portal-switch-sub {
  font-size: 11.5px;
  color: #64748b;
  margin-top: 2px;
}

body:not(.light-theme) .portal-switch-sub {
  color: #a1a1aa;
}

.portal-switch-arrow-wrapper {
  color: #2563eb;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 4px;
  transition: transform 180ms ease;
  flex-shrink: 0;
}

body:not(.light-theme) .portal-switch-arrow-wrapper {
  color: #60a5fa;
}

.btn-portal-switch:hover .portal-switch-arrow-wrapper {
  transform: translateX(4px);
}

/* --- MESSAGE STYLING --- */
.teacher-login-view .login-message {
  margin: 0;
  font-size: 13px;
  min-height: 0;
  text-align: center;
  font-weight: 600;
  transition: all 150ms ease;
}

.teacher-login-view .login-message:empty {
  display: none;
}

.teacher-login-view .login-message.error,
.teacher-login-view .login-message:not(:empty) {
  padding: 10px 14px;
  border-radius: 10px;
  background: #fef2f2;
  border: 1px solid #fee2e2;
  color: #b91c1c;
  line-height: 1.4;
}

body:not(.light-theme) .teacher-login-view .login-message.error,
body:not(.light-theme) .teacher-login-view .login-message:not(:empty) {
  background: rgba(239, 68, 68, 0.15);
  border-color: rgba(239, 68, 68, 0.3);
  color: #f87171;
}

@media (max-width: 1100px) {
  .teacher-login-view {
    grid-template-columns: 1fr;
    padding: 36px 28px;
    gap: 32px;
    margin: 20px auto;
    width: calc(100% - 40px);
  }

  .teacher-login-view .brand-strip {
    min-height: auto;
    padding: 36px 30px;
  }

  .teacher-login-view .login-panel {
    padding: 34px 28px;
  }
}

@media (max-width: 640px) {
  .teacher-login-view {
    padding: 24px 18px;
    margin: 12px auto;
    width: calc(100% - 24px);
  }

  .teacher-login-view .brand-strip {
    padding: 26px 20px;
  }

  .teacher-login-view .login-panel {
    padding: 26px 18px;
  }
}

/* Toggle Switch */
.switch {
  position: relative;
  display: inline-block;
  width: 50px;
  height: 28px;
}

.switch input {
  opacity: 0;
  width: 0;
  height: 0;
}

.slider {
  position: absolute;
  cursor: pointer;
  top: 0; left: 0; right: 0; bottom: 0;
  background-color: rgba(255,255,255,0.2);
  transition: .4s;
}

body.light-theme .slider {
  background-color: rgba(0,0,0,0.2);
}

.slider:before {
  position: absolute;
  content: "";
  height: 20px;
  width: 20px;
  left: 4px;
  bottom: 4px;
  background-color: white;
  transition: .4s;
}

input:checked + .slider {
  background-color: var(--primary);
}

input:checked + .slider:before {
  transform: translateX(22px);
}

.slider.round {
  border-radius: 34px;
}

.slider.round:before {
  border-radius: 50%;
}

/* REDDIT-STYLE FORUMS */
body.forum-page {
  display: block;
  min-height: 100vh;
  height: auto;
  overflow-y: auto;
  overflow-x: hidden;
}

body.forum-page .main-content.forum-full-screen {
  height: auto;
  min-height: 100vh;
  max-width: 920px;
  margin: 0 auto;
  width: 100%;
  box-sizing: border-box;
  padding: 28px 20px 80px;
  overflow-y: visible;
}

.reddit-thread-container {
  display: flex;
  background: var(--bg-panel);
  border: 1px solid var(--border-color);
  border-radius: 12px;
  overflow: visible;
  margin-bottom: 24px;
  width: 100%;
  box-sizing: border-box;
}

.vote-column {
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: 14px 8px;
  background: rgba(255, 255, 255, 0.02);
  border-right: 1px solid var(--border-color);
  min-width: 52px;
  flex-shrink: 0;
}

.vote-btn {
  background: transparent;
  border: none;
  color: var(--text-muted);
  cursor: pointer;
  padding: 4px;
  border-radius: 4px;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.2s ease;
}

.vote-btn:hover {
  background: rgba(255, 255, 255, 0.08);
  color: var(--text-main);
}

.vote-btn.active {
  color: var(--primary);
}

.vote-count {
  font-weight: 700;
  font-size: 0.95rem;
  margin: 4px 0;
}

.post-content {
  padding: 20px 24px;
  flex: 1 1 0%;
  min-width: 0; /* CRITICAL: allows flex child to shrink properly and prevents clipping */
  overflow-wrap: break-word;
  word-break: break-word;
}

.post-meta {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 0.85rem;
  color: var(--text-muted);
  margin-bottom: 8px;
  flex-wrap: wrap;
}

.author-name {
  font-weight: 600;
  color: var(--text-main);
}

.post-title {
  font-size: 1.4rem;
  font-weight: 700;
  margin-bottom: 12px;
  line-height: 1.4;
  word-break: break-word;
  overflow-wrap: break-word;
}

.post-body {
  font-size: 1rem;
  line-height: 1.65;
  margin-bottom: 16px;
  white-space: pre-wrap;
  word-break: break-word;
  overflow-wrap: break-word;
}

.post-actions {
  display: flex;
  gap: 8px;
  margin-top: 8px;
}

.btn-small {
  padding: 4px 8px;
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--text-muted);
  border-radius: 4px;
}

.btn-small:hover {
  background: rgba(255, 255, 255, 0.05);
  color: var(--text-main);
}

.answer-card {
  display: flex;
  background: var(--bg-panel);
  border: 1px solid var(--border-color);
  border-radius: 10px;
  overflow: visible;
  width: 100%;
  box-sizing: border-box;
  margin-bottom: 12px;
}

.answer-content {
  padding: 16px 20px;
  flex: 1 1 0%;
  min-width: 0; /* CRITICAL: prevents flex child overflow */
  overflow-wrap: break-word;
  word-break: break-word;
}

.answer-body {
  font-size: 0.95rem;
  line-height: 1.6;
  white-space: pre-wrap;
  word-break: break-word;
  overflow-wrap: break-word;
}

/* KaTeX Formula Display & Responsiveness */
.katex-display {
  overflow-x: auto;
  overflow-y: hidden;
  max-width: 100%;
  -webkit-overflow-scrolling: touch;
  padding: 8px 0;
  margin: 12px 0;
}

.katex {
  font-size: 1.05em;
  max-width: 100%;
}

/* Light Theme Overrides for Forums */
body.light-theme .reddit-thread-container,
body.light-theme .answer-card,
body.light-theme .reply-box-container {
  background: #ffffff;
  border-color: rgba(226, 232, 240, 0.9);
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.04);
}

body.light-theme .vote-column {
  background: rgba(248, 250, 252, 0.9);
  border-color: rgba(226, 232, 240, 0.9);
}

body.light-theme .vote-btn:hover {
  background: rgba(0, 0, 0, 0.05);
  color: var(--text-main);
}

/* Mobile & Small Screens Responsiveness */
@media (max-width: 640px) {
  body.forum-page .main-content.forum-full-screen {
    padding: 16px 12px 64px !important;
  }
  .reddit-thread-container {
    border-radius: 8px;
    margin-bottom: 16px;
  }
  .vote-column {
    min-width: 40px;
    padding: 8px 4px;
  }
  .vote-btn .material-icons {
    font-size: 20px;
  }
  .vote-count {
    font-size: 0.85rem;
  }
  .post-content {
    padding: 14px 12px;
  }
  .post-title {
    font-size: 1.15rem;
    margin-bottom: 8px;
  }
  .post-body {
    font-size: 0.92rem;
    margin-bottom: 12px;
  }
  .post-meta {
    gap: 4px 6px;
    font-size: 0.78rem;
  }
  .answer-card {
    border-radius: 8px;
  }
  .answer-content {
    padding: 12px 10px;
  }
  .answer-body {
    font-size: 0.88rem;
  }
  .reply-box-container {
    padding: 14px 12px;
    margin-bottom: 24px !important;
  }
}

/* ANIMATIONS */
@keyframes votePop {
  0% { transform: scale(1); }
  50% { transform: scale(1.4); color: var(--primary); }
  100% { transform: scale(1); }
}

.vote-animate {
  animation: votePop 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}