/* ==========================================================================
   THEME: Nordic Obsidian & Cyber Mint
   Brand Redesign for BSUIR Group 434501 Fair Lab Queue
   ========================================================================== */

:root {
  /* Color Palette */
  --bg-base: #080b0f;
  --bg-surface: #0e131b;
  --bg-card: #131922;
  --bg-card-hover: #19222f;
  --bg-card-active: #1f2b3c;
  --bg-glass: rgba(19, 25, 34, 0.85);

  --border-subtle: rgba(255, 255, 255, 0.08);
  --border-card: rgba(255, 255, 255, 0.1);
  --border-card-hover: rgba(52, 211, 153, 0.35);

  /* Typography Colors */
  --text-pure: #ffffff;
  --text-main: #e2e8f0;
  --text-secondary: #94a3b8;
  --text-muted: #64748b;
  --text-disabled: #475569;

  /* Primary Brand Accent (Cyber Mint & Emerald) */
  --accent-mint: #10b981;
  --accent-mint-bright: #34d399;
  --accent-mint-deep: #059669;
  --accent-mint-glow: rgba(16, 185, 129, 0.22);
  --accent-mint-soft: rgba(16, 185, 129, 0.12);

  /* Secondary Accents */
  --accent-cyan: #06b6d4;
  --accent-cyan-light: #38bdf8;
  --accent-cyan-glow: rgba(6, 182, 212, 0.2);
  --accent-cyan-soft: rgba(6, 182, 212, 0.12);

  --accent-amber: #f59e0b;
  --accent-amber-bright: #fbbf24;
  --accent-amber-glow: rgba(245, 158, 11, 0.2);
  --accent-amber-soft: rgba(245, 158, 11, 0.12);

  --accent-rose: #f43f5e;
  --accent-rose-soft: rgba(244, 63, 94, 0.12);

  --accent-purple: #a855f7;
  --accent-purple-soft: rgba(168, 85, 247, 0.12);

  /* Geometry & Shadows */
  --radius-xs: 6px;
  --radius-sm: 10px;
  --radius-md: 14px;
  --radius-lg: 18px;
  --radius-xl: 24px;
  --radius-full: 9999px;

  --shadow-sm: 0 2px 8px rgba(0, 0, 0, 0.4);
  --shadow-card: 0 4px 20px -2px rgba(0, 0, 0, 0.5), 0 2px 6px -1px rgba(0, 0, 0, 0.3);
  --shadow-hover: 0 12px 30px -4px rgba(0, 0, 0, 0.7), 0 0 20px -2px var(--accent-mint-glow);
  --shadow-hero: 0 16px 40px -8px rgba(0, 0, 0, 0.8), 0 0 30px -4px var(--accent-mint-glow);

  --font-sans: 'Plus Jakarta Sans', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  --font-mono: 'JetBrains Mono', 'Fira Code', monospace;
}

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

body {
  font-family: var(--font-sans);
  background-color: var(--bg-base);
  color: var(--text-main);
  line-height: 1.5;
  min-height: 100vh;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  background-image: 
    radial-gradient(circle at 15% 10%, rgba(16, 185, 129, 0.05) 0%, transparent 40%),
    radial-gradient(circle at 85% 15%, rgba(6, 182, 212, 0.05) 0%, transparent 40%),
    radial-gradient(circle at 50% 90%, rgba(245, 158, 11, 0.03) 0%, transparent 50%);
  background-attachment: fixed;
}

.app-container {
  max-width: 1280px;
  margin: 0 auto;
  padding: 0 20px 80px 20px;
}

/* ==========================================================================
   Navigation Bar
   ========================================================================== */

.navbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 16px 20px;
  margin-top: 16px;
  margin-bottom: 24px;
  background: var(--bg-glass);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-sm);
  gap: 16px;
}

.nav-left, .nav-center, .nav-right {
  display: flex;
  align-items: center;
  gap: 14px;
}

/* Logo */
.logo-box {
  display: flex;
  align-items: center;
  gap: 12px;
}

.logo-icon-pulse {
  width: 40px;
  height: 40px;
  background: linear-gradient(135deg, #10b981, #06b6d4);
  border-radius: var(--radius-sm);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 20px;
  box-shadow: 0 0 16px var(--accent-mint-glow);
  animation: logoGlow 3s ease-in-out infinite alternate;
}

@keyframes logoGlow {
  0% { box-shadow: 0 0 12px var(--accent-mint-glow); }
  100% { box-shadow: 0 0 24px rgba(6, 182, 212, 0.4); }
}

.logo-text-group {
  display: flex;
  flex-direction: column;
}

.logo-title {
  font-size: 16px;
  font-weight: 800;
  letter-spacing: 0.5px;
  color: var(--text-pure);
}

.logo-title .accent-text {
  color: var(--accent-mint-bright);
}

.logo-subtitle {
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 1px;
  color: var(--text-muted);
}

/* Academic Week Badge */
.badge-week {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 6px 14px;
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-full);
  font-size: 12px;
  font-weight: 600;
  color: var(--accent-cyan-light);
}

