/* ============================================================
   WatchLane — components.css
   Komponen UI: Button, Badge, Toast, Modal, Spinner, Dropdown
   ============================================================ */
@import 'tokens.css';

/* ── BUTTONS ────────────────────────────────────────────── */
.btn-primary {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 10px 20px;
  background: var(--red);
  color: #fff;
  border-radius: var(--r-sm);
  font-family: 'Space Grotesk', sans-serif;
  font-weight: 500;
  font-size: 14px;
  transition: filter 0.2s ease, box-shadow 0.2s ease;
  white-space: nowrap;
}

.btn-primary:hover {
  filter: brightness(1.15);
  box-shadow: var(--red-shadow);
}

.btn-ghost {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 10px 20px;
  background: transparent;
  color: var(--text-1);
  border: 1px solid var(--border-hi);
  border-radius: var(--r-sm);
  font-family: 'Space Grotesk', sans-serif;
  font-weight: 500;
  font-size: 14px;
  transition: background 0.2s ease, border-color 0.2s ease;
  white-space: nowrap;
}

.btn-ghost:hover {
  background: var(--red-dim);
  border-color: var(--red-border);
}

.btn-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 40px;
  height: 40px;
  border-radius: 50%;
  color: var(--text-1);
  transition: background 0.2s ease;
}

.btn-icon:hover {
  background: var(--surface-2);
}

/* ── BADGES ─────────────────────────────────────────────── */
.badge {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 3px 8px;
  border-radius: var(--r-sm);
  font-family: 'Space Grotesk', sans-serif;
  font-size: 11px;
  font-weight: 500;
  line-height: 1;
  white-space: nowrap;
}

.badge-red {
  background: var(--red-dim);
  color: var(--red);
  border: 1px solid var(--red-border);
}

.badge-green {
  background: rgba(34, 197, 94, 0.1);
  color: var(--green);
  border: 1px solid rgba(34, 197, 94, 0.2);
}

.badge-yellow {
  background: rgba(245, 158, 11, 0.1);
  color: var(--yellow);
  border: 1px solid rgba(245, 158, 11, 0.2);
}

.badge-blue {
  background: rgba(59, 130, 246, 0.1);
  color: var(--blue);
  border: 1px solid rgba(59, 130, 246, 0.2);
}

.badge-grey {
  background: rgba(107, 114, 128, 0.15);
  color: var(--grey);
  border: 1px solid rgba(107, 114, 128, 0.2);
}

/* Status Badges */
.status-ongoing {
  background: rgba(34, 197, 94, 0.1);
  color: var(--green);
  border: 1px solid rgba(34, 197, 94, 0.2);
}

.status-completed {
  background: rgba(107, 114, 128, 0.15);
  color: var(--grey);
  border: 1px solid rgba(107, 114, 128, 0.2);
}

.status-hiatus {
  background: rgba(245, 158, 11, 0.1);
  color: var(--yellow);
  border: 1px solid rgba(245, 158, 11, 0.2);
}

.status-cancelled {
  background: var(--red-dim);
  color: var(--red);
  border: 1px solid var(--red-border);
}

.status-upcoming {
  background: rgba(59, 130, 246, 0.1);
  color: var(--blue);
  border: 1px solid rgba(59, 130, 246, 0.2);
}

/* Type Badges (Anime) */
.badge-sub {
  background: rgba(59, 130, 246, 0.12);
  color: #60A5FA;
  border: 1px solid rgba(59, 130, 246, 0.25);
}

.badge-dub {
  background: rgba(34, 197, 94, 0.1);
  color: #4ADE80;
  border: 1px solid rgba(34, 197, 94, 0.2);
}

.badge-raw {
  background: rgba(107, 114, 128, 0.12);
  color: var(--grey);
  border: 1px solid rgba(107, 114, 128, 0.2);
}

.badge-hd {
  background: rgba(192, 132, 252, 0.12);
  color: #C084FC;
  border: 1px solid rgba(192, 132, 252, 0.25);
}

