/* Art direction: Combat sport / BJJ training tool → Dark, technical, disciplined
   Palette: Dark-first. Deep charcoal surfaces, electric blue accent (gi-blue).
   Typography: General Sans (body — clean, technical) + Clash Display (headings — bold, martial)
   Density: Balanced — journal needs breathing room, dashboard needs density */

:root {
  /* Type Scale */
  --text-xs:   clamp(0.75rem,  0.7rem  + 0.25vw, 0.875rem);
  --text-sm:   clamp(0.875rem, 0.8rem  + 0.35vw, 1rem);
  --text-base: clamp(1rem,     0.95rem + 0.25vw, 1.125rem);
  --text-lg:   clamp(1.125rem, 1rem    + 0.75vw, 1.5rem);
  --text-xl:   clamp(1.5rem,   1.2rem  + 1.25vw, 2.25rem);
  --text-2xl:  clamp(2rem,     1.2rem  + 2.5vw,  3.5rem);
  --text-3xl:  clamp(2.5rem,   1rem    + 4vw,    5rem);
  --text-hero: clamp(3rem,     0.5rem  + 7vw,    8rem);

  /* Spacing */
  --space-1:  0.25rem;
  --space-2:  0.5rem;
  --space-3:  0.75rem;
  --space-4:  1rem;
  --space-5:  1.25rem;
  --space-6:  1.5rem;
  --space-8:  2rem;
  --space-10: 2.5rem;
  --space-12: 3rem;
  --space-16: 4rem;
  --space-20: 5rem;
  --space-24: 6rem;
  --space-32: 8rem;

  /* Radius */
  --radius-sm: 0.375rem;
  --radius-md: 0.5rem;
  --radius-lg: 0.75rem;
  --radius-xl: 1rem;
  --radius-full: 9999px;

  /* Transitions */
  --transition-interactive: 180ms cubic-bezier(0.16, 1, 0.3, 1);

  /* Content widths */
  --content-narrow: 640px;
  --content-default: 960px;
  --content-wide: 1200px;
  --content-full: 100%;

  /* Fonts */
  --font-display: 'Clash Display', 'Helvetica Neue', sans-serif;
  --font-body: 'General Sans', 'Inter', sans-serif;
}

/* DARK MODE (default) */
:root, [data-theme="dark"] {
  /* Surfaces — Deep charcoal, almost black */
  --color-bg:             #0d0d0f;
  --color-surface:        #131316;
  --color-surface-2:      #1a1a1e;
  --color-surface-offset: #161619;
  --color-surface-offset-2: #1e1e22;
  --color-surface-dynamic: #252529;
  --color-divider:        #2a2a2f;
  --color-border:         #35353b;

  /* Text */
  --color-text:           #e8e8ec;
  --color-text-muted:     #8a8a94;
  --color-text-faint:     #55555e;
  --color-text-inverse:   #0d0d0f;

  /* Primary Accent — Electric Blue (gi blue) */
  --color-primary:        #3b82f6;
  --color-primary-hover:  #2563eb;
  --color-primary-active: #1d4ed8;
  --color-primary-highlight: #1e2a45;

  /* Secondary — Gold (competition gold) */
  --color-gold:           #eab308;
  --color-gold-hover:     #ca8a04;
  --color-gold-active:    #a16207;
  --color-gold-highlight: #2a2510;

  /* Success */
  --color-success:        #22c55e;
  --color-success-hover:  #16a34a;
  --color-success-active: #15803d;
  --color-success-highlight: #162b1f;

  /* Warning */
  --color-warning:        #f59e0b;
  --color-warning-hover:  #d97706;
  --color-warning-active: #b45309;
  --color-warning-highlight: #2d2210;

  /* Error */
  --color-error:          #ef4444;
  --color-error-hover:    #dc2626;
  --color-error-active:   #b91c1c;
  --color-error-highlight: #2d1515;

  /* Belt Colors */
  --belt-white:   #e8e8ec;
  --belt-blue:    #3b82f6;
  --belt-purple:  #8b5cf6;
  --belt-brown:   #92400e;
  --belt-black:   #1a1a1e;

  /* Shadows */
  --shadow-sm: 0 1px 2px oklch(0 0 0 / 0.3);
  --shadow-md: 0 4px 12px oklch(0 0 0 / 0.4);
  --shadow-lg: 0 12px 32px oklch(0 0 0 / 0.5);
}

