/* ============================================
   DESIGN TOKENS & CUSTOM PROPERTIES
   ============================================ */
:root {
  /* Color Palette — Clean, Minimal Light Theme */
  --bg-primary: #f8fafc;
  --bg-secondary: #f1f5f9;
  --bg-card: #ffffff;
  --bg-card-hover: #f8fafc;
  --bg-glass: rgba(241, 245, 249, 0.7);
  --bg-glass-hover: rgba(226, 232, 240, 0.7);

  --text-primary: #0f172a;
  --text-secondary: #475569;
  --text-muted: #94a3b8;
  --text-accent: #0f172a;

  --accent-violet: #0f172a;
  --accent-violet-glow: rgba(15, 23, 42, 0.1);
  --accent-indigo: #475569;
  --accent-pink: #db2777;
  --accent-teal: #0d9488;
  --accent-amber: #d97706;
  --accent-emerald: #059669;
  --accent-rose: #e11d48;
  --accent-sky: #0284c7;

  --gradient-primary: linear-gradient(135deg, #0f172a, #334155);
  --gradient-warm: linear-gradient(135deg, #d97706, #db2777);
  --gradient-cool: linear-gradient(135deg, #0d9488, #475569);
  --gradient-card: #ffffff;

  --border-subtle: #e2e8f0;
  --border-glow: #cbd5e1;

  --shadow-sm: 0 1px 2px 0 rgba(0, 0, 0, 0.05);
  --shadow-md: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -1px rgba(0, 0, 0, 0.06);
  --shadow-lg: 0 10px 15px -3px rgba(0, 0, 0, 0.1), 0 4px 6px -2px rgba(0, 0, 0, 0.05);
  --shadow-glow: 0 4px 14px 0 rgba(0, 0, 0, 0.05);

  --radius-sm: 8px;
  --radius-md: 12px;
  --radius-lg: 16px;
  --radius-xl: 20px;
  --radius-full: 9999px;

  --font-sans: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  --font-mono: 'JetBrains Mono', 'Fira Code', monospace;

  --transition-fast: 150ms cubic-bezier(0.4, 0, 0.2, 1);
  --transition-base: 250ms cubic-bezier(0.4, 0, 0.2, 1);
  --transition-slow: 400ms cubic-bezier(0.4, 0, 0.2, 1);
  --transition-spring: 500ms cubic-bezier(0.34, 1.56, 0.64, 1);
}

/* ============================================
   RESET & BASE
   ============================================ */
*, *::before, *::after {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

html {
  font-size: 16px;
  scroll-behavior: smooth;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

body {
  font-family: var(--font-sans);
  background: var(--bg-primary);
  color: var(--text-primary);
  min-height: 100vh;
  overflow-x: hidden;
  line-height: 1.6;
}

/* ============================================
   ANIMATED BACKGROUND BLOBS
   ============================================ */
/* Removed background blobs */

/* ============================================
   APP CONTAINER
   ============================================ */
.app-container {
  position: relative;
  z-index: 1;
  max-width: 1200px;
  margin: 0 auto;
  padding: 24px 20px 60px;
}

/* ============================================
   HEADER
   ============================================ */
.app-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 20px 28px;
  background: var(--bg-card);
  backdrop-filter: blur(20px) saturate(1.5);
  -webkit-backdrop-filter: blur(20px) saturate(1.5);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-xl);
  margin-bottom: 20px;
  animation: slide-down 0.6s var(--transition-spring) both;
}

.header-left {
  display: flex;
  align-items: center;
  gap: 14px;
}

.logo-icon {
  width: 48px;
  height: 48px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--gradient-primary);
  border-radius: var(--radius-md);
  color: white;
  box-shadow: 0 4px 16px var(--accent-violet-glow);
}

.app-title {
  font-size: 1.5rem;
  font-weight: 800;
  letter-spacing: -0.02em;
  color: var(--text-primary);
}

.app-subtitle {
  font-size: 0.82rem;
  color: var(--text-secondary);
  font-weight: 400;
}

.header-right {
  display: flex;
  align-items: center;
  gap: 16px;
}

.live-clock {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 8px 16px;
  background: var(--bg-glass);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-full);
  font-family: var(--font-mono);
  font-size: 0.9rem;
  font-weight: 500;
  color: var(--text-primary);
}

.clock-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--accent-emerald);
  animation: pulse-dot 2s ease-in-out infinite;
}

@keyframes pulse-dot {
  0%, 100% { opacity: 1; box-shadow: 0 0 0 0 rgba(16, 185, 129, 0.4); }
  50% { opacity: 0.7; box-shadow: 0 0 0 6px rgba(16, 185, 129, 0); }
}

.current-status {
  padding: 6px 14px;
  border-radius: var(--radius-full);
  font-size: 0.78rem;
  font-weight: 600;
  letter-spacing: 0.02em;
  text-transform: uppercase;
  white-space: nowrap;
}

