/* 
 * Minimal, elegant video browser
 * Netflix/Apple TV/Criterion-inspired
 * Works in dark/light modes
 */

:root {
  /* Dark theme (default) */
  --bg-primary: #0a0a0a;
  --bg-secondary: #1a1a1a;
  --bg-surface: #2a2a2a;
  --text-primary: #ffffff;
  --text-secondary: #a0a0a0;
  --text-tertiary: #666666;
  --border-color: #333333;
  --accent: #e50914; /* Subtle red accent, Netflix-style */
  --radius: 8px;
  --shadow: 0 4px 12px rgba(0, 0, 0, 0.25);
  --hover-shadow: 0 8px 24px rgba(0, 0, 0, 0.4);
  --transition: all 0.2s ease;
}

[data-theme="light"] {
  --bg-primary: #ffffff;
  --bg-secondary: #f5f5f5;
  --bg-surface: #f0f0f0;
  --text-primary: #000000;
  --text-secondary: #555555;
  --text-tertiary: #888888;
  --border-color: #dddddd;
  --shadow: 0 4px 12px rgba(0, 0, 0, 0.05);
  --hover-shadow: 0 8px 24px rgba(0, 0, 0, 0.1);
}

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

html {
  font-size: 16px;
  scroll-behavior: smooth;
}

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

/* Utility Classes */
.container {
  max-width: 1400px;
  margin: 0 auto;
  padding: 0 2rem;
}

.hidden {
  display: none !important;
}

/* Header */
.header {
  position: sticky;
  top: 0;
  z-index: 100;
  background-color: var(--bg-primary);
  border-bottom: 1px solid var(--border-color);
  padding: 1.5rem 0;
  backdrop-filter: blur(10px);
  background-color: rgba(10, 10, 10, 0.9);
}

[data-theme="light"] .header {
  background-color: rgba(255, 255, 255, 0.9);
}

.header-content {
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.logo {
  font-size: 1.5rem;
  font-weight: 700;
  letter-spacing: -0.02em;
  text-decoration: none;
  color: var(--text-primary);
}

.logo span {
  color: var(--accent);
}

.theme-toggle {
  background: none;
  border: 1px solid var(--border-color);
  color: var(--text-secondary);
  padding: 0.5rem 1rem;
  border-radius: var(--radius);
  cursor: pointer;
  font-size: 0.9rem;
  transition: var(--transition);
}

.theme-toggle:hover {
  color: var(--text-primary);
  border-color: var(--text-tertiary);
}

/* Grid Page */
.grid-page {
  padding: 3rem 0;
}

.page-title {
  font-size: 2rem;
  font-weight: 300;
  margin-bottom: 2rem;
  letter-spacing: -0.01em;
}

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

/* Video Card */
.video-card {
  background: var(--bg-surface);
  border-radius: var(--radius);
  overflow: hidden;
  transition: var(--transition);
  text-decoration: none;
  color: inherit;
  display: block;
}

.video-card:hover {
  transform: translateY(-4px);
  box-shadow: var(--hover-shadow);
}

.video-card-thumbnail {
  width: 100%;
  aspect-ratio: 16 / 9;
  background-color: var(--bg-secondary);
  position: relative;
  overflow: hidden;
}

.video-card-thumbnail img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: var(--transition);
}

.video-card:hover .video-card-thumbnail img {
  transform: scale(1.03);
}

.video-card-thumbnail .play-icon {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  background: rgba(0, 0, 0, 0.7);
  width: 48px;
  height: 48px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 0;
  transition: var(--transition);
}

.video-card:hover .video-card-thumbnail .play-icon {
  opacity: 1;
}

.video-card-info {
  padding: 1.25rem;
}

.video-card-title {
  font-size: 1.1rem;
  font-weight: 500;
  margin-bottom: 0.5rem;
  line-height: 1.3;
  color: var(--text-primary);
}

.video-card-description {
  font-size: 0.9rem;
  color: var(--text-secondary);
  line-height: 1.4;
}

/* Watch Page */
.watch-page {
  min-height: 100vh;
  background: #000;
}

.player-container {
  position: relative;
  max-width: 1200px;
  margin: 0 auto;
  padding: 2rem;
}

.video-player {
  width: 100%;
  aspect-ratio: 16 / 9;
  background: #000;
  border-radius: var(--radius);
  overflow: hidden;
}

.video-player video {
  width: 100%;
  height: 100%;
  display: block;
}

.player-info {
  max-width: 800px;
  margin: 2rem auto 0;
  padding: 0 2rem;
}