/* LIGHT MODE */
[data-theme="light"] {
  --color-bg:             #f5f5f7;
  --color-surface:        #ffffff;
  --color-surface-2:      #fafafa;
  --color-surface-offset: #ebebed;
  --color-surface-offset-2: #e0e0e4;
  --color-surface-dynamic: #d5d5da;
  --color-divider:        #d0d0d6;
  --color-border:         #c0c0c8;

  --color-text:           #111114;
  --color-text-muted:     #6b6b76;
  --color-text-faint:     #9a9aa4;
  --color-text-inverse:   #f5f5f7;

  --color-primary:        #2563eb;
  --color-primary-hover:  #1d4ed8;
  --color-primary-active: #1e40af;
  --color-primary-highlight: #dbeafe;

  --color-gold:           #ca8a04;
  --color-gold-hover:     #a16207;
  --color-gold-active:    #854d0e;
  --color-gold-highlight: #fef9c3;

  --color-success:        #16a34a;
  --color-success-hover:  #15803d;
  --color-success-active: #166534;
  --color-success-highlight: #dcfce7;

  --color-warning:        #d97706;
  --color-warning-hover:  #b45309;
  --color-warning-active: #92400e;
  --color-warning-highlight: #fef3c7;

  --color-error:          #dc2626;
  --color-error-hover:    #b91c1c;
  --color-error-active:   #991b1b;
  --color-error-highlight: #fee2e2;

  --belt-white:   #e8e8ec;
  --belt-blue:    #2563eb;
  --belt-purple:  #7c3aed;
  --belt-brown:   #92400e;
  --belt-black:   #111114;

  --shadow-sm: 0 1px 2px oklch(0.2 0.01 80 / 0.06);
  --shadow-md: 0 4px 12px oklch(0.2 0.01 80 / 0.08);
  --shadow-lg: 0 12px 32px oklch(0.2 0.01 80 / 0.12);
}

@media (prefers-color-scheme: light) {
  :root:not([data-theme]) {
    --color-bg:             #f5f5f7;
    --color-surface:        #ffffff;
    --color-surface-2:      #fafafa;
    --color-surface-offset: #ebebed;
    --color-surface-offset-2: #e0e0e4;
    --color-surface-dynamic: #d5d5da;
    --color-divider:        #d0d0d6;
    --color-border:         #c0c0c8;
    --color-text:           #111114;
    --color-text-muted:     #6b6b76;
    --color-text-faint:     #9a9aa4;
    --color-text-inverse:   #f5f5f7;
    --color-primary:        #2563eb;
    --color-primary-hover:  #1d4ed8;
    --color-primary-active: #1e40af;
    --color-primary-highlight: #dbeafe;
    --shadow-sm: 0 1px 2px oklch(0.2 0.01 80 / 0.06);
    --shadow-md: 0 4px 12px oklch(0.2 0.01 80 / 0.08);
    --shadow-lg: 0 12px 32px oklch(0.2 0.01 80 / 0.12);
  }
}

/* ===== GLOBAL STYLES ===== */

body.app-view {
  min-height: 100dvh;
  overflow: hidden;
}

body.app-view #app {
  display: flex !important;
  min-height: 100dvh;
}

/* ===== SIDEBAR ===== */
.sidebar {
  width: 260px;
  min-width: 260px;
  background: var(--color-surface);
  border-right: 1px solid var(--color-divider);
  display: flex;
  flex-direction: column;
  height: 100dvh;
  position: sticky;
  top: 0;
  z-index: 10;
}

.sidebar-header {
  padding: var(--space-5) var(--space-5);
  border-bottom: 1px solid var(--color-divider);
  display: flex;
  align-items: center;
  gap: var(--space-3);
}

.sidebar-logo {
  width: 36px;
  height: 36px;
}

.sidebar-brand {
  font-family: var(--font-display);
  font-size: var(--text-lg);
  font-weight: 600;
  color: var(--color-text);
  letter-spacing: -0.02em;
}

.sidebar-brand span {
  color: var(--color-primary);
}

.sidebar-nav {
  flex: 1;
  padding: var(--space-3) var(--space-3);
  overflow-y: auto;
}

.nav-section-label {
  font-size: var(--text-xs);
  font-weight: 600;
  color: var(--color-text-faint);
  text-transform: uppercase;
  letter-spacing: 0.08em;
  padding: var(--space-4) var(--space-3) var(--space-2);
}