.current-status.in-class {
  background: rgba(16, 185, 129, 0.15);
  color: var(--accent-emerald);
  border: 1px solid rgba(16, 185, 129, 0.3);
}

.current-status.break-time {
  background: rgba(245, 158, 11, 0.15);
  color: var(--accent-amber);
  border: 1px solid rgba(245, 158, 11, 0.3);
}

.current-status.off-hours {
  background: var(--bg-glass);
  color: var(--text-secondary);
  border: 1px solid var(--border-subtle);
}

/* ============================================
   DAY TABS
   ============================================ */
.day-tabs {
  display: flex;
  gap: 6px;
  padding: 6px;
  background: var(--bg-card);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-lg);
  margin-bottom: 20px;
  animation: slide-down 0.6s var(--transition-spring) 0.05s both;
  overflow-x: auto;
  scrollbar-width: none;
}

.day-tabs::-webkit-scrollbar {
  display: none;
}

.day-tab {
  flex: 1;
  min-width: 100px;
  padding: 10px 16px;
  border: none;
  background: transparent;
  color: var(--text-secondary);
  font-family: var(--font-sans);
  font-size: 0.85rem;
  font-weight: 500;
  border-radius: var(--radius-sm);
  cursor: pointer;
  transition: all var(--transition-base);
  position: relative;
  text-align: center;
  white-space: nowrap;
}

.day-tab:hover {
  color: var(--text-primary);
  background: var(--bg-glass-hover);
}

.day-tab.active {
  color: white;
  background: var(--gradient-primary);
  box-shadow: var(--shadow-sm);
  font-weight: 600;
}

.day-tab.today::after {
  content: '';
  position: absolute;
  bottom: 4px;
  left: 50%;
  transform: translateX(-50%);
  width: 5px;
  height: 5px;
  border-radius: 50%;
  background: var(--accent-emerald);
}

.day-tab.active.today::after {
  background: white;
}

/* ============================================
   STATS BAR
   ============================================ */
.stats-bar {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 12px;
  margin-bottom: 24px;
  animation: slide-down 0.6s var(--transition-spring) 0.1s both;
}

.stat-card {
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: 16px 12px;
  background: var(--bg-card);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
  transition: all var(--transition-base);
}

.stat-card:hover {
  border-color: var(--border-glow);
  box-shadow: var(--shadow-glow);
  transform: translateY(-2px);
}

.stat-value {
  font-size: 1.6rem;
  font-weight: 700;
  color: var(--text-primary);
}

.stat-label {
  font-size: 0.72rem;
  font-weight: 500;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.06em;
  margin-top: 4px;
}

/* ============================================
   SCHEDULE GRID
   ============================================ */
.schedule-section {
  animation: slide-down 0.6s var(--transition-spring) 0.15s both;
}

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

/* ============================================
   PERIOD CARD
   ============================================ */
.period-card {
  position: relative;
  padding: 20px;
  background: var(--bg-card);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-lg);
  transition: all var(--transition-base);
  overflow: hidden;
  animation: card-in 0.5s var(--transition-spring) both;
}

.period-card::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  width: 4px;
  height: 100%;
  border-radius: 4px 0 0 4px;
  background: var(--card-accent, var(--accent-violet));
  opacity: 0.7;
  transition: opacity var(--transition-base);
}

.period-card:hover {
  border-color: var(--border-glow);
  transform: translateY(-3px);
  box-shadow: var(--shadow-md), 0 0 20px var(--accent-violet-glow);
}

.period-card:hover::before {
  opacity: 1;
}

.period-card.empty {
  opacity: 0.35;
  background: var(--bg-glass);
  border-style: dashed;
}

.period-card.empty:hover {
  opacity: 0.55;
  transform: none;
  box-shadow: none;
}

.period-card.active-now {
  border-color: var(--accent-emerald);
  box-shadow: 0 0 0 2px var(--accent-emerald), var(--shadow-sm);
  animation: active-pulse 3s ease-in-out infinite;
}

.period-card.active-now::before {
  background: var(--accent-emerald);
  opacity: 1;
}

.period-card.completed {
  opacity: 0.5;
}

.period-card.completed .period-class-name {
  text-decoration: line-through;
  text-decoration-color: var(--text-muted);
}

@keyframes active-pulse {
  0%, 100% { box-shadow: 0 0 0 2px rgba(5, 150, 105, 0.4), var(--shadow-sm); }
  50% { box-shadow: 0 0 0 4px rgba(5, 150, 105, 0.2), var(--shadow-md); }
}

@keyframes card-in {
  from {
    opacity: 0;
    transform: translateY(20px) scale(0.96);
  }
  to {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
}

.period-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  margin-bottom: 12px;
}

.period-number {
  font-size: 0.72rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--text-muted);
}