.pulse-dot {
  width: 8px;
  height: 8px;
  background-color: var(--accent-mint-bright);
  border-radius: 50%;
  box-shadow: 0 0 8px var(--accent-mint);
  animation: pulseAnim 2s infinite;
}

@keyframes pulseAnim {
  0% { transform: scale(0.95); opacity: 0.8; }
  50% { transform: scale(1.2); opacity: 1; }
  100% { transform: scale(0.95); opacity: 0.8; }
}

/* Subgroup Switcher */
.subgroup-switcher {
  display: flex;
  background: rgba(0, 0, 0, 0.4);
  padding: 4px;
  border-radius: var(--radius-full);
  border: 1px solid var(--border-subtle);
}

.pill-btn {
  background: transparent;
  border: none;
  color: var(--text-secondary);
  font-family: inherit;
  font-size: 13px;
  font-weight: 600;
  padding: 7px 16px;
  border-radius: var(--radius-full);
  cursor: pointer;
  transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
  white-space: nowrap;
}

.pill-btn:hover {
  color: var(--text-pure);
}

.pill-btn.active {
  background: var(--accent-mint-deep);
  color: var(--text-pure);
  box-shadow: 0 2px 10px var(--accent-mint-glow);
}

/* User Pill (Persistent Login) */
.user-pill {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 6px 14px;
  background: var(--accent-mint-soft);
  border: 1px solid rgba(16, 185, 129, 0.3);
  border-radius: var(--radius-full);
  font-size: 13px;
  font-weight: 600;
  color: var(--accent-mint-bright);
}

.user-pill .user-avatar {
  font-size: 14px;
}

.user-pill .user-name {
  color: var(--text-pure);
  font-weight: 700;
}

.user-pill .user-subgroup {
  padding: 2px 7px;
  background: rgba(16, 185, 129, 0.25);
  border-radius: var(--radius-full);
  font-size: 11px;
}

.btn-icon {
  background: transparent;
  border: none;
  color: var(--text-muted);
  cursor: pointer;
  font-size: 14px;
  padding: 2px 6px;
  border-radius: 50%;
  transition: color 0.2s;
}

.btn-icon:hover {
  color: var(--accent-rose);
}

/* ==========================================================================
   Buttons
   ========================================================================== */

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 9px 18px;
  font-family: inherit;
  font-size: 14px;
  font-weight: 600;
  border-radius: var(--radius-sm);
  cursor: pointer;
  transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
  border: 1px solid transparent;
  text-decoration: none;
}

.btn-sm {
  padding: 6px 13px;
  font-size: 12px;
  border-radius: var(--radius-xs);
}