.nav-item {
  display: flex;
  align-items: center;
  gap: var(--space-3);
  padding: var(--space-2) var(--space-3);
  border-radius: var(--radius-md);
  color: var(--color-text-muted);
  text-decoration: none;
  font-size: var(--text-sm);
  font-weight: 500;
  cursor: pointer;
  width: 100%;
  text-align: left;
}

.nav-item:hover {
  background: var(--color-surface-offset);
  color: var(--color-text);
}

.nav-item.active {
  background: var(--color-primary-highlight);
  color: var(--color-primary);
}

.nav-item i {
  width: 20px;
  height: 20px;
  flex-shrink: 0;
}

.nav-item .badge {
  margin-left: auto;
  background: var(--color-primary);
  color: white;
  font-size: 11px;
  font-weight: 600;
  padding: 1px 6px;
  border-radius: var(--radius-full);
}

.nav-item .pro-badge {
  margin-left: auto;
  background: linear-gradient(135deg, var(--color-gold), var(--color-warning));
  color: #000;
  font-size: 10px;
  font-weight: 700;
  padding: 1px 6px;
  border-radius: var(--radius-full);
  letter-spacing: 0.05em;
}

.sidebar-footer {
  padding: var(--space-3) var(--space-3);
  border-top: 1px solid var(--color-divider);
}

.user-card {
  display: flex;
  align-items: center;
  gap: var(--space-3);
  padding: var(--space-2) var(--space-3);
  border-radius: var(--radius-md);
  cursor: pointer;
}

.user-card:hover {
  background: var(--color-surface-offset);
}

.user-avatar {
  width: 32px;
  height: 32px;
  border-radius: var(--radius-full);
  background: var(--color-primary);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: var(--text-xs);
  font-weight: 700;
  color: white;
}

.user-info {
  flex: 1;
  min-width: 0;
}

.user-name {
  font-size: var(--text-sm);
  font-weight: 600;
  color: var(--color-text);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.user-belt {
  font-size: var(--text-xs);
  color: var(--color-text-muted);
  display: flex;
  align-items: center;
  gap: var(--space-1);
}

.belt-dot {
  width: 8px;
  height: 8px;
  border-radius: var(--radius-full);
  display: inline-block;
}

/* ===== MAIN CONTENT ===== */
.main-content {
  flex: 1;
  overflow-y: auto;
  height: 100dvh;
}

.content-header {
  padding: var(--space-5) var(--space-8);
  border-bottom: 1px solid var(--color-divider);
  display: flex;
  align-items: center;
  justify-content: space-between;
  background: var(--color-surface);
  position: sticky;
  top: 0;
  z-index: 5;
}

.content-header h1 {
  font-family: var(--font-display);
  font-size: var(--text-xl);
  font-weight: 600;
  color: var(--color-text);
}

.content-body {
  padding: var(--space-6) var(--space-8);
}

/* ===== BUTTONS ===== */
.btn {
  display: inline-flex;
  align-items: center;
  gap: var(--space-2);
  padding: var(--space-2) var(--space-4);
  border-radius: var(--radius-md);
  font-size: var(--text-sm);
  font-weight: 600;
  cursor: pointer;
  border: 1px solid transparent;
  text-decoration: none;
  white-space: nowrap;
}

.btn-primary {
  background: var(--color-primary);
  color: white;
}
.btn-primary:hover { background: var(--color-primary-hover); }

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

.btn-ghost {
  background: transparent;
  color: var(--color-text-muted);
}
.btn-ghost:hover { background: var(--color-surface-offset); color: var(--color-text); }

.btn-gold {
  background: linear-gradient(135deg, var(--color-gold), var(--color-warning));
  color: #000;
  font-weight: 700;
}
.btn-gold:hover { opacity: 0.9; }

.btn-sm {
  padding: var(--space-1) var(--space-3);
  font-size: var(--text-xs);
}

.btn-lg {
  padding: var(--space-3) var(--space-6);
  font-size: var(--text-base);
}

/* ===== CARDS ===== */
.card {
  background: var(--color-surface);
  border: 1px solid var(--color-divider);
  border-radius: var(--radius-lg);
  padding: var(--space-5);
}

.card-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: var(--space-4);
}

.card-title {
  font-family: var(--font-display);
  font-size: var(--text-lg);
  font-weight: 600;
  color: var(--color-text);
}

/* ===== KPI CARDS ===== */
.kpi-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: var(--space-4);
  margin-bottom: var(--space-6);
}