.badge-4k {
  background: rgba(245, 158, 11, 0.12);
  color: var(--yellow);
  border: 1px solid rgba(245, 158, 11, 0.25);
}

/* ── PILLS (filter) ──────────────────────────────────────── */
.pill {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 6px 14px;
  border: 1px solid var(--border-hi);
  border-radius: 999px;
  background: transparent;
  color: var(--text-2);
  font-family: 'Space Grotesk', sans-serif;
  font-size: 13px;
  cursor: pointer;
  transition: background 0.2s ease, border-color 0.2s ease, color 0.2s ease;
  white-space: nowrap;
}

.pill:hover {
  background: var(--surface-2);
  color: var(--text-1);
}

.pill.active {
  background: var(--red-dim);
  border-color: var(--red-border);
  color: var(--red);
}

/* ── TOAST ───────────────────────────────────────────────── */
.toast-container {
  position: fixed;
  bottom: 24px;
  right: 24px;
  z-index: 9999;
  display: flex;
  flex-direction: column;
  gap: 8px;
  pointer-events: none;
}

.toast {
  background: var(--surface-2);
  border: 1px solid var(--border-hi);
  border-radius: var(--r-md);
  padding: 12px 16px;
  color: var(--text-1);
  font-size: 14px;
  font-weight: 500;
  min-width: 240px;
  max-width: 360px;
  animation: slideUp 0.3s ease;
  pointer-events: all;
  box-shadow: var(--shadow-md);
}

.toast.error {
  border-left: 3px solid var(--red);
}

.toast.success {
  border-left: 3px solid var(--green);
}

.toast.info {
  border-left: 3px solid var(--blue);
}

/* ── MODAL ───────────────────────────────────────────────── */
.modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.85);
  z-index: 1000;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
  animation: fadeIn 0.2s ease;
}

.modal-box {
  background: var(--surface-1);
  border: 1px solid var(--border-hi);
  border-radius: var(--r-lg);
  max-width: 640px;
  width: 100%;
  max-height: 90vh;
  overflow-y: auto;
  animation: scaleIn 0.25s ease;
  box-shadow: var(--shadow-lg);
}

.modal-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 20px 24px 0;
}

.modal-body {
  padding: 20px 24px 24px;
}

/* ── SPINNER ─────────────────────────────────────────────── */
.spinner {
  width: 32px;
  height: 32px;
  border: 3px solid var(--border);
  border-top: 3px solid var(--red);
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
}

.spinner-center {
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 48px;
}

/* ── SKELETON ────────────────────────────────────────────── */
.skeleton-card {
  width: 160px;
  height: 240px;
  border-radius: var(--r-md);
  flex-shrink: 0;
}

.skeleton-hero {
  width: 100%;
  height: 520px;
}

.skeleton-text {
  height: 14px;
  border-radius: 4px;
}

.skeleton-text-sm {
  height: 11px;
  width: 60%;
  border-radius: 4px;
}

/* ── DIVIDER ─────────────────────────────────────────────── */
.divider {
  height: 1px;
  background: var(--border);
  margin: 16px 0;
}

/* ── DROPDOWN ────────────────────────────────────────────── */
.dropdown {
  position: relative;
}

.dropdown-menu {
  position: absolute;
  top: calc(100% + 8px);
  left: 0;
  background: var(--surface-1);
  border: 1px solid var(--border-hi);
  border-radius: var(--r-md);
  min-width: 180px;
  z-index: 200;
  animation: slideDown 0.2s ease;
  box-shadow: var(--shadow-md);
  overflow: hidden;
}

.dropdown-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 14px;
  color: var(--text-2);
  font-size: 14px;
  cursor: pointer;
  transition: background 0.15s ease, color 0.15s ease;
}

.dropdown-item:hover {
  background: var(--surface-2);
  color: var(--text-1);
}

.dropdown-item.active {
  color: var(--red);
  background: var(--red-dim);
}

/* ── EMPTY & ERROR STATE ─────────────────────────────────── */
.empty-state,
.error-state {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 12px;
  padding: 64px 24px;
  text-align: center;
  color: var(--text-3);
}

