/* ============================================================
   07-components.css — Kurvin UI Components
   Sharp corners. Street art palette. No softness.
   ============================================================ */

/* ── Buttons ─────────────────────────────────────────────────
   Sharp rectangles. Uppercase. Aggressive.
   ──────────────────────────────────────────────────────────── */

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: var(--space-2);
  height: 38px;
  padding: 0 var(--space-5);
  font-family: var(--font-sans);
  font-size: var(--font-size-sm);
  font-weight: var(--font-weight-bold);
  letter-spacing: 0.06em;
  text-transform: uppercase;
  cursor: pointer;
  white-space: nowrap;
  border-radius: var(--radius-xs);
  border: 1px solid transparent;
  transition:
    background var(--dur-fast) ease,
    color var(--dur-fast) ease,
    border-color var(--dur-fast) ease,
    transform var(--dur-fast) ease,
    box-shadow var(--dur-fast) ease;
  position: relative;
  overflow: hidden;
}

.btn:active {
  transform: translateY(2px);
  box-shadow: none;
}

.btn.w-full { width: 100%; }

/* Primary: spray pink fill */
.btn-primary {
  background: var(--color-accent);
  color: var(--color-text-inverse);
  border-color: var(--color-accent);
}

.btn-primary:hover {
  background: var(--color-accent-hover);
  border-color: var(--color-accent-hover);
  box-shadow: var(--shadow-accent);
}

/* Secondary: outlined pink */
.btn-secondary {
  background: transparent;
  color: var(--color-accent);
  border-color: var(--color-accent);
}

.btn-secondary:hover {
  background: var(--accent-tint-sm);
  box-shadow: var(--shadow-accent);
}

/* Ghost */
.btn-ghost {
  background: transparent;
  color: var(--color-text-muted);
  border-color: transparent;
}

.btn-ghost:hover {
  background: var(--color-bg-surface);
  color: var(--color-text);
  border-color: var(--color-border);
}

/* Danger */
.btn-danger {
  background: rgba(255, 68, 68, 0.1);
  color: var(--color-error);
  border-color: var(--color-error);
}
.btn-danger:hover { background: rgba(255, 68, 68, 0.2); }

/* Size variants */
.btn-sm { height: 30px; padding: 0 var(--space-3); font-size: var(--font-size-xs); }
.btn-lg { height: 46px; padding: 0 var(--space-8); font-size: var(--font-size-md); }
.btn-xl { height: 54px; padding: 0 var(--space-10); font-size: var(--font-size-lg); }

/* Icon only */
.btn-icon {
  width: 38px;
  height: 38px;
  padding: 0;
  flex-shrink: 0;
}

.btn-icon.btn-sm { width: 30px; height: 30px; }

/* Spray drip effect (from 05-animations.css) */
.btn-primary.btn-drip::after,
.btn-secondary.btn-drip::after {
  background: rgba(255, 255, 255, 0.1);
}

/* ── Cards ───────────────────────────────────────────────────
   Sharp. No border-radius (or 2px max). Hover: accent border.
   ──────────────────────────────────────────────────────────── */

.card {
  display: flex;
  flex-direction: column;
  background: var(--color-bg-surface);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-xs);
  overflow: hidden;
  cursor: pointer;
  transition:
    border-color var(--dur-fast) ease,
    box-shadow var(--dur-fast) ease,
    transform var(--dur-fast) ease;
  contain: layout style paint;
  position: relative;
}

.card:hover {
  border-color: var(--color-accent);
  box-shadow: var(--shadow-accent);
}

.card-thumb {
  aspect-ratio: 2 / 3; /* poster portrait by default */
  overflow: hidden;
  background: var(--color-bg-surface-2);
  flex-shrink: 0;
  position: relative;
}

.card-thumb-wide {
  aspect-ratio: 16 / 9;
}

.card-thumb img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform var(--dur-slow) ease;
}

.card:hover .card-thumb img {
  transform: scale(1.05);
}