.btn-primary {
  background: linear-gradient(135deg, #10b981, #059669);
  color: #ffffff;
  box-shadow: 0 4px 14px var(--accent-mint-glow);
}

.btn-primary:hover:not(:disabled) {
  background: linear-gradient(135deg, #34d399, #10b981);
  transform: translateY(-1px);
  box-shadow: 0 6px 18px var(--accent-mint-glow);
}

.btn-primary:disabled {
  opacity: 0.45;
  cursor: not-allowed;
  box-shadow: none;
}

.btn-secondary {
  background: rgba(255, 255, 255, 0.06);
  border-color: var(--border-subtle);
  color: var(--text-main);
}

.btn-secondary:hover {
  background: rgba(255, 255, 255, 0.12);
  border-color: rgba(255, 255, 255, 0.2);
  color: var(--text-pure);
}

.btn-ghost {
  background: transparent;
  color: var(--text-secondary);
}

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

.btn-outline-light {
  background: transparent;
  border: 1px solid rgba(255, 255, 255, 0.15);
  color: var(--text-main);
}

.btn-outline-light:hover {
  border-color: var(--accent-mint-bright);
  color: var(--accent-mint-bright);
  background: var(--accent-mint-soft);
}

.btn-warning {
  background: linear-gradient(135deg, #f59e0b, #d97706);
  color: #ffffff;
  box-shadow: 0 4px 12px var(--accent-amber-glow);
}

.btn-warning:hover:not(:disabled) {
  background: linear-gradient(135deg, #fbbf24, #f59e0b);
  transform: translateY(-1px);
}

.btn-danger-sm {
  background: rgba(239, 68, 68, 0.15);
  border: 1px solid rgba(239, 68, 68, 0.4);
  color: #f87171;
  padding: 6px 14px;
  font-size: 12px;
  font-weight: 700;
  border-radius: var(--radius-xs);
  cursor: pointer;
  transition: all 0.2s ease;
  display: inline-flex;
  align-items: center;
  gap: 5px;
}

.btn-danger-sm:hover {
  background: #dc2626;
  border-color: #ef4444;
  color: #ffffff;
  box-shadow: 0 2px 10px rgba(220, 38, 38, 0.35);
  transform: translateY(-1px);
}

.btn-join-pulse {
  animation: joinPulse 2.5s infinite;
}

@keyframes joinPulse {
  0% { box-shadow: 0 0 0 0 rgba(16, 185, 129, 0.6); }
  70% { box-shadow: 0 0 0 10px rgba(16, 185, 129, 0); }
  100% { box-shadow: 0 0 0 0 rgba(16, 185, 129, 0); }
}

/* ==========================================================================
   Top Fairness Banner
   ========================================================================== */

.banner-fairness {
  margin-bottom: 24px;
  background: linear-gradient(135deg, rgba(16, 185, 129, 0.08), rgba(6, 182, 212, 0.04));
  border: 1px solid rgba(16, 185, 129, 0.2);
  border-radius: var(--radius-md);
  padding: 16px 20px;
}

.banner-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
}

.banner-icon {
  font-size: 32px;
  flex-shrink: 0;
}

.banner-text {
  flex: 1;
}

.banner-headline {
  font-size: 14px;
  font-weight: 700;
  color: var(--accent-mint-bright);
  margin-bottom: 4px;
}

.banner-text p {
  font-size: 13px;
  color: var(--text-secondary);
  line-height: 1.4;
  margin: 0;
}

.banner-action {
  flex-shrink: 0;
}

/* ==========================================================================
   FEATURED SPOTLIGHT HERO CARD (Ближайшая лабораторная работа)
   ========================================================================== */

.spotlight-hero-section {
  margin-bottom: 30px;
}

.spotlight-card {
  position: relative;
  background: linear-gradient(135deg, #131c26 0%, #172230 100%);
  border: 1px solid rgba(52, 211, 153, 0.35);
  border-radius: var(--radius-xl);
  padding: 24px 28px;
  box-shadow: var(--shadow-hero);
  overflow: hidden;
  display: flex;
  flex-direction: column;
  gap: 18px;
  transition: all 0.3s ease;
}

.spotlight-card::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 4px;
  background: linear-gradient(90deg, #10b981, #06b6d4, #f59e0b);
}

.spotlight-top-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 12px;
}

.spotlight-badge-group {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
}

.badge-spotlight-label {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 5px 12px;
  background: linear-gradient(135deg, #10b981, #059669);
  color: #fff;
  font-size: 11px;
  font-weight: 800;
  letter-spacing: 0.8px;
  border-radius: var(--radius-full);
  text-transform: uppercase;
  box-shadow: 0 0 12px var(--accent-mint-glow);
}

.badge-relative-date {
  padding: 5px 12px;
  border-radius: var(--radius-full);
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.4px;
}

.badge-relative-date.today {
  background: rgba(245, 158, 11, 0.15);
  border: 1px solid rgba(245, 158, 11, 0.4);
  color: #fbbf24;
}

.badge-relative-date.tomorrow {
  background: rgba(6, 182, 212, 0.15);
  border: 1px solid rgba(6, 182, 212, 0.4);
  color: #38bdf8;
}

.badge-relative-date.normal {
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid var(--border-subtle);
  color: var(--text-secondary);
}

.spotlight-time-pill {
  font-family: var(--font-mono);
  font-size: 15px;
  font-weight: 700;
  color: var(--text-pure);
  background: rgba(0, 0, 0, 0.4);
  padding: 6px 14px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border-subtle);
  display: inline-flex;
  align-items: center;
  gap: 8px;
}

.spotlight-body {
  display: grid;
  grid-template-columns: 1fr auto;
  align-items: center;
  gap: 20px;
}

.spotlight-main-info {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.spotlight-subject-row {
  display: flex;
  align-items: center;
  gap: 12px;
  flex-wrap: wrap;
}

.subject-code-tag {
  font-size: 22px;
  font-weight: 800;
  letter-spacing: 0.5px;
  color: #ffffff;
  padding: 4px 12px;
  border-radius: var(--radius-sm);
  background: rgba(255, 255, 255, 0.08);
}

.subject-subgroup-pill {
  padding: 4px 10px;
  font-size: 12px;
  font-weight: 700;
  border-radius: var(--radius-full);
}

.subject-subgroup-pill.p1 {
  background: rgba(6, 182, 212, 0.18);
  border: 1px solid rgba(6, 182, 212, 0.4);
  color: #38bdf8;
}

.subject-subgroup-pill.p2 {
  background: rgba(168, 85, 247, 0.18);
  border: 1px solid rgba(168, 85, 247, 0.4);
  color: #c084fc;
}

.subject-subgroup-pill.p0 {
  background: rgba(245, 158, 11, 0.18);
  border: 1px solid rgba(245, 158, 11, 0.4);
  color: #fbbf24;
}

.spotlight-subject-title {
  font-size: 18px;
  font-weight: 700;
  color: var(--text-pure);
}

.spotlight-meta-tags {
  display: flex;
  align-items: center;
  gap: 16px;
  flex-wrap: wrap;
  margin-top: 4px;
}

.meta-pill {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 13px;
  color: var(--text-secondary);
  background: rgba(255, 255, 255, 0.04);
  padding: 4px 10px;
  border-radius: var(--radius-xs);
  border: 1px solid var(--border-subtle);
}

.meta-pill strong {
  color: var(--text-main);
}

.spotlight-actions {
  display: flex;
  flex-direction: column;
  gap: 10px;
  align-items: flex-end;
}

.spotlight-cta-btn {
  padding: 12px 24px;
  font-size: 15px;
  font-weight: 700;
}

/* ==========================================================================
   Schedule Section & Filter Controls
   ========================================================================== */

.schedule-control-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 16px;
  margin-bottom: 16px;
}

.control-bar-left {
  display: flex;
  flex-direction: column;
}

.section-title {
  font-size: 20px;
  font-weight: 800;
  color: var(--text-pure);
  letter-spacing: -0.3px;
}

.section-subtitle {
  font-size: 13px;
  color: var(--text-muted);
}

.schedule-control-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 20px;
  flex-wrap: wrap;
  gap: 16px;
}

.control-bar-right-filters {
  display: flex;
  align-items: center;
  gap: 12px;
  flex-wrap: wrap;
}

/* Lesson Type Tabs (All, Labs, Practicals) */
.lesson-type-tabs {
  display: flex;
  background: rgba(0, 0, 0, 0.4);
  padding: 4px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border-subtle);
  gap: 4px;
}

.type-tab {
  background: transparent;
  border: none;
  color: var(--text-secondary);
  font-family: inherit;
  font-size: 13px;
  font-weight: 600;
  padding: 7px 14px;
  border-radius: var(--radius-xs);
  cursor: pointer;
  transition: all 0.2s;
  white-space: nowrap;
}

.type-tab:hover {
  color: var(--text-pure);
}

.type-tab.active {
  background: var(--bg-card);
  color: #38bdf8;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.4);
  border: 1px solid rgba(56, 189, 248, 0.35);
}

/* Time Filter Tabs */
.time-filter-tabs {
  display: flex;
  background: rgba(0, 0, 0, 0.4);
  padding: 4px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border-subtle);
  gap: 4px;
}