.kpi-card {
  background: var(--color-surface);
  border: 1px solid var(--color-divider);
  border-radius: var(--radius-lg);
  padding: var(--space-5);
}

.kpi-label {
  font-size: var(--text-xs);
  font-weight: 600;
  color: var(--color-text-muted);
  text-transform: uppercase;
  letter-spacing: 0.05em;
  margin-bottom: var(--space-1);
}

.kpi-value {
  font-family: var(--font-display);
  font-size: var(--text-xl);
  font-weight: 700;
  color: var(--color-text);
  font-variant-numeric: tabular-nums;
}

.kpi-change {
  font-size: var(--text-xs);
  font-weight: 600;
  margin-top: var(--space-1);
}

.kpi-change.positive { color: var(--color-success); }
.kpi-change.negative { color: var(--color-error); }

/* ===== DASHBOARD BOTTOM GRID ===== */
.dashboard-bottom-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: var(--space-6);
}

/* ===== CHAT / AI COACH ===== */
.chat-container {
  display: flex;
  flex-direction: column;
  height: calc(100dvh - 73px);
}

.chat-messages {
  flex: 1;
  overflow-y: auto;
  padding: var(--space-6) var(--space-8);
  display: flex;
  flex-direction: column;
  gap: var(--space-4);
}

.chat-message {
  display: flex;
  gap: var(--space-3);
  max-width: 80%;
}

.chat-message.user {
  align-self: flex-end;
  flex-direction: row-reverse;
}

.chat-message-avatar {
  width: 32px;
  height: 32px;
  border-radius: var(--radius-full);
  flex-shrink: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: var(--text-xs);
  font-weight: 700;
}

.chat-message.ai .chat-message-avatar {
  background: var(--color-primary);
  color: white;
}

.chat-message.user .chat-message-avatar {
  background: var(--color-surface-dynamic);
  color: var(--color-text);
}

.chat-message-bubble {
  padding: var(--space-3) var(--space-4);
  border-radius: var(--radius-lg);
  font-size: var(--text-sm);
  line-height: 1.6;
}

.chat-message.ai .chat-message-bubble {
  background: var(--color-surface);
  border: 1px solid var(--color-divider);
  color: var(--color-text);
}

.chat-message.user .chat-message-bubble {
  background: var(--color-primary);
  color: white;
}

.chat-input-area {
  padding: var(--space-4) var(--space-8);
  border-top: 1px solid var(--color-divider);
  background: var(--color-surface);
}

.chat-input-wrapper {
  display: flex;
  gap: var(--space-3);
  align-items: flex-end;
}

.chat-input {
  flex: 1;
  background: var(--color-bg);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-lg);
  padding: var(--space-3) var(--space-4);
  color: var(--color-text);
  font-size: var(--text-sm);
  resize: none;
  min-height: 44px;
  max-height: 120px;
  outline: none;
}

.chat-input:focus {
  border-color: var(--color-primary);
}

.chat-input::placeholder {
  color: var(--color-text-faint);
}

.chat-send-btn {
  width: 44px;
  height: 44px;
  background: var(--color-primary);
  color: white;
  border-radius: var(--radius-lg);
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.chat-send-btn:hover { background: var(--color-primary-hover); }
.chat-send-btn:disabled { opacity: 0.4; cursor: not-allowed; }

.chat-suggestions {
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-2);
  margin-bottom: var(--space-3);
}

.chat-suggestion {
  padding: var(--space-2) var(--space-3);
  background: var(--color-surface-offset);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-full);
  font-size: var(--text-xs);
  color: var(--color-text-muted);
  cursor: pointer;
}

.chat-suggestion:hover {
  background: var(--color-primary-highlight);
  color: var(--color-primary);
  border-color: var(--color-primary);
}

/* ===== JOURNAL ===== */
.journal-entry {
  background: var(--color-surface);
  border: 1px solid var(--color-divider);
  border-radius: var(--radius-lg);
  padding: var(--space-5);
  margin-bottom: var(--space-4);
}

.journal-entry-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: var(--space-3);
}

.journal-date {
  font-size: var(--text-sm);
  font-weight: 600;
  color: var(--color-text);
}

.journal-tags {
  display: flex;
  gap: var(--space-2);
  flex-wrap: wrap;
}

.tag {
  padding: 2px var(--space-2);
  border-radius: var(--radius-full);
  font-size: 11px;
  font-weight: 600;
}