/* Skeleton placeholder when image not loaded */
.card-thumb.loading { background: var(--color-bg-surface-2); }
.card-thumb.loading::after {
  content: '';
  position: absolute;
  inset: 0;
  background: linear-gradient(
    90deg,
    var(--color-bg-surface-2) 25%,
    var(--color-bg-surface)   50%,
    var(--color-bg-surface-2) 75%
  );
  background-size: 200% auto;
  animation: shimmer 1.6s linear infinite;
}

.card-body {
  padding: var(--space-3);
  display: flex;
  flex-direction: column;
  gap: var(--space-1);
  flex: 1;
}

.card-title {
  font-size: var(--font-size-sm);
  font-weight: var(--font-weight-semi);
  color: var(--color-text);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  line-height: 1.3;
}

.card-meta {
  font-size: var(--font-size-xs);
  color: var(--color-text-muted);
  font-family: var(--font-mono);
  display: flex;
  align-items: center;
  gap: var(--space-2);
  flex-wrap: wrap;
}

.card-meta-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-top: auto;
  padding-top: var(--space-1);
}

/* Featured card (16:9 wide) */
.card-featured {
  grid-column: span 2;
}

.card-featured .card-thumb {
  aspect-ratio: 16 / 9;
}

/* ── Hero ────────────────────────────────────────────────────
   Full-width featured item at top of home/media pages.
   21:9 aspect ratio. Sharp corners.
   ──────────────────────────────────────────────────────────── */

.hero-card {
  position: relative;
  aspect-ratio: 21 / 9;
  overflow: hidden;
  background: var(--color-bg-surface-2);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-xs);
  cursor: pointer;
  transition: border-color var(--dur-fast) ease;
}

.hero-card:hover { border-color: var(--color-accent); }

.hero-card-bg {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform var(--dur-slower) ease;
}

.hero-card:hover .hero-card-bg {
  transform: scale(1.03);
}

.hero-card-overlay {
  position: absolute;
  inset: 0;
  background: linear-gradient(
    to right,
    rgba(0, 0, 0, 0.92) 0%,
    rgba(0, 0, 0, 0.6)  40%,
    rgba(0, 0, 0, 0.1)  100%
  );
}

/* Bottom gradient */
.hero-card-overlay::after {
  content: '';
  position: absolute;
  inset: 0;
  background: linear-gradient(
    to top,
    rgba(17, 17, 17, 0.9) 0%,
    transparent 40%
  );
}

.hero-card-content {
  position: absolute;
  bottom: 0;
  left: 0;
  padding: var(--space-6) var(--space-8);
  z-index: 2;
  max-width: 55%;
}

.hero-badge {
  display: inline-flex;
  align-items: center;
  padding: 3px 10px;
  background: var(--color-accent);
  color: var(--color-text-inverse);
  font-family: var(--font-display);
  font-size: var(--font-size-sm);
  letter-spacing: 0.1em;
  text-transform: uppercase;
  margin-bottom: var(--space-2);
  border-radius: var(--radius-xs);
}

.hero-title {
  font-family: var(--font-display);
  font-size: clamp(var(--font-size-2xl), 4vw, var(--font-size-4xl));
  letter-spacing: 0.06em;
  text-transform: uppercase;
  line-height: 1;
  color: var(--color-text);
  margin-bottom: var(--space-2);
  text-shadow: 0 2px 8px rgba(0,0,0,0.8);
}

.hero-meta {
  display: flex;
  align-items: center;
  gap: var(--space-3);
  margin-bottom: var(--space-4);
  font-size: var(--font-size-sm);
  color: var(--color-text-muted);
  font-family: var(--font-mono);
  flex-wrap: wrap;
}

.hero-description {
  font-size: var(--font-size-sm);
  color: rgba(245, 245, 245, 0.7);
  line-height: var(--line-height-relaxed);
  max-width: 44ch;
  margin-bottom: var(--space-5);
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.hero-actions {
  display: flex;
  gap: var(--space-3);
}

/* Hero rotator dots */
.hero-dots {
  position: absolute;
  bottom: var(--space-4);
  right: var(--space-6);
  display: flex;
  gap: var(--space-2);
  z-index: 2;
}

.hero-dot {
  width: 24px;
  height: 3px;
  background: rgba(255,255,255,0.3);
  cursor: pointer;
  transition: background var(--dur-fast) ease;
  border-radius: var(--radius-xs);
}

.hero-dot.active { background: var(--color-accent); width: 32px; }

/* ── Section header row ──────────────────────────────────────
   Section title + optional "see all" link.
   ──────────────────────────────────────────────────────────── */

.section-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--space-4);
  margin-bottom: var(--space-4);
}