.player-title {
  font-size: 2rem;
  font-weight: 300;
  margin-bottom: 1rem;
  line-height: 1.2;
}

.player-description {
  color: var(--text-secondary);
  font-size: 1.1rem;
  line-height: 1.6;
}

.back-button {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  background: var(--bg-surface);
  color: var(--text-primary);
  border: none;
  padding: 0.75rem 1.5rem;
  border-radius: var(--radius);
  cursor: pointer;
  font-size: 1rem;
  margin-bottom: 2rem;
  transition: var(--transition);
}

.back-button:hover {
  background: var(--bg-secondary);
}

/* Loading States */
.loading {
  display: flex;
  justify-content: center;
  align-items: center;
  min-height: 50vh;
  font-size: 1.1rem;
  color: var(--text-secondary);
}

.spinner {
  width: 40px;
  height: 40px;
  border: 3px solid var(--border-color);
  border-top-color: var(--accent);
  border-radius: 50%;
  animation: spin 1s linear infinite;
  margin-right: 1rem;
}

@keyframes spin {
  to { transform: rotate(360deg); }
}

/* Empty State */
.empty-state {
  text-align: center;
  padding: 4rem 2rem;
  color: var(--text-secondary);
}

/* Responsive */
@media (max-width: 768px) {
  .container {
    padding: 0 1rem;
  }
  
  .video-grid {
    grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
    gap: 1.5rem;
  }
  
  .player-container {
    padding: 1rem;
  }
  
  .player-info {
    padding: 0 1rem;
  }
  
  .player-title {
    font-size: 1.5rem;
  }
}




/* ============================
   Header icon buttons
   ============================ */

.header-content {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.header-icon-btn {
  background: none;
  border: none;
  color: inherit;
  font-size: 1.2rem;
  cursor: pointer;
  padding: 6px 8px;
  border-radius: 6px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.header-icon-btn:hover {
  background: rgba(255, 255, 255, 0.08);
}

/* Keep logo centered visually */
.logo {
  margin: 0 auto;
  font-weight: 600;
}


/* Kill purple link color in header icons */
.header-icon-btn,
.header-icon-btn:visited,
.header-icon-btn i {
  color: #ffffff !important;
}


.header-icon-btn:hover {
  background: rgba(255, 255, 255, 0.08);
  color: #ffffff;
}


/* ===== FIX HEADER ICON VISIBILITY (FINAL) ===== */

.header-icon-btn,
.header-icon-btn i {
  color: currentColor !important;
}

/* Dark mode */
html[data-theme="dark"] .header {
  color: #ffffff;
}

/* Light mode */
html[data-theme="light"] .header {
  color: #111111;
}

/* Hover */
.header-icon-btn:hover {
  background: rgba(0, 0, 0, 0.08);
}


/* ===== HEADER ICON COLOR FIX ===== */

.header {
  color: #ffffff;
}

html[data-theme="light"] .header {
  color: #111111;
}

.header-icon-btn,
.header-icon-btn i {
  color: currentColor !important;
}

.header-icon-btn {
  background: none;
  border: none;
  font-size: 1.1rem;
  cursor: pointer;
  padding: 6px;
  border-radius: 6px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.header-icon-btn:hover {
  background: rgba(0, 0, 0, 0.08);
}


/* =========================
   Video Player Menu
   Black & White – Light + Dark
   ========================= */

.main-menu {
  position: fixed;
  top: 56px;
  right: 16px;
  min-width: 180px;

  background: #ffffff;
  color: #000000;

  border: 1px solid #e5e5e5;
  border-radius: 10px;
  padding: 8px 0;

  display: flex;
  flex-direction: column;
  z-index: 99999;

  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.12);
}

.main-menu.hidden {
  display: none;
}

.main-menu a {
  padding: 10px 16px;
  text-decoration: none;

  color: #000000;
  font-size: 14px;
  font-weight: 500;

  transition: background 0.15s ease;
}

.main-menu a:hover {
  background: #f2f2f2;
}

/* =========================
   Dark Mode
   ========================= */

body.dark .main-menu,
body[data-theme="dark"] .main-menu {
  background: #111111;
  color: #ffffff;
  border: 1px solid #2a2a2a;
}

body.dark .main-menu a,
body[data-theme="dark"] .main-menu a {
  color: #ffffff;
}

body.dark .main-menu a:hover,
body[data-theme="dark"] .main-menu a:hover {
  background: #1e1e1e;
}

/* =========================
   Mobile tweak
   ========================= */

@media (max-width: 480px) {
  .main-menu {
    top: 52px;
    right: 12px;
    min-width: 160px;
  }
}


.hidden {
  display: none !important;
}