.time-tab {
  background: transparent;
  border: none;
  color: var(--text-secondary);
  font-family: inherit;
  font-size: 13px;
  font-weight: 600;
  padding: 7px 14px;
  border-radius: var(--radius-xs);
  cursor: pointer;
  transition: all 0.2s;
  white-space: nowrap;
}

.time-tab:hover {
  color: var(--text-pure);
}

.time-tab.active {
  background: var(--bg-card);
  color: var(--accent-mint-bright);
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.4);
  border: 1px solid rgba(52, 211, 153, 0.3);
}

/* Subject Quick Filters */
.subject-filters-bar {
  display: flex;
  align-items: center;
  gap: 8px;
  overflow-x: auto;
  padding-bottom: 8px;
  margin-bottom: 20px;
  scrollbar-width: thin;
}

.sub-chip {
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid var(--border-subtle);
  color: var(--text-secondary);
  font-family: inherit;
  font-size: 12px;
  font-weight: 600;
  padding: 6px 14px;
  border-radius: var(--radius-full);
  cursor: pointer;
  transition: all 0.2s;
  white-space: nowrap;
}

.sub-chip:hover {
  background: rgba(255, 255, 255, 0.08);
  color: var(--text-pure);
}

.sub-chip.active {
  background: var(--accent-mint-soft);
  border-color: var(--accent-mint-bright);
  color: var(--accent-mint-bright);
  box-shadow: 0 0 10px var(--accent-mint-glow);
}

/* ==========================================================================
   Sessions Grid & Session Cards
   ========================================================================== */

.sessions-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(350px, 1fr));
  gap: 20px;
}

.session-card {
  background: var(--bg-card);
  border: 1px solid var(--border-card);
  border-radius: var(--radius-lg);
  padding: 18px 20px;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  box-shadow: var(--shadow-card);
  cursor: pointer;
  transition: all 0.25s cubic-bezier(0.4, 0, 0.2, 1);
  position: relative;
  overflow: hidden;
}

.session-card:hover {
  background: var(--bg-card-hover);
  border-color: var(--border-card-hover);
  transform: translateY(-3px);
  box-shadow: var(--shadow-hover);
}

/* Card Top Ribbon: Date & Time in High Contrast */
.card-date-ribbon {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 14px;
  padding-bottom: 12px;
  border-bottom: 1px solid var(--border-subtle);
}