.empty-state__icon,
.error-state__icon {
  font-size: 48px;
  opacity: 0.5;
}

.empty-state__title,
.error-state__title {
  font-size: 16px;
  color: var(--text-2);
  font-weight: 500;
}

.empty-state__subtitle,
.error-state__subtitle {
  font-size: 13px;
}

/* ── CONTENT ROW (Carousel Section) ──────────────────────── */
.content-row {
  margin-bottom: 40px;
}

.content-row__header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 16px;
  padding: 0 16px;
}

.content-row__title {
  font-family: 'Barlow Condensed', sans-serif;
  font-size: 22px;
  font-weight: 700;
  color: var(--text-1);
  letter-spacing: 0.3px;
}

.content-row__view-all {
  font-family: 'Space Grotesk', sans-serif;
  font-size: 13px;
  color: var(--text-3);
  transition: color 0.2s;
}

.content-row__view-all:hover {
  color: var(--red);
}

.content-row__wrap {
  position: relative;
}

.content-row__track {
  display: flex;
  gap: 12px;
  overflow-x: auto;
  scroll-behavior: smooth;
  padding: 4px 16px 12px;
  scrollbar-width: none;
}

.content-row__track::-webkit-scrollbar {
  display: none;
}

.content-row__btn {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  z-index: 10;
  width: 40px;
  height: 60px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(8, 9, 14, 0.85);
  border: 1px solid var(--border-hi);
  color: var(--text-1);
  font-size: 18px;
  cursor: pointer;
  transition: background 0.2s, border-color 0.2s;
  border-radius: var(--r-sm);
}

.content-row__btn:hover {
  background: var(--surface-2);
  border-color: var(--red-border);
}

.content-row__btn--prev {
  left: 0;
  border-radius: 0 var(--r-sm) var(--r-sm) 0;
}

.content-row__btn--next {
  right: 0;
  border-radius: var(--r-sm) 0 0 var(--r-sm);
}

/* ── RANK OVERLAY (Top 10) ───────────────────────────────── */
.rank-number {
  position: absolute;
  bottom: -8px;
  left: -8px;
  font-family: 'Barlow Condensed', sans-serif;
  font-size: 72px;
  font-weight: 700;
  line-height: 1;
  color: transparent;
  -webkit-text-stroke: 2px rgba(255, 255, 255, 0.15);
  text-shadow: none;
  pointer-events: none;
  user-select: none;
  z-index: 5;
}

/* ── RESPONSIVE ──────────────────────────────────────────── */
@media (max-width: 768px) {
  .toast-container {
    bottom: 16px;
    right: 16px;
    left: 16px;
  }

  .toast {
    min-width: unset;
    max-width: 100%;
  }

  .skeleton-hero {
    height: 320px;
  }

  .skeleton-card {
    width: 120px;
    height: 180px;
  }

  .content-row__title {
    font-size: 18px;
  }

  .content-row__btn {
    display: none;
  }
}

/* ============================================================
   FOOTER — ditambahkan Step 3
   ============================================================ */

/* ── SITE FOOTER ─────────────────────────────────────────── */
.site-footer {
  background: var(--surface-1);
  border-top: 1px solid var(--border);
  margin-top: 64px;
}

.footer-inner {
  max-width: 1400px;
  margin: 0 auto;
  padding: 48px 20px 32px;
  display: flex;
  gap: 48px;
}

