/* Crunchyroll clone — MOCK DEMO. Classic dark app theme. */
@import url('https://fonts.googleapis.com/css2?family=Lato:wght@400;700;900&display=swap');

:root {
  --orange: #F47521;
  --orange-hover: #FF8C3A;
  --bg: #000000;
  --panel: #141519;
  --card: #23252B;
  --elevated: #2D2F36;
  --hairline: #33353B;
  --text: #FFFFFF;
  --text-2: #A0A0A0;
  --text-3: #6B6B6B;
  --green: #2BB673;
  --nav-h: 60px;
}

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

html { scroll-behavior: smooth; }

body {
  background: var(--bg);
  color: var(--text);
  font-family: 'Lato', 'Helvetica Neue', Helvetica, Arial, sans-serif;
  font-weight: 400;
  line-height: 1.4;
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
}

a { color: inherit; text-decoration: none; }
img { display: block; max-width: 100%; }
button { font-family: inherit; cursor: pointer; border: none; background: none; color: inherit; }

/* ---------- Buttons ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  font-weight: 700; text-transform: uppercase; letter-spacing: 0.5px;
  border-radius: 4px; padding: 11px 20px; font-size: 14px;
  transition: background .15s, transform .1s, border-color .15s;
  white-space: nowrap;
}
.btn-primary { background: var(--orange); color: #0A0A0A; }
.btn-primary:hover { background: var(--orange-hover); }
.btn-outline { background: transparent; color: #fff; border: 2px solid rgba(255,255,255,.5); }
.btn-outline:hover { border-color: #fff; background: rgba(255,255,255,.08); }
.btn:active { transform: scale(.97); }

/* ---------- Nav ---------- */
.nav {
  position: sticky; top: 0; z-index: 100; height: var(--nav-h);
  background: var(--panel); border-bottom: 1px solid var(--hairline);
  display: flex; align-items: center; gap: 20px; padding: 0 24px;
}
.nav-hamburger { display: none; font-size: 22px; }
.logo { display: flex; align-items: center; gap: 8px; font-weight: 900; font-size: 22px; color: var(--orange); letter-spacing: -0.5px; }
.logo-eye { width: 22px; height: 22px; border-radius: 50%; border: 3px solid var(--orange); position: relative; }
.logo-eye::after { content: ''; position: absolute; width: 6px; height: 6px; background: var(--orange); border-radius: 50%; top: 50%; left: 50%; transform: translate(-50%,-50%); }