.card-date-badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 12px;
  font-weight: 700;
  color: var(--text-main);
}

.date-status-tag {
  font-size: 10px;
  font-weight: 800;
  text-transform: uppercase;
  padding: 2px 7px;
  border-radius: var(--radius-xs);
  letter-spacing: 0.5px;
}

.date-status-tag.today {
  background: rgba(245, 158, 11, 0.2);
  color: #fbbf24;
  border: 1px solid rgba(245, 158, 11, 0.4);
}

.date-status-tag.tomorrow {
  background: rgba(6, 182, 212, 0.2);
  color: #38bdf8;
  border: 1px solid rgba(6, 182, 212, 0.4);
}

.card-time-pill {
  font-family: var(--font-mono);
  font-size: 13px;
  font-weight: 700;
  color: #ffffff;
  background: rgba(0, 0, 0, 0.35);
  padding: 4px 10px;
  border-radius: var(--radius-xs);
  border: 1px solid var(--border-subtle);
}

/* Card Subject & Details */
.card-subject-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 8px;
}

.card-subject-code {
  font-size: 17px;
  font-weight: 800;
  letter-spacing: 0.3px;
  padding: 2px 8px;
  border-radius: var(--radius-xs);
}

.card-subgroup-badge {
  font-size: 11px;
  font-weight: 700;
  padding: 3px 8px;
  border-radius: var(--radius-full);
}

.card-subgroup-badge.badge-sub1 {
  background: rgba(6, 182, 212, 0.15);
  color: #38bdf8;
  border: 1px solid rgba(6, 182, 212, 0.3);
}

.card-subgroup-badge.badge-sub2 {
  background: rgba(168, 85, 247, 0.15);
  color: #c084fc;
  border: 1px solid rgba(168, 85, 247, 0.3);
}

.card-subgroup-badge.badge-sub0 {
  background: rgba(245, 158, 11, 0.15);
  color: #fbbf24;
  border: 1px solid rgba(245, 158, 11, 0.3);
}

.card-subject-fullname {
  font-size: 14px;
  font-weight: 600;
  color: var(--text-pure);
  line-height: 1.35;
  margin-bottom: 12px;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.card-meta-list {
  display: flex;
  flex-direction: column;
  gap: 6px;
  margin-bottom: 16px;
  font-size: 12px;
  color: var(--text-secondary);
}

.card-meta-item {
  display: flex;
  align-items: center;
  gap: 8px;
}

.card-meta-item .meta-icon {
  font-size: 14px;
  width: 18px;
  text-align: center;
}

/* Card Footer */
.card-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding-top: 12px;
  border-top: 1px solid var(--border-subtle);
  gap: 10px;
}

/* Status Badges */
.status-badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 4px 10px;
  font-size: 12px;
  font-weight: 700;
  border-radius: var(--radius-full);
}

.status-badge.status-open {
  background: rgba(16, 185, 129, 0.15);
  border: 1px solid rgba(16, 185, 129, 0.35);
  color: #34d399;
}

.status-badge.status-lottery {
  background: rgba(245, 158, 11, 0.18);
  border: 1px solid rgba(245, 158, 11, 0.4);
  color: #fbbf24;
  animation: lotteryPulse 2s infinite;
}

@keyframes lotteryPulse {
  0% { box-shadow: 0 0 0 0 rgba(245, 158, 11, 0.4); }
  70% { box-shadow: 0 0 0 8px rgba(245, 158, 11, 0); }
  100% { box-shadow: 0 0 0 0 rgba(245, 158, 11, 0); }
}

.status-badge.status-live {
  background: rgba(244, 63, 94, 0.18);
  border: 1px solid rgba(244, 63, 94, 0.4);
  color: #fb7185;
}

.status-badge.status-scheduled {
  background: rgba(100, 116, 139, 0.15);
  border: 1px solid rgba(148, 163, 184, 0.3);
  color: #94a3b8;
  font-weight: 700;
}

/* Lesson Type Specific Badges */
.badge-lesson-type {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 4px 10px;
  font-size: 11px;
  font-weight: 800;
  letter-spacing: 0.3px;
  text-transform: uppercase;
  border-radius: var(--radius-full);
}

.badge-lesson-type.badge-lr {
  background: rgba(16, 185, 129, 0.16);
  border: 1px solid rgba(52, 211, 153, 0.4);
  color: #34d399;
}

.badge-lesson-type.badge-pz {
  background: rgba(168, 85, 247, 0.16);
  border: 1px solid rgba(192, 132, 252, 0.4);
  color: #c084fc;
}

/* ==========================================================================
   View 2: Dedicated Session Queue Board
   ========================================================================== */

.board-top-nav {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 20px;
  flex-wrap: wrap;
  gap: 12px;
}

.board-action-buttons {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
}

