/* ===== Variables ===== */
:root {
  --bg: #0a0e1a;
  --bg-secondary: #111627;
  --surface: #161b2e;
  --surface-hover: #1c2240;
  --border: #2a3154;
  --border-light: #353d66;
  --text: #e8e6e3;
  --text-muted: #8a8fa8;
  --text-dim: #5a6080;
  --gold: #d4a520;
  --gold-light: #f0c040;
  --gold-dark: #b8860b;
  --red: #c0392b;
  --red-light: #e74c3c;
  --youtube-red: #ff0000;
  --twitter-blue: #1da1f2;
  --insta-pink: #e1306c;
  --radius-sm: 6px;
  --radius-md: 10px;
  --radius-lg: 16px;
  --radius-xl: 24px;
  --font-sans: 'DM Sans', system-ui, -apple-system, sans-serif;
  --font-serif: 'DM Serif Display', Georgia, serif;
  --ease-out-quart: cubic-bezier(0.25, 1, 0.5, 1);
  --dur-1: 200ms;
  --dur-2: 300ms;
  --dur-3: 400ms;
}

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

html {
  font-family: var(--font-sans);
  background: var(--bg);
  color: var(--text);
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  scroll-behavior: smooth;
}

body {
  min-height: 100dvh;
  background: var(--bg);
}

a { color: var(--gold); text-decoration: none; }
a:hover { color: var(--gold-light); }

img { max-width: 100%; display: block; }

/* ===== App Content ===== */
.app-content {
  width: 100%;
  min-height: 100dvh;
}

/* ===== Hero ===== */
.hero {
  background: linear-gradient(180deg, #0d1225 0%, var(--bg) 100%);
  border-bottom: 1px solid var(--border);
  padding: 3rem 1.5rem 2rem;
  text-align: center;
  position: relative;
  overflow: hidden;
}

.hero::before {
  content: '';
  position: absolute;
  top: 0; left: 0; right: 0; bottom: 0;
  background: radial-gradient(ellipse at 50% 0%, rgba(212,165,32,0.08) 0%, transparent 60%);
  pointer-events: none;
}

.hero-content {
  position: relative;
  z-index: 1;
  max-width: 700px;
  margin: 0 auto;
}

.hero-skull {
  width: 80px;
  height: 80px;
  margin: 0 auto 1rem;
  color: var(--gold);
}

.hero-skull svg { width: 100%; height: 100%; }

.hero h1 {
  font-family: var(--font-serif);
  font-size: clamp(1.8rem, 5vw, 3rem);
  color: var(--gold);
  line-height: 1.2;
  margin-bottom: 0.5rem;
  text-shadow: 0 2px 20px rgba(212,165,32,0.2);
}

.hero-subtitle {
  color: var(--text-muted);
  font-size: 1.1rem;
  font-weight: 300;
}

/* ===== Controls ===== */
.controls {
  max-width: 1200px;
  margin: 0 auto;
  padding: 1.5rem;
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

.search-wrap {
  position: relative;
}

.search-icon {
  position: absolute;
  left: 14px;
  top: 50%;
  transform: translateY(-50%);
  width: 18px;
  height: 18px;
  color: var(--text-dim);
  pointer-events: none;
}

.search-input {
  width: 100%;
  padding: 12px 16px 12px 44px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  color: var(--text);
  font-size: 1rem;
  font-family: var(--font-sans);
  outline: none;
  transition: border-color var(--dur-1) ease, box-shadow var(--dur-1) ease;
}

.search-input:focus {
  border-color: var(--gold-dark);
  box-shadow: 0 0 0 3px rgba(212,165,32,0.15);
}

.search-input::placeholder { color: var(--text-dim); }

.language-tabs {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
}

.lang-tab {
  padding: 8px 16px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-xl);
  color: var(--text-muted);
  font-size: 0.875rem;
  font-family: var(--font-sans);
  cursor: pointer;
  transition: background-color var(--dur-1) ease, color var(--dur-1) ease, border-color var(--dur-1) ease;
  white-space: nowrap;
}

.lang-tab:hover {
  background: var(--surface-hover);
  color: var(--text);
}

.lang-tab.active {
  background: var(--gold-dark);
  border-color: var(--gold);
  color: #fff;
}

.tab-flag { margin-right: 4px; }
.tab-count { opacity: 0.7; font-size: 0.8em; }

.sort-wrap {
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.sort-label {
  color: var(--text-muted);
  font-size: 0.875rem;
  white-space: nowrap;
}

.sort-select {
  padding: 8px 12px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  color: var(--text);
  font-size: 0.875rem;
  font-family: var(--font-sans);
  cursor: pointer;
  outline: none;
}

.sort-select:focus {
  border-color: var(--gold-dark);
}

/* ===== Creators Grid ===== */
.creators-grid {
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 1.5rem 2rem;
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(360px, 1fr));
  gap: 1rem;
}

/* ===== Creator Card ===== */
.creator-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  overflow: hidden;
  transition: border-color var(--dur-2) ease, box-shadow var(--dur-2) ease;
}