.tag-gi { background: var(--color-primary-highlight); color: var(--color-primary); }
.tag-nogi { background: var(--color-surface-dynamic); color: var(--color-text-muted); }
.tag-comp { background: var(--color-gold-highlight); color: var(--color-gold); }
.tag-drill { background: var(--color-success-highlight); color: var(--color-success); }

.journal-body {
  font-size: var(--text-sm);
  color: var(--color-text-muted);
  line-height: 1.7;
  margin-bottom: var(--space-3);
}

.journal-techniques {
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-2);
}

.technique-chip {
  padding: var(--space-1) var(--space-3);
  background: var(--color-surface-offset);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-full);
  font-size: var(--text-xs);
  color: var(--color-text-muted);
}

/* ===== TECHNIQUE LIBRARY ===== */
.technique-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: var(--space-4);
}

.technique-card {
  background: var(--color-surface);
  border: 1px solid var(--color-divider);
  border-radius: var(--radius-lg);
  padding: var(--space-5);
  cursor: pointer;
}

.technique-card:hover {
  border-color: var(--color-primary);
  background: var(--color-surface-2);
}

.technique-position {
  font-size: var(--text-xs);
  font-weight: 600;
  color: var(--color-primary);
  text-transform: uppercase;
  letter-spacing: 0.05em;
  margin-bottom: var(--space-2);
}

.technique-name {
  font-family: var(--font-display);
  font-size: var(--text-lg);
  font-weight: 600;
  color: var(--color-text);
  margin-bottom: var(--space-2);
}

.technique-desc {
  font-size: var(--text-sm);
  color: var(--color-text-muted);
  line-height: 1.6;
  margin-bottom: var(--space-3);
}

.technique-meta {
  display: flex;
  gap: var(--space-4);
  font-size: var(--text-xs);
  color: var(--color-text-faint);
}

.technique-meta span {
  display: flex;
  align-items: center;
  gap: var(--space-1);
}

/* ===== FORMS ===== */
.form-group {
  margin-bottom: var(--space-4);
}

.form-label {
  display: block;
  font-size: var(--text-sm);
  font-weight: 600;
  color: var(--color-text);
  margin-bottom: var(--space-2);
}

.form-input, .form-select, .form-textarea {
  width: 100%;
  background: var(--color-bg);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-md);
  padding: var(--space-2) var(--space-3);
  color: var(--color-text);
  font-size: var(--text-sm);
  outline: none;
}

.form-input:focus, .form-select:focus, .form-textarea:focus {
  border-color: var(--color-primary);
  box-shadow: 0 0 0 3px oklch(from var(--color-primary) l c h / 0.15);
}

.form-textarea {
  min-height: 100px;
  resize: vertical;
}

/* ===== FILTERS BAR ===== */
.filters-bar {
  display: flex;
  gap: var(--space-3);
  margin-bottom: var(--space-5);
  flex-wrap: wrap;
  align-items: center;
}

.filter-chip {
  padding: var(--space-1) var(--space-3);
  background: var(--color-surface-offset);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-full);
  font-size: var(--text-xs);
  font-weight: 500;
  color: var(--color-text-muted);
  cursor: pointer;
}

.filter-chip:hover, .filter-chip.active {
  background: var(--color-primary-highlight);
  border-color: var(--color-primary);
  color: var(--color-primary);
}

/* ===== LANDING PAGE ===== */
.landing-page {
  min-height: 100dvh;
}

.landing-nav {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: var(--space-4) var(--space-8);
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 100;
  background: oklch(from var(--color-bg) l c h / 0.85);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--color-divider);
}

.landing-nav-brand {
  display: flex;
  align-items: center;
  gap: var(--space-3);
  text-decoration: none;
}

.landing-nav-brand .sidebar-brand {
  font-size: var(--text-lg);
}

.landing-nav-links {
  display: flex;
  gap: var(--space-6);
  align-items: center;
}

.landing-nav-links a {
  color: var(--color-text-muted);
  text-decoration: none;
  font-size: var(--text-sm);
  font-weight: 500;
}

.landing-nav-links a:hover { color: var(--color-text); }

.landing-hero {
  padding: calc(var(--space-32) + var(--space-16)) var(--space-8) var(--space-24);
  text-align: center;
  max-width: 900px;
  margin: 0 auto;
}

.landing-hero h1 {
  font-family: var(--font-display);
  font-size: var(--text-3xl);
  font-weight: 700;
  color: var(--color-text);
  margin-bottom: var(--space-5);
  letter-spacing: -0.03em;
  line-height: 1.05;
}