.section-header .section-title {
  display: flex;
  align-items: center;
  gap: var(--space-3);
}

.section-header .see-all {
  font-family: var(--font-mono);
  font-size: var(--font-size-xs);
  color: var(--color-accent);
  letter-spacing: 0.06em;
  text-transform: uppercase;
  cursor: pointer;
  transition: color var(--dur-fast) ease;
  white-space: nowrap;
}

.section-header .see-all:hover { color: var(--color-accent-hover); }

/* ── Category pills ──────────────────────────────────────────
   Sharp rectangles. Bebas Neue. Active = pink fill.
   ──────────────────────────────────────────────────────────── */

.pill {
  display: inline-flex;
  align-items: center;
  height: 30px;
  padding: 0 var(--space-3);
  background: var(--color-bg-surface);
  border: 1px solid var(--color-border);
  font-family: var(--font-display);
  font-size: var(--font-size-sm);
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--color-text-muted);
  cursor: pointer;
  transition: all var(--dur-fast) ease;
  white-space: nowrap;
  border-radius: var(--radius-xs);
  flex-shrink: 0;
}

.pill:hover {
  border-color: var(--color-accent);
  color: var(--color-accent);
}

.pill.active {
  background: var(--color-accent);
  border-color: var(--color-accent);
  color: var(--color-text-inverse);
}

/* ── Tabs ────────────────────────────────────────────────────
   Used on media page: Movies | TV Shows | Anime
   ──────────────────────────────────────────────────────────── */

.tabs {
  display: flex;
  border-bottom: 1px solid var(--color-border);
  margin-bottom: var(--space-5);
}

.tab {
  display: flex;
  align-items: center;
  height: 40px;
  padding: 0 var(--space-5);
  font-family: var(--font-display);
  font-size: var(--font-size-md);
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--color-text-muted);
  cursor: pointer;
  border-bottom: 2px solid transparent;
  margin-bottom: -1px;
  transition: color var(--dur-fast) ease, border-color var(--dur-fast) ease;
}

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

.tab.active {
  color: var(--color-accent);
  border-bottom-color: var(--color-accent);
}

/* ── Search input (standalone) ───────────────────────────────
   ──────────────────────────────────────────────────────────── */

.search-field {
  position: relative;
  width: 100%;
}

.search-field-icon {
  position: absolute;
  left: 12px;
  top: 50%;
  transform: translateY(-50%);
  width: 16px;
  height: 16px;
  color: var(--color-text-faint);
  pointer-events: none;
}

.search-field input {
  width: 100%;
  height: 42px;
  background: var(--color-bg-surface);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-xs);
  color: var(--color-text);
  font-size: var(--font-size-base);
  padding: 0 var(--space-4) 0 40px;
  outline: none;
  transition: border-color var(--dur-fast) ease;
}

.search-field input::placeholder { color: var(--color-text-faint); }
.search-field input:focus { border-color: var(--color-accent); }

/* ── Settings panel components ───────────────────────────────
   ──────────────────────────────────────────────────────────── */

.settings-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 var(--space-5);
  height: var(--top-bar-height);
  border-bottom: 1px solid var(--color-border);
  flex-shrink: 0;
}

.settings-title {
  font-family: var(--font-display);
  font-size: var(--font-size-xl);
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.settings-body {
  flex: 1;
  overflow-y: auto;
  padding: var(--space-4);
  display: flex;
  flex-direction: column;
  gap: var(--space-5);
}

.settings-section-label {
  font-family: var(--font-mono);
  font-size: var(--font-size-xs);
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--color-text-faint);
  margin-bottom: var(--space-2);
}

.settings-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--space-4);
  padding: var(--space-3) var(--space-3);
  background: var(--color-bg-surface);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-xs);
  font-size: var(--font-size-sm);
  transition: border-color var(--dur-fast) ease;
}