.session-header-card {
  background: var(--bg-card);
  border: 1px solid var(--border-card);
  border-radius: var(--radius-lg);
  padding: 22px 26px;
  margin-bottom: 20px;
  box-shadow: var(--shadow-card);
}

/* Personal User Status Box */
.user-queue-status-box {
  margin-bottom: 20px;
  padding: 16px 22px;
  border-radius: var(--radius-md);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
}

.user-queue-status-box.in-queue {
  background: linear-gradient(135deg, rgba(16, 185, 129, 0.15), rgba(6, 182, 212, 0.08));
  border: 1px solid rgba(52, 211, 153, 0.4);
  box-shadow: 0 0 20px var(--accent-mint-glow);
}

.user-queue-status-box.not-in-queue {
  background: rgba(255, 255, 255, 0.03);
  border: 1px dashed var(--border-subtle);
}

.user-queue-status-left {
  display: flex;
  align-items: center;
  gap: 14px;
}

.user-pos-pill-huge {
  font-family: var(--font-mono);
  font-size: 20px;
  font-weight: 800;
  padding: 8px 16px;
  border-radius: var(--radius-sm);
  background: var(--accent-mint);
  color: #000;
  box-shadow: 0 0 16px var(--accent-mint-glow);
}

.user-status-text h5 {
  font-size: 15px;
  font-weight: 700;
  color: var(--text-pure);
  margin-bottom: 2px;
}

.user-status-text p {
  font-size: 12px;
  color: var(--text-secondary);
  margin: 0;
}

/* Lottery Active Banner */
.lottery-active-banner {
  background: linear-gradient(135deg, rgba(245, 158, 11, 0.12), rgba(217, 119, 6, 0.06));
  border: 1px solid rgba(245, 158, 11, 0.35);
  border-radius: var(--radius-md);
  padding: 18px 24px;
  margin-bottom: 22px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
}

.banner-lottery-content {
  flex: 1;
}

.lottery-pulse-badge {
  font-size: 12px;
  font-weight: 800;
  letter-spacing: 0.8px;
  color: #fbbf24;
  margin-bottom: 6px;
}

.banner-lottery-content p {
  font-size: 13px;
  color: var(--text-secondary);
  margin-bottom: 8px;
}

.lottery-countdown-box {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-size: 13px;
  color: var(--text-main);
  background: rgba(0, 0, 0, 0.4);
  padding: 4px 12px;
  border-radius: var(--radius-full);
}

.lottery-countdown-box strong {
  font-family: var(--font-mono);
  font-size: 15px;
  color: #fbbf24;
}

/* ==========================================================================
   Queue Table
   ========================================================================== */

.queue-list-container {
  background: var(--bg-card);
  border: 1px solid var(--border-card);
  border-radius: var(--radius-lg);
  padding: 22px 24px;
  box-shadow: var(--shadow-card);
}

.queue-list-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 18px;
  flex-wrap: wrap;
  gap: 12px;
}

.queue-list-header h4 {
  font-size: 17px;
  font-weight: 800;
  color: var(--text-pure);
}

.queue-sub-hint {
  font-size: 12px;
  color: var(--text-muted);
}

.queue-legend {
  display: flex;
  align-items: center;
  gap: 14px;
  font-size: 12px;
  color: var(--text-secondary);
}

.legend-item {
  display: flex;
  align-items: center;
  gap: 6px;
}

.queue-table-wrapper {
  overflow-x: auto;
}

.queue-table {
  width: 100%;
  border-collapse: separate;
  border-spacing: 0 8px;
  font-size: 14px;
}

.queue-table th {
  padding: 10px 14px;
  text-align: left;
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.8px;
  color: var(--text-muted);
  border-bottom: 1px solid var(--border-subtle);
}

.queue-table td {
  padding: 12px 14px;
  background: rgba(255, 255, 255, 0.02);
  border-top: 1px solid var(--border-subtle);
  border-bottom: 1px solid var(--border-subtle);
  vertical-align: middle;
  transition: all 0.2s;
}

.queue-table tr td:first-child {
  border-left: 1px solid var(--border-subtle);
  border-top-left-radius: var(--radius-sm);
  border-bottom-left-radius: var(--radius-sm);
}

.queue-table tr td:last-child {
  border-right: 1px solid var(--border-subtle);
  border-top-right-radius: var(--radius-sm);
  border-bottom-right-radius: var(--radius-sm);
}

.queue-table tr:hover td {
  background: rgba(255, 255, 255, 0.04);
}

/* Position Badges (Olympic style medals) */
.queue-pos-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 38px;
  height: 38px;
  border-radius: var(--radius-xs);
  font-family: var(--font-mono);
  font-size: 14px;
  font-weight: 800;
  color: var(--text-pure);
  background: rgba(255, 255, 255, 0.08);
}