.creator-card:hover {
  border-color: var(--border-light);
  box-shadow: 0 4px 20px rgba(0,0,0,0.3);
}

.creator-card.retired {
  opacity: 0.7;
}

.card-header {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 16px;
  cursor: pointer;
  user-select: none;
}

.card-avatar {
  width: 48px;
  height: 48px;
  min-width: 48px;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--gold-dark), var(--gold));
  display: grid;
  place-items: center;
}

.avatar-letter {
  font-family: var(--font-serif);
  font-size: 1.4rem;
  color: var(--bg);
  font-weight: 700;
}

.avatar-letter.large {
  font-size: 2.5rem;
}

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

.card-name-row {
  display: flex;
  align-items: center;
  gap: 6px;
  flex-wrap: wrap;
}

.card-name {
  font-size: 1rem;
  font-weight: 600;
  color: var(--text);
  line-height: 1.3;
}

.card-flag { font-size: 1.1rem; }

.card-meta {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-top: 2px;
}

.sub-count {
  display: flex;
  align-items: center;
  gap: 4px;
  color: var(--text-muted);
  font-size: 0.8rem;
}

.sub-count svg {
  width: 14px;
  height: 14px;
  min-width: 14px;
}

.sub-count.large {
  font-size: 1rem;
  color: var(--gold);
}

.card-lang {
  color: var(--text-dim);
  font-size: 0.75rem;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.badge {
  padding: 2px 8px;
  border-radius: var(--radius-sm);
  font-size: 0.7rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.retired-badge {
  background: rgba(192,57,43,0.2);
  color: var(--red-light);
  border: 1px solid rgba(192,57,43,0.3);
}

.expand-btn {
  width: 32px;
  height: 32px;
  min-width: 32px;
  border: none;
  background: transparent;
  color: var(--text-dim);
  cursor: pointer;
  border-radius: var(--radius-sm);
  display: grid;
  place-items: center;
  transition: transform var(--dur-2) var(--ease-out-quart), color var(--dur-1) ease;
}

.expand-btn:hover { color: var(--gold); }

.expand-btn svg { width: 18px; height: 18px; }

.expand-btn.rotated {
  transform: rotate(180deg);
}

/* ===== Card Body ===== */
.card-body {
  padding: 0 16px 16px;
  border-top: 1px solid var(--border);
  animation: slideDown var(--dur-2) var(--ease-out-quart);
}

@keyframes slideDown {
  from { opacity: 0; transform: translateY(-8px); }
  to { opacity: 1; transform: translateY(0); }
}

.card-focus {
  color: var(--text-muted);
  font-size: 0.875rem;
  line-height: 1.6;
  margin-top: 12px;
}

.card-links {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 12px;
}

.link-btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 6px 14px;
  border-radius: var(--radius-md);
  font-size: 0.8rem;
  font-weight: 500;
  transition: background-color var(--dur-1) ease, color var(--dur-1) ease;
  text-decoration: none;
}

.link-btn svg {
  width: 16px;
  height: 16px;
  min-width: 16px;
}

.youtube-btn {
  background: rgba(255,0,0,0.12);
  color: #ff4444;
}
.youtube-btn:hover { background: rgba(255,0,0,0.22); color: #ff6666; }

.twitter-btn {
  background: rgba(29,161,242,0.12);
  color: var(--twitter-blue);
}
.twitter-btn:hover { background: rgba(29,161,242,0.22); }

.insta-btn {
  background: rgba(225,48,108,0.12);
  color: var(--insta-pink);
}
.insta-btn:hover { background: rgba(225,48,108,0.22); }

.other-btn {
  background: rgba(212,165,32,0.12);
  color: var(--gold);
}
.other-btn:hover { background: rgba(212,165,32,0.22); }

/* ===== Video Feed ===== */
.video-feed {
  margin-top: 16px;
}

.feed-title {
  font-size: 0.9rem;
  color: var(--text-muted);
  margin-bottom: 10px;
  font-weight: 600;
}

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

.video-card {
  border-radius: var(--radius-md);
  overflow: hidden;
  background: var(--bg-secondary);
  border: 1px solid var(--border);
  transition: border-color var(--dur-1) ease, transform var(--dur-1) ease;
  text-decoration: none;
  color: var(--text);
}

.video-card:hover {
  border-color: var(--gold-dark);
  transform: translateY(-2px);
}

.video-thumb {
  position: relative;
  aspect-ratio: 16/9;
  overflow: hidden;
  background: #000;
}

.video-thumb img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.play-overlay {
  position: absolute;
  inset: 0;
  display: grid;
  place-items: center;
  background: rgba(0,0,0,0.3);
  opacity: 0;
  transition: opacity var(--dur-1) ease;
}

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

.play-overlay svg {
  width: 28px;
  height: 28px;
  color: #fff;
}

.video-info {
  padding: 8px;
}

.video-title {
  font-size: 0.75rem;
  font-weight: 500;
  line-height: 1.4;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.video-meta {
  display: flex;
  gap: 8px;
  margin-top: 4px;
  font-size: 0.65rem;
  color: var(--text-dim);
}

.feed-loading, .feed-error, .feed-empty, .no-videos-note {
  color: var(--text-dim);
  font-size: 0.85rem;
  padding: 8px 0;
}

/* ===== Detail View ===== */
.detail-view {
  max-width: 900px;
  margin: 0 auto;
  padding: 2rem 1.5rem;
}

.back-btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 8px 16px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  color: var(--text-muted);
  font-size: 0.875rem;
  cursor: pointer;
  font-family: var(--font-sans);
  transition: color var(--dur-1) ease, border-color var(--dur-1) ease;
  margin-bottom: 2rem;
}

.back-btn:hover { color: var(--gold); border-color: var(--gold-dark); }
.back-btn svg { width: 16px; height: 16px; }

.detail-header {
  display: flex;
  align-items: center;
  gap: 1.5rem;
  margin-bottom: 2rem;
}

.detail-avatar {
  width: 80px;
  height: 80px;
  min-width: 80px;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--gold-dark), var(--gold));
  display: grid;
  place-items: center;
}