.landing-hero h1 span {
  background: linear-gradient(135deg, var(--color-primary), #60a5fa);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.landing-hero p {
  font-size: var(--text-lg);
  color: var(--color-text-muted);
  max-width: 600px;
  margin: 0 auto var(--space-8);
  line-height: 1.6;
}

.landing-hero-cta {
  display: flex;
  gap: var(--space-4);
  justify-content: center;
  flex-wrap: wrap;
}

.landing-features {
  padding: var(--space-24) var(--space-8);
  max-width: 1200px;
  margin: 0 auto;
}

.landing-features h2 {
  font-family: var(--font-display);
  font-size: var(--text-2xl);
  font-weight: 700;
  text-align: center;
  margin-bottom: var(--space-12);
  color: var(--color-text);
}

.features-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
  gap: var(--space-6);
}

.feature-card {
  background: var(--color-surface);
  border: 1px solid var(--color-divider);
  border-radius: var(--radius-xl);
  padding: var(--space-8);
}

.feature-icon {
  width: 48px;
  height: 48px;
  background: var(--color-primary-highlight);
  border-radius: var(--radius-lg);
  display: flex;
  align-items: center;
  justify-content: center;
  margin-bottom: var(--space-4);
  color: var(--color-primary);
}

.feature-card h3 {
  font-family: var(--font-display);
  font-size: var(--text-lg);
  font-weight: 600;
  color: var(--color-text);
  margin-bottom: var(--space-2);
}

.feature-card p {
  font-size: var(--text-sm);
  color: var(--color-text-muted);
  line-height: 1.6;
}

/* ===== PRICING ===== */
.pricing-section {
  padding: var(--space-24) var(--space-8);
  max-width: 1000px;
  margin: 0 auto;
}

.pricing-section h2 {
  font-family: var(--font-display);
  font-size: var(--text-2xl);
  font-weight: 700;
  text-align: center;
  margin-bottom: var(--space-3);
  color: var(--color-text);
}

.pricing-subtitle {
  text-align: center;
  color: var(--color-text-muted);
  font-size: var(--text-base);
  margin-bottom: var(--space-12);
}

.pricing-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: var(--space-6);
  align-items: start;
}

.pricing-card {
  background: var(--color-surface);
  border: 1px solid var(--color-divider);
  border-radius: var(--radius-xl);
  padding: var(--space-8);
  position: relative;
}

.pricing-card.featured {
  border-color: var(--color-primary);
  box-shadow: 0 0 0 1px var(--color-primary), var(--shadow-lg);
}