.queue-pos-badge.pos-1 {
  background: linear-gradient(135deg, #f59e0b, #d97706);
  color: #fff;
  box-shadow: 0 0 14px var(--accent-amber-glow);
}

.queue-pos-badge.pos-2 {
  background: linear-gradient(135deg, #94a3b8, #64748b);
  color: #fff;
}

.queue-pos-badge.pos-3 {
  background: linear-gradient(135deg, #d97706, #b45309);
  color: #fff;
}

/* Badges */
.badge {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 4px 9px;
  font-size: 12px;
  font-weight: 600;
  border-radius: var(--radius-xs);
}

.badge-lottery {
  background: rgba(245, 158, 11, 0.15);
  color: #fbbf24;
  border: 1px solid rgba(245, 158, 11, 0.3);
}

.badge-waiting {
  background: rgba(6, 182, 212, 0.15);
  color: #38bdf8;
  border: 1px solid rgba(6, 182, 212, 0.3);
}

/* ==========================================================================
   Modals & Anti-Bot Engine
   ========================================================================== */

.modal-overlay {
  position: fixed;
  top: 0;
  left: 0;
  width: 100vw;
  height: 100vh;
  background: rgba(4, 7, 12, 0.82);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 1000;
  padding: 20px;
}

.modal-overlay.hidden {
  display: none !important;
}

.modal-box {
  background: #111722;
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: var(--radius-lg);
  width: 100%;
  max-width: 480px;
  box-shadow: 0 20px 50px rgba(0, 0, 0, 0.8), 0 0 30px rgba(16, 185, 129, 0.1);
  overflow: hidden;
  animation: modalIn 0.25s cubic-bezier(0.16, 1, 0.3, 1);
}

.modal-box.modal-lg {
  max-width: 680px;
}

@keyframes modalIn {
  from { opacity: 0; transform: scale(0.96) translateY(10px); }
  to { opacity: 1; transform: scale(1) translateY(0); }
}

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

.modal-header h3 {
  font-size: 17px;
  font-weight: 700;
  color: var(--text-pure);
}

.modal-close {
  background: transparent;
  border: none;
  color: var(--text-muted);
  font-size: 18px;
  cursor: pointer;
  transition: color 0.2s;
}

.modal-close:hover {
  color: var(--text-pure);
}

.modal-body {
  padding: 22px 24px;
}

.modal-desc {
  font-size: 13px;
  color: var(--text-secondary);
  line-height: 1.5;
  margin-bottom: 16px;
}

.modal-footer {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 12px;
  padding: 16px 24px;
  border-top: 1px solid var(--border-subtle);
  background: rgba(0, 0, 0, 0.2);
}

.form-group {
  margin-bottom: 16px;
}

.form-group label {
  display: block;
  font-size: 12px;
  font-weight: 600;
  color: var(--text-secondary);
  margin-bottom: 6px;
}

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

.flex-1 { flex: 1; }
.flex-2 { flex: 2; }

.form-control {
  width: 100%;
  padding: 10px 14px;
  background: rgba(0, 0, 0, 0.4);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-sm);
  color: var(--text-pure);
  font-family: inherit;
  font-size: 14px;
  transition: all 0.2s;
}

.form-control:focus {
  outline: none;
  border-color: var(--accent-mint);
  box-shadow: 0 0 10px var(--accent-mint-glow);
}

.modal-alert-error {
  padding: 10px 14px;
  background: rgba(244, 63, 94, 0.15);
  border: 1px solid rgba(244, 63, 94, 0.3);
  color: #fb7185;
  font-size: 12px;
  font-weight: 600;
  border-radius: var(--radius-sm);
  margin-top: 14px;
}

.active-user-notice {
  padding: 10px 14px;
  background: rgba(16, 185, 129, 0.1);
  border: 1px solid rgba(16, 185, 129, 0.25);
  border-radius: var(--radius-sm);
  font-size: 13px;
  color: var(--accent-mint-bright);
}

/* Anti-Bot Slider & Canvas */
.antibot-container {
  background: rgba(0, 0, 0, 0.3);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-sm);
  padding: 14px;
  margin-top: 14px;
}

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

.antibot-title {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 12px;
  color: var(--text-pure);
}

.antibot-hint {
  font-size: 11px;
  color: var(--text-muted);
}

.canvas-wrapper {
  background: #090c10;
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-xs);
  overflow: hidden;
  margin-bottom: 12px;
}

.canvas-wrapper canvas {
  display: block;
  width: 100%;
}

.slider-wrapper {
  margin-bottom: 8px;
}

.slider-control {
  width: 100%;
  height: 8px;
  border-radius: 4px;
  outline: none;
  appearance: none;
  -webkit-appearance: none;
  background: rgba(255, 255, 255, 0.1);
  cursor: pointer;
}

