:root {
  --bg: #0f0f0f;
  --surface: #1a1a1a;
  --surface2: #242424;
  --border: #333;
  --accent: #e50914;
  --accent-hover: #f40612;
  --text: #e5e5e5;
  --text-muted: #888;
  --radius: 8px;
  --shadow: 0 4px 24px rgba(0,0,0,0.5);
}

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

body {
  background: var(--bg);
  color: var(--text);
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  min-height: 100vh;
}

a { color: var(--accent); text-decoration: none; }
a:hover { text-decoration: underline; }

/* NAV */
nav {
  background: var(--surface);
  border-bottom: 1px solid var(--border);
  padding: 0 2rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 60px;
  position: sticky;
  top: 0;
  z-index: 100;
}

.nav-logo {
  font-size: 1.4rem;
  font-weight: 700;
  color: var(--accent);
  letter-spacing: -0.5px;
}

.nav-links {
  display: flex;
  gap: 1rem;
  align-items: center;
}

.nav-links a, .nav-links button {
  color: var(--text);
  background: none;
  border: none;
  cursor: pointer;
  font-size: 0.9rem;
  padding: 0.4rem 0.8rem;
  border-radius: var(--radius);
  transition: background 0.2s;
}
.nav-links a:hover, .nav-links button:hover { background: var(--surface2); text-decoration: none; }

/* PAGES */
.page { display: none; min-height: calc(100vh - 60px); }
.page.active { display: block; }

/* HERO */
.hero {
  text-align: center;
  padding: 6rem 2rem 4rem;
  max-width: 700px;
  margin: 0 auto;
}
.hero h1 { font-size: 2.8rem; font-weight: 800; margin-bottom: 1rem; line-height: 1.2; }
.hero p { font-size: 1.1rem; color: var(--text-muted); margin-bottom: 2rem; }

/* BUTTONS */
.btn {
  display: inline-block;
  padding: 0.75rem 1.75rem;
  border-radius: var(--radius);
  font-size: 0.95rem;
  font-weight: 600;
  cursor: pointer;
  border: none;
  transition: all 0.2s;
}
.btn-primary { background: var(--accent); color: #fff; }
.btn-primary:hover { background: var(--accent-hover); }
.btn-secondary { background: var(--surface2); color: var(--text); border: 1px solid var(--border); }
.btn-secondary:hover { background: var(--border); }
.btn-outline { background: transparent; color: var(--text); border: 1px solid var(--border); }
.btn-outline:hover { background: var(--surface2); }
.btn-sm { padding: 0.4rem 0.9rem; font-size: 0.85rem; }
.btn-full { width: 100%; }

/* FORMS */
.auth-container {
  max-width: 420px;
  margin: 4rem auto;
  padding: 2.5rem;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
}
.auth-container h2 { margin-bottom: 1.5rem; font-size: 1.5rem; }

.form-group { margin-bottom: 1.2rem; }
.form-group label { display: block; margin-bottom: 0.4rem; font-size: 0.9rem; color: var(--text-muted); }
.form-group input {
  width: 100%;
  padding: 0.65rem 0.9rem;
  background: var(--surface2);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  color: var(--text);
  font-size: 0.95rem;
  transition: border-color 0.2s;
}
.form-group input:focus { outline: none; border-color: var(--accent); }

.form-error { color: #ff6b6b; font-size: 0.85rem; margin-top: 0.4rem; }
.form-link { text-align: center; margin-top: 1rem; font-size: 0.9rem; color: var(--text-muted); }

/* PRICING */
.pricing-page { padding: 4rem 2rem; }
.pricing-page h2 { text-align: center; font-size: 2rem; margin-bottom: 0.5rem; }
.pricing-subtitle { text-align: center; color: var(--text-muted); margin-bottom: 3rem; }

.plans-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 1.5rem;
  max-width: 900px;
  margin: 0 auto;
}

.plan-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 2rem;
  text-align: center;
  transition: border-color 0.2s;
}
.plan-card.featured { border-color: var(--accent); position: relative; }
.plan-card.featured::before {
  content: 'Popular';
  position: absolute;
  top: -12px;
  left: 50%;
  transform: translateX(-50%);
  background: var(--accent);
  color: #fff;
  padding: 2px 12px;
  border-radius: 20px;
  font-size: 0.75rem;
  font-weight: 600;
}