/* Brand kolom kiri */
.footer-brand {
  flex-shrink: 0;
  width: 220px;
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.footer-brand img {
  height: 24px;
  width: auto;
}

.footer-brand p {
  font-size: 13px;
  color: var(--text-2);
  line-height: 1.6;
}

.footer-disclaimer {
  font-size: 11px !important;
  color: var(--text-3) !important;
  line-height: 1.6 !important;
  margin-top: 8px;
  padding-top: 12px;
  border-top: 1px solid var(--border);
}

/* Grid link kolom */
.footer-links {
  flex: 1;
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  gap: 32px;
}

.footer-col h4 {
  font-size: 11px;
  font-family: 'Space Grotesk', sans-serif;
  font-weight: 500;
  text-transform: uppercase;
  letter-spacing: 1px;
  color: var(--text-3);
  margin-bottom: 12px;
  margin-top: 20px;
  padding-bottom: 6px;
  border-bottom: 1px solid var(--border);
}

.footer-col h4:first-child {
  margin-top: 0;
}

.footer-col a {
  display: block;
  font-size: 13px;
  color: var(--text-2);
  text-decoration: none;
  padding: 4px 0;
  transition: color 0.15s;
  line-height: 1.5;
}

.footer-col a:hover {
  color: var(--red);
}

/* Footer bottom bar */
.footer-bottom {
  max-width: 1400px;
  margin: 0 auto;
  padding: 16px 20px;
  border-top: 1px solid var(--border);
  display: flex;
  align-items: center;
  gap: 20px;
  flex-wrap: wrap;
  font-size: 12px;
  color: var(--text-3);
}

.footer-bottom a {
  color: var(--text-3);
  text-decoration: none;
  transition: color 0.15s;
}

.footer-bottom a:hover {
  color: var(--text-2);
}

.footer-note {
  margin-left: auto;
  font-size: 11px;
  font-style: italic;
}

/* ── 404 PAGE ─────────────────────────────────────────────── */
.page-404 {
  min-height: calc(100vh - var(--nav-h) - 200px);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: calc(var(--nav-h) + 60px) 20px 60px;
  text-align: center;
}

.error-code {
  font-family: 'Barlow Condensed', sans-serif;
  font-size: 140px;
  font-weight: 700;
  line-height: 1;
  color: var(--red);
  text-shadow: var(--red-shadow-lg);
  animation: glowPulse 3s ease-in-out infinite;
  margin-bottom: 8px;
}

.error-title {
  font-family: 'Barlow Condensed', sans-serif;
  font-size: 28px;
  font-weight: 600;
  color: var(--text-1);
  margin-bottom: 12px;
}

.error-desc {
  font-size: 15px;
  color: var(--text-2);
  max-width: 420px;
  line-height: 1.6;
  margin-bottom: 32px;
}

.error-actions {
  display: flex;
  gap: 12px;
  justify-content: center;
  flex-wrap: wrap;
}

/* Section "Mungkin Kamu Suka" di 404 */
.suggestions-section {
  width: 100%;
  max-width: 1200px;
  margin: 64px auto 0;
  padding: 0 20px;
  text-align: left;
}

.suggestions-title {
  font-size: 20px;
  font-weight: 600;
  margin-bottom: 20px;
  color: var(--text-1);
}

.suggestions-grid {
  display: grid;
  grid-template-columns: repeat(6, 1fr);
  gap: 16px;
}

/* ── RESPONSIVE FOOTER ───────────────────────────────────── */
@media (max-width: 1024px) {
  .footer-inner {
    flex-direction: column;
    gap: 32px;
  }

  .footer-brand {
    width: 100%;
    flex-direction: row;
    align-items: flex-start;
    gap: 24px;
  }

  .footer-links {
    grid-template-columns: repeat(3, 1fr);
  }
}

@media (max-width: 768px) {
  .footer-links {
    grid-template-columns: repeat(2, 1fr);
    gap: 20px;
  }

  .footer-note {
    margin-left: 0;
    width: 100%;
  }

  .error-code {
    font-size: 100px;
  }

  .suggestions-grid {
    grid-template-columns: repeat(3, 1fr);
  }
}

@media (max-width: 480px) {
  .footer-inner {
    padding: 32px 16px 24px;
  }

  .footer-brand {
    flex-direction: column;
  }

  .footer-links {
    grid-template-columns: repeat(2, 1fr);
    gap: 16px;
  }

  .error-code {
    font-size: 80px;
  }

  .suggestions-grid {
    grid-template-columns: repeat(2, 1fr);
  }
}