.pricing-card.featured::before {
  content: 'Most Popular';
  position: absolute;
  top: calc(var(--space-4) * -1);
  left: 50%;
  transform: translateX(-50%);
  background: var(--color-primary);
  color: white;
  font-size: 11px;
  font-weight: 700;
  padding: 4px 12px;
  border-radius: var(--radius-full);
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.pricing-tier {
  font-size: var(--text-sm);
  font-weight: 600;
  color: var(--color-text-muted);
  text-transform: uppercase;
  letter-spacing: 0.05em;
  margin-bottom: var(--space-3);
}

.pricing-price {
  font-family: var(--font-display);
  font-size: var(--text-xl);
  font-weight: 700;
  color: var(--color-text);
  margin-bottom: var(--space-2);
}

.pricing-price span {
  font-size: var(--text-sm);
  font-weight: 400;
  color: var(--color-text-muted);
}

.pricing-desc {
  font-size: var(--text-sm);
  color: var(--color-text-muted);
  margin-bottom: var(--space-6);
  line-height: 1.5;
}

.pricing-features {
  list-style: none;
  margin-bottom: var(--space-6);
}

.pricing-features li {
  display: flex;
  align-items: flex-start;
  gap: var(--space-2);
  font-size: var(--text-sm);
  color: var(--color-text-muted);
  padding: var(--space-2) 0;
}

.pricing-features li i {
  color: var(--color-success);
  flex-shrink: 0;
  margin-top: 2px;
}

.pricing-features li.disabled {
  color: var(--color-text-faint);
}

.pricing-features li.disabled i {
  color: var(--color-text-faint);
}

/* ===== GAME PLAN ===== */
.gameplan-flow {
  display: flex;
  flex-direction: column;
  gap: var(--space-4);
}

.gameplan-node {
  background: var(--color-surface);
  border: 1px solid var(--color-divider);
  border-radius: var(--radius-lg);
  padding: var(--space-4) var(--space-5);
  position: relative;
}

.gameplan-node::before {
  content: '';
  position: absolute;
  left: 24px;
  top: -16px;
  width: 2px;
  height: 16px;
  background: var(--color-primary);
}

.gameplan-node:first-child::before {
  display: none;
}

.gameplan-node-position {
  font-size: var(--text-xs);
  font-weight: 600;
  color: var(--color-primary);
  text-transform: uppercase;
  letter-spacing: 0.05em;
  margin-bottom: var(--space-1);
}

.gameplan-node-action {
  font-family: var(--font-display);
  font-size: var(--text-base);
  font-weight: 600;
  color: var(--color-text);
  margin-bottom: var(--space-2);
}

.gameplan-node-details {
  font-size: var(--text-sm);
  color: var(--color-text-muted);
  line-height: 1.6;
}

/* ===== DRILL TIMER ===== */
.drill-timer {
  text-align: center;
  padding: var(--space-8);
}

.drill-timer-display {
  font-family: var(--font-display);
  font-size: var(--text-3xl);
  font-weight: 700;
  color: var(--color-text);
  font-variant-numeric: tabular-nums;
  margin-bottom: var(--space-4);
}

.drill-timer-label {
  font-size: var(--text-lg);
  color: var(--color-primary);
  font-weight: 600;
  margin-bottom: var(--space-6);
}

.drill-controls {
  display: flex;
  gap: var(--space-4);
  justify-content: center;
}

/* ===== MODALS ===== */
.modal-overlay {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: oklch(0 0 0 / 0.6);
  backdrop-filter: blur(4px);
  -webkit-backdrop-filter: blur(4px);
  z-index: 200;
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 0;
  pointer-events: none;
  transition: opacity 200ms ease;
}

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

.modal {
  background: var(--color-surface);
  border: 1px solid var(--color-divider);
  border-radius: var(--radius-xl);
  padding: var(--space-8);
  width: 90%;
  max-width: 500px;
  max-height: 90vh;
  overflow-y: auto;
  transform: translateY(20px);
  transition: transform 200ms ease;
}

.modal-overlay.active .modal {
  transform: translateY(0);
}

.modal h2 {
  font-family: var(--font-display);
  font-size: var(--text-xl);
  font-weight: 600;
  color: var(--color-text);
  margin-bottom: var(--space-5);
}

/* ===== EMPTY STATES ===== */
.empty-state {
  text-align: center;
  padding: var(--space-16) var(--space-8);
}

.empty-state-icon {
  width: 64px;
  height: 64px;
  margin: 0 auto var(--space-4);
  color: var(--color-text-faint);
}

.empty-state h3 {
  font-family: var(--font-display);
  font-size: var(--text-lg);
  font-weight: 600;
  color: var(--color-text);
  margin-bottom: var(--space-2);
}

.empty-state p {
  font-size: var(--text-sm);
  color: var(--color-text-muted);
  margin: 0 auto var(--space-6);
  max-width: 400px;
}

/* ===== LANDING FOOTER ===== */
.landing-footer {
  padding: var(--space-8) var(--space-8);
  border-top: 1px solid var(--color-divider);
  text-align: center;
}

.landing-footer p {
  font-size: var(--text-xs);
  color: var(--color-text-faint);
  margin: 0 auto;
}

.landing-footer a {
  color: var(--color-text-muted);
  text-decoration: none;
}

.landing-footer a:hover { color: var(--color-primary); }

/* ===== MOBILE SIDEBAR ===== */
.mobile-header {
  display: none;
  align-items: center;
  justify-content: space-between;
  padding: var(--space-3) var(--space-4);
  background: var(--color-surface);
  border-bottom: 1px solid var(--color-divider);
  position: sticky;
  top: 0;
  z-index: 5;
}

.mobile-header .sidebar-brand {
  font-size: var(--text-base);
}

.hamburger-btn {
  width: 40px;
  height: 40px;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--color-text);
}

.sidebar-overlay {
  display: none;
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: oklch(0 0 0 / 0.5);
  z-index: 9;
}

/* ===== TOAST ===== */
.toast-container {
  position: fixed;
  bottom: var(--space-6);
  right: var(--space-6);
  z-index: 300;
  display: flex;
  flex-direction: column;
  gap: var(--space-2);
}