.plan-name { font-size: 1.2rem; font-weight: 700; margin-bottom: 0.5rem; }
.plan-price { font-size: 2.5rem; font-weight: 800; margin: 1rem 0; }
.plan-price span { font-size: 1rem; font-weight: 400; color: var(--text-muted); }
.plan-features { list-style: none; margin: 1.5rem 0; text-align: left; }
.plan-features li { padding: 0.4rem 0; color: var(--text-muted); font-size: 0.9rem; }
.plan-features li::before { content: '✓ '; color: #4caf50; font-weight: 700; }

/* DASHBOARD / VIDEOS */
.dashboard { padding: 2rem; max-width: 1400px; margin: 0 auto; }
.dashboard h2 { font-size: 1.5rem; margin-bottom: 1.5rem; }

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

.video-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  overflow: hidden;
  cursor: pointer;
  transition: transform 0.2s, border-color 0.2s;
}
.video-card:hover { transform: translateY(-2px); border-color: var(--accent); }

.video-thumbnail {
  width: 100%;
  aspect-ratio: 16/9;
  background: var(--surface2);
  display: flex;
  align-items: center;
  justify-content: center;
  position: relative;
  overflow: hidden;
}
.video-thumbnail img { width: 100%; height: 100%; object-fit: cover; }
.video-thumbnail .play-icon {
  position: absolute;
  font-size: 3rem;
  opacity: 0.8;
}
.video-duration {
  position: absolute;
  bottom: 6px;
  right: 8px;
  background: rgba(0,0,0,0.8);
  padding: 2px 6px;
  border-radius: 4px;
  font-size: 0.75rem;
}

.video-info { padding: 0.8rem 1rem; }
.video-info h3 { font-size: 0.95rem; font-weight: 600; margin-bottom: 0.3rem; line-height: 1.4; }
.video-meta { font-size: 0.8rem; color: var(--text-muted); }

/* VIDEO PLAYER */
.player-overlay {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.92);
  z-index: 200;
  align-items: center;
  justify-content: center;
  flex-direction: column;
}
.player-overlay.active { display: flex; }

.player-container {
  width: 90vw;
  max-width: 1100px;
}
.player-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 1rem;
}
.player-header h3 { font-size: 1.1rem; }
.player-close {
  background: none;
  border: none;
  color: var(--text);
  font-size: 1.8rem;
  cursor: pointer;
  line-height: 1;
}

video {
  width: 100%;
  border-radius: var(--radius);
  background: #000;
}

.player-actions { margin-top: 1rem; display: flex; gap: 0.75rem; }

/* SUBSCRIPTION BANNER */
.sub-banner {
  background: linear-gradient(135deg, #1a0a0a, #2a0a0a);
  border: 1px solid var(--accent);
  border-radius: var(--radius);
  padding: 2rem;
  text-align: center;
  max-width: 500px;
  margin: 4rem auto;
}
.sub-banner h3 { font-size: 1.3rem; margin-bottom: 0.5rem; }
.sub-banner p { color: var(--text-muted); margin-bottom: 1.5rem; }

/* ALERTS */
.alert {
  padding: 0.75rem 1rem;
  border-radius: var(--radius);
  margin-bottom: 1rem;
  font-size: 0.9rem;
}
.alert-error { background: rgba(255,107,107,0.15); border: 1px solid #ff6b6b; color: #ff6b6b; }
.alert-success { background: rgba(76,175,80,0.15); border: 1px solid #4caf50; color: #4caf50; }

/* LOADING */
.spinner {
  display: inline-block;
  width: 20px;
  height: 20px;
  border: 2px solid var(--border);
  border-top-color: var(--accent);
  border-radius: 50%;
  animation: spin 0.7s linear infinite;
  vertical-align: middle;
}
@keyframes spin { to { transform: rotate(360deg); } }

.loading-state { text-align: center; padding: 4rem; color: var(--text-muted); }

/* ACCOUNT PAGE */
.account-page { padding: 2rem; max-width: 600px; margin: 0 auto; }
.account-page h2 { font-size: 1.5rem; margin-bottom: 2rem; }
.account-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1.5rem;
  margin-bottom: 1.5rem;
}
.account-card h3 { font-size: 1rem; font-weight: 600; margin-bottom: 1rem; color: var(--text-muted); text-transform: uppercase; font-size: 0.75rem; letter-spacing: 1px; }
.info-row { display: flex; justify-content: space-between; padding: 0.6rem 0; border-bottom: 1px solid var(--border); font-size: 0.9rem; }
.info-row:last-child { border-bottom: none; }
.status-badge {
  padding: 2px 10px;
  border-radius: 20px;
  font-size: 0.8rem;
  font-weight: 600;
}
.status-active { background: rgba(76,175,80,0.2); color: #4caf50; }
.status-inactive { background: rgba(255,107,107,0.2); color: #ff6b6b; }
.status-past_due { background: rgba(255,152,0,0.2); color: #ff9800; }

@media (max-width: 600px) {
  .hero h1 { font-size: 2rem; }
  .video-grid { grid-template-columns: 1fr; }
  .player-container { width: 100vw; }
}
