/* ============================================================
   LevelUp SaaS — GLASSMORPHISM Theme
   Frosted glass cards on rich gradient mesh background
   ============================================================ */

@import url('https://fonts.googleapis.com/css2?family=Inter:wght@300;400;500;600;700;800;900&display=swap');

/* --- Design Tokens --- */
:root {
  /* Mesh gradient BG */
  --bg-body: #0c0a1a;
  --bg-mesh: 
    radial-gradient(ellipse at 10% 20%, rgba(120, 75, 255, 0.25) 0%, transparent 50%),
    radial-gradient(ellipse at 85% 30%, rgba(59, 130, 246, 0.20) 0%, transparent 50%),
    radial-gradient(ellipse at 50% 80%, rgba(236, 72, 153, 0.15) 0%, transparent 50%),
    radial-gradient(ellipse at 30% 60%, rgba(16, 185, 129, 0.10) 0%, transparent 50%);

  /* Glass surfaces */
  --glass-bg: rgba(255, 255, 255, 0.06);
  --glass-bg-hover: rgba(255, 255, 255, 0.10);
  --glass-bg-strong: rgba(255, 255, 255, 0.12);
  --glass-bg-input: rgba(255, 255, 255, 0.08);
  --glass-bg-input-focus: rgba(255, 255, 255, 0.14);
  --glass-blur: blur(20px);
  --glass-blur-heavy: blur(40px);

  /* Borders — luminous */
  --border-glass: rgba(255, 255, 255, 0.10);
  --border-glass-hover: rgba(255, 255, 255, 0.22);
  --border-glow: rgba(139, 92, 246, 0.40);
  --border-glow-blue: rgba(59, 130, 246, 0.40);

  /* Text */
  --text-primary: #f8fafc;
  --text-secondary: #b0b8c8;
  --text-muted: #6b7a90;
  --text-accent: #a78bfa;

  /* Accent Gradients */
  --gradient-primary: linear-gradient(135deg, #7c3aed, #6366f1, #3b82f6);
  --gradient-accent: linear-gradient(135deg, #8b5cf6, #ec4899);
  --gradient-success: linear-gradient(135deg, #10b981, #34d399);
  --gradient-warning: linear-gradient(135deg, #f59e0b, #fbbf24);
  --gradient-danger: linear-gradient(135deg, #ef4444, #f87171);
  --gradient-info: linear-gradient(135deg, #06b6d4, #22d3ee);
  --gradient-glass-border: linear-gradient(135deg, rgba(255,255,255,0.15), rgba(255,255,255,0.05));

  /* Flat accents */
  --accent-purple: #8b5cf6;
  --accent-blue: #3b82f6;
  --accent-indigo: #6366f1;
  --accent-emerald: #10b981;
  --accent-amber: #f59e0b;
  --accent-red: #ef4444;
  --accent-pink: #ec4899;
  --accent-cyan: #06b6d4;

  /* Shadows */
  --shadow-glass: 0 8px 32px rgba(0, 0, 0, 0.35);
  --shadow-glass-hover: 0 12px 48px rgba(0, 0, 0, 0.45);
  --shadow-glow: 0 0 40px rgba(139, 92, 246, 0.15);
  --shadow-glow-strong: 0 0 60px rgba(139, 92, 246, 0.25);

  /* Radius */  
  --radius-sm: 12px;
  --radius-md: 16px;
  --radius-lg: 20px;
  --radius-xl: 24px;
  --radius-full: 9999px;

  /* Sidebar */
  --sidebar-width: 260px;

  /* Transitions */
  --transition-fast: 0.15s ease;
  --transition-base: 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  --transition-slow: 0.5s cubic-bezier(0.4, 0, 0.2, 1);
}

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

html { scroll-behavior: smooth; }

body {
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
  background: var(--bg-body);
  background-image: var(--bg-mesh);
  background-attachment: fixed;
  color: var(--text-primary);
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  overflow-x: hidden;
  min-height: 100vh;
}

a { color: inherit; text-decoration: none; }
img { max-width: 100%; display: block; }

/* --- Scrollbar --- */
::-webkit-scrollbar { width: 6px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: rgba(255,255,255,0.12); border-radius: 10px; }
::-webkit-scrollbar-thumb:hover { background: rgba(255,255,255,0.25); }

/* ============================================================
   LAYOUT
   ============================================================ */

.app-layout { display: flex; min-height: 100vh; }

/* --- Sidebar --- */
.sidebar {
  width: var(--sidebar-width);
  background: rgba(12, 10, 26, 0.7);
  backdrop-filter: var(--glass-blur-heavy);
  -webkit-backdrop-filter: var(--glass-blur-heavy);
  border-right: 1px solid var(--border-glass);
  display: flex;
  flex-direction: column;
  position: fixed;
  top: 0; left: 0; bottom: 0;
  z-index: 50;
  transition: transform var(--transition-base);
}

.sidebar-brand {
  padding: 24px 20px;
  border-bottom: 1px solid var(--border-glass);
  display: flex;
  align-items: center;
  gap: 12px;
}

.sidebar-brand .brand-icon {
  width: 42px; height: 42px;
  background: var(--gradient-primary);
  border-radius: var(--radius-md);
  display: flex; align-items: center; justify-content: center;
  font-size: 20px;
  box-shadow: 0 0 25px rgba(124, 58, 237, 0.4);
}

.sidebar-brand .brand-text {
  font-size: 20px; font-weight: 800;
  background: var(--gradient-primary);
  -webkit-background-clip: text; -webkit-text-fill-color: transparent;
  background-clip: text;
  letter-spacing: -0.5px;
}

.sidebar-nav {
  flex: 1; padding: 16px 12px;
  overflow-y: auto;
  display: flex; flex-direction: column; gap: 2px;
}

.nav-section-label {
  font-size: 10px; font-weight: 700;
  text-transform: uppercase; letter-spacing: 1.5px;
  color: var(--text-muted);
  padding: 16px 12px 8px;
}

.nav-link {
  display: flex; align-items: center; gap: 12px;
  padding: 10px 14px;
  border-radius: var(--radius-sm);
  font-size: 14px; font-weight: 500;
  color: var(--text-secondary);
  transition: all var(--transition-fast);
  position: relative;
  border: 1px solid transparent;
}

.nav-link:hover {
  color: var(--text-primary);
  background: var(--glass-bg);
  border-color: var(--border-glass);
}

.nav-link.active {
  color: #fff;
  background: rgba(139, 92, 246, 0.12);
  border-color: rgba(139, 92, 246, 0.25);
  box-shadow: 0 0 20px rgba(139, 92, 246, 0.08);
}

.nav-link.active::before {
  content: '';
  position: absolute; left: 0; top: 50%;
  transform: translateY(-50%);
  width: 3px; height: 20px;
  background: var(--gradient-primary);
  border-radius: 0 4px 4px 0;
}

.nav-link .nav-icon { width: 20px; text-align: center; font-size: 16px; }

.nav-link .nav-badge {
  margin-left: auto;
  background: var(--gradient-primary);
  color: #fff; font-size: 10px; font-weight: 700;
  padding: 2px 8px; border-radius: var(--radius-full);
}

.sidebar-footer {
  padding: 16px;
  border-top: 1px solid var(--border-glass);
}

.sidebar-footer .logout-btn {
  display: flex; align-items: center; gap: 12px;
  padding: 10px 12px; border-radius: var(--radius-sm);
  font-size: 14px; font-weight: 500;
  color: var(--accent-red);
  background: transparent; border: none; cursor: pointer;
  width: 100%; transition: all var(--transition-fast);
}

.sidebar-footer .logout-btn:hover {
  background: rgba(239, 68, 68, 0.1);
}

/* --- Main Content --- */
.main-content {
  flex: 1;
  margin-left: var(--sidebar-width);
  min-height: 100vh;
  display: flex; flex-direction: column;
}

.topbar {
  height: 64px;
  background: rgba(12, 10, 26, 0.5);
  backdrop-filter: var(--glass-blur);
  -webkit-backdrop-filter: var(--glass-blur);
  border-bottom: 1px solid var(--border-glass);
  display: flex; align-items: center; justify-content: space-between;
  padding: 0 32px;
  position: sticky; top: 0; z-index: 30;
}

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

.hamburger-btn {
  display: none;
  background: none;
  border: 1px solid var(--border-glass);
  color: var(--text-primary);
  font-size: 20px; cursor: pointer;
  padding: 8px; border-radius: var(--radius-sm);
  transition: all var(--transition-fast);
}

.hamburger-btn:hover { background: var(--glass-bg); }

.page-content { flex: 1; padding: 32px; }

/* Overlay */
.sidebar-overlay {
  display: none;
  position: fixed; top: 0; left: 0; right: 0; bottom: 0;
  background: rgba(0,0,0,0.5);
  backdrop-filter: blur(4px);
  z-index: 40;
}

/* ============================================================
   GLASS CARDS — The Star of the Show
   ============================================================ */

.glass-card {
  background: var(--glass-bg);
  backdrop-filter: var(--glass-blur);
  -webkit-backdrop-filter: var(--glass-blur);
  border: 1px solid var(--border-glass);
  border-radius: var(--radius-lg);
  padding: 24px;
  transition: all var(--transition-base);
  box-shadow: var(--shadow-glass);
}

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

.glass-card-static {
  background: var(--glass-bg);
  backdrop-filter: var(--glass-blur);
  -webkit-backdrop-filter: var(--glass-blur);
  border: 1px solid var(--border-glass);
  border-radius: var(--radius-lg);
  padding: 24px;
  box-shadow: var(--shadow-glass);
}

.glass-card-glow {
  background: var(--glass-bg);
  backdrop-filter: var(--glass-blur);
  -webkit-backdrop-filter: var(--glass-blur);
  border: 1px solid var(--border-glass);
  border-radius: var(--radius-lg);
  padding: 24px;
  transition: all var(--transition-base);
  box-shadow: var(--shadow-glass);
}

.glass-card-glow:hover {
  border-color: var(--border-glow);
  box-shadow: var(--shadow-glass-hover), var(--shadow-glow);
  transform: translateY(-3px);
}

/* Stat Cards — Glass with gradient top accent */
.stat-card {
  background: var(--glass-bg);
  backdrop-filter: var(--glass-blur);
  -webkit-backdrop-filter: var(--glass-blur);
  border: 1px solid var(--border-glass);
  border-radius: var(--radius-lg);
  padding: 24px;
  transition: all var(--transition-base);
  position: relative; overflow: hidden;
  box-shadow: var(--shadow-glass);
}

.stat-card::before {
  content: '';
  position: absolute; top: 0; left: 0; right: 0;
  height: 3px;
  background: var(--gradient-primary);
  opacity: 0;
  transition: opacity var(--transition-base);
}

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

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

.stat-card .stat-icon {
  width: 48px; height: 48px;
  border-radius: var(--radius-md);
  display: flex; align-items: center; justify-content: center;
  font-size: 22px; margin-bottom: 16px;
  backdrop-filter: var(--glass-blur);
}

.stat-card .stat-value {
  font-size: 32px; font-weight: 800;
  line-height: 1; margin-bottom: 4px;
}

.stat-card .stat-label {
  font-size: 13px; color: var(--text-secondary); font-weight: 500;
}

/* ============================================================
   BUTTONS
   ============================================================ */

.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  padding: 10px 22px; border-radius: var(--radius-sm);
  font-size: 14px; font-weight: 600;
  border: none; cursor: pointer;
  transition: all var(--transition-base);
  font-family: inherit; line-height: 1.4;
}

.btn-primary {
  background: var(--gradient-primary);
  color: #fff;
  box-shadow: 0 4px 20px rgba(124, 58, 237, 0.35);
}
.btn-primary:hover {
  box-shadow: 0 8px 35px rgba(124, 58, 237, 0.55);
  transform: translateY(-2px);
}

.btn-secondary {
  background: var(--glass-bg);
  backdrop-filter: var(--glass-blur);
  color: var(--text-primary);
  border: 1px solid var(--border-glass);
}
.btn-secondary:hover {
  background: var(--glass-bg-hover);
  border-color: var(--border-glass-hover);
}

.btn-success {
  background: var(--gradient-success);
  color: #fff;
  box-shadow: 0 4px 20px rgba(16, 185, 129, 0.3);
}
.btn-success:hover {
  box-shadow: 0 8px 30px rgba(16, 185, 129, 0.5);
  transform: translateY(-2px);
}

.btn-danger {
  background: var(--gradient-danger);
  color: #fff;
  box-shadow: 0 4px 20px rgba(239, 68, 68, 0.3);
}
.btn-danger:hover {
  box-shadow: 0 8px 30px rgba(239, 68, 68, 0.5);
  transform: translateY(-2px);
}

.btn-ghost {
  background: transparent;
  color: var(--text-secondary);
  padding: 8px 16px;
}
.btn-ghost:hover {
  color: var(--text-primary);
  background: var(--glass-bg);
}

.btn-lg { padding: 14px 30px; font-size: 16px; border-radius: var(--radius-md); }
.btn-sm { padding: 6px 14px; font-size: 12px; }
.btn-block { width: 100%; }

.btn-glow { position: relative; overflow: hidden; }
.btn-glow::after {
  content: '';
  position: absolute; top: -50%; left: -50%;
  width: 200%; height: 200%;
  background: radial-gradient(circle, rgba(255,255,255,0.2) 0%, transparent 60%);
  opacity: 0; transition: opacity 0.3s;
}
.btn-glow:hover::after { opacity: 1; }

/* ============================================================
   FORMS
   ============================================================ */

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

.form-label {
  display: block; font-size: 13px; font-weight: 600;
  color: var(--text-secondary); margin-bottom: 8px;
  text-transform: uppercase; letter-spacing: 0.5px;
}

.form-input, .form-select, .form-textarea,
input[type="text"], input[type="email"], input[type="password"],
input[type="url"], input[type="number"], input[type="date"],
input[type="datetime-local"], select, textarea {
  width: 100%; padding: 12px 16px;
  background: var(--glass-bg-input);
  backdrop-filter: blur(10px);
  border: 1px solid var(--border-glass);
  border-radius: var(--radius-sm);
  color: var(--text-primary);
  font-size: 14px; font-family: inherit;
  transition: all var(--transition-fast);
  outline: none;
}

.form-input:focus, .form-select:focus, .form-textarea:focus,
input[type="text"]:focus, input[type="email"]:focus,
input[type="password"]:focus, input[type="url"]:focus,
input[type="number"]:focus, input[type="date"]:focus,
input[type="datetime-local"]:focus, select:focus, textarea:focus {
  background: var(--glass-bg-input-focus);
  border-color: var(--accent-purple);
  box-shadow: 0 0 0 3px rgba(139, 92, 246, 0.15), var(--shadow-glow);
}

textarea { min-height: 100px; resize: vertical; }
select option { background: #1a1530; color: var(--text-primary); }
input[type="checkbox"], input[type="radio"] { width: auto; accent-color: var(--accent-purple); }
.form-help { font-size: 12px; color: var(--text-muted); margin-top: 4px; }

.form-group p { margin-bottom: 16px; }
.form-group p label {
  display: block; font-size: 13px; font-weight: 600;
  color: var(--text-secondary); margin-bottom: 8px;
  text-transform: uppercase; letter-spacing: 0.5px;
}
.form-group .helptext { font-size: 12px; color: var(--text-muted); margin-top: 4px; display: block; }
.form-group ul.errorlist { list-style: none; padding: 0; margin: 4px 0 0; }
.form-group ul.errorlist li { color: var(--accent-red); font-size: 12px; padding: 4px 0; }

/* ============================================================
   BADGES
   ============================================================ */

.badge {
  display: inline-flex; align-items: center; gap: 4px;
  padding: 4px 12px; border-radius: var(--radius-full);
  font-size: 11px; font-weight: 700;
  text-transform: uppercase; letter-spacing: 0.5px;
  backdrop-filter: blur(10px);
}

.badge-primary { background: rgba(139, 92, 246, 0.20); color: #a78bfa; border: 1px solid rgba(139, 92, 246, 0.15); }
.badge-success { background: rgba(16, 185, 129, 0.20); color: #34d399; border: 1px solid rgba(16, 185, 129, 0.15); }
.badge-warning { background: rgba(245, 158, 11, 0.20); color: #fbbf24; border: 1px solid rgba(245, 158, 11, 0.15); }
.badge-danger { background: rgba(239, 68, 68, 0.20); color: #f87171; border: 1px solid rgba(239, 68, 68, 0.15); }
.badge-info { background: rgba(6, 182, 212, 0.20); color: #22d3ee; border: 1px solid rgba(6, 182, 212, 0.15); }
.badge-live { background: rgba(239, 68, 68, 0.20); color: #f87171; border: 1px solid rgba(239, 68, 68, 0.15); animation: pulse-badge 2s ease-in-out infinite; }

/* ============================================================
   AVATARS
   ============================================================ */

.avatar {
  width: 40px; height: 40px;
  border-radius: var(--radius-full);
  display: flex; align-items: center; justify-content: center;
  font-size: 14px; font-weight: 700; text-transform: uppercase;
  background: var(--gradient-accent);
  color: #fff; flex-shrink: 0;
  box-shadow: 0 0 15px rgba(139, 92, 246, 0.2);
}

.avatar-sm { width: 32px; height: 32px; font-size: 12px; }
.avatar-lg { width: 56px; height: 56px; font-size: 20px; }
.avatar-xl { width: 80px; height: 80px; font-size: 28px; }
.avatar img { width: 100%; height: 100%; border-radius: inherit; object-fit: cover; }

/* ============================================================
   ALERTS
   ============================================================ */

.alert {
  padding: 14px 20px; border-radius: var(--radius-md);
  font-size: 14px; font-weight: 500; margin-bottom: 16px;
  display: flex; align-items: center; gap: 10px;
  border: 1px solid;
  backdrop-filter: var(--glass-blur);
  animation: slideDown 0.3s ease;
}

.alert-success { background: rgba(16, 185, 129, 0.12); border-color: rgba(16, 185, 129, 0.25); color: #34d399; }
.alert-error { background: rgba(239, 68, 68, 0.12); border-color: rgba(239, 68, 68, 0.25); color: #f87171; }
.alert-warning { background: rgba(245, 158, 11, 0.12); border-color: rgba(245, 158, 11, 0.25); color: #fbbf24; }
.alert-info { background: rgba(59, 130, 246, 0.12); border-color: rgba(59, 130, 246, 0.25); color: #60a5fa; }

/* ============================================================
   TABLES
   ============================================================ */

.table-container {
  overflow-x: auto; border-radius: var(--radius-lg);
  border: 1px solid var(--border-glass);
  backdrop-filter: var(--glass-blur);
}

table { width: 100%; border-collapse: collapse; }
thead { background: var(--glass-bg); }
th {
  padding: 12px 16px; text-align: left;
  font-size: 11px; font-weight: 700;
  text-transform: uppercase; letter-spacing: 1px;
  color: var(--text-muted);
  border-bottom: 1px solid var(--border-glass);
}
td {
  padding: 14px 16px; font-size: 14px;
  border-bottom: 1px solid var(--border-glass);
  color: var(--text-secondary);
}
tr:last-child td { border-bottom: none; }
tr:hover td { background: var(--glass-bg); }

/* ============================================================
   TABS
   ============================================================ */

.tabs {
  display: flex; gap: 0;
  border-bottom: 1px solid var(--border-glass);
  overflow-x: auto;
  background: var(--glass-bg);
  backdrop-filter: var(--glass-blur);
  border-radius: var(--radius-lg) var(--radius-lg) 0 0;
}
.tabs::-webkit-scrollbar { display: none; }

.tab-btn {
  padding: 14px 24px; font-size: 13px; font-weight: 600;
  color: var(--text-muted); background: none;
  border: none; cursor: pointer; white-space: nowrap;
  transition: all var(--transition-fast);
  border-bottom: 2px solid transparent; font-family: inherit;
}
.tab-btn:hover { color: var(--text-primary); }
.tab-btn.active { color: var(--accent-purple); border-bottom-color: var(--accent-purple); }

.tab-content { display: none; }
.tab-content.active { display: block; animation: fadeIn 0.3s ease; }

/* ============================================================
   FILTER PILLS
   ============================================================ */

.filter-pills { display: flex; gap: 8px; flex-wrap: wrap; margin-bottom: 24px; }

.filter-pill {
  padding: 8px 18px; border-radius: var(--radius-full);
  font-size: 13px; font-weight: 500;
  color: var(--text-secondary);
  background: var(--glass-bg);
  backdrop-filter: blur(10px);
  border: 1px solid var(--border-glass);
  cursor: pointer; transition: all var(--transition-fast); text-decoration: none;
}
.filter-pill:hover { background: var(--glass-bg-hover); color: var(--text-primary); }
.filter-pill.active {
  background: rgba(139, 92, 246, 0.18);
  color: var(--accent-purple);
  border-color: var(--border-glow);
  box-shadow: 0 0 15px rgba(139, 92, 246, 0.1);
}

/* ============================================================
   CHAT
   ============================================================ */

.chat-container {
  display: flex; flex-direction: column; height: 500px;
  background: var(--glass-bg);
  backdrop-filter: var(--glass-blur);
  border: 1px solid var(--border-glass);
  border-radius: var(--radius-lg);
  overflow: hidden; box-shadow: var(--shadow-glass);
}

.chat-header {
  padding: 16px 20px;
  border-bottom: 1px solid var(--border-glass);
  background: var(--glass-bg);
  font-weight: 700; font-size: 14px;
  display: flex; align-items: center; gap: 8px;
}

.chat-messages {
  flex: 1; overflow-y: auto; padding: 20px;
  display: flex; flex-direction: column; gap: 12px;
}

.chat-bubble {
  max-width: 80%; padding: 10px 16px;
  border-radius: var(--radius-md); font-size: 14px; line-height: 1.5;
}
.chat-bubble.sent {
  align-self: flex-end;
  background: var(--gradient-primary); color: #fff;
  border-bottom-right-radius: 4px;
  box-shadow: 0 4px 15px rgba(124, 58, 237, 0.25);
}
.chat-bubble.received {
  align-self: flex-start;
  background: var(--glass-bg-strong); color: var(--text-primary);
  border-bottom-left-radius: 4px;
  border: 1px solid var(--border-glass);
}

.chat-meta { font-size: 10px; color: var(--text-muted); margin-top: 4px; padding: 0 4px; }

.chat-input {
  padding: 16px;
  border-top: 1px solid var(--border-glass);
  background: var(--glass-bg);
}

/* ============================================================
   PAGE HEADERS
   ============================================================ */

.page-header { margin-bottom: 32px; }
.page-header h1 { font-size: 28px; font-weight: 800; margin-bottom: 4px; letter-spacing: -0.5px; }
.page-header p { color: var(--text-secondary); font-size: 15px; }

/* ============================================================
   EMPTY STATES
   ============================================================ */

.empty-state {
  text-align: center; padding: 60px 20px;
  border: 2px dashed var(--border-glass);
  border-radius: var(--radius-lg);
  backdrop-filter: var(--glass-blur);
}
.empty-state .empty-icon { font-size: 48px; margin-bottom: 16px; opacity: 0.5; }
.empty-state h3 { font-size: 18px; font-weight: 700; margin-bottom: 8px; color: var(--text-secondary); }
.empty-state p { font-size: 14px; color: var(--text-muted); }

/* ============================================================
   UTILITIES
   ============================================================ */

.text-gradient {
  background: var(--gradient-accent);
  -webkit-background-clip: text; -webkit-text-fill-color: transparent;
  background-clip: text;
}

.text-muted { color: var(--text-muted); }
.text-secondary { color: var(--text-secondary); }
.text-accent { color: var(--text-accent); }
.text-success { color: var(--accent-emerald); }
.text-warning { color: var(--accent-amber); }
.text-danger { color: var(--accent-red); }
.text-sm { font-size: 13px; }
.text-xs { font-size: 11px; }
.text-lg { font-size: 18px; }
.text-xl { font-size: 24px; }
.text-2xl { font-size: 28px; }

.font-bold { font-weight: 700; }
.font-semibold { font-weight: 600; }
.font-medium { font-weight: 500; }
.font-black { font-weight: 900; }

.flex { display: flex; }
.flex-col { flex-direction: column; }
.flex-wrap { flex-wrap: wrap; }
.items-center { align-items: center; }
.items-start { align-items: flex-start; }
.items-end { align-items: flex-end; }
.justify-between { justify-content: space-between; }
.justify-center { justify-content: center; }
.gap-2 { gap: 8px; }
.gap-3 { gap: 12px; }
.gap-4 { gap: 16px; }
.gap-6 { gap: 24px; }
.gap-8 { gap: 32px; }

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

.mt-2 { margin-top: 8px; }
.mt-4 { margin-top: 16px; }
.mt-6 { margin-top: 24px; }
.mt-8 { margin-top: 32px; }
.mb-2 { margin-bottom: 8px; }
.mb-4 { margin-bottom: 16px; }
.mb-6 { margin-bottom: 24px; }
.mb-8 { margin-bottom: 32px; }

.p-4 { padding: 16px; }
.p-6 { padding: 24px; }
.p-8 { padding: 32px; }
.px-4 { padding-left: 16px; padding-right: 16px; }
.py-2 { padding-top: 8px; padding-bottom: 8px; }

.w-full { width: 100%; }
.h-full { height: 100%; }

.line-clamp-2 { display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.line-clamp-3 { display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; overflow: hidden; }

.overflow-hidden { overflow: hidden; }
.relative { position: relative; }
.truncate { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.sr-only { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0,0,0,0); border: 0; }
.rounded-full { border-radius: var(--radius-full); }

/* ============================================================
   ANIMATIONS
   ============================================================ */

@keyframes fadeIn { from { opacity: 0; transform: translateY(10px); } to { opacity: 1; transform: translateY(0); } }
@keyframes slideDown { from { opacity: 0; transform: translateY(-12px); } to { opacity: 1; transform: translateY(0); } }
@keyframes slideInLeft { from { opacity: 0; transform: translateX(-20px); } to { opacity: 1; transform: translateX(0); } }
@keyframes pulse-badge { 0%, 100% { opacity: 1; } 50% { opacity: 0.5; } }
@keyframes glow { 0%, 100% { box-shadow: 0 0 20px rgba(139,92,246,0.2); } 50% { box-shadow: 0 0 50px rgba(139,92,246,0.4); } }
@keyframes float { 0%, 100% { transform: translateY(0px); } 50% { transform: translateY(-12px); } }
@keyframes shimmer { 0% { background-position: -200% 0; } 100% { background-position: 200% 0; } }

.animate-fade-in { animation: fadeIn 0.5s ease; }
.animate-slide-in { animation: slideInLeft 0.4s ease; }
.animate-float { animation: float 6s ease-in-out infinite; }
.animate-glow { animation: glow 3s ease-in-out infinite; }

.stagger-item { opacity: 0; animation: fadeIn 0.4s ease forwards; }
.stagger-item:nth-child(1) { animation-delay: 0.05s; }
.stagger-item:nth-child(2) { animation-delay: 0.10s; }
.stagger-item:nth-child(3) { animation-delay: 0.15s; }
.stagger-item:nth-child(4) { animation-delay: 0.20s; }
.stagger-item:nth-child(5) { animation-delay: 0.25s; }
.stagger-item:nth-child(6) { animation-delay: 0.30s; }
.stagger-item:nth-child(7) { animation-delay: 0.35s; }
.stagger-item:nth-child(8) { animation-delay: 0.40s; }
.stagger-item:nth-child(9) { animation-delay: 0.45s; }
.stagger-item:nth-child(10) { animation-delay: 0.50s; }

/* ============================================================
   LANDING PAGE
   ============================================================ */

.landing-page {
  min-height: 100vh;
  background: var(--bg-body);
  background-image: var(--bg-mesh);
  overflow: hidden;
}

.landing-hero {
  min-height: 100vh;
  display: flex; align-items: center; justify-content: center;
  position: relative; padding: 40px 20px;
}

.hero-bg {
  position: absolute; top: 0; left: 0; right: 0; bottom: 0;
  background: 
    radial-gradient(ellipse at 25% 25%, rgba(124, 58, 237, 0.20) 0%, transparent 50%),
    radial-gradient(ellipse at 75% 75%, rgba(236, 72, 153, 0.15) 0%, transparent 50%),
    radial-gradient(ellipse at 50% 50%, rgba(59, 130, 246, 0.10) 0%, transparent 70%);
  z-index: 0;
}

.hero-grid {
  position: absolute; top: 0; left: 0; right: 0; bottom: 0;
  background-image: 
    linear-gradient(rgba(255,255,255,0.03) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255,255,255,0.03) 1px, transparent 1px);
  background-size: 60px 60px;
  z-index: 0;
}

.hero-content {
  position: relative; z-index: 1;
  text-align: center; max-width: 800px;
}

.hero-content h1 { font-size: 64px; font-weight: 900; line-height: 1.1; letter-spacing: -2px; margin-bottom: 20px; }

.hero-content .hero-subtitle {
  font-size: 20px; color: var(--text-secondary);
  max-width: 600px; margin: 0 auto 40px; line-height: 1.6;
}

.hero-buttons { display: flex; gap: 16px; justify-content: center; flex-wrap: wrap; }

.hero-feature-card {
  background: var(--glass-bg);
  backdrop-filter: var(--glass-blur);
  -webkit-backdrop-filter: var(--glass-blur);
  border: 1px solid var(--border-glass);
  border-radius: var(--radius-lg);
  padding: 32px 24px; text-align: center;
  transition: all var(--transition-base);
  box-shadow: var(--shadow-glass);
}
.hero-feature-card:hover {
  transform: translateY(-6px);
  border-color: var(--border-glow);
  box-shadow: var(--shadow-glass-hover), var(--shadow-glow-strong);
}
.hero-feature-card .feature-icon { font-size: 40px; margin-bottom: 16px; }
.hero-feature-card h3 { font-size: 18px; font-weight: 700; margin-bottom: 8px; }
.hero-feature-card p { font-size: 14px; color: var(--text-secondary); line-height: 1.6; }

.landing-nav {
  position: fixed; top: 0; left: 0; right: 0; z-index: 100;
  padding: 16px 32px;
  display: flex; align-items: center; justify-content: space-between;
  background: rgba(12, 10, 26, 0.5);
  backdrop-filter: var(--glass-blur-heavy);
  -webkit-backdrop-filter: var(--glass-blur-heavy);
  border-bottom: 1px solid var(--border-glass);
}

.landing-nav .nav-brand {
  font-size: 22px; font-weight: 800;
  background: var(--gradient-primary);
  -webkit-background-clip: text; -webkit-text-fill-color: transparent;
  background-clip: text;
  display: flex; align-items: center; gap: 10px;
}

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

/* ============================================================
   COVER BANNER
   ============================================================ */

.cover-banner {
  height: 200px; width: 100%;
  border-radius: var(--radius-lg);
  overflow: hidden; position: relative;
  background: linear-gradient(135deg, #1e1541, #2d1b69, #1a1145);
}
.cover-banner img { width: 100%; height: 100%; object-fit: cover; opacity: 0.7; }
.cover-banner-tall { height: 280px; }

/* ============================================================
   LEADERBOARD
   ============================================================ */

.leaderboard-card {
  background: var(--glass-bg);
  backdrop-filter: var(--glass-blur);
  border: 1px solid var(--border-glass);
  border-radius: var(--radius-lg);
  overflow: hidden; box-shadow: var(--shadow-glass);
}

.leaderboard-header {
  padding: 16px 20px;
  background: linear-gradient(135deg, rgba(245, 158, 11, 0.15), rgba(234, 179, 8, 0.08));
  border-bottom: 1px solid var(--border-glass);
  display: flex; align-items: center; justify-content: space-between;
}

.leaderboard-item {
  display: flex; align-items: center; gap: 12px;
  padding: 12px 20px;
  border-bottom: 1px solid var(--border-glass);
  transition: background var(--transition-fast);
}
.leaderboard-item:last-child { border-bottom: none; }
.leaderboard-item:hover { background: var(--glass-bg); }
.leaderboard-item.current-user { background: rgba(139, 92, 246, 0.08); border-left: 3px solid var(--accent-purple); }

.rank-badge {
  width: 32px; height: 32px;
  border-radius: var(--radius-full);
  display: flex; align-items: center; justify-content: center;
  font-size: 12px; font-weight: 800; flex-shrink: 0;
}
.rank-1 { background: linear-gradient(135deg, #f59e0b, #fbbf24); color: #78350f; box-shadow: 0 0 15px rgba(245, 158, 11, 0.3); }
.rank-2 { background: linear-gradient(135deg, #9ca3af, #d1d5db); color: #374151; }
.rank-3 { background: linear-gradient(135deg, #f97316, #fb923c); color: #7c2d12; }
.rank-default { background: var(--glass-bg); color: var(--text-muted); }

.leaderboard-footer {
  padding: 12px 20px;
  background: var(--glass-bg);
  border-top: 1px solid var(--border-glass);
  display: flex; justify-content: space-between;
  font-size: 13px; color: var(--text-secondary);
}

/* ============================================================
   AUTH PAGES
   ============================================================ */

.auth-page {
  min-height: 100vh;
  display: flex; align-items: center; justify-content: center;
  background: var(--bg-body);
  background-image: var(--bg-mesh);
  position: relative;
}

.auth-page .auth-bg {
  position: absolute; top: 0; left: 0; right: 0; bottom: 0;
  background: radial-gradient(ellipse at 50% 0%, rgba(124, 58, 237, 0.15) 0%, transparent 60%);
}

.auth-card {
  width: 100%; max-width: 440px;
  background: var(--glass-bg);
  backdrop-filter: var(--glass-blur-heavy);
  -webkit-backdrop-filter: var(--glass-blur-heavy);
  border: 1px solid var(--border-glass);
  border-radius: var(--radius-xl);
  padding: 40px; position: relative; z-index: 1;
  box-shadow: var(--shadow-glass);
}

.auth-card .auth-header { text-align: center; margin-bottom: 32px; }
.auth-card .auth-header h1 { font-size: 28px; font-weight: 800; margin-bottom: 8px; }
.auth-card .auth-header p { color: var(--text-secondary); font-size: 14px; }

/* ============================================================
   XP BAR
   ============================================================ */

.xp-bar { height: 6px; background: var(--glass-bg); border-radius: var(--radius-full); overflow: hidden; }
.xp-bar-fill { height: 100%; background: var(--gradient-primary); border-radius: var(--radius-full); transition: width 1s ease; }

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

@media (max-width: 1024px) {
  .grid-3 { grid-template-columns: repeat(2, 1fr); }
  .grid-4 { grid-template-columns: repeat(2, 1fr); }
}

@media (max-width: 768px) {
  .sidebar { transform: translateX(-100%); }
  .sidebar.open { transform: translateX(0); }
  .sidebar-overlay.active { display: block; }
  .hamburger-btn { display: flex; }
  .main-content { margin-left: 0; }
  .page-content { padding: 20px 16px; }
  .topbar { padding: 0 16px; }
  .grid-2, .grid-3, .grid-4 { grid-template-columns: 1fr; }
  .hero-content h1 { font-size: 36px; letter-spacing: -1px; }
  .hero-content .hero-subtitle { font-size: 16px; }
  .landing-nav { padding: 12px 16px; }
  .auth-card { margin: 16px; padding: 28px; }
}

@media (max-width: 480px) {
  .hero-content h1 { font-size: 28px; }
  .hero-buttons { flex-direction: column; align-items: center; }
  .stat-card .stat-value { font-size: 24px; }
}
