/* OMANG Premium Styling System */

:root {
  color-scheme: dark;
  --bg-app: #000000;
  --bg-sidebar: #050505;
  --bg-card: #080808;
  --bg-input: #121212;
  --border-color: #1a1a1a;
  --border-focus: #333333;

  --text-primary: #f3f4f6;
  --text-secondary: #9ca3af;
  --text-muted: #6b7280;

  --accent-gradient: linear-gradient(135deg, #6366f1, #3b82f6);
  --accent-color: #5850ec;

  --emerald: #10b981;
  --emerald-alpha: rgba(16, 185, 129, 0.15);
  --rose: #ef4444;

  --font-display: 'Outfit', 'Inter', system-ui, sans-serif;
  --font-body: 'Plus Jakarta Sans', 'Inter', system-ui, sans-serif;

  --transition-fast: 0.15s ease;
  --transition-normal: 0.25s cubic-bezier(0.4, 0, 0.2, 1);

  /* Admin tokens */
  --admin-bg: #0f0f1a;
  --admin-sidebar-bg: #13131f;
  --admin-card-bg: #1a1a2e;
  --admin-border: #2a2a3e;
  --admin-accent: #3b82f6;
  --admin-accent-soft: rgba(59, 130, 246, 0.15);
  --admin-nav-hover: rgba(255, 255, 255, 0.04);
  --admin-nav-active: rgba(59, 130, 246, 0.12);
}

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

html, body {
  height: 100%;
  overflow: hidden;
  background-color: var(--bg-app);
  color: var(--text-primary);
  font-family: var(--font-body);
  -webkit-font-smoothing: antialiased;
}

/* Scrollbar */
::-webkit-scrollbar { width: 6px; height: 6px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: var(--border-color); border-radius: 99px; }
::-webkit-scrollbar-thumb:hover { background: var(--text-muted); }

/* ================================================================
   LOGIN PAGE
   ================================================================ */

.login-page {
  position: fixed;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  background: #06070a;
  z-index: 300;
  overflow: hidden;
}

.login-page[hidden] { display: none; }

/* Animated background orbs */
.login-bg-effects {
  position: absolute;
  inset: 0;
  pointer-events: none;
  overflow: hidden;
}

.login-orb {
  position: absolute;
  border-radius: 50%;
  filter: blur(100px);
  opacity: 0.35;
  animation: orb-float 12s ease-in-out infinite;
}

.login-orb-1 {
  width: 500px; height: 500px;
  background: radial-gradient(circle, #6366f1, transparent 70%);
  top: -15%; left: -10%;
  animation-delay: 0s;
}

.login-orb-2 {
  width: 400px; height: 400px;
  background: radial-gradient(circle, #3b82f6, transparent 70%);
  bottom: -10%; right: -8%;
  animation-delay: -4s;
}

.login-orb-3 {
  width: 300px; height: 300px;
  background: radial-gradient(circle, #8b5cf6, transparent 70%);
  top: 40%; right: 30%;
  animation-delay: -8s;
  opacity: 0.2;
}

@keyframes orb-float {
  0%, 100% { transform: translate(0, 0) scale(1); }
  33% { transform: translate(30px, -20px) scale(1.05); }
  66% { transform: translate(-20px, 15px) scale(0.95); }
}

.login-container {
  position: relative;
  z-index: 1;
  display: flex;
  width: min(960px, calc(100% - 32px));
  min-height: 520px;
  background: rgba(14, 17, 22, 0.65);
  border: 1px solid rgba(255, 255, 255, 0.06);
  border-radius: 20px;
  backdrop-filter: blur(40px);
  box-shadow: 0 40px 120px rgba(0, 0, 0, 0.5), inset 0 1px 0 rgba(255, 255, 255, 0.04);
  overflow: hidden;
  animation: login-appear 0.6s cubic-bezier(0.16, 1, 0.3, 1);
}

@keyframes login-appear {
  from { opacity: 0; transform: translateY(20px) scale(0.97); }
  to { opacity: 1; transform: translateY(0) scale(1); }
}

/* Login Hero (left) */
.login-hero {
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 48px 40px;
  background: linear-gradient(135deg, rgba(99, 102, 241, 0.08), rgba(59, 130, 246, 0.04));
  border-right: 1px solid rgba(255, 255, 255, 0.04);
}

.login-hero-inner {
  max-width: 320px;
}

.login-logo {
  display: flex;
  align-items: center;
  gap: 14px;
  margin-bottom: 20px;
}

.login-logo-icon {
  width: 52px; height: 52px;
  border-radius: 14px;
  background: var(--accent-gradient);
  display: grid;
  place-items: center;
  color: #fff;
  box-shadow: 0 8px 24px rgba(99, 102, 241, 0.3);
}

.login-logo-text {
  font-family: var(--font-display);
  font-size: 32px;
  font-weight: 800;
  background: linear-gradient(135deg, #fff, #a5b4fc);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  letter-spacing: 1px;
}

.login-tagline {
  font-size: 15px;
  color: var(--text-secondary);
  line-height: 1.6;
  margin-bottom: 32px;
}

.login-features {
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.login-feature {
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 13px;
  color: var(--text-secondary);
}

.login-feature svg {
  color: #818cf8;
  flex-shrink: 0;
}

/* Login Form (right) */
.login-form-panel {
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 48px 40px;
}

.login-form-inner {
  width: 100%;
  max-width: 340px;
}

.login-form-header {
  margin-bottom: 32px;
}

.login-form-header h2 {
  font-family: var(--font-display);
  font-size: 26px;
  font-weight: 700;
  color: #fff;
  margin-bottom: 8px;
}

.login-form-header p {
  font-size: 14px;
  color: var(--text-muted);
}

.login-form {
  display: flex;
  flex-direction: column;
  gap: 18px;
}

.login-field {
  display: flex;
  flex-direction: column;
  gap: 7px;
}

.login-field label {
  font-size: 12px;
  font-weight: 700;
  color: var(--text-secondary);
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.login-field input,
.login-field select {
  height: 48px;
  border: 1px solid var(--border-color);
  border-radius: 10px;
  background: rgba(255, 255, 255, 0.03);
  color: var(--text-primary);
  padding: 0 14px;
  font-family: var(--font-body);
  font-size: 14px;
  transition: all var(--transition-fast);
}

.login-field input:focus,
.login-field select:focus {
  outline: none;
  border-color: var(--border-focus);
  box-shadow: 0 0 0 3px rgba(79, 70, 229, 0.15);
  background: rgba(255, 255, 255, 0.05);
}

.login-field select option {
  background: #12131a;
  color: #ffffff;
}

.login-field input::placeholder {
  color: var(--text-muted);
}

.login-submit-btn {
  height: 48px;
  border: 0;
  border-radius: 10px;
  background: var(--accent-gradient);
  color: #fff;
  font-family: var(--font-display);
  font-size: 15px;
  font-weight: 700;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  box-shadow: 0 6px 20px rgba(99, 102, 241, 0.25);
  transition: all var(--transition-fast);
  margin-top: 4px;
}

.login-submit-btn:hover {
  transform: translateY(-1px);
  box-shadow: 0 8px 28px rgba(99, 102, 241, 0.35);
}

.login-submit-btn:active {
  transform: translateY(0);
}

.login-error {
  min-height: 18px;
  color: #fca5a5;
  font-size: 13px;
  text-align: center;
}

.login-footer-note {
  margin-top: 24px;
  text-align: center;
  font-size: 11px;
  color: var(--text-muted);
  padding: 10px;
  border: 1px dashed var(--border-color);
  border-radius: 8px;
}


/* ================================================================
   STUDENT CHAT LAYOUT
   ================================================================ */

.app-layout {
  display: flex;
  height: 100vh;
  width: 100vw;
  overflow: hidden;
  position: relative;
}

.app-layout[hidden] { display: none; }

/* Sidebar */
.sidebar {
  width: 280px;
  background-color: var(--bg-sidebar);
  border-right: 1px solid var(--border-color);
  display: flex;
  flex-direction: column;
  height: 100%;
  flex-shrink: 0;
  z-index: 100;
  transition: transform var(--transition-normal), width var(--transition-normal);
}

/* Sidebar Collapse Option */
.sidebar-collapse-btn {
  background: transparent;
  border: 0;
  color: var(--text-secondary);
  cursor: pointer;
  padding: 6px;
  border-radius: 6px;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background-color var(--transition-fast);
}

.sidebar-collapse-btn:hover {
  background-color: rgba(255, 255, 255, 0.05);
  color: #fff;
}

.floating-sidebar-toggle {
  position: absolute;
  top: 20px;
  left: 20px;
  background: rgba(10, 12, 17, 0.7);
  border: 1px solid #222222;
  color: #ffffff;
  border-radius: 8px;
  width: 42px;
  height: 42px;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  z-index: 99;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.25s ease, background-color 0.2s ease, transform 0.2s ease;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.5);
}

.floating-sidebar-toggle:hover {
  background: #111111;
  border-color: #444444;
  transform: scale(1.05);
}

.floating-sidebar-toggle svg {
  stroke: #ffffff;
}

/* Collapsed Layout State */
.app-layout.sidebar-collapsed .sidebar {
  width: 0px !important;
  transform: translateX(-100%);
  border-right: none;
  overflow: hidden;
}

.app-layout.sidebar-collapsed .floating-sidebar-toggle {
  opacity: 1;
  pointer-events: auto;
}

.sidebar-header {
  height: 56px;
  padding: 0 16px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  border-bottom: 1px solid var(--border-color);
}

.brand {
  display: flex;
  align-items: center;
  gap: 10px;
}

.brand-avatar {
  width: 32px; height: 32px;
  border-radius: 8px;
  background: var(--accent-gradient);
  display: grid;
  place-items: center;
  color: #fff;
  box-shadow: 0 0 12px rgba(99, 102, 241, 0.3);
}

.brand-name {
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 17px;
  letter-spacing: 0.5px;
  background: linear-gradient(120deg, #fff, var(--text-secondary));
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
}

.mobile-only-btn {
  display: none;
  background: transparent;
  border: 0;
  color: var(--text-secondary);
  cursor: pointer;
  padding: 4px;
}

.sidebar-actions { padding: 14px; }

.btn {
  width: 100%;
  height: 40px;
  border-radius: 10px;
  border: 1px solid var(--border-color);
  font-family: var(--font-display);
  font-weight: 600;
  font-size: 13px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  transition: all var(--transition-fast);
}

.btn-primary {
  background: var(--accent-gradient);
  color: #fff;
  border: 0;
  box-shadow: 0 4px 12px rgba(99, 102, 241, 0.2);
}

.btn-primary:hover {
  transform: translateY(-1px);
  box-shadow: 0 6px 16px rgba(99, 102, 241, 0.3);
}

.btn-secondary {
  background: var(--bg-card);
  color: var(--text-primary);
}

.btn-secondary:hover {
  background: var(--border-color);
  border-color: var(--text-muted);
}

/* Student Profile Card */
.sidebar-profile-card {
  margin: 0 14px 10px;
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: 10px;
  padding: 14px;
}

.profile-avatar-row {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 12px;
}

.profile-avatar {
  width: 36px; height: 36px;
  border-radius: 50%;
  background: var(--accent-gradient);
  display: grid;
  place-items: center;
  color: #fff;
}

.profile-info {
  display: flex;
  flex-direction: column;
}

.profile-info strong {
  font-family: var(--font-display);
  font-size: 14px;
  color: #fff;
}

.profile-role-badge {
  font-size: 10px;
  font-weight: 800;
  text-transform: uppercase;
  color: #818cf8;
  letter-spacing: 0.5px;
}

.profile-stats {
  display: grid;
  grid-template-columns: 1fr 1fr 1fr;
  gap: 6px;
}

.profile-stat {
  background: rgba(255, 255, 255, 0.025);
  border: 1px solid rgba(255, 255, 255, 0.04);
  border-radius: 6px;
  padding: 6px 8px;
  text-align: center;
}

.profile-stat .label {
  display: block;
  font-size: 8px;
  text-transform: uppercase;
  color: var(--text-muted);
  font-weight: 800;
  letter-spacing: 0.5px;
}

.profile-stat strong {
  display: block;
  font-family: var(--font-display);
  font-size: 12px;
  color: #fff;
  margin-top: 2px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

/* Session List */
.sessions-nav {
  flex: 1;
  min-height: 0;
  display: flex;
  flex-direction: column;
  gap: 6px;
  padding: 0 12px 12px;
  overflow: hidden;
}

/* Sessions nav header with collapse toggle */
.sessions-nav-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 8px 10px 4px;
}

.sessions-collapse-btn {
  width: 22px;
  height: 22px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 4px;
  transition: all var(--transition-fast);
  color: var(--text-muted);
}

.sessions-collapse-btn:hover {
  background: rgba(255,255,255,0.06);
  color: #818cf8;
}

.sessions-collapse-btn.collapsed svg {
  transform: rotate(180deg);
}

.session-list-container {
  flex: 1;
  overflow-y: auto;
  min-height: 0;
  transition: max-height 0.3s cubic-bezier(0.4, 0, 0.2, 1), opacity 0.2s ease;
  max-height: 1200px;
  opacity: 1;
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.session-list-container::-webkit-scrollbar {
  width: 6px;
  height: 6px;
}

.session-list-container::-webkit-scrollbar-track {
  background: transparent;
}

.session-list-container::-webkit-scrollbar-thumb {
  background: var(--border-color);
  border-radius: 99px;
}

.session-list-container::-webkit-scrollbar-thumb:hover {
  background: var(--text-muted);
}

.session-list-container.collapsed {
  max-height: 0;
  opacity: 0;
  pointer-events: none;
}

.section-title {
  font-family: var(--font-display);
  font-size: 10px;
  font-weight: 800;
  text-transform: uppercase;
  color: var(--text-muted);
  letter-spacing: 1px;
  padding: 8px 10px 4px;
}


.session-item {
  width: 100%;
  min-height: 36px;
  padding: 7px 10px;
  background: transparent;
  border: 0;
  border-radius: 8px;
  display: flex;
  align-items: center;
  gap: 10px;
  cursor: pointer;
  text-align: left;
  color: var(--text-secondary);
  font-size: 13px;
  transition: all var(--transition-fast);
}

.session-item:hover {
  background-color: rgba(255, 255, 255, 0.04);
  color: var(--text-primary);
}

.session-item.active {
  background-color: rgba(99, 102, 241, 0.1);
  color: #fff;
  border-left: 3px solid var(--accent-color);
  border-radius: 4px 8px 8px 4px;
}

.session-icon {
  flex-shrink: 0;
  color: var(--text-muted);
}

.session-item.active .session-icon { color: #818cf8; }

.session-title {
  flex: 1;
  font-size: 12px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

/* Sidebar Footer */
.sidebar-footer {
  border-top: none;
  padding: 0;
  background: transparent;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.sidebar-dashboard-strip {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 5px;
}

.memory-status {
  display: flex;
  flex-direction: column;
  gap: 6px;
  border-top: 1px dashed var(--border-color);
  padding-top: 8px;
}

.memory-status-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}

.mini-link-btn {
  border: 0;
  background: transparent;
  color: #818cf8;
  font-family: var(--font-display);
  font-size: 10px;
  font-weight: 700;
  cursor: pointer;
  padding: 0;
}

.mini-link-btn:hover { color: #a5b4fc; }

.memory-status-grid {
  display: grid;
  gap: 4px;
  max-height: 220px;
  overflow-y: auto;
  transition: max-height 0.3s cubic-bezier(0.4, 0, 0.2, 1), opacity 0.2s ease;
  opacity: 1;
}

.memory-status-grid.collapsed {
  max-height: 0;
  opacity: 0;
  pointer-events: none;
  overflow: hidden;
}

.memory-collapse-btn {
  width: 22px;
  height: 22px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 4px;
  transition: all var(--transition-fast);
  color: var(--text-muted);
}

.memory-collapse-btn:hover {
  background: rgba(255, 255, 255, 0.06);
  color: #818cf8;
}

.memory-collapse-btn.collapsed svg {
  transform: rotate(180deg);
}

.memory-status-item {
  background: rgba(255, 255, 255, 0.02);
  border: 1px solid var(--border-color);
  border-radius: 6px;
  padding: 6px 8px;
}

.memory-status-item .label {
  display: block;
  font-size: 8px;
  text-transform: uppercase;
  color: var(--text-muted);
  font-weight: 700;
  letter-spacing: 0.7px;
}

.memory-status-item strong {
  display: block;
  margin-top: 1px;
  font-size: 10px;
  color: var(--text-secondary);
  line-height: 1.4;
  overflow-wrap: anywhere;
}

.memory-status-item.ok { border-color: rgba(16, 185, 129, 0.35); }
.memory-status-item.warn { border-color: rgba(245, 158, 11, 0.35); }

.dash-item {
  background: rgba(255, 255, 255, 0.02);
  border: 1px solid var(--border-color);
  border-radius: 6px;
  padding: 5px 8px;
}

.dash-item .label {
  font-size: 8px;
  text-transform: uppercase;
  color: var(--text-muted);
  font-weight: 700;
}

.dash-item strong {
  font-size: 10px;
  color: var(--text-secondary);
  display: block;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.footer-actions {
  display: flex;
  gap: 6px;
}

.footer-actions .btn {
  flex: 1;
  height: 32px;
  font-size: 11px;
}

.pulse-indicator {
  width: 7px; height: 7px;
  background-color: var(--emerald);
  border-radius: 50%;
  display: inline-block;
  box-shadow: 0 0 0 3px var(--emerald-alpha);
  animation: pulse-ring 2s infinite;
}

@keyframes pulse-ring {
  0% { box-shadow: 0 0 0 0 var(--emerald-alpha); }
  70% { box-shadow: 0 0 0 5px rgba(16, 185, 129, 0); }
  100% { box-shadow: 0 0 0 0 rgba(16, 185, 129, 0); }
}

/* Sidebar Logout */
.sidebar-logout-btn {
  width: 100%;
  height: 34px;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  background: transparent;
  border: 1px solid var(--border-color);
  border-radius: 8px;
  color: var(--text-muted);
  font-family: var(--font-display);
  font-size: 12px;
  font-weight: 600;
  cursor: pointer;
  transition: all var(--transition-fast);
}

.sidebar-logout-btn:hover {
  background: rgba(239, 68, 68, 0.08);
  border-color: rgba(239, 68, 68, 0.3);
  color: #fca5a5;
}


/* ================================================================
   MAIN CONTENT / CHAT
   ================================================================ */

.main-content {
  flex: 1;
  display: flex;
  flex-direction: column;
  height: 100%;
  overflow: hidden;
  background-color: var(--bg-app);
  position: relative;
}

/* Topbar */
.topbar {
  height: 56px;
  padding: 0 20px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  border-bottom: 1px solid var(--border-color);
  background: rgba(8, 9, 12, 0.8);
  backdrop-filter: blur(16px);
  z-index: 10;
}

.menu-toggle {
  display: none;
  background: transparent;
  border: 0;
  color: var(--text-secondary);
  cursor: pointer;
  padding: 6px;
  border-radius: 6px;
}

.menu-toggle:hover {
  background-color: rgba(255, 255, 255, 0.05);
  color: #fff;
}

.topbar-center {
  display: flex;
  align-items: center;
  gap: 10px;
}

.topbar-title-row {
  display: flex;
  align-items: baseline;
  gap: 8px;
}

.topbar-title {
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 16px;
  color: #fff;
}

.topbar-subtitle {
  font-family: var(--font-display);
  font-weight: 500;
  font-size: 13px;
  color: var(--text-muted);
}

.topbar-account {
  display: flex;
  align-items: center;
  gap: 8px;
}

.model-badge {
  display: flex;
  align-items: center;
  gap: 6px;
  height: 26px;
  padding: 0 10px;
  border-radius: 999px;
  border: 1px solid var(--border-color);
  background: rgba(255, 255, 255, 0.025);
  font-size: 11px;
  font-weight: 700;
  color: var(--text-secondary);
}

.model-dot {
  width: 6px; height: 6px;
  border-radius: 50%;
  background: var(--emerald);
}

/* Chat Logo Header */
.chat-logo-header {
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: 20px 0 0;
  flex-shrink: 0;
  background: var(--bg-app);
  z-index: 5;
}

.chat-logo-img {
  width: 90px;
  height: 90px;
  border-radius: 50%;
  object-fit: cover;
  border: 2px solid rgba(255, 255, 255, 0.12);
  box-shadow: 0 0 0 4px rgba(99, 102, 241, 0.15), 0 8px 24px rgba(0, 0, 0, 0.4);
  background: #0e1116;
  transition: box-shadow 0.3s ease;
}

.chat-logo-img:hover {
  box-shadow: 0 0 0 6px rgba(99, 102, 241, 0.25), 0 12px 32px rgba(0, 0, 0, 0.5);
}

.chat-logo-separator {
  width: 100%;
  height: 1px;
  background: linear-gradient(90deg, transparent, var(--border-color) 20%, var(--border-color) 80%, transparent);
  margin-top: 18px;
}

/* Chat Viewport */
.chat-viewport {
  flex: 1;
  overflow-y: auto;
  padding: 24px 0 160px;
  display: flex;
  flex-direction: column;
  align-items: center;
}

.chat-messages {
  width: 100%;
  max-width: 720px;
  padding: 0 20px;
  display: flex;
  flex-direction: column;
  gap: 24px;
}

/* Messages */
.message {
  display: flex;
  flex-direction: column;
  max-width: 80%;
  line-height: 1.65;
  font-size: 14px;
  animation: msg-in 0.3s cubic-bezier(0.16, 1, 0.3, 1);
}

@keyframes msg-in {
  from { opacity: 0; transform: translateY(8px); }
  to { opacity: 1; transform: translateY(0); }
}

.message.user {
  align-self: flex-end;
  background: #ffffff;
  border: none;
  color: #000000;
  padding: 12px 24px;
  border-radius: 24px;
  word-break: break-word;
  font-weight: 500;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.15);
}

.message.assistant {
  align-self: flex-start;
  max-width: 90%;
  position: relative;
  padding: 10px 0;
  background: transparent;
  border: none;
  border-radius: 0;
  color: #ffffff;
  white-space: pre-wrap;
  word-break: break-word;
  font-size: 15px;
}

.message.assistant::before {
  display: none;
}

.message.system {
  align-self: center;
  background-color: rgba(99, 102, 241, 0.08);
  border: 1px solid rgba(99, 102, 241, 0.2);
  color: #a5b4fc;
  font-size: 12px;
  font-weight: 600;
  padding: 6px 16px;
  border-radius: 30px;
  max-width: 90%;
  text-align: center;
}

/* Typing */
.typing {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 6px 0;
}

.typing span {
  width: 5px; height: 5px;
  border-radius: 50%;
  background-color: var(--text-secondary);
  animation: typing-blink 1.2s infinite ease-in-out;
}

.typing span:nth-child(2) { animation-delay: 0.15s; }
.typing span:nth-child(3) { animation-delay: 0.3s; }

@keyframes typing-blink {
  0%, 100% { opacity: 0.2; transform: translateY(0); }
  50% { opacity: 1; transform: translateY(-3px); }
}



/* Composer */
.composer-container {
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  padding: 20px;
  background: #000000;
  display: flex;
  justify-content: center;
  z-index: 5;
  border-top: 1px solid #111111;
}

.composer-form {
  width: 100%;
  max-width: 720px;
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.composer-input-wrapper {
  display: flex;
  align-items: center;
  gap: 12px;
  width: 100%;
}

.composer-input-area {
  flex: 1;
  background-color: #ffffff;
  border: none;
  border-radius: 24px;
  padding: 10px 20px;
  display: flex;
  align-items: center;
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.3);
  transition: all var(--transition-fast);
}

textarea#messageInput {
  flex: 1;
  height: 24px;
  min-height: 24px;
  max-height: 160px;
  background: transparent;
  border: 0;
  outline: none;
  resize: none;
  color: #000000;
  font-family: var(--font-body);
  font-size: 15px;
  line-height: 1.6;
  padding: 0;
  caret-color: #000000;
}

textarea#messageInput::placeholder {
  color: #777777;
}

.voice-btn-glowing {
  background: #000000;
  border: 2px solid #00e676;
  color: #00e676;
  border-radius: 24px;
  padding: 8px 20px;
  font-size: 14px;
  font-weight: 700;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  cursor: pointer;
  box-shadow: 0 0 14px rgba(0, 230, 118, 0.4);
  transition: all 0.25s cubic-bezier(0.4, 0, 0.2, 1);
  height: 44px;
}

.voice-btn-glowing:hover {
  background: #00e676;
  color: #000000;
  box-shadow: 0 0 20px rgba(0, 230, 118, 0.7);
}

.voice-btn-glowing.listening {
  border-color: #ff1744;
  color: #ff1744;
  box-shadow: 0 0 16px rgba(255, 23, 68, 0.5);
  animation: mic-pulsate 1.5s infinite;
}

.voice-btn-glowing svg {
  stroke: currentColor;
  flex-shrink: 0;
}

.composer-actions-bottom {
  display: flex;
  align-items: center;
  justify-content: flex-start;
  padding-left: 8px;
}

.file-tools {
  display: flex;
  gap: 8px;
}

.action-btn {
  background: transparent;
  border: 0;
  color: #888888;
  cursor: pointer;
  width: 36px;
  height: 36px;
  border-radius: 50%;
  display: grid;
  place-items: center;
  transition: all var(--transition-fast);
}

.action-btn:hover {
  background-color: rgba(255, 255, 255, 0.1);
  color: #ffffff;
}

.action-btn svg {
  stroke: currentColor;
}

@keyframes mic-pulsate { 0% { transform: scale(1); } 50% { transform: scale(1.08); } 100% { transform: scale(1); } }

.submit-btn { background: var(--accent-gradient); color: #fff; }
.submit-btn:hover { transform: scale(1.06); }

.composer-footnote { font-size: 10px; color: var(--text-muted); text-align: center; }

.sr-only { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0,0,0,0); border: 0; }

/* Code blocks */
code {
  font-family: Consolas, Monaco, 'Andale Mono', monospace;
  background-color: rgba(255, 255, 255, 0.08);
  padding: 2px 6px;
  border-radius: 4px;
  font-size: 13px;
  color: #fb7185;
}

.code-block {
  background-color: #0b0d10;
  border: 1px solid var(--border-color);
  border-radius: 8px;
  padding: 12px 16px;
  margin: 10px 0;
  overflow-x: auto;
}

.code-block code { background-color: transparent; padding: 0; color: #e2e8f0; font-size: 13px; }

.message p { margin-bottom: 6px; }
.message p:last-child { margin-bottom: 0; }
.message strong { color: #fff; font-weight: 700; }


/* ================================================================
   ADMIN DASHBOARD
   ================================================================ */

.admin-app-layout {
  display: flex;
  height: 100vh;
  width: 100vw;
  overflow: hidden;
  position: relative;
  background-color: var(--admin-bg);
}

.admin-app-layout[hidden] { display: none; }

.admin-sidebar {
  width: 220px;
  min-width: 220px;
  background-color: var(--admin-sidebar-bg);
  border-right: 1px solid var(--admin-border);
  display: flex;
  flex-direction: column;
  height: 100%;
  flex-shrink: 0;
  z-index: 100;
  transition: transform var(--transition-normal);
}

.admin-sidebar-header {
  height: 56px;
  padding: 0 16px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  border-bottom: 1px solid var(--admin-border);
}

.admin-brand { display: flex; align-items: center; gap: 10px; }

.admin-brand-icon {
  width: 32px; height: 32px;
  border-radius: 8px;
  background: linear-gradient(135deg, #3b82f6, #1d4ed8);
  display: grid;
  place-items: center;
  color: #fff;
  box-shadow: 0 0 12px rgba(59, 130, 246, 0.3);
}

.admin-brand-text { display: flex; flex-direction: column; }

.admin-brand-label {
  font-family: var(--font-display);
  font-size: 9px; font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 1.5px;
  color: var(--text-muted);
  line-height: 1;
}

.admin-brand-name {
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 15px;
  color: #fff;
  line-height: 1.2;
}

.admin-sidebar-toggle { display: none; background: transparent; border: 0; color: var(--text-secondary); cursor: pointer; padding: 4px; }

.admin-sidebar-actions { padding: 14px 14px 8px; }

.admin-sidebar-actions .btn {
  height: 36px;
  border-radius: 8px;
  font-size: 12px;
  background: linear-gradient(135deg, #3b82f6, #1d4ed8);
  box-shadow: 0 4px 12px rgba(59, 130, 246, 0.2);
}

.admin-sidebar-actions .btn:hover { box-shadow: 0 6px 16px rgba(59, 130, 246, 0.35); }

/* Admin Nav */
.admin-nav { flex: 1; overflow-y: auto; padding: 4px 10px 16px; }
.admin-nav-group { margin-bottom: 4px; }

.admin-nav-group-title {
  font-family: var(--font-display);
  font-size: 10px; font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 1.2px;
  color: var(--text-muted);
  padding: 12px 10px 5px;
  display: flex;
  align-items: center;
  gap: 8px;
}

.admin-nav-group-title::after { content: ""; flex: 1; height: 1px; background: var(--admin-border); opacity: 0.5; }

.admin-nav-item {
  width: 100%;
  min-height: 34px;
  padding: 6px 10px;
  background: transparent;
  border: 0;
  border-radius: 6px;
  display: flex;
  align-items: center;
  gap: 10px;
  cursor: pointer;
  text-align: left;
  color: var(--text-secondary);
  font-family: var(--font-body);
  font-size: 13px;
  font-weight: 500;
  transition: all var(--transition-fast);
  margin-bottom: 1px;
}

.admin-nav-item svg { flex-shrink: 0; color: var(--text-muted); transition: color var(--transition-fast); }
.admin-nav-item:hover { background-color: var(--admin-nav-hover); color: var(--text-primary); }
.admin-nav-item:hover svg { color: var(--text-secondary); }
.admin-nav-item.active { background-color: var(--admin-nav-active); color: #fff; }
.admin-nav-item.active svg { color: var(--admin-accent); }

/* Admin Sidebar Footer */
.admin-sidebar-footer {
  padding: 10px 14px;
  border-top: 1px solid var(--admin-border);
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.admin-version-badge {
  display: flex;
  align-items: center;
  gap: 6px;
  color: var(--text-muted);
  font-family: var(--font-display);
  font-size: 10px;
  font-weight: 700;
}

.version-number { color: var(--text-secondary); font-weight: 800; }

.version-dot {
  width: 7px; height: 7px;
  border-radius: 50%;
  background: var(--emerald);
  box-shadow: 0 0 6px rgba(16, 185, 129, 0.4);
  margin-left: auto;
}

/* Admin Main */
.admin-main { flex: 1; display: flex; flex-direction: column; height: 100%; overflow: hidden; background-color: var(--admin-bg); }

.admin-topbar {
  height: 50px;
  min-height: 50px;
  padding: 0 20px;
  display: flex;
  align-items: center;
  gap: 16px;
  border-bottom: 1px solid var(--admin-border);
  background: rgba(15, 15, 26, 0.85);
  backdrop-filter: blur(12px);
}

.admin-breadcrumb { display: flex; align-items: center; gap: 8px; font-size: 13px; flex: 1; }
.breadcrumb-root { color: var(--text-secondary); font-weight: 600; }
.breadcrumb-sep { color: var(--text-muted); font-size: 14px; }
.breadcrumb-context { color: var(--text-secondary); }
.breadcrumb-current { color: var(--admin-accent); font-weight: 700; }

.admin-topbar-right { display: flex; align-items: center; gap: 10px; }

.admin-search-box {
  display: flex;
  align-items: center;
  gap: 6px;
  height: 30px;
  padding: 0 12px;
  border: 1px solid var(--admin-border);
  border-radius: 6px;
  background: rgba(255, 255, 255, 0.03);
  color: var(--text-muted);
  font-size: 12px;
  cursor: pointer;
  transition: all var(--transition-fast);
}

.admin-search-box:hover { border-color: var(--text-muted); color: var(--text-secondary); }

.admin-user-avatar {
  width: 30px; height: 30px;
  display: grid;
  place-items: center;
  border-radius: 50%;
  background: linear-gradient(135deg, #3b82f6, #1d4ed8);
  color: #fff;
  cursor: pointer;
}

/* Admin Page Content */
.admin-page-content { flex: 1; overflow-y: auto; padding: 24px; }

.admin-page-header { margin-bottom: 22px; }

.admin-page-title { font-family: var(--font-display); font-size: 24px; font-weight: 700; color: var(--admin-accent); margin-bottom: 4px; }
.admin-page-subtitle { font-size: 13px; color: var(--text-muted); }

.admin-cards-row { display: grid; grid-template-columns: repeat(auto-fit, minmax(170px, 1fr)); gap: 12px; margin-bottom: 20px; }

.admin-stat-card {
  background: var(--admin-card-bg);
  border: 1px solid var(--admin-border);
  border-radius: 10px;
  padding: 14px 16px;
  transition: border-color var(--transition-fast);
}

.admin-stat-card:hover { border-color: rgba(255, 255, 255, 0.1); }
.admin-stat-card .stat-label { font-size: 10px; font-weight: 800; text-transform: uppercase; letter-spacing: 0.8px; color: var(--text-muted); margin-bottom: 6px; }
.admin-stat-card .stat-value { font-family: var(--font-display); font-size: 22px; font-weight: 700; color: var(--text-primary); }
.admin-stat-card .stat-value.ok { color: var(--emerald); }
.admin-stat-card .stat-value.warn { color: #f59e0b; }
.admin-stat-card .stat-detail { font-size: 11px; color: var(--text-muted); margin-top: 4px; }

.admin-panel-card { background: var(--admin-card-bg); border: 1px solid var(--admin-border); border-radius: 10px; margin-bottom: 18px; overflow: hidden; }
.admin-panel-header { display: flex; align-items: center; justify-content: space-between; padding: 14px 18px; border-bottom: 1px solid var(--admin-border); }
.admin-panel-title { font-family: var(--font-display); font-size: 15px; font-weight: 700; color: var(--text-primary); }
.admin-panel-subtitle { font-size: 12px; color: var(--text-muted); margin-top: 2px; }
.admin-panel-body { padding: 14px 18px; }
.admin-panel-actions { display: flex; gap: 8px; }

.admin-pill-btn {
  height: 28px;
  padding: 0 12px;
  border: 1px solid var(--admin-border);
  border-radius: 6px;
  background: transparent;
  color: var(--text-secondary);
  font-family: var(--font-display);
  font-size: 11px;
  font-weight: 600;
  cursor: pointer;
  transition: all var(--transition-fast);
}

.admin-pill-btn:hover { background: var(--admin-nav-hover); color: var(--text-primary); border-color: var(--text-muted); }
.admin-pill-btn.accent { border-color: var(--admin-accent); color: var(--admin-accent); }
.admin-pill-btn.accent:hover { background: var(--admin-accent-soft); }
.admin-pill-btn.danger { border-color: rgba(239, 68, 68, 0.5); color: #ef4444; }
.admin-pill-btn.danger:hover { background: rgba(239, 68, 68, 0.1); }

/* Admin Tables */
.admin-table { width: 100%; border-collapse: collapse; font-size: 12px; }
.admin-table th, .admin-table td { padding: 10px 12px; border-bottom: 1px solid rgba(255, 255, 255, 0.05); color: var(--text-secondary); text-align: left; vertical-align: top; }
.admin-table th { color: var(--text-muted); font-size: 10px; font-weight: 800; letter-spacing: 0.7px; text-transform: uppercase; }
.admin-table td strong { color: var(--text-primary); }

.status-pill { display: inline-flex; align-items: center; min-height: 22px; border: 1px solid var(--border-color); border-radius: 999px; padding: 0 8px; color: var(--text-primary); font-size: 11px; font-weight: 800; }
.status-pill.done { border-color: rgba(16, 185, 129, 0.4); color: #6ee7b7; }
.status-pill.queued { border-color: rgba(99, 102, 241, 0.45); color: #a5b4fc; }
.status-pill.failed { border-color: rgba(239, 68, 68, 0.45); color: #fca5a5; }
.status-pill.running { border-color: rgba(245, 158, 11, 0.45); color: #fbbf24; }
.status-pill.enabled { border-color: rgba(16, 185, 129, 0.5); background: rgba(16, 185, 129, 0.12); color: #6ee7b7; }

/* Admin Health */
.admin-health-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; padding: 14px; }
.admin-health-item { display: flex; align-items: flex-start; gap: 10px; border: 1px solid var(--admin-border); border-radius: 8px; background: rgba(255, 255, 255, 0.015); padding: 12px; }
.admin-health-item:hover { border-color: rgba(255, 255, 255, 0.08); }
.admin-health-dot { width: 9px; height: 9px; margin-top: 4px; border-radius: 50%; flex: 0 0 auto; background: var(--text-muted); }
.admin-health-item.ok .admin-health-dot { background: var(--emerald); box-shadow: 0 0 0 4px var(--emerald-alpha); }
.admin-health-item.warn .admin-health-dot { background: #f59e0b; box-shadow: 0 0 0 4px rgba(245, 158, 11, 0.16); }
.admin-health-label { font-family: var(--font-display); font-size: 13px; font-weight: 600; color: var(--text-primary); }
.admin-health-detail { font-size: 11px; color: var(--text-secondary); margin-top: 2px; line-height: 1.45; }

/* Admin misc */
.admin-tabs { display: flex; gap: 2px; padding: 0 18px; border-bottom: 1px solid var(--admin-border); }
.admin-tab { height: 38px; padding: 0 14px; background: transparent; border: 0; border-bottom: 2px solid transparent; color: var(--text-secondary); font-family: var(--font-body); font-size: 13px; font-weight: 600; cursor: pointer; transition: all var(--transition-fast); }
.admin-tab:hover { color: var(--text-primary); }
.admin-tab.active { color: var(--admin-accent); border-bottom-color: var(--admin-accent); }
.admin-tab .tab-count { margin-left: 4px; font-size: 11px; color: var(--text-muted); font-weight: 500; }

.admin-two-col { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
.admin-overview-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; margin-bottom: 18px; }

.admin-tag { display: inline-flex; align-items: center; height: 20px; padding: 0 7px; border-radius: 4px; font-size: 10px; font-weight: 700; letter-spacing: 0.3px; }
.admin-tag.green { background: rgba(16, 185, 129, 0.15); color: #6ee7b7; }
.admin-tag.blue { background: rgba(99, 102, 241, 0.15); color: #a5b4fc; }
.admin-tag.gray { background: rgba(255, 255, 255, 0.06); color: var(--text-secondary); }
.admin-tag.red { background: rgba(239, 68, 68, 0.12); color: #fca5a5; }

.admin-job-card { background: var(--admin-card-bg); border: 1px solid var(--admin-border); border-radius: 10px; padding: 16px; margin-bottom: 12px; }
.admin-job-header { display: flex; align-items: center; justify-content: space-between; margin-bottom: 12px; }
.admin-job-title { font-family: var(--font-display); font-size: 14px; font-weight: 700; color: var(--text-primary); }
.admin-job-schedule { font-size: 12px; color: var(--text-muted); margin-top: 2px; }
.admin-job-status { display: flex; align-items: center; gap: 16px; text-align: right; }
.admin-job-status-item { display: flex; flex-direction: column; }
.admin-job-status-label { font-size: 9px; text-transform: uppercase; letter-spacing: 0.8px; color: var(--text-muted); font-weight: 800; }
.admin-job-status-value { font-size: 12px; color: var(--text-secondary); margin-top: 2px; }
.admin-job-tags { display: flex; gap: 6px; margin-bottom: 12px; }
.admin-job-actions { display: flex; gap: 6px; justify-content: flex-end; padding-top: 10px; border-top: 1px solid var(--admin-border); }

.admin-kv-row { display: flex; gap: 20px; font-size: 13px; padding: 7px 0; border-bottom: 1px solid rgba(255, 255, 255, 0.04); }
.admin-kv-row:last-child { border-bottom: 0; }
.admin-kv-label { color: var(--text-muted); min-width: 120px; font-weight: 600; font-size: 12px; }
.admin-kv-value { color: var(--text-primary); flex: 1; overflow-wrap: anywhere; }
.admin-kv-value.path { color: #818cf8; font-family: Consolas, Monaco, monospace; font-size: 12px; }

.admin-toggle { position: relative; width: 36px; height: 18px; flex-shrink: 0; }
.admin-toggle input { opacity: 0; width: 0; height: 0; }
.admin-toggle-slider { position: absolute; cursor: pointer; inset: 0; background-color: var(--admin-border); border-radius: 18px; transition: var(--transition-fast); }
.admin-toggle-slider::before { content: ""; position: absolute; height: 12px; width: 12px; left: 3px; bottom: 3px; background-color: #fff; border-radius: 50%; transition: var(--transition-fast); }
.admin-toggle input:checked + .admin-toggle-slider { background-color: var(--admin-accent); }
.admin-toggle input:checked + .admin-toggle-slider::before { transform: translateX(18px); }

.admin-skill-row { display: flex; align-items: center; gap: 12px; padding: 10px 18px; border-bottom: 1px solid rgba(255, 255, 255, 0.04); transition: background var(--transition-fast); }
.admin-skill-row:hover { background: rgba(255, 255, 255, 0.015); }
.admin-skill-row:last-child { border-bottom: 0; }
.admin-skill-row.is-disabled { opacity: 0.68; }
.admin-skill-icon { width: 26px; height: 26px; border-radius: 6px; display: grid; place-items: center; font-size: 13px; flex-shrink: 0; }
.admin-skill-info { flex: 1; }
.admin-skill-name { font-family: var(--font-display); font-size: 13px; font-weight: 600; color: var(--text-primary); }
.admin-skill-desc { font-size: 11px; color: var(--text-muted); margin-top: 1px; }

.admin-filter-bar { display: flex; gap: 6px; padding: 10px 18px; border-bottom: 1px solid var(--admin-border); }
.admin-filter-pill { height: 24px; padding: 0 10px; border-radius: 4px; border: 0; font-size: 11px; font-weight: 700; cursor: pointer; transition: all var(--transition-fast); background: rgba(255, 255, 255, 0.05); color: var(--text-secondary); }
.admin-filter-pill.active { background: var(--admin-accent); color: #fff; }
.admin-filter-pill:hover:not(.active) { background: rgba(255, 255, 255, 0.08); color: var(--text-primary); }

.admin-info-note { display: flex; align-items: center; gap: 10px; padding: 10px 14px; border: 1px dashed var(--admin-border); border-radius: 8px; color: var(--text-muted); font-size: 12px; line-height: 1.5; margin: 12px 18px; }

.admin-log-container { max-height: 260px; overflow-y: auto; padding: 10px 14px; font-family: Consolas, Monaco, monospace; font-size: 11px; line-height: 1.7; color: var(--text-secondary); }
.admin-log-line { padding: 2px 0; border-bottom: 1px solid rgba(255, 255, 255, 0.02); }
.admin-log-time { color: var(--text-muted); margin-right: 8px; }

.admin-empty { padding: 14px; color: var(--text-muted); font-size: 12px; }
.admin-path { color: var(--text-muted); font-family: Consolas, Monaco, monospace; font-size: 11px; overflow-wrap: anywhere; }


/* ================================================================
   ADMIN STUDENTS PAGE
   ================================================================ */

/* Two-column layout: table left, form right */
.admin-students-layout {
  display: grid;
  grid-template-columns: 1fr 380px;
  gap: 16px;
  align-items: start;
}

/* Form container */
.admin-form {
  display: flex;
  flex-direction: column;
  gap: 14px;
}

/* Field wrapper */
.admin-form-field {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

/* Label */
.admin-form-label {
  font-family: var(--font-display);
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.6px;
  color: var(--text-secondary);
}

/* Input / Password */
.admin-form-input {
  height: 40px;
  padding: 0 12px;
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid var(--admin-border);
  border-radius: 8px;
  color: var(--text-primary);
  font-family: var(--font-body);
  font-size: 13px;
  transition: border-color var(--transition-fast), box-shadow var(--transition-fast);
}

.admin-form-input::placeholder {
  color: var(--text-muted);
}

.admin-form-input:focus {
  outline: none;
  border-color: var(--admin-accent);
  box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.12);
  background: rgba(255, 255, 255, 0.05);
}

/* Submit button */
.admin-form-submit-btn {
  height: 40px;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  background: linear-gradient(135deg, #3b82f6, #1d4ed8);
  color: #fff;
  border: 0;
  border-radius: 8px;
  font-family: var(--font-display);
  font-size: 13px;
  font-weight: 700;
  cursor: pointer;
  box-shadow: 0 4px 14px rgba(59, 130, 246, 0.25);
  transition: transform var(--transition-fast), box-shadow var(--transition-fast);
  margin-top: 2px;
}

.admin-form-submit-btn:hover {
  transform: translateY(-1px);
  box-shadow: 0 6px 20px rgba(59, 130, 246, 0.38);
}

.admin-form-submit-btn:active {
  transform: translateY(0);
}

/* Feedback message */
.admin-form-msg {
  min-height: 18px;
  font-family: var(--font-display);
  font-size: 12px;
  font-weight: 600;
  color: var(--text-muted);
  text-align: center;
  border-radius: 6px;
  padding: 0;
  transition: all var(--transition-fast);
}

.admin-form-msg.success {
  color: #6ee7b7;
  background: rgba(16, 185, 129, 0.08);
  border: 1px solid rgba(16, 185, 129, 0.25);
  padding: 7px 12px;
}

.admin-form-msg.error {
  color: #fca5a5;
  background: rgba(239, 68, 68, 0.08);
  border: 1px solid rgba(239, 68, 68, 0.25);
  padding: 7px 12px;
}

/* Responsive: stack on smaller screens */
@media (max-width: 960px) {
  .admin-students-layout {
    grid-template-columns: 1fr;
  }
}

/* ================================================================
   RESPONSIVE
   ================================================================ */

@media (max-width: 768px) {
  /* Login responsive */
  .login-container { flex-direction: column; min-height: auto; }
  .login-hero { display: none; }
  .login-form-panel { padding: 32px 24px; }
  .login-form-inner { max-width: 100%; }

  /* Chat responsive */
  .sidebar { position: absolute; left: 0; top: 0; bottom: 0; transform: translateX(-100%); }
  .sidebar.active { transform: translateX(0); box-shadow: 12px 0 32px rgba(0, 0, 0, 0.5); }
  .menu-toggle { display: block; }
  .mobile-only-btn { display: block; }
  .chat-viewport { padding-bottom: 140px; }
  .message { max-width: 92%; }
  .composer-container { padding: 12px; }
  .composer-input-area { padding: 6px 12px; border-radius: 14px; gap: 6px; }
  .topbar { padding: 0 12px; }
  textarea#messageInput { font-size: 13px; }

  /* Admin responsive */
  .admin-sidebar { position: absolute; left: 0; top: 0; bottom: 0; transform: translateX(-100%); z-index: 150; }
  .admin-sidebar.active { transform: translateX(0); box-shadow: 12px 0 32px rgba(0, 0, 0, 0.5); }
  .admin-sidebar-toggle { display: block; }
  .admin-topbar .menu-toggle { display: block; }
  .admin-cards-row { grid-template-columns: repeat(2, 1fr); }
  .admin-two-col { grid-template-columns: 1fr; }
  .admin-health-grid { grid-template-columns: 1fr; }
  .admin-overview-grid { grid-template-columns: 1fr; }
  .admin-search-box { display: none; }
}

/* Resource recommendations styles */
.resource-card-container {
  display: flex;
  flex-direction: column;
  gap: 10px;
  margin: 12px 0 8px;
  width: 100%;
}

.resource-card {
  display: flex;
  align-items: center;
  gap: 16px;
  padding: 14px 18px;
  background: linear-gradient(135deg, rgba(26, 30, 42, 0.75), rgba(16, 19, 28, 0.85));
  border: 1px solid rgba(99, 102, 241, 0.2);
  border-radius: 12px;
  text-decoration: none;
  backdrop-filter: blur(12px);
  box-shadow: 0 6px 18px rgba(0, 0, 0, 0.3), inset 0 1px 0 rgba(255, 255, 255, 0.05);
  transition: all var(--transition-fast) cubic-bezier(0.16, 1, 0.3, 1);
  cursor: pointer;
  margin-top: 6px;
  margin-bottom: 6px;
}

.resource-card:hover {
  transform: translateY(-2px);
  border-color: rgba(129, 140, 248, 0.5);
  background: linear-gradient(135deg, rgba(35, 41, 58, 0.85), rgba(22, 27, 39, 0.9));
  box-shadow: 0 10px 24px rgba(99, 102, 241, 0.15), 0 4px 12px rgba(0, 0, 0, 0.4);
}

.resource-icon-wrapper {
  width: 44px;
  height: 44px;
  border-radius: 10px;
  display: grid;
  place-items: center;
  flex-shrink: 0;
  transition: transform var(--transition-fast);
  font-size: 18px;
}

.resource-card:hover .resource-icon-wrapper {
  transform: scale(1.08);
}

.resource-card.pdf .resource-icon-wrapper {
  background: rgba(239, 68, 68, 0.16);
  color: #f87171;
  border: 1px solid rgba(239, 68, 68, 0.3);
}

.resource-card.video .resource-icon-wrapper {
  background: rgba(16, 185, 129, 0.16);
  color: #34d399;
  border: 1px solid rgba(16, 185, 129, 0.3);
}

.resource-card.book .resource-icon-wrapper {
  background: rgba(245, 158, 11, 0.16);
  color: #fbbf24;
  border: 1px solid rgba(245, 158, 11, 0.3);
}

.resource-details {
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 4px;
  min-width: 0;
}

.resource-header-row {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
}

.resource-title {
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 14px;
  color: #ffffff;
  line-height: 1.4;
  word-break: break-word;
}

.resource-type-tag {
  font-size: 9px;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.8px;
  padding: 2px 7px;
  border-radius: 4px;
  display: inline-block;
  line-height: 1.2;
  flex-shrink: 0;
}

.pdf .resource-type-tag {
  background: rgba(239, 68, 68, 0.2);
  color: #fca5a5;
  border: 1px solid rgba(239, 68, 68, 0.3);
}

.video .resource-type-tag {
  background: rgba(16, 185, 129, 0.2);
  color: #6ee7b7;
  border: 1px solid rgba(16, 185, 129, 0.3);
}

.book .resource-type-tag {
  background: rgba(245, 158, 11, 0.2);
  color: #fcd34d;
  border: 1px solid rgba(245, 158, 11, 0.3);
}

.resource-desc {
  font-size: 12px;
  color: #a1a1aa;
  line-height: 1.4;
}

.resource-arrow {
  color: #71717a;
  transition: transform var(--transition-fast), color var(--transition-fast);
  flex-shrink: 0;
}

.resource-card:hover .resource-arrow {
  transform: translateX(4px);
  color: #c7d2fe;
}

.resource-card.interactive .resource-icon-wrapper,
.resource-card.quiz .resource-icon-wrapper {
  background: rgba(139, 92, 246, 0.18);
  color: #a78bfa;
  border: 1px solid rgba(139, 92, 246, 0.35);
}

.interactive .resource-type-tag,
.quiz .resource-type-tag {
  background: rgba(139, 92, 246, 0.2);
  color: #ddd6fe;
  border: 1px solid rgba(139, 92, 246, 0.35);
}

.resource-card.generic .resource-icon-wrapper {
  background: rgba(107, 114, 128, 0.12); /* Gray */
  color: #9ca3af;
  border: 1px solid rgba(107, 114, 128, 0.2);
}

.generic .resource-type-tag {
  background: rgba(107, 114, 128, 0.15);
  color: #d1d5db;
}


/* ================================================================
   ADMIN DREAMING PAGE
   ================================================================ */

.dream-pipeline-flow {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 24px;
  background: rgba(255, 255, 255, 0.02);
  border-radius: 10px;
  margin-top: 15px;
  flex-wrap: wrap;
  gap: 16px;
}

.dream-flow-stage {
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  gap: 8px;
  flex: 1;
  min-width: 100px;
  transition: transform var(--transition-fast);
  position: relative;
}

.dream-flow-stage:hover {
  transform: translateY(-4px);
}

.dream-flow-icon {
  width: 54px;
  height: 54px;
  border-radius: 50%;
  display: grid;
  place-items: center;
  font-size: 20px;
  transition: all 0.3s ease;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
  border: 1px solid rgba(255, 255, 255, 0.05);
}

.dream-flow-stage:hover .dream-flow-icon {
  box-shadow: 0 0 20px currentColor;
  filter: brightness(1.2);
  transform: scale(1.08);
}

.dream-flow-label {
  font-family: var(--font-display);
  font-size: 13px;
  font-weight: 700;
  color: var(--text-primary);
}

.dream-flow-count {
  font-size: 15px;
  font-weight: 800;
  font-family: var(--font-display);
  color: var(--text-secondary);
  margin-top: -2px;
}

.dream-flow-arrow {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 40px;
  color: var(--text-muted);
  opacity: 0.6;
  animation: pulse-arrow 2s infinite ease-in-out;
}

.dream-flow-arrow svg path {
  stroke: currentColor;
  stroke-linecap: round;
  stroke-linejoin: round;
  stroke-dasharray: 4, 4;
  animation: flow-dash-move 1.5s infinite linear;
}

@keyframes pulse-arrow {
  0%, 100% { transform: scale(1); opacity: 0.5; }
  50% { transform: scale(1.08); opacity: 0.95; }
}

@keyframes flow-dash-move {
  to {
    stroke-dashoffset: -8;
  }
}

/* Stage Details Grid */
.dream-stages-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 16px;
  margin-bottom: 20px;
}

@media (max-width: 1024px) {
  .dream-stages-grid {
    grid-template-columns: 1fr;
  }
}

.dream-stage-panel {
  display: flex;
  flex-direction: column;
  max-height: 520px;
  background: var(--admin-card-bg);
  border: 1px solid var(--admin-border);
  border-radius: 10px;
  overflow: hidden;
}

.dream-stage-items {
  flex: 1;
  overflow-y: auto;
  padding: 14px;
  display: flex;
  flex-direction: column;
  gap: 12px;
  max-height: 440px;
}

/* Custom Scrollbar for Stage Items */
.dream-stage-items::-webkit-scrollbar {
  width: 6px;
}
.dream-stage-items::-webkit-scrollbar-track {
  background: transparent;
}
.dream-stage-items::-webkit-scrollbar-thumb {
  background: rgba(255, 255, 255, 0.08);
  border-radius: 3px;
}
.dream-stage-items::-webkit-scrollbar-thumb:hover {
  background: rgba(255, 255, 255, 0.15);
}

.dream-empty {
  padding: 24px;
  text-align: center;
  color: var(--text-muted);
  font-size: 12px;
  background: rgba(255, 255, 255, 0.01);
  border-radius: 8px;
  border: 1px dashed var(--admin-border);
}

/* Dream Item Card */
.dream-item {
  background: rgba(255, 255, 255, 0.02);
  border: 1px solid var(--admin-border);
  border-radius: 8px;
  padding: 12px;
  transition: all 0.25s cubic-bezier(0.4, 0, 0.2, 1);
  position: relative;
  overflow: hidden;
}

.dream-item::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: linear-gradient(135deg, rgba(255, 255, 255, 0.03), transparent);
  opacity: 0;
  transition: opacity 0.3s ease;
}

.dream-item:hover {
  background: rgba(255, 255, 255, 0.04);
  border-color: rgba(255, 255, 255, 0.15);
  transform: translateY(-2px);
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
}

.dream-item:hover::before {
  opacity: 1;
}

.dream-item-promotable {
  border-left: 3px solid var(--emerald);
  background: rgba(16, 185, 129, 0.02);
}

.dream-item-promotable:hover {
  background: rgba(16, 185, 129, 0.04);
  border-color: rgba(16, 185, 129, 0.3);
}

.dream-item-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 8px;
  position: relative;
  z-index: 1;
}

.dream-item-type {
  font-family: var(--font-display);
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  color: var(--admin-accent);
  letter-spacing: 0.5px;
}

.dream-item-badge {
  font-size: 9px;
  font-weight: 800;
  padding: 2px 6px;
  border-radius: 4px;
  letter-spacing: 0.3px;
}

.dream-item-badge.promotable {
  background: rgba(16, 185, 129, 0.15);
  color: #6ee7b7;
}

.dream-item-badge.pending {
  background: rgba(245, 158, 11, 0.12);
  color: #fcd34d;
}

.dream-item-fact {
  font-size: 12px;
  color: var(--text-primary);
  line-height: 1.5;
  margin-bottom: 10px;
  overflow-wrap: anywhere;
  position: relative;
  z-index: 1;
}

.dream-item-metrics {
  display: flex;
  flex-direction: column;
  gap: 6px;
  margin-bottom: 10px;
  position: relative;
  z-index: 1;
}

.dream-metric {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 11px;
}

.dream-metric-label {
  color: var(--text-muted);
  width: 70px;
  flex-shrink: 0;
}

.dream-bar {
  flex: 1;
  height: 6px;
  background: rgba(255, 255, 255, 0.08);
  border-radius: 3px;
  overflow: hidden;
  position: relative;
}

.dream-bar-fill {
  height: 100%;
  border-radius: 3px;
  transition: width 0.6s cubic-bezier(0.4, 0, 0.2, 1);
}

.dream-metric-val {
  font-family: Consolas, Monaco, monospace;
  font-size: 11px;
  color: var(--text-secondary);
  width: 30px;
  text-align: right;
}

.dream-item-reflection {
  font-style: italic;
  font-size: 11px;
  color: var(--text-muted);
  background: rgba(255, 255, 255, 0.015);
  border-left: 2px solid rgba(255, 255, 255, 0.1);
  padding: 6px 10px;
  margin-bottom: 10px;
  border-radius: 0 4px 4px 0;
  position: relative;
  z-index: 1;
}

.dream-item-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 4px;
  position: relative;
  z-index: 1;
}

/* Bottom Grid layout */
.dream-bottom-grid {
  display: grid;
  grid-template-columns: 380px 1fr;
  gap: 16px;
  margin-top: 18px;
}

@media (max-width: 768px) {
  .dream-bottom-grid {
    grid-template-columns: 1fr;
  }
}

.dream-memory-preview {
  font-family: Consolas, Monaco, monospace;
  font-size: 11px;
  line-height: 1.5;
  color: #a5b4fc;
  background: rgba(0, 0, 0, 0.2);
  padding: 12px;
  border-radius: 6px;
  border: 1px solid var(--admin-border);
  overflow-x: auto;
  max-height: 300px;
  white-space: pre-wrap;
}

.admin-select {
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid var(--admin-border);
  border-radius: 6px;
  color: var(--text-primary);
  font-family: var(--font-body);
  font-size: 12px;
  padding: 6px 32px 6px 12px;
  cursor: pointer;
  outline: none;
  transition: all var(--transition-fast);
  appearance: none;
  -webkit-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='rgba(255,255,255,0.6)' stroke-width='2'%3E%3Cpath stroke-linecap='round' stroke-linejoin='round' d='M19.5 8.25l-7.5 7.5-7.5-7.5'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 8px center;
  background-size: 14px;
}

.admin-select:hover {
  background-color: rgba(255, 255, 255, 0.08);
  border-color: rgba(255, 255, 255, 0.2);
}

.admin-select:focus {
  border-color: var(--admin-accent);
  box-shadow: 0 0 0 2px var(--admin-accent-soft);
}

.admin-select option {
  background: #12131a;
  color: var(--text-primary);
  padding: 10px;
}

/* ================================================================
   STUDENT ACTIVITY DASHBOARD
   ================================================================ */

/* Activity view full-page layout */
.activity-view-section {
  display: flex;
  flex-direction: column;
  overflow: hidden;
  /* Override the chat-viewport's 160px bottom padding (meant for the chat input bar) */
  padding-bottom: 0 !important;
  padding-top: 0 !important;
}

/* Topbar with back button */
.activity-topbar {
  flex-shrink: 0;
  padding: 12px 24px;
  border-bottom: 1px solid var(--border-color);
  background: rgba(14, 17, 22, 0.7);
  display: flex;
  align-items: center;
  gap: 12px;
}

.activity-back-btn {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 7px 14px;
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid var(--border-color);
  border-radius: 8px;
  color: var(--text-secondary);
  font-family: var(--font-display);
  font-size: 12px;
  font-weight: 600;
  cursor: pointer;
  transition: all var(--transition-fast);
}

.activity-back-btn:hover {
  background: rgba(99, 102, 241, 0.1);
  border-color: rgba(99, 102, 241, 0.3);
  color: #a5b4fc;
}

.activity-back-btn svg {
  transition: transform var(--transition-fast);
}

.activity-back-btn:hover svg {
  transform: translateX(-3px);
}

/* Scrollable content area inside activity view */
.activity-dashboard-container {
  flex: 1;
  overflow-y: auto;
  padding: 24px 40px;
  max-width: 1600px;
  width: 100%;
  margin: 0 auto;
  display: flex;
  flex-direction: column;
  gap: 20px;
}

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

.activity-header h2 {
  font-family: var(--font-display);
  font-size: 20px;
  font-weight: 800;
  color: #fff;
  margin: 0;
}

.activity-summary-row {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 16px;
  margin-bottom: 8px;
}

.activity-summary-card {
  background: rgba(255, 255, 255, 0.02);
  border: 1px solid var(--border-color);
  border-radius: 12px;
  padding: 16px;
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.activity-summary-card .label {
  font-family: var(--font-display);
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  color: var(--text-muted);
  letter-spacing: 0.5px;
}

.activity-summary-card .value {
  font-size: 24px;
  font-weight: 800;
  color: #fff;
  font-family: var(--font-display);
}

.activity-summary-card .desc {
  font-size: 11px;
  color: var(--text-secondary);
}

/* Tab Navigation */
.activity-tabs-nav {
  display: flex;
  gap: 6px;
  border-bottom: 1px solid var(--border-color);
  padding-bottom: 10px;
  overflow-x: auto;
  flex-shrink: 0;
  scrollbar-width: none;
}

.activity-tabs-nav::-webkit-scrollbar { display: none; }

.activity-tab-btn {
  background: transparent;
  border: 0;
  font-family: var(--font-display);
  font-size: 13px;
  font-weight: 700;
  color: var(--text-secondary);
  padding: 6px 16px;
  border-radius: 6px;
  cursor: pointer;
  transition: all var(--transition-fast);
}

.activity-tab-btn.active {
  background: var(--primary-color, #6366f1);
  color: #fff;
}

.activity-tab-btn:hover:not(.active) {
  background: rgba(255, 255, 255, 0.05);
  color: #fff;
}

/* Category Sections */
.activity-section {
  display: flex;
  flex-direction: column;
  gap: 14px;
  margin-top: 10px;
}

.activity-section h3 {
  font-family: var(--font-display);
  font-size: 14px;
  font-weight: 700;
  color: var(--text-secondary);
  border-left: 3px solid var(--primary-color, #6366f1);
  padding-left: 8px;
  margin: 0;
}

.activity-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 16px;
}

/* Dashboard Cards */
.activity-card {
  background: rgba(255, 255, 255, 0.02);
  border: 1px solid var(--border-color);
  border-radius: 12px;
  padding: 16px;
  display: flex;
  flex-direction: column;
  gap: 10px;
  cursor: pointer;
  transition: all 0.25s cubic-bezier(0.16, 1, 0.3, 1);
  position: relative;
}

.activity-card:hover {
  transform: translateY(-2px);
  border-color: rgba(99, 102, 241, 0.3);
  background: rgba(255, 255, 255, 0.03);
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.2);
}

.activity-card-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.activity-card-title {
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 13px;
  color: #fff;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.activity-card-meta {
  font-size: 11px;
  color: var(--text-muted);
}

/* Badges */
.activity-badge {
  font-size: 9px;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  padding: 2px 6px;
  border-radius: 4px;
}

.activity-badge.passed {
  background: rgba(16, 185, 129, 0.15);
  color: #6ee7b7;
}

.activity-badge.failed {
  background: rgba(239, 68, 68, 0.15);
  color: #fca5a5;
}

.activity-badge.unattempted {
  background: rgba(107, 114, 128, 0.15);
  color: #d1d5db;
}

.activity-badge.watched {
  background: rgba(16, 185, 129, 0.15);
  color: #6ee7b7;
}

.activity-badge.dropped {
  background: rgba(245, 158, 11, 0.15);
  color: #fcd34d;
}

.activity-badge.unwatched {
  background: rgba(107, 114, 128, 0.15);
  color: #d1d5db;
}

/* Progress bar inside card */
.activity-card-progress {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 10px;
  color: var(--text-secondary);
}

.activity-bar {
  flex: 1;
  height: 6px;
  background: rgba(255, 255, 255, 0.08);
  border-radius: 3px;
  overflow: hidden;
}

.activity-bar-fill {
  height: 100%;
  border-radius: 3px;
  background: var(--primary-color, #6366f1);
  transition: width 0.3s ease;
}

.activity-badge.dropped + .activity-bar .activity-bar-fill {
  background: var(--amber, #f59e0b);
}

.activity-badge.watched + .activity-bar .activity-bar-fill {
  background: var(--emerald, #10b981);
}

/* INTERACTIVE MODALS STYLING */
.activity-modal {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  z-index: 1000;
  display: flex;
  align-items: center;
  justify-content: center;
}

.activity-modal-backdrop {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(0, 0, 0, 0.7);
  backdrop-filter: blur(4px);
}

.activity-modal-wrapper {
  position: relative;
  width: 90%;
  max-width: 520px;
  z-index: 1001;
}

.activity-modal-container {
  background: #181922;
  border: 1px solid var(--border-color);
  border-radius: 16px;
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.5);
  overflow: hidden;
  display: flex;
  flex-direction: column;
}

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

.activity-modal-header h3 {
  font-family: var(--font-display);
  font-size: 15px;
  font-weight: 800;
  color: #fff;
  margin: 0;
}

.activity-modal-close-btn {
  background: transparent;
  border: 0;
  color: var(--text-muted);
  font-size: 24px;
  font-weight: 400;
  cursor: pointer;
  line-height: 1;
}

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

.activity-modal-body {
  padding: 20px;
}

/* Mock Player and Solver */
.video-player-mock {
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.video-screen {
  aspect-ratio: 16/9;
  background: #0d0e12;
  border-radius: 8px;
  display: flex;
  align-items: center;
  justify-content: center;
  position: relative;
  overflow: hidden;
  border: 1px solid rgba(255, 255, 255, 0.05);
}

.video-screen-thumbnail {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: linear-gradient(180deg, rgba(0, 0, 0, 0.2), rgba(0, 0, 0, 0.8));
  display: flex;
  align-items: center;
  justify-content: center;
}

.video-play-btn {
  width: 54px;
  height: 54px;
  background: var(--primary-color, #6366f1);
  border-radius: 50%;
  display: grid;
  place-items: center;
  color: #fff;
  border: 0;
  cursor: pointer;
  box-shadow: 0 4px 12px rgba(99, 102, 241, 0.4);
  transition: transform var(--transition-fast);
}

.video-play-btn:hover {
  transform: scale(1.1);
}

.video-player-progress-container {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.video-player-progress-container label {
  font-size: 11px;
  color: var(--text-secondary);
}

.video-progress-slider {
  width: 100%;
  height: 6px;
  background: rgba(255, 255, 255, 0.1);
  border-radius: 3px;
  outline: none;
  cursor: pointer;
  accent-color: var(--primary-color, #6366f1);
}

.video-player-controls {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 10px;
  margin-top: 10px;
}

.quiz-solver-mock {
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.quiz-question {
  font-family: var(--font-display);
  font-size: 13px;
  font-weight: 600;
  color: #fff;
  line-height: 1.5;
}

.quiz-options {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.quiz-option-btn {
  background: rgba(255, 255, 255, 0.02);
  border: 1px solid var(--border-color);
  border-radius: 8px;
  padding: 10px 14px;
  font-family: var(--font-body);
  font-size: 12px;
  color: var(--text-secondary);
  text-align: left;
  cursor: pointer;
  transition: all var(--transition-fast);
}

.quiz-option-btn:hover {
  background: rgba(255, 255, 255, 0.05);
  border-color: var(--text-secondary);
  color: #fff;
}

.quiz-option-btn.selected {
  background: rgba(99, 102, 241, 0.1);
  border-color: var(--primary-color, #6366f1);
  color: #fff;
}

.quiz-submit-btn {
  width: 100%;
  height: 40px;
  background: var(--primary-color, #6366f1);
  color: #fff;
  font-family: var(--font-display);
  font-size: 13px;
  font-weight: 700;
  border: 0;
  border-radius: 8px;
  cursor: pointer;
  transition: all var(--transition-fast);
  margin-top: 6px;
}

.quiz-submit-btn:hover {
  background: #4f46e5;
}

.quiz-submit-btn:disabled {
  background: rgba(255, 255, 255, 0.05);
  color: var(--text-muted);
  cursor: not-allowed;
}

.quiz-solver-feedback {
  padding: 10px 12px;
  border-radius: 6px;
  font-size: 12px;
  text-align: center;
}

.quiz-solver-feedback.correct {
  background: rgba(16, 185, 129, 0.1);
  color: #6ee7b7;
  border: 1px solid rgba(16, 185, 129, 0.2);
}

.quiz-solver-feedback.incorrect {
  background: rgba(239, 68, 68, 0.1);
  color: #fca5a5;
  border: 1px solid rgba(239, 68, 68, 0.2);
}

/* ── Option states after answer is submitted ───────────────────── */
.quiz-option-btn:disabled {
  cursor: not-allowed;
  opacity: 0.75;
}

.quiz-option-btn.correct-answer {
  background: rgba(16, 185, 129, 0.15) !important;
  border-color: rgba(16, 185, 129, 0.6) !important;
  color: #6ee7b7 !important;
  font-weight: 700;
  opacity: 1 !important;
}

.quiz-option-btn.wrong-answer {
  background: rgba(239, 68, 68, 0.12) !important;
  border-color: rgba(239, 68, 68, 0.5) !important;
  color: #fca5a5 !important;
  opacity: 1 !important;
}

/* ── Multi-question quiz progress bar ─────────────────────────── */
.quiz-progress-bar-wrap {
  width: 100%;
  height: 6px;
  background: rgba(255,255,255,0.08);
  border-radius: 3px;
  margin-bottom: 20px;
  overflow: hidden;
}

.quiz-progress-bar {
  height: 100%;
  background: linear-gradient(90deg, #6366f1, #a78bfa);
  border-radius: 3px;
  transition: width 0.4s ease;
}

/* ── Quiz score screen ─────────────────────────────────────────── */
.quiz-score-screen {
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: 12px 0;
  gap: 8px;
}

.quiz-score-emoji {
  font-size: 52px;
  line-height: 1;
  margin-bottom: 4px;
}

.quiz-score-title {
  font-size: 22px;
  font-weight: 700;
  color: var(--text-primary, #f8fafc);
}

.quiz-score-number {
  font-size: 44px;
  font-weight: 800;
  background: linear-gradient(135deg, #6366f1, #a78bfa);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  line-height: 1;
}

.quiz-score-pct {
  font-size: 15px;
  color: var(--text-muted, #94a3b8);
  margin-bottom: 8px;
}

.quiz-score-breakdown {
  width: 100%;
  display: flex;
  flex-direction: column;
  gap: 6px;
  max-height: 260px;
  overflow-y: auto;
  padding-right: 4px;
}

.quiz-score-row {
  display: flex;
  align-items: flex-start;
  gap: 8px;
  padding: 7px 10px;
  border-radius: 8px;
  font-size: 13px;
}

.quiz-score-row.correct {
  background: rgba(34, 197, 94, 0.08);
  border: 1px solid rgba(34, 197, 94, 0.2);
}

.quiz-score-row.incorrect {
  background: rgba(239, 68, 68, 0.08);
  border: 1px solid rgba(239, 68, 68, 0.15);
}

.quiz-score-row-text {
  color: var(--text-secondary, #cbd5e1);
  line-height: 1.4;
}

/* ── In-progress badge ─────────────────────────────────────────── */
.activity-badge.in-progress {
  background: rgba(251, 191, 36, 0.15);
  color: #fbbf24;
  border: 1px solid rgba(251, 191, 36, 0.25);
}

/* ================================================================
   PICTURE VIEWER SPLIT LAYOUT
   ================================================================ */

/* Ensure the main container behaves correctly in flex layout */
.app-layout {
  display: flex;
  height: 100vh;
  overflow: hidden;
  position: relative;
}

.sidebar {
  flex-shrink: 0;
}

.main-content {
  flex: 1;
  display: flex;
  flex-direction: column;
  height: 100vh;
  min-width: 0;
  overflow: hidden;
  transition: width 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

/* Picture Viewer Panel */
.picture-viewer {
  width: 45%;
  flex-shrink: 0;
  background-color: var(--bg-card);
  border-left: 1px solid var(--border-color);
  display: flex;
  flex-direction: column;
  height: 100vh;
  overflow: hidden;
  animation: slideInRight 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  transition: width 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  z-index: 10;
}

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

.picture-viewer-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 16px 20px;
  border-bottom: 1px solid var(--border-color);
  background-color: rgba(21, 24, 31, 0.95);
  backdrop-filter: blur(10px);
}

.picture-viewer-title {
  font-family: var(--font-display);
  font-size: 1.1rem;
  font-weight: 600;
  color: var(--text-primary);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  max-width: 80%;
}

.picture-viewer-close-btn {
  background: transparent;
  border: none;
  color: var(--text-secondary);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 32px;
  height: 32px;
  border-radius: 50%;
  transition: background-color var(--transition-fast), color var(--transition-fast);
}

.picture-viewer-close-btn:hover {
  background-color: var(--border-color);
  color: var(--text-primary);
}

.picture-viewer-content {
  flex: 1;
  overflow-y: auto;
  padding: 24px;
  display: flex;
  flex-direction: column;
  gap: 20px;
}

.picture-viewer-image-wrapper {
  display: flex;
  align-items: center;
  justify-content: center;
  background-color: var(--bg-input);
  border: 1px solid var(--border-color);
  border-radius: 12px;
  padding: 24px;
  min-height: 300px;
  max-height: 60vh;
  overflow: hidden;
  box-shadow: inset 0 2px 8px rgba(0, 0, 0, 0.2);
}

.picture-viewer-image-wrapper img {
  max-width: 100%;
  max-height: 100%;
  object-fit: contain;
  border-radius: 6px;
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.4);
}

.picture-viewer-meta {
  background-color: rgba(255, 255, 255, 0.02);
  border: 1px solid var(--border-color);
  border-radius: 12px;
  padding: 18px 22px;
}

.picture-viewer-meta p {
  font-family: var(--font-body);
  font-size: 0.95rem;
  line-height: 1.6;
  color: var(--text-secondary);
}

/* Mobile responsive layout */
@media (max-width: 768px) {
  .picture-viewer {
    position: absolute;
    right: 0;
    top: 0;
    width: 100%;
    height: 100%;
    z-index: 1000;
  }
}


/* ================================================================
   INTERACTIVE FLASHCARD DECK
   ================================================================ */

.flashcard-deck {
  margin: 12px 0;
  border-radius: 16px;
  /* overflow: hidden intentionally OMITTED — it breaks CSS 3D perspective/backface-visibility */
  border: 1px solid rgba(99, 102, 241, 0.25);
  background: rgba(12, 12, 30, 0.6);
}

.flashcard-deck-header {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 14px 18px;
  background: linear-gradient(135deg, rgba(99, 102, 241, 0.15), rgba(139, 92, 246, 0.1));
  border-bottom: 1px solid rgba(99, 102, 241, 0.2);
  border-radius: 16px 16px 0 0;
}

.flashcard-deck-icon {
  font-size: 20px;
}

.flashcard-deck-title {
  font-size: 14px;
  font-weight: 600;
  color: #c4b5fd;
  letter-spacing: 0.02em;
  flex: 1;
}

.flashcard-deck-tip {
  font-size: 11px;
  color: rgba(196, 181, 253, 0.5);
  font-style: italic;
}

.flashcard-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
  gap: 14px;
  padding: 18px;
}

/* --- Individual Card --- */
.flashcard {
  /* perspective must be on the PARENT of the element that transforms */
  perspective: 1000px;
  -webkit-perspective: 1000px;
  cursor: pointer;
  height: 160px;
  user-select: none;
}

.flashcard-inner {
  position: relative;
  width: 100%;
  height: 100%;
  transform-style: preserve-3d;
  -webkit-transform-style: preserve-3d;
  transition: transform 0.55s cubic-bezier(0.4, 0, 0.2, 1);
  border-radius: 12px;
}

.flashcard:hover .flashcard-inner {
  box-shadow: 0 8px 32px rgba(99, 102, 241, 0.35);
}

.flashcard.flipped .flashcard-inner {
  transform: rotateY(180deg);
  -webkit-transform: rotateY(180deg);
}

.flashcard-front,
.flashcard-back {
  position: absolute;
  inset: 0;
  border-radius: 12px;
  backface-visibility: hidden;
  -webkit-backface-visibility: hidden;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 14px;
  text-align: center;
  gap: 6px;
  overflow: hidden;
}

/* Front face — dark indigo — sits in front (z-index:2) */
.flashcard-front {
  background: linear-gradient(135deg, #1e1b4b 0%, #312e81 100%);
  border: 1px solid rgba(99, 102, 241, 0.4);
  z-index: 2;
}

/* Back face — purple/violet — rotated 180deg, behind the front (z-index:1) */
.flashcard-back {
  background: linear-gradient(135deg, #4c1d95 0%, #6d28d9 100%);
  border: 1px solid rgba(139, 92, 246, 0.5);
  transform: rotateY(180deg);
  -webkit-transform: rotateY(180deg);
  z-index: 1;
}

.flashcard-number {
  font-size: 10px;
  color: rgba(196, 181, 253, 0.45);
  letter-spacing: 0.06em;
  position: absolute;
  top: 10px;
  right: 12px;
}

.flashcard-term {
  font-size: 15px;
  font-weight: 700;
  color: #e0e7ff;
  line-height: 1.3;
}

.flashcard-hint {
  font-size: 10px;
  color: rgba(196, 181, 253, 0.45);
  margin-top: 4px;
  font-style: italic;
}

.flashcard-definition {
  font-size: 12px;
  color: #ddd6fe;
  line-height: 1.5;
  overflow-y: auto;
  max-height: 90px;
}

.flashcard-example {
  font-size: 11px;
  color: rgba(221, 214, 254, 0.65);
  margin-top: 6px;
  line-height: 1.4;
  border-top: 1px solid rgba(255,255,255,0.1);
  padding-top: 6px;
  width: 100%;
  text-align: left;
}

@media (max-width: 500px) {
  .flashcard-grid {
    grid-template-columns: 1fr 1fr;
    gap: 10px;
    padding: 12px;
  }
  .flashcard {
    height: 140px;
  }
}

/* ================================================================ */
/* CLASSROOM CARDS HUB STYLES                                       */
/* ================================================================ */

.classroom-hub-container {
  padding: 28px 36px;
  max-width: 1240px;
  margin: 0 auto;
  width: 100%;
}

.classroom-hub-header {
  margin-bottom: 24px;
}

.classroom-hub-title {
  font-size: 24px;
  font-weight: 800;
  color: #f8fafc;
  letter-spacing: -0.5px;
  margin: 0 0 6px 0;
}

.classroom-hub-subtitle {
  font-size: 13px;
  color: #94a3b8;
}

.classroom-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 22px;
  margin-top: 16px;
}

.classroom-card {
  background: rgba(30, 41, 59, 0.7);
  backdrop-filter: blur(12px);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 16px;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  transition: all 0.25s cubic-bezier(0.4, 0, 0.2, 1);
  cursor: pointer;
  position: relative;
}

.classroom-card:hover {
  transform: translateY(-5px);
  border-color: rgba(99, 102, 241, 0.45);
  box-shadow: 0 16px 32px -10px rgba(99, 102, 241, 0.35);
  background: rgba(30, 41, 59, 0.92);
}

.classroom-cover {
  height: 130px;
  width: 100%;
  position: relative;
  overflow: hidden;
  background: linear-gradient(135deg, #1e1b4b 0%, #312e81 100%);
}

.classroom-cover-img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.4s ease;
}

.classroom-card:hover .classroom-cover-img {
  transform: scale(1.06);
}

.classroom-badge {
  position: absolute;
  top: 12px;
  right: 12px;
  background: rgba(15, 23, 42, 0.85);
  backdrop-filter: blur(8px);
  border: 1px solid rgba(255, 255, 255, 0.15);
  color: #a78bfa;
  font-size: 10px;
  font-weight: 700;
  padding: 3px 10px;
  border-radius: 99px;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.classroom-body {
  padding: 18px 20px 20px 20px;
  flex: 1;
  display: flex;
  flex-direction: column;
}

.classroom-name {
  font-size: 16px;
  font-weight: 700;
  color: #f1f5f9;
  margin-bottom: 8px;
  line-height: 1.35;
}

.classroom-meta {
  font-size: 12px;
  color: #94a3b8;
  display: flex;
  gap: 12px;
  margin-top: 8px;
  margin-bottom: 18px;
}

.classroom-enter-btn {
  width: 100%;
  padding: 10px 16px;
  border-radius: 10px;
  background: linear-gradient(135deg, #4f46e5 0%, #6366f1 100%);
  color: white;
  font-weight: 600;
  font-size: 13px;
  border: none;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  transition: all 0.2s ease;
  cursor: pointer;
  margin-top: auto;
}

.classroom-card:hover .classroom-enter-btn {
  background: linear-gradient(135deg, #6366f1 0%, #818cf8 100%);
  box-shadow: 0 4px 14px rgba(99, 102, 241, 0.4);
}

.classroom-detail-header {
  display: flex;
  flex-direction: column;
  gap: 14px;
  margin-bottom: 18px;
}

.classroom-back-link {
  align-self: flex-start;
  border: 1px solid rgba(148, 163, 184, 0.22);
  background: rgba(15, 23, 42, 0.62);
  color: #cbd5e1;
  border-radius: 8px;
  padding: 8px 12px;
  font-size: 12px;
  font-weight: 700;
  cursor: pointer;
}

.classroom-detail-hero {
  display: grid;
  grid-template-columns: 88px minmax(0, 1fr) auto;
  gap: 18px;
  align-items: center;
  background: rgba(15, 23, 42, 0.72);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 8px;
  padding: 16px;
}

.classroom-detail-hero img {
  width: 88px;
  height: 88px;
  border-radius: 8px;
  object-fit: cover;
  background: rgba(30, 41, 59, 0.9);
}

.classroom-badge.inline {
  position: static;
  display: inline-flex;
  margin-bottom: 8px;
}

.classroom-chat-btn {
  border: none;
  border-radius: 8px;
  background: #22c55e;
  color: #052e16;
  font-weight: 800;
  font-size: 13px;
  padding: 10px 14px;
  cursor: pointer;
}

.classroom-tabs {
  display: flex;
  gap: 8px;
  overflow-x: auto;
  padding-bottom: 8px;
  margin-bottom: 14px;
}

.classroom-tab {
  border: 1px solid rgba(148, 163, 184, 0.2);
  background: rgba(15, 23, 42, 0.65);
  color: #cbd5e1;
  border-radius: 8px;
  min-height: 38px;
  padding: 8px 12px;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-size: 12px;
  font-weight: 800;
  white-space: nowrap;
  cursor: pointer;
}

.classroom-tab strong {
  min-width: 22px;
  min-height: 22px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 999px;
  background: rgba(148, 163, 184, 0.18);
  color: #e2e8f0;
  font-size: 11px;
}

.classroom-tab.active {
  background: #f8fafc;
  color: #0f172a;
  border-color: #f8fafc;
}

.classroom-tab.active strong {
  background: rgba(15, 23, 42, 0.12);
  color: #0f172a;
}

.classroom-tab-panel {
  min-height: 260px;
}

.classroom-resource-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(250px, 1fr));
  gap: 14px;
}

.classroom-resource-card,
.classroom-topic-card,
.classroom-test-card {
  background: rgba(30, 41, 59, 0.78);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 8px;
  overflow: hidden;
}

.classroom-resource-card {
  display: grid;
  grid-template-rows: 130px 1fr;
}

.classroom-resource-thumb {
  width: 100%;
  height: 130px;
  object-fit: cover;
  background: #111827;
}

.classroom-resource-thumb.placeholder {
  display: flex;
  align-items: center;
  justify-content: center;
  color: #e2e8f0;
  font-size: 32px;
  font-weight: 900;
}

.classroom-resource-body {
  padding: 14px;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.classroom-resource-type {
  color: #93c5fd;
  font-size: 10px;
  font-weight: 900;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.classroom-resource-body h3,
.classroom-topic-card h3,
.classroom-test-card h3 {
  margin: 0;
  color: #f8fafc;
  font-size: 15px;
  line-height: 1.35;
}

.classroom-resource-body p,
.classroom-topic-card p,
.classroom-test-card p {
  margin: 0;
  color: #94a3b8;
  font-size: 12px;
  line-height: 1.5;
}

.classroom-resource-link {
  margin-top: auto;
  color: #bfdbfe;
  font-size: 12px;
  font-weight: 800;
  text-decoration: none;
}

.classroom-topic-list,
.classroom-test-list,
.classroom-overview-grid {
  display: grid;
  gap: 12px;
}

.classroom-topic-card,
.classroom-test-card {
  padding: 16px;
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 16px;
  align-items: start;
}

.topic-objective {
  color: #dbeafe !important;
  margin-top: 8px !important;
}

.topic-counts,
.test-count {
  display: flex;
  flex-direction: column;
  gap: 6px;
  align-items: flex-end;
  color: #cbd5e1;
  font-size: 11px;
  font-weight: 800;
  white-space: nowrap;
}

.classroom-empty {
  padding: 22px;
  border: 1px dashed rgba(148, 163, 184, 0.28);
  border-radius: 8px;
  color: #94a3b8;
  background: rgba(15, 23, 42, 0.45);
  font-size: 13px;
}

@media (max-width: 720px) {
  .classroom-hub-container {
    padding: 18px;
  }

  .classroom-detail-hero {
    grid-template-columns: 64px minmax(0, 1fr);
  }

  .classroom-detail-hero img {
    width: 64px;
    height: 64px;
  }

  .classroom-chat-btn {
    grid-column: 1 / -1;
  }

  .classroom-topic-card,
  .classroom-test-card {
    grid-template-columns: 1fr;
  }

  .topic-counts,
  .test-count {
    align-items: flex-start;
  }
}