.slider-control::-webkit-slider-thumb {
  appearance: none;
  -webkit-appearance: none;
  width: 24px;
  height: 24px;
  border-radius: 50%;
  background: var(--accent-mint);
  box-shadow: 0 0 10px var(--accent-mint-glow);
  cursor: grab;
  border: 2px solid #fff;
  transition: transform 0.1s;
}

.slider-control::-webkit-slider-thumb:hover {
  transform: scale(1.15);
}

.antibot-status {
  font-size: 12px;
  color: var(--text-muted);
  text-align: center;
  padding-top: 4px;
  transition: all 0.2s;
}

.antibot-status.matched {
  color: var(--accent-mint-bright);
  font-weight: 700;
}

/* ==========================================================================
   Toasts & Utilities
   ========================================================================== */

.toast-container {
  position: fixed;
  bottom: 24px;
  right: 24px;
  display: flex;
  flex-direction: column;
  gap: 10px;
  z-index: 2000;
  pointer-events: none;
}

.toast {
  pointer-events: auto;
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 12px 18px;
  background: #141b24;
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: var(--radius-sm);
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.6);
  font-size: 13px;
  font-weight: 600;
  color: #fff;
  animation: toastIn 0.3s cubic-bezier(0.16, 1, 0.3, 1);
}

.toast-success { border-color: rgba(16, 185, 129, 0.4); }
.toast-error { border-color: rgba(244, 63, 94, 0.4); }

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

.hidden { display: none !important; }

/* Responsive Adjustments */
@media (max-width: 900px) {
  .navbar {
    flex-direction: column;
    align-items: stretch;
  }
  .nav-left, .nav-center, .nav-right {
    justify-content: space-between;
  }
  .spotlight-body {
    grid-template-columns: 1fr;
  }
  .spotlight-actions {
    align-items: stretch;
  }
  .schedule-control-bar {
    flex-direction: column;
    align-items: stretch;
  }
  .sessions-grid {
    grid-template-columns: 1fr;
  }
}

/* ==========================================================================
   Telegram Mini App & Mobile Phone Optimizations
   ========================================================================== */
@media (max-width: 600px) {
  .app-container {
    padding: max(8px, env(safe-area-inset-top)) 10px max(30px, env(safe-area-inset-bottom)) 10px;
  }
  .navbar {
    padding: 10px 12px;
    margin-top: 4px;
    margin-bottom: 14px;
    gap: 10px;
    border-radius: var(--radius-md);
  }
  .nav-left {
    display: flex;
    align-items: center;
    justify-content: space-between;
    width: 100%;
  }
  .nav-center {
    width: 100%;
    margin-top: 2px;
  }
  .subgroup-switcher {
    width: 100%;
    display: flex;
    justify-content: space-between;
  }
  .subgroup-switcher .pill-btn {
    flex: 1;
    text-align: center;
    padding: 7px 4px;
    font-size: 12px;
  }
  .nav-right {
    width: 100%;
    display: flex;
    justify-content: space-between;
    align-items: center;
  }
  .user-pill {
    max-width: 220px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    padding: 5px 10px;
    font-size: 12px;
  }
  .schedule-control-bar {
    gap: 10px;
    margin-bottom: 12px;
  }
  .lesson-type-tabs, .time-filter-tabs, .subject-filters-bar {
    display: flex;
    overflow-x: auto;
    white-space: nowrap;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: none;
    padding-bottom: 2px;
  }
  .lesson-type-tabs::-webkit-scrollbar,
  .time-filter-tabs::-webkit-scrollbar,
  .subject-filters-bar::-webkit-scrollbar {
    display: none;
  }
  .type-tab, .time-tab, .chip-subject {
    flex-shrink: 0;
    padding: 7px 12px;
    font-size: 12px;
  }
  .btn:active, .pill-btn:active, .type-tab:active, .time-tab:active {
    transform: scale(0.96);
  }
  
  /* Bottom Sheet modal style on phones inside Telegram */
  .modal-overlay {
    padding: 0;
    align-items: flex-end;
  }
  .modal-box {
    width: 100%;
    max-width: 100%;
    max-height: 88vh;
    border-bottom-left-radius: 0;
    border-bottom-right-radius: 0;
    border-top: 1px solid rgba(52, 211, 153, 0.3);
    animation: slideUpModal 0.28s cubic-bezier(0.16, 1, 0.3, 1);
  }
  .modal-box.modal-lg {
    max-height: 92vh;
  }
  .modal-header {
    padding: 14px 18px;
    position: sticky;
    top: 0;
    background: #111722;
    z-index: 10;
  }
  .modal-body {
    padding: 16px 18px;
    max-height: 65vh;
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
  }
  .modal-footer {
    padding: 12px 18px;
    position: sticky;
    bottom: 0;
    background: #0e141e;
    z-index: 10;
  }
}

@keyframes slideUpModal {
  from { transform: translateY(100%); opacity: 0.6; }
  to { transform: translateY(0); opacity: 1; }
}