.detail-name {
  font-family: var(--font-serif);
  font-size: 2rem;
  color: var(--gold);
}

.detail-flag { font-size: 1.5rem; }

.detail-meta {
  display: flex;
  align-items: center;
  gap: 12px;
  flex-wrap: wrap;
  margin-top: 4px;
}

.detail-lang {
  color: var(--text-dim);
  font-size: 0.85rem;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.detail-section {
  margin-bottom: 2rem;
}

.detail-section h2 {
  font-family: var(--font-serif);
  font-size: 1.3rem;
  color: var(--gold);
  margin-bottom: 0.75rem;
  padding-bottom: 0.5rem;
  border-bottom: 1px solid var(--border);
}

.detail-section p {
  color: var(--text-muted);
  line-height: 1.7;
}

/* ===== Loading & Empty States ===== */
.loading-state, .empty-state, .not-found {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 4rem 1.5rem;
  color: var(--text-dim);
  text-align: center;
  gap: 1rem;
}

.not-found h1 {
  font-family: var(--font-serif);
  font-size: 4rem;
  color: var(--gold);
}

.spinner {
  width: 36px;
  height: 36px;
  border: 3px solid var(--border);
  border-top-color: var(--gold);
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
}

.spinner.small { width: 20px; height: 20px; border-width: 2px; }

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

/* ===== Footer ===== */
.site-footer {
  max-width: 1200px;
  margin: 0 auto;
  padding: 2rem 1.5rem;
  text-align: center;
  color: var(--text-dim);
  font-size: 0.8rem;
  border-top: 1px solid var(--border);
}

/* ===== Responsive ===== */
@media (max-width: 480px) {
  .creators-grid {
    grid-template-columns: 1fr;
  }
  .hero { padding: 2rem 1rem 1.5rem; }
  .controls { padding: 1rem; }
  .creators-grid { padding: 0 1rem 1.5rem; }
  .video-grid { grid-template-columns: repeat(auto-fill, minmax(130px, 1fr)); }
  .detail-header { flex-direction: column; text-align: center; }
  .detail-name { font-size: 1.5rem; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 0.01ms !important;
    transition-duration: 0.01ms !important;
  }
}