.settings-row:hover { border-color: var(--color-border-hover); }

.settings-footer {
  padding: var(--space-4);
  border-top: 1px solid var(--color-border);
  display: flex;
  gap: var(--space-3);
  flex-shrink: 0;
}

/* Toggle switch */
.toggle {
  position: relative;
  display: inline-block;
  width: 36px;
  height: 20px;
  flex-shrink: 0;
}

.toggle input { opacity: 0; width: 0; height: 0; }

.toggle-track {
  position: absolute;
  inset: 0;
  background: var(--color-border);
  cursor: pointer;
  transition: background var(--dur-fast) ease;
  border-radius: var(--radius-xs);
}

.toggle input:checked + .toggle-track { background: var(--color-accent); }

.toggle-track::after {
  content: '';
  position: absolute;
  top: 3px;
  left: 3px;
  width: 14px;
  height: 14px;
  background: white;
  transition: transform var(--dur-fast) ease;
  border-radius: 1px;
}

.toggle input:checked + .toggle-track::after {
  transform: translateX(16px);
}

/* Spinner */
.spinner {
  width: 24px;
  height: 24px;
  border: 2px solid var(--color-border);
  border-top-color: var(--color-accent);
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
}

/* Empty state */
.empty-state {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: var(--space-4);
  padding: var(--space-12);
  text-align: center;
  color: var(--color-text-faint);
  min-height: 240px;
  border: 1px dashed var(--color-border);
  border-radius: var(--radius-xs);
}

.empty-state h3 {
  font-family: var(--font-display);
  font-size: var(--font-size-2xl);
  letter-spacing: 0.1em;
  color: var(--color-text-muted);
}

/* Error state */
.error-state {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: var(--space-3);
  padding: var(--space-8);
  border: 1px solid var(--color-error);
  background: rgba(255,68,68,0.05);
  border-radius: var(--radius-xs);
  text-align: center;
}

.error-state p {
  color: var(--color-error);
  font-size: var(--font-size-sm);
  max-width: 40ch;
  margin: 0 auto;
}

/* Detail panel components */
.detail-backdrop {
  width: 100%;
  aspect-ratio: 16 / 9;
  object-fit: cover;
  flex-shrink: 0;
}

.detail-poster-row {
  display: flex;
  gap: var(--space-5);
  padding: var(--space-5);
}

.detail-poster {
  width: 120px;
  flex-shrink: 0;
  border: 1px solid var(--color-border);
  border-radius: var(--radius-xs);
  overflow: hidden;
  margin-top: calc(-1 * var(--space-10));
}

.detail-poster img {
  width: 100%;
  height: auto;
  display: block;
}

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

.detail-title {
  font-family: var(--font-display);
  font-size: var(--font-size-2xl);
  letter-spacing: 0.06em;
  text-transform: uppercase;
  line-height: 1;
  color: var(--color-text);
  margin-bottom: var(--space-2);
}

.detail-rating {
  font-family: var(--font-mono);
  font-size: var(--font-size-sm);
  color: var(--color-accent-gold);
  display: flex;
  align-items: center;
  gap: var(--space-1);
  margin-bottom: var(--space-3);
}

.detail-overview {
  font-size: var(--font-size-sm);
  color: var(--color-text-muted);
  line-height: var(--line-height-relaxed);
  padding: 0 var(--space-5) var(--space-5);
}

/* Quick access chips (proxy recent) */
.chip {
  display: inline-flex;
  align-items: center;
  height: 28px;
  padding: 0 var(--space-3);
  background: var(--color-bg-surface);
  border: 1px solid var(--color-border);
  font-size: var(--font-size-xs);
  font-family: var(--font-mono);
  color: var(--color-text-muted);
  cursor: pointer;
  border-radius: var(--radius-xs);
  transition: border-color var(--dur-fast) ease, color var(--dur-fast) ease;
  white-space: nowrap;
  overflow: hidden;
  max-width: 180px;
  text-overflow: ellipsis;
}

.chip:hover { border-color: var(--color-accent); color: var(--color-accent); }