.toast {
  background: var(--color-surface);
  border: 1px solid var(--color-divider);
  border-radius: var(--radius-lg);
  padding: var(--space-3) var(--space-5);
  box-shadow: var(--shadow-lg);
  font-size: var(--text-sm);
  color: var(--color-text);
  display: flex;
  align-items: center;
  gap: var(--space-3);
  animation: slideIn 300ms ease forwards;
  max-width: 360px;
}

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

/* ===== RESPONSIVE ===== */
@media (max-width: 768px) {
  .sidebar {
    position: fixed;
    left: -260px;
    z-index: 10;
    transition: left 200ms ease;
  }

  .sidebar.open {
    left: 0;
  }

  .sidebar-overlay.active {
    display: block;
  }

  .mobile-header {
    display: flex;
  }

  body.app-view #app {
    flex-direction: column;
  }

  .main-content {
    height: auto;
    min-height: 0;
    width: 100%;
  }

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

  .dashboard-bottom-grid {
    grid-template-columns: 1fr !important;
  }

  .content-header {
    padding: var(--space-4);
  }

  .content-body {
    padding: var(--space-4);
  }

  .chat-messages {
    padding: var(--space-4);
  }

  .chat-input-area {
    padding: var(--space-3) var(--space-4);
  }

  .chat-message {
    max-width: 90%;
  }

  .landing-nav {
    padding: var(--space-3) var(--space-4);
  }

  .landing-hero {
    padding: calc(var(--space-24) + var(--space-12)) var(--space-4) var(--space-16);
  }

  .landing-hero h1 {
    font-size: var(--text-2xl);
  }

  .landing-features, .pricing-section {
    padding: var(--space-12) var(--space-4);
  }

  .landing-nav-links {
    gap: var(--space-4);
  }

  .landing-nav-links a:not(.btn) {
    display: none;
  }
}

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

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

::-webkit-scrollbar-thumb {
  background: var(--color-surface-dynamic);
  border-radius: var(--radius-full);
}

::-webkit-scrollbar-thumb:hover {
  background: var(--color-text-faint);
}

/* ===== SKELETON LOADERS ===== */
.skeleton {
  background: linear-gradient(
    90deg,
    var(--color-surface-offset) 25%,
    var(--color-surface-dynamic) 50%,
    var(--color-surface-offset) 75%
  );
  background-size: 200% 100%;
  animation: shimmer 1.5s infinite;
  border-radius: var(--radius-md);
}

@keyframes shimmer {
  0% { background-position: 200% 0; }
  100% { background-position: -200% 0; }
}

/* ===== STREAK DISPLAY ===== */
.streak-display {
  display: flex;
  align-items: center;
  gap: var(--space-2);
  padding: var(--space-2) var(--space-3);
  background: var(--color-gold-highlight);
  border-radius: var(--radius-full);
  font-size: var(--text-xs);
  font-weight: 700;
  color: var(--color-gold);
}

/* ===== AUTH PAGES ===== */
.auth-page {
  min-height: 100dvh;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: var(--space-4);
}

.auth-card {
  background: var(--color-surface);
  border: 1px solid var(--color-divider);
  border-radius: var(--radius-xl);
  padding: var(--space-8);
  width: 100%;
  max-width: 420px;
}

.auth-card h1 {
  font-family: var(--font-display);
  font-size: var(--text-xl);
  font-weight: 700;
  color: var(--color-text);
  text-align: center;
  margin-bottom: var(--space-6);
}

.auth-divider {
  display: flex;
  align-items: center;
  gap: var(--space-4);
  margin: var(--space-5) 0;
  color: var(--color-text-faint);
  font-size: var(--text-xs);
}

.auth-divider::before,
.auth-divider::after {
  content: '';
  flex: 1;
  height: 1px;
  background: var(--color-divider);
}

.btn-google {
  width: 100%;
  justify-content: center;
  background: var(--color-surface-offset);
  border: 1px solid var(--color-border);
  color: var(--color-text);
  gap: var(--space-3);
}

.btn-google:hover {
  background: var(--color-surface-dynamic);
}

.auth-footer {
  text-align: center;
  margin-top: var(--space-5);
  font-size: var(--text-sm);
  color: var(--color-text-muted);
}

.auth-footer a {
  color: var(--color-primary);
  text-decoration: none;
  font-weight: 600;
}

.auth-footer a:hover {
  text-decoration: underline;
}
