:root {
  --bg-primary: #0a0a0f;
  --bg-surface: #16161f;
  --bg-elevated: #1e1e2e;
  --bg-hover: #252538;
  --accent-primary: #e63946;
  --accent-secondary: #ff6b6b;
  --accent-gradient: linear-gradient(135deg, #e63946, #ff6b6b);
  --text-primary: #f0f0f0;
  --text-secondary: #8a8a9a;
  --text-muted: #5a5a6a;
  --border-color: #2a2a3a;
  --border-light: #3a3a4a;
  --shadow-glow: 0 0 20px rgba(230, 57, 70, 0.15);
  --shadow-card: 0 4px 24px rgba(0, 0, 0, 0.4);
  --radius-sm: 8px;
  --radius-md: 12px;
  --radius-lg: 16px;
  --radius-xl: 24px;
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }

body {
  background-color: var(--bg-primary);
  color: var(--text-primary);
  font-family: "Inter", system-ui, -apple-system, sans-serif;
  margin: 0;
  padding: 0;
  min-height: 100vh;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

/* Custom Scrollbar */
::-webkit-scrollbar { width: 8px; height: 8px; }
::-webkit-scrollbar-track { background: var(--bg-primary); }
::-webkit-scrollbar-thumb { background: var(--border-color); border-radius: 4px; }
::-webkit-scrollbar-thumb:hover { background: var(--border-light); }

/* Utility Classes */
.glass {
  background: rgba(22, 22, 31, 0.7);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border: 1px solid rgba(255, 255, 255, 0.08);
}
.glass-strong {
  background: rgba(22, 22, 31, 0.85);
  backdrop-filter: blur(30px);
  -webkit-backdrop-filter: blur(30px);
  border: 1px solid rgba(255, 255, 255, 0.1);
}

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

.scrollbar-hide {
  -ms-overflow-style: none;
  scrollbar-width: none;
}
.scrollbar-hide::-webkit-scrollbar { display: none; }

/* Layout classes */
.container { max-width: 1280px; margin: 0 auto; padding: 0 1rem; }
.flex { display: flex; }
.flex-col { display: flex; flex-direction: column; }
.items-center { align-items: center; }
.justify-between { justify-content: space-between; }
.justify-center { justify-content: center; }
.gap-2 { gap: 0.5rem; }
.gap-3 { gap: 0.75rem; }
.gap-4 { gap: 1rem; }
.gap-6 { gap: 1.5rem; }

/* Header */
header {
  position: sticky;
  top: 0;
  z-index: 50;
  padding: 1rem 0;
  border-bottom: 1px solid var(--border-color);
}

.search-bar {
  display: flex;
  align-items: center;
  background: var(--bg-surface);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-xl);
  padding: 0.5rem 1rem;
  width: 100%;
  max-width: 400px;
}
.search-bar input {
  background: transparent;
  border: none;
  color: var(--text-primary);
  width: 100%;
  outline: none;
  padding: 0.25rem 0.5rem;
}

/* Category Bar */
.category-bar {
  display: flex;
  gap: 0.75rem;
  padding: 1rem 0;
  overflow-x: auto;
  border-bottom: 1px solid var(--border-color);
}

.category-btn {
  background: var(--bg-surface);
  color: var(--text-secondary);
  border: 1px solid var(--border-color);
  padding: 0.5rem 1rem;
  border-radius: var(--radius-xl);
  white-space: nowrap;
  font-size: 0.875rem;
  cursor: pointer;
  transition: all 0.2s;
}

.category-btn:hover { background: var(--bg-hover); color: var(--text-primary); }
.category-btn.active {
  background: var(--accent-primary);
  color: white;
  border-color: var(--accent-primary);
  box-shadow: var(--shadow-glow);
}

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

.video-card {
  background: var(--bg-surface);
  border-radius: var(--radius-lg);
  overflow: hidden;
  transition: transform 0.2s;
  cursor: pointer;
  border: 1px solid var(--border-color);
}

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

.thumbnail {
  width: 100%;
  aspect-ratio: 16/9;
  object-fit: cover;
}
.thumbnail-container {
  position: relative;
}

.duration-badge {
  position: absolute;
  bottom: 0.5rem;
  right: 0.5rem;
  background: rgba(0,0,0,0.8);
  color: white;
  padding: 0.25rem 0.5rem;
  border-radius: 4px;
  font-size: 0.75rem;
  font-weight: 500;
}

.video-info { padding: 1rem; }
.video-title {
  font-size: 1rem;
  font-weight: 600;
  margin: 0 0 0.5rem 0;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.video-meta {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  color: var(--text-secondary);
  font-size: 0.875rem;
}

.video-tags { 
  display: flex; gap: 0.5rem; flex-wrap: wrap; margin-top: 0.75rem;
}
.video-tag {
  background: var(--bg-elevated);
  padding: 0.2rem 0.5rem;
  border-radius: 4px;
  font-size: 0.75rem;
  color: var(--text-secondary);
}

/* Buttons */
.btn {
  padding: 0.5rem 1rem;
  border-radius: var(--radius-md);
  border: none;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.2s;
}

.btn-primary {
  background: var(--accent-gradient);
  color: white;
  box-shadow: var(--shadow-glow);
}
.btn-primary:hover { opacity: 0.9; }

/* Player Modal */
.modal-overlay {
  position: fixed;
  top: 0; left: 0; right: 0; bottom: 0;
  background: rgba(10, 10, 15, 0.95);
  backdrop-filter: blur(10px);
  z-index: 100;
  display: flex;
  align-items: center;
  justify-content: center;
}
.modal-content {
  width: 100%;
  max-width: 1000px;
  background: var(--bg-surface);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-lg);
  overflow: hidden;
}
.player-wrapper {
  position: relative;
  padding-top: 56.25%; /* 16:9 Aspect Ratio */
}
.player-wrapper iframe {
  position: absolute;
  top: 0; left: 0; width: 100%; height: 100%;
  border: none;
}

.player-info { padding: 1.5rem; }
.close-btn {
  background: transparent;
  color: var(--text-secondary);
  border: none;
  font-size: 1.5rem;
  cursor: pointer;
}
.close-btn:hover { color: var(--text-primary); }

@keyframes shimmer { 0% { background-position: -200% 0; } 100% { background-position: 200% 0; } }
.skeleton {
  background: linear-gradient(90deg, var(--bg-surface) 25%, var(--bg-elevated) 50%, var(--bg-surface) 75%);
  background-size: 200% 100%;
  animation: shimmer 1.5s infinite;
  border-radius: var(--radius-md);
}