.nav-links { display: flex; align-items: center; gap: 22px; }
.nav-link { font-size: 14px; font-weight: 700; color: #fff; position: relative; padding: 6px 0; }
.nav-link:hover, .nav-link.active { color: var(--orange); }

.nav-dropdown { position: relative; }
.nav-dropdown-toggle { display: flex; align-items: center; gap: 4px; }
.nav-dropdown-toggle .chev { font-size: 10px; }
.mega-menu {
  position: absolute; top: calc(100% + 8px); left: 0; background: var(--panel);
  border: 1px solid var(--hairline); border-radius: 6px; padding: 16px;
  display: none; grid-template-columns: repeat(2, minmax(140px,1fr)); gap: 6px 24px;
  box-shadow: 0 12px 30px rgba(0,0,0,.6); min-width: 320px;
}
.nav-dropdown.open .mega-menu { display: grid; }
.mega-menu a { font-size: 13px; color: var(--text-2); padding: 6px 8px; border-radius: 4px; }
.mega-menu a:hover { color: #fff; background: var(--elevated); }

.nav-spacer { flex: 1; }
.nav-actions { display: flex; align-items: center; gap: 16px; }
.icon-btn { display: flex; align-items: center; justify-content: center; width: 36px; height: 36px; border-radius: 50%; color: #fff; }
.icon-btn:hover { background: var(--elevated); }
.icon-btn svg { width: 20px; height: 20px; }

.avatar-menu { position: relative; }
.avatar-btn { width: 36px; height: 36px; border-radius: 50%; overflow: hidden; border: 2px solid transparent; }
.avatar-btn:hover { border-color: var(--orange); }
.avatar-btn img { width: 100%; height: 100%; object-fit: cover; }
.avatar-btn .avatar-placeholder { width: 100%; height: 100%; background: var(--elevated); display: flex; align-items: center; justify-content: center; }
.avatar-dropdown {
  position: absolute; top: calc(100% + 10px); right: 0; background: var(--panel);
  border: 1px solid var(--hairline); border-radius: 8px; min-width: 200px; padding: 8px;
  display: none; box-shadow: 0 12px 30px rgba(0,0,0,.6);
}
.avatar-menu.open .avatar-dropdown { display: block; }
.avatar-dropdown .user-row { display: flex; align-items: center; gap: 10px; padding: 8px 10px; border-bottom: 1px solid var(--hairline); margin-bottom: 6px; }
.avatar-dropdown .user-row img { width: 32px; height: 32px; border-radius: 50%; }
.avatar-dropdown .user-row .uname { font-weight: 700; font-size: 14px; }
.avatar-dropdown a, .avatar-dropdown button { display: block; width: 100%; text-align: left; padding: 9px 10px; font-size: 14px; color: var(--text-2); border-radius: 4px; }
.avatar-dropdown a:hover, .avatar-dropdown button:hover { color: #fff; background: var(--elevated); }

/* ---------- Search overlay ---------- */
.search-overlay {
  position: fixed; inset: 0; z-index: 200; background: rgba(0,0,0,.92);
  display: none; flex-direction: column; align-items: center; padding-top: 80px;
}
.search-overlay.open { display: flex; }
.search-box { width: min(680px, 90vw); display: flex; align-items: center; gap: 12px; background: var(--card); border: 1px solid var(--hairline); border-radius: 8px; padding: 6px 16px; }
.search-box input { flex: 1; background: none; border: none; color: #fff; font-size: 20px; padding: 14px 0; outline: none; font-family: inherit; }
.search-box .close-search { font-size: 24px; color: var(--text-2); }
.search-results { width: min(680px, 90vw); margin-top: 20px; display: grid; grid-template-columns: repeat(auto-fill, minmax(120px,1fr)); gap: 14px; max-height: 65vh; overflow-y: auto; padding-bottom: 40px; }
.search-results .sr-card img { width: 100%; aspect-ratio: 3/4; object-fit: cover; border-radius: 4px; }
.search-results .sr-card .t { font-size: 13px; font-weight: 700; margin-top: 6px; }
.search-empty { color: var(--text-2); margin-top: 30px; }

/* ---------- Hero carousel ---------- */
.hero { position: relative; height: 68vh; min-height: 420px; overflow: hidden; }
.hero-slide { position: absolute; inset: 0; opacity: 0; transition: opacity .8s ease; }
.hero-slide.active { opacity: 1; }
.hero-slide img { width: 100%; height: 100%; object-fit: cover; object-position: center 20%; }
.hero-slide .hero-grad { position: absolute; inset: 0; background: linear-gradient(90deg, rgba(0,0,0,.95) 0%, rgba(0,0,0,.7) 35%, rgba(0,0,0,.1) 70%, rgba(0,0,0,.4) 100%); }
.hero-content { position: absolute; left: 0; bottom: 0; top: 0; display: flex; flex-direction: column; justify-content: center; max-width: 620px; padding: 0 56px; z-index: 2; }
.hero-title { font-size: clamp(32px, 5vw, 56px); font-weight: 900; line-height: 1.05; margin-bottom: 16px; }
.hero-desc { font-size: 16px; color: #e5e5e5; margin-bottom: 24px; display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; overflow: hidden; }
.hero-btns { display: flex; gap: 14px; flex-wrap: wrap; }
.hero-arrows { position: absolute; z-index: 3; top: 50%; transform: translateY(-50%); width: 100%; display: flex; justify-content: space-between; padding: 0 16px; pointer-events: none; }
.hero-arrows button { pointer-events: auto; width: 44px; height: 44px; border-radius: 50%; background: rgba(20,21,25,.6); color: #fff; font-size: 22px; display: flex; align-items: center; justify-content: center; }
.hero-arrows button:hover { background: var(--orange); }
.hero-dots { position: absolute; z-index: 3; bottom: 20px; left: 50%; transform: translateX(-50%); display: flex; gap: 10px; }
.hero-dots button { width: 10px; height: 10px; border-radius: 50%; background: rgba(255,255,255,.4); }
.hero-dots button.active { background: var(--orange); width: 26px; border-radius: 6px; }

/* ---------- Rows / carousels ---------- */
main { padding-bottom: 40px; }
.row { position: relative; margin: 34px 0; padding: 0 56px; }
.row-header { font-size: 22px; font-weight: 700; margin-bottom: 14px; }
.row-track { display: flex; gap: 12px; overflow-x: auto; scroll-snap-type: x mandatory; scroll-behavior: smooth; padding-bottom: 8px; scrollbar-width: none; }
.row-track::-webkit-scrollbar { display: none; }
.row-arrow { position: absolute; top: 50%; z-index: 5; width: 44px; height: 44px; border-radius: 50%; background: var(--card); border: 1px solid var(--hairline); color: #fff; font-size: 20px; display: flex; align-items: center; justify-content: center; opacity: 0; transition: opacity .2s; }
.row:hover .row-arrow { opacity: 1; }
.row-arrow.left { left: 12px; } .row-arrow.right { right: 12px; }
.row-arrow:hover { background: var(--orange); }

/* ---------- Card ---------- */
.card { flex: 0 0 auto; width: 170px; scroll-snap-align: start; position: relative; transition: transform .2s; cursor: pointer; }
.card:hover { transform: scale(1.05); z-index: 6; }
.card-poster { width: 100%; aspect-ratio: 3/4; border-radius: 4px; overflow: hidden; background: var(--card); position: relative; }
.card-poster img { width: 100%; height: 100%; object-fit: cover; }
.card-title { font-size: 14px; font-weight: 700; margin-top: 8px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.card-sub { font-size: 12px; color: var(--text-2); margin-top: 2px; }
.card-overlay { position: absolute; inset: 0; background: linear-gradient(to top, rgba(20,21,25,.96) 0%, rgba(20,21,25,.55) 55%, rgba(20,21,25,0) 100%); opacity: 0; transition: opacity .2s; display: flex; flex-direction: column; justify-content: flex-end; padding: 12px; }
.card:hover .card-overlay { opacity: 1; }
.card-overlay .play { position: absolute; top: 50%; left: 50%; transform: translate(-50%,-50%); width: 48px; height: 48px; border-radius: 50%; background: var(--orange); display: flex; align-items: center; justify-content: center; }
.card-overlay .play svg { width: 20px; height: 20px; fill: #fff; }
.card-overlay .ov-title { font-size: 13px; font-weight: 700; }
.card-overlay .ov-meta { font-size: 11px; color: var(--text-2); margin-top: 4px; }
.card-overlay .ov-star { color: var(--orange); font-weight: 700; }

/* ---------- Premium upsell banner ---------- */
.upsell { margin: 44px 56px; border-radius: 12px; overflow: hidden; position: relative; min-height: 240px; display: flex; align-items: center; }
.upsell img.bg { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }
.upsell .upsell-grad { position: absolute; inset: 0; background: linear-gradient(90deg, rgba(0,0,0,.9), rgba(0,0,0,.4)); }
.upsell .upsell-content { position: relative; z-index: 2; padding: 40px 48px; max-width: 560px; }
.upsell h2 { font-size: 30px; font-weight: 900; margin-bottom: 10px; }
.upsell p { color: #e0e0e0; margin-bottom: 20px; }

/* ---------- Footer ---------- */
.footer { border-top: 1px solid var(--hairline); padding: 44px 56px 24px; background: #000; }
.footer-cols { display: grid; grid-template-columns: repeat(4, 1fr); gap: 30px; margin-bottom: 30px; }
.footer-col h4 { font-size: 13px; text-transform: uppercase; letter-spacing: .5px; margin-bottom: 14px; color: #fff; }
.footer-col a { display: block; font-size: 14px; color: var(--text-2); padding: 5px 0; }
.footer-col a:hover { color: #fff; }
.footer-social { display: flex; gap: 12px; }
.footer-social a { width: 34px; height: 34px; border-radius: 50%; background: var(--card); display: flex; align-items: center; justify-content: center; padding: 0; }
.footer-social a:hover { background: var(--orange); }
.footer-social svg { width: 16px; height: 16px; fill: #fff; }
.footer-bottom { border-top: 1px solid var(--hairline); padding-top: 20px; display: flex; align-items: center; gap: 20px; flex-wrap: wrap; }
.footer-bottom .cr { color: var(--text-3); font-size: 12px; }
.footer-bottom .legal { display: flex; gap: 16px; margin-left: auto; flex-wrap: wrap; }
.footer-bottom .legal a { color: var(--text-3); font-size: 12px; }
.footer-bottom .legal a:hover { color: var(--text-2); }
.footer-badges { display: flex; gap: 10px; margin: 16px 0; }
.footer-badges .badge { border: 1px solid var(--hairline); border-radius: 6px; padding: 8px 14px; font-size: 12px; color: var(--text-2); display: flex; gap: 8px; align-items: center; }
.mock-note { color: var(--orange); font-size: 12px; font-weight: 700; margin-top: 14px; }

/* ---------- Series detail ---------- */
.series-hero { position: relative; min-height: 74vh; display: flex; align-items: flex-end; }
.series-hero .banner-img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; object-position: center 25%; }
.series-hero .banner-grad { position: absolute; inset: 0; background: linear-gradient(to top, #000 4%, rgba(0,0,0,.6) 40%, rgba(0,0,0,.35) 100%), linear-gradient(90deg, rgba(0,0,0,.85), rgba(0,0,0,.1) 70%); }
.series-hero-inner { position: relative; z-index: 2; display: flex; gap: 32px; padding: 0 56px 44px; width: 100%; align-items: flex-end; }
.series-poster { flex: 0 0 220px; width: 220px; aspect-ratio: 3/4; border-radius: 8px; overflow: hidden; box-shadow: 0 10px 30px rgba(0,0,0,.6); }
.series-poster img { width: 100%; height: 100%; object-fit: cover; }
.series-info { flex: 1; max-width: 720px; }
.series-jp { color: var(--text-2); font-size: 15px; margin-bottom: 6px; }
.series-title { font-size: clamp(30px, 4.5vw, 52px); font-weight: 900; line-height: 1.05; margin-bottom: 14px; }
.series-meta { display: flex; align-items: center; gap: 14px; flex-wrap: wrap; margin-bottom: 14px; font-size: 14px; color: var(--text-2); }
.stars { display: inline-flex; align-items: center; gap: 4px; color: var(--orange); font-size: 16px; }
.stars .score-num { color: #fff; font-weight: 700; margin-left: 4px; }
.rating-badge { border: 1px solid var(--text-2); border-radius: 3px; padding: 1px 6px; font-size: 12px; }
.genre-tags { display: flex; gap: 8px; flex-wrap: wrap; margin-bottom: 18px; }
.genre-tag { background: var(--card); border: 1px solid var(--hairline); border-radius: 20px; padding: 5px 14px; font-size: 13px; color: var(--text-2); }
.series-desc { font-size: 15px; color: #e0e0e0; margin-bottom: 24px; max-width: 680px; }
.series-btns { display: flex; gap: 14px; flex-wrap: wrap; }

.series-section { padding: 40px 56px; }
.series-section h2 { font-size: 24px; font-weight: 700; margin-bottom: 20px; }
.trailer-wrap { position: relative; width: 100%; max-width: 960px; aspect-ratio: 16/9; border-radius: 10px; overflow: hidden; background: var(--card); }
.trailer-wrap iframe { position: absolute; inset: 0; width: 100%; height: 100%; border: 0; }

/* ---------- Premium page ---------- */
.premium-hero { text-align: center; padding: 70px 24px 30px; }
.premium-hero h1 { font-size: clamp(34px, 5vw, 52px); font-weight: 900; margin-bottom: 12px; }
.premium-hero p { color: var(--text-2); font-size: 17px; max-width: 560px; margin: 0 auto; }
.trial-callout { display: inline-flex; align-items: center; gap: 10px; margin-top: 20px; background: rgba(244,117,33,.12); border: 1px solid var(--orange); color: var(--orange); border-radius: 30px; padding: 10px 22px; font-weight: 700; font-size: 14px; }
.plans { display: grid; grid-template-columns: repeat(3, 1fr); gap: 20px; max-width: 1000px; margin: 40px auto; padding: 0 24px; }
.plan { background: var(--card); border: 1px solid var(--hairline); border-radius: 12px; padding: 28px 24px; position: relative; display: flex; flex-direction: column; border-top: 3px solid var(--orange); }
.plan.featured { border: 2px solid var(--orange); border-top: 3px solid var(--orange); transform: scale(1.03); }
.plan .ribbon { position: absolute; top: -13px; left: 50%; transform: translateX(-50%); background: var(--orange); color: #fff; font-size: 12px; font-weight: 700; text-transform: uppercase; letter-spacing: .5px; padding: 5px 16px; border-radius: 20px; }
.plan h3 { font-size: 22px; font-weight: 700; margin-bottom: 8px; }
.plan .price { font-size: 40px; font-weight: 900; margin-bottom: 2px; }
.plan .price span { font-size: 15px; font-weight: 400; color: var(--text-2); }
.plan .plan-sub { color: var(--text-2); font-size: 13px; margin-bottom: 20px; }
.plan .btn { width: 100%; margin-bottom: 20px; }
.plan ul { list-style: none; display: flex; flex-direction: column; gap: 11px; }
.plan li { display: flex; gap: 10px; font-size: 14px; align-items: flex-start; }
.plan li svg { flex: 0 0 18px; width: 18px; height: 18px; margin-top: 1px; }
.plan li.no { color: var(--text-3); }
.check { fill: var(--orange); }
.dash { fill: var(--text-3); }

.compare { max-width: 1000px; margin: 60px auto; padding: 0 24px; }
.compare h2, .faq h2 { font-size: 28px; font-weight: 700; text-align: center; margin-bottom: 24px; }
.compare-table { width: 100%; border-collapse: collapse; }
.compare-table th, .compare-table td { padding: 14px 12px; text-align: center; border-bottom: 1px solid var(--hairline); font-size: 14px; }
.compare-table th:first-child, .compare-table td:first-child { text-align: left; color: var(--text-2); }
.compare-table thead th { font-weight: 700; font-size: 15px; }
.compare-table .yes { color: var(--orange); font-weight: 700; font-size: 18px; }
.compare-table .no { color: var(--text-3); }

.faq { max-width: 760px; margin: 60px auto; padding: 0 24px 40px; }
.faq-item { border-bottom: 1px solid var(--hairline); }
.faq-q { width: 100%; text-align: left; padding: 20px 0; font-size: 17px; font-weight: 700; display: flex; justify-content: space-between; align-items: center; gap: 16px; }
.faq-q .plus { color: var(--orange); font-size: 24px; transition: transform .2s; flex-shrink: 0; }
.faq-item.open .faq-q .plus { transform: rotate(45deg); }
.faq-a { max-height: 0; overflow: hidden; transition: max-height .3s, padding .3s; color: var(--text-2); font-size: 15px; }
.faq-item.open .faq-a { max-height: 220px; padding-bottom: 20px; }

/* ---------- Login ---------- */
.login-page { min-height: calc(100vh - var(--nav-h)); display: flex; align-items: center; justify-content: center; position: relative; padding: 40px 20px; }
.login-bg { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }
.login-bg-grad { position: absolute; inset: 0; background: rgba(0,0,0,.72); }
.login-card { position: relative; z-index: 2; width: min(420px, 100%); background: var(--panel); border: 1px solid var(--hairline); border-radius: 12px; padding: 40px 34px; }
.login-card .logo { justify-content: center; margin-bottom: 8px; }
.login-card h1 { text-align: center; font-size: 26px; font-weight: 900; margin-bottom: 6px; }
.login-card .sub { text-align: center; color: var(--text-2); font-size: 14px; margin-bottom: 26px; }
.field { margin-bottom: 16px; }
.field label { display: block; font-size: 13px; color: var(--text-2); margin-bottom: 6px; }
.field input { width: 100%; background: var(--card); border: 1px solid var(--hairline); border-radius: 6px; padding: 13px 14px; color: #fff; font-size: 15px; font-family: inherit; outline: none; }
.field input:focus { border-color: var(--orange); }
.login-card .btn { width: 100%; margin-top: 6px; }
.login-note { text-align: center; color: var(--text-3); font-size: 12px; margin-top: 18px; }

/* ---------- Responsive ---------- */
.cta-short { display: none; }
@media (max-width: 860px) {
  .nav { padding: 0 14px; gap: 10px; }
  .nav-hamburger { display: flex; }
  .logo { font-size: 18px; }
  .logo-eye { width: 18px; height: 18px; }
  .nav-actions { gap: 10px; }
  .nav-actions .btn-primary { padding: 8px 14px; font-size: 12px; letter-spacing: 0; }
  .cta-full { display: none; }
  .cta-short { display: inline; }
  .nav-links { display: none; }
  .nav-links.open { display: flex; position: absolute; top: var(--nav-h); left: 0; right: 0; flex-direction: column; align-items: flex-start; background: var(--panel); border-bottom: 1px solid var(--hairline); padding: 12px 20px; gap: 6px; }
  .nav-links.open .nav-dropdown { width: 100%; }
  .mega-menu { position: static; display: grid; box-shadow: none; border: none; padding: 4px 0 8px 12px; min-width: 0; }
  .nav-dropdown .mega-menu { display: none; }
  .nav-dropdown.open .mega-menu { display: grid; }
  .row, .series-section, .upsell { padding-left: 16px; padding-right: 16px; }
  .upsell { margin: 30px 16px; }
  .hero-content { padding: 0 20px; }
  .series-hero-inner { flex-direction: column; align-items: flex-start; padding: 0 16px 30px; }
  .series-poster { flex-basis: 130px; width: 130px; }
  .plans { grid-template-columns: 1fr; }
  .plan.featured { transform: none; }
  .footer-cols { grid-template-columns: repeat(2, 1fr); }
  .footer { padding: 34px 16px 20px; }
  .card { width: 140px; }
}
@media (max-width: 600px) {
  .compare-table { min-width: 500px; }
  .compare-table th, .compare-table td { padding: 12px 8px; }
}
@media (max-width: 480px) {
  .footer-cols { grid-template-columns: 1fr; }
  .hero { height: 60vh; }
  .card { width: 120px; }
}