.period-time {
  font-family: var(--font-mono);
  font-size: 0.78rem;
  font-weight: 500;
  color: var(--text-secondary);
  padding: 3px 10px;
  background: var(--bg-glass);
  border-radius: var(--radius-full);
}

.period-class-name {
  font-size: 1.15rem;
  font-weight: 700;
  color: var(--text-primary);
  margin-bottom: 6px;
  letter-spacing: -0.01em;
}

.period-class-type {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  font-size: 0.72rem;
  font-weight: 500;
  color: var(--text-secondary);
  padding: 3px 10px;
  background: var(--bg-glass);
  border-radius: var(--radius-full);
}

.period-card.empty .period-class-name {
  color: var(--text-muted);
  font-weight: 400;
  font-style: italic;
}

/* Active now badge */
.now-badge {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  font-size: 0.68rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--accent-emerald);
  padding: 3px 10px;
  background: rgba(16, 185, 129, 0.12);
  border-radius: var(--radius-full);
  margin-top: 8px;
}

.now-badge::before {
  content: '';
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--accent-emerald);
  animation: pulse-dot 2s ease-in-out infinite;
}

/* Play / Special type */
.period-card.play-card {
  --card-accent: var(--accent-teal);
  background: linear-gradient(145deg, rgba(20, 184, 166, 0.08), var(--bg-card));
}

/* ============================================
   WEEKLY OVERVIEW
   ============================================ */
.weekly-overview {
  margin-top: 40px;
  animation: slide-down 0.6s var(--transition-spring) 0.2s both;
}

.section-title {
  font-size: 1.1rem;
  font-weight: 700;
  color: var(--text-primary);
  margin-bottom: 16px;
  letter-spacing: -0.01em;
}

.weekly-grid {
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  gap: 10px;
}

.weekly-day-col {
  background: var(--bg-card);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
  padding: 14px;
  transition: all var(--transition-base);
}

.weekly-day-col:hover {
  border-color: var(--border-glow);
  transform: translateY(-2px);
}

.weekly-day-col.today-col {
  border-color: var(--accent-violet);
  box-shadow: var(--shadow-glow);
}

.weekly-day-name {
  font-size: 0.78rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--text-secondary);
  margin-bottom: 10px;
  text-align: center;
}

.weekly-day-col.today-col .weekly-day-name {
  color: var(--accent-violet);
}

.weekly-slot {
  padding: 5px 8px;
  margin-bottom: 4px;
  border-radius: var(--radius-sm);
  font-size: 0.68rem;
  font-weight: 500;
  color: var(--text-secondary);
  background: var(--bg-glass);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  transition: all var(--transition-fast);
}

.weekly-slot:hover {
  background: var(--bg-glass-hover);
  color: var(--text-primary);
}

.weekly-slot.filled {
  color: var(--text-primary);
  background: rgba(139, 92, 246, 0.1);
}

.weekly-slot.empty-slot {
  opacity: 0.3;
}

.weekly-class-count {
  text-align: center;
  margin-top: 10px;
  font-size: 0.72rem;
  color: var(--text-muted);
}

.weekly-class-count strong {
  color: var(--text-accent);
}

/* ============================================
   ANIMATIONS
   ============================================ */
@keyframes slide-down {
  from {
    opacity: 0;
    transform: translateY(-16px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

/* ============================================
   RESPONSIVE
   ============================================ */
@media (max-width: 768px) {
  .app-container {
    padding: 12px 10px 40px;
  }

  .app-header {
    flex-direction: column;
    gap: 14px;
    padding: 16px 20px;
    align-items: flex-start;
  }

  .header-right {
    width: 100%;
    justify-content: space-between;
  }

  .stats-bar {
    grid-template-columns: repeat(2, 1fr);
  }

  .schedule-grid {
    grid-template-columns: 1fr;
  }

  .weekly-grid {
    grid-template-columns: repeat(2, 1fr);
  }

  .weekly-day-col:last-child {
    grid-column: span 2;
  }

  .day-tab {
    min-width: 80px;
    padding: 8px 12px;
    font-size: 0.8rem;
  }
}

@media (max-width: 480px) {
  .app-title {
    font-size: 1.2rem;
  }

  .stats-bar {
    grid-template-columns: repeat(2, 1fr);
    gap: 8px;
  }

  .stat-value {
    font-size: 1.3rem;
  }

  .weekly-grid {
    grid-template-columns: 1fr;
  }

  .weekly-day-col:last-child {
    grid-column: span 1;
  }
}

/* ============================================
   SCROLLBAR STYLING
   ============================================ */
::-webkit-scrollbar {
  width: 6px;
  height: 6px;
}

::-webkit-scrollbar-track {
  background: transparent;
}

::-webkit-scrollbar-thumb {
  background: var(--border-subtle);
  border-radius: var(--radius-full);
}

::-webkit-scrollbar-thumb:hover {
  background: var(--accent-violet);
}
