/* ============================================
   ReelShort - Official Style
   Streaming Platform · Horizontal Scroll · Dark Immersive
   ============================================ */

/* ---- CSS Variables (Design Tokens) ---- */
:root {
  /* Background Colors */
  --bg-primary: #0a0a0a;
  --bg-secondary: #111111;
  --bg-card: #1a1a1a;
  --bg-glass: rgba(255, 255, 255, 0.04);

  /* Accent Colors */
  --accent-green: #00E676;
  --accent-red: #FF1744;
  --accent-gold: #FFD700;
  --accent-orange: #FF6B35;

  /* Text Colors */
  --text-primary: #FFFFFF;
  --text-secondary: rgba(255, 255, 255, 0.6);
  --text-muted: rgba(255, 255, 255, 0.35);

  /* Glow Effects */
  --glow-green: 0 0 20px rgba(0, 230, 118, 0.35);

  /* Spacing */
  --section-gap: 36px;
  --container-max: 1400px;
  --gap-card: 12px;

  /* Border Radius */
  --radius-sm: 6px;
  --radius-md: 10px;
  --radius-lg: 14px;
  --radius-full: 9999px;

  /* Font */
  --font-cn: "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", system-ui, sans-serif;

  /* Transitions */
  --transition-fast: 0.2s ease-out;
  --transition-normal: 0.3s ease-out;
}

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

html {
  scroll-behavior: smooth;
  -webkit-text-size-adjust: 100%;
}

body {
  font-family: var(--font-cn);
  background: var(--bg-primary);
  color: var(--text-primary);
  line-height: 1.5;
  overflow-x: hidden;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

a {
  color: inherit;
  text-decoration: none;
}

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

button {
  border: none;
  cursor: pointer;
  font-family: inherit;
  background: none;
}

ul, ol {
  list-style: none;
}

/* Hide scrollbar but keep scroll functionality */
.hide-scrollbar {
  -ms-overflow-style: none;
  scrollbar-width: none;
}
.hide-scrollbar::-webkit-scrollbar {
  display: none;
}

/* ---- Container ---- */
.container {
  width: 100%;
  max-width: var(--container-max);
  margin: 0 auto;
  padding: 0 16px;
}

/* ============================================
   1. Header Navigation
   ============================================ */
.header {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 1000;
  height: 56px;
  display: flex;
  align-items: center;
  padding: 0 16px;
  background: rgba(10, 10, 10, 0.85);
  backdrop-filter: blur(24px);
  -webkit-backdrop-filter: blur(24px);
  transition: background var(--transition-normal), box-shadow var(--transition-normal);
}

.header.scrolled {
  background: rgba(10, 10, 10, 0.96);
  box-shadow: 0 1px 0 rgba(255, 255, 255, 0.06);
}

.header__inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  width: 100%;
  max-width: var(--container-max);
  margin: 0 auto;
}

.header__brand {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-shrink: 0;
}

.header__logo {
  width: 32px;
  height: 32px;
  background: linear-gradient(135deg, var(--accent-red), var(--accent-orange));
  border-radius: 8px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 16px;
  font-weight: 900;
  color: #fff;
}

.header__name {
  font-size: 17px;
  font-weight: 700;
  letter-spacing: -0.01em;
  color: var(--text-primary);
}

/* Navigation Links */
.header__nav {
  display: none;
  align-items: center;
  gap: 28px;
}

.header__nav-link {
  font-size: 14px;
  font-weight: 500;
  color: var(--text-secondary);
  transition: color var(--transition-fast);
  position: relative;
}

.header__nav-link:hover,
.header__nav-link--active {
  color: var(--text-primary);
}

.header__nav-link--active::after {
  content: "";
  position: absolute;
  bottom: -4px;
  left: 50%;
  transform: translateX(-50%);
  width: 16px;
  height: 2px;
  background: var(--accent-red);
  border-radius: 1px;
}

/* Search Button */
.header__search {
  width: 36px;
  height: 36px;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--text-secondary);
  transition: color var(--transition-fast);
  border-radius: 50%;
}

.header__search:hover {
  color: var(--text-primary);
  background: rgba(255, 255, 255, 0.06);
}

/* ============================================
   2. Banner Carousel
   ============================================ */
.banner {
  position: relative;
  width: 100%;
  padding-top: 56px; /* header offset */
  overflow: hidden;
}

.banner__slider {
  position: relative;
  width: 100%;
}

.banner__slide {
  position: relative;
  width: 100%;
  aspect-ratio: 16 / 9;
  overflow: hidden;
}

.banner__img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  /* Replace with actual drama poster */
}

.banner__overlay {
  position: absolute;
  inset: 0;
  background: linear-gradient(
    to top,
    var(--bg-primary) 0%,
    rgba(10, 10, 10, 0.7) 40%,
    rgba(10, 10, 10, 0.2) 100%
  );
}

.banner__content {
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  padding: 0 16px 28px;
  z-index: 2;
}

.banner__tags {
  display: flex;
  gap: 6px;
  margin-bottom: 10px;
  flex-wrap: wrap;
}

.banner__tag {
  padding: 3px 10px;
  background: rgba(255, 23, 68, 0.15);
  border: 1px solid rgba(255, 23, 68, 0.3);
  border-radius: var(--radius-full);
  font-size: 11px;
  font-weight: 600;
  color: var(--accent-red);
}

.banner__tag--green {
  background: rgba(0, 230, 118, 0.12);
  border-color: rgba(0, 230, 118, 0.25);
  color: var(--accent-green);
}

.banner__tag--gold {
  background: rgba(255, 215, 0, 0.12);
  border-color: rgba(255, 215, 0, 0.25);
  color: var(--accent-gold);
}

.banner__title {
  font-size: 24px;
  font-weight: 900;
  line-height: 1.25;
  margin-bottom: 8px;
  letter-spacing: -0.01em;
}

.banner__desc {
  font-size: 13px;
  color: var(--text-secondary);
  margin-bottom: 16px;
  line-height: 1.6;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.banner__actions {
  display: flex;
  gap: 10px;
  align-items: center;
}

.banner__play-btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 10px 24px;
  background: var(--accent-red);
  color: #fff;
  font-size: 14px;
  font-weight: 700;
  border-radius: var(--radius-full);
  transition: all var(--transition-fast);
}

.banner__play-btn:hover {
  background: #E01140;
  transform: scale(1.04);
}

.banner__play-btn:active {
  transform: scale(0.97);
}

.banner__ep-btn {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 10px 18px;
  background: rgba(255, 255, 255, 0.1);
  border: 1px solid rgba(255, 255, 255, 0.12);
  color: var(--text-primary);
  font-size: 13px;
  font-weight: 500;
  border-radius: var(--radius-full);
  transition: all var(--transition-fast);
}

.banner__ep-btn:hover {
  background: rgba(255, 255, 255, 0.16);
}

/* Carousel Indicators */
.banner__dots {
  position: absolute;
  bottom: 10px;
  left: 50%;
  transform: translateX(-50%);
  display: flex;
  gap: 6px;
  z-index: 5;
}

.banner__dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.25);
  transition: all var(--transition-normal);
  cursor: pointer;
}

.banner__dot--active {
  width: 20px;
  border-radius: 3px;
  background: var(--accent-red);
}

/* ============================================
   3. Trending Grid
   ============================================ */
}

/* ============================================
   4. Trending Now (Grid Layout)
   ============================================ */
.drama-grid {
  padding: 24px 0 0;
}

.drama-grid__header {
  display: flex;
  align-items: center;
  padding: 0 16px;
  margin-bottom: 16px;
}

.drama-grid__title {
  font-size: 20px;
  font-weight: 800;
  letter-spacing: -0.01em;
  display: flex;
  align-items: center;
  gap: 8px;
}

.drama-grid__title-icon {
  width: 4px;
  height: 20px;
  border-radius: 2px;
  background: var(--accent-red);
  flex-shrink: 0;
}

.drama-grid__container {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(140px, 1fr));
  gap: 12px;
  padding: 0 12px;
  align-items: start;
}

/* ---- Drama Cards ---- */
.drama-card {
  cursor: pointer;
  transition: transform var(--transition-normal);
  display: flex;
  flex-direction: column;
}

.drama-card:active {
  transform: scale(0.96);
}

.drama-card__cover {
  position: relative;
  width: 100%;
  aspect-ratio: 3 / 4;
  border-radius: var(--radius-md);
  overflow: hidden;
  background: var(--bg-card);
  flex-shrink: 0;
}

.drama-card__img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
  transition: transform var(--transition-normal);
}

.drama-card:hover .drama-card__img {
  transform: scale(1.06);
}

.drama-card__cover::after {
  content: "";
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  height: 40%;
  background: linear-gradient(transparent, rgba(0, 0, 0, 0.6));
  pointer-events: none;
}

/* Episode Badge */
.drama-card__eps {
  position: absolute;
  bottom: 8px;
  right: 8px;
  padding: 2px 8px;
  background: rgba(0, 0, 0, 0.75);
  border-radius: 4px;
  font-size: 10px;
  color: rgba(255, 255, 255, 0.85);
  z-index: 2;
  backdrop-filter: blur(4px);
  white-space: nowrap;
}

/* HOT Badge */
.drama-card__hot {
  position: absolute;
  top: 6px;
  left: 6px;
  padding: 1px 6px;
  background: linear-gradient(135deg, var(--accent-red), var(--accent-orange));
  border-radius: 4px;
  font-size: 10px;
  font-weight: 700;
  color: #fff;
  z-index: 2;
}

/* VIP Badge */
.drama-card__vip {
  position: absolute;
  top: 6px;
  right: 6px;
  padding: 1px 6px;
  background: linear-gradient(135deg, var(--accent-gold), #FFA000);
  border-radius: 4px;
  font-size: 10px;
  font-weight: 700;
  color: #000;
  z-index: 2;
}

/* Play Button Overlay */
.drama-card__play {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%) scale(0.7);
  width: 36px;
  height: 36px;
  background: rgba(255, 23, 68, 0.9);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 0;
  transition: all var(--transition-normal);
  z-index: 3;
}

.drama-card:hover .drama-card__play {
  opacity: 1;
  transform: translate(-50%, -50%) scale(1);
}

.drama-card__play-icon {
  width: 0;
  height: 0;
  border-style: solid;
  border-width: 6px 0 6px 10px;
  border-color: transparent transparent transparent #fff;
  margin-left: 2px;
}

.drama-card__info {
  padding: 8px 2px 0;
  flex: 1;
  min-width: 0;
}

.drama-card__name {
  font-size: 14px;
  font-weight: 600;
  line-height: 1.4;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
  text-overflow: ellipsis;
  margin-bottom: 3px;
  max-width: 100%;
  word-break: break-word;
}

.drama-card__meta {
  font-size: 11px;
  color: var(--text-muted);
  display: block;
  margin-top: 4px;
}

/* ============================================
   Detail Modal
   ============================================ */
.modal {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  z-index: 1000;
  display: none;
  align-items: center;
  justify-content: center;
}

.modal--active {
  display: flex;
}

.modal__overlay {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(0, 0, 0, 0.75);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
}

.modal__content {
  position: relative;
  z-index: 1;
  width: 90%;
  max-width: 680px;
  max-height: 82vh;
  background: linear-gradient(155deg, #1a1a1a, #0f0f0f);
  border: 1px solid rgba(255, 215, 0, 0.15);
  border-radius: var(--radius-lg);
  overflow: hidden;
  opacity: 0;
  transform: scale(0.92);
  transition: opacity 0.3s cubic-bezier(0.4, 0, 0.2, 1),
              transform 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.modal--active .modal__content {
  opacity: 1;
  transform: scale(1);
}

.modal--closing .modal__content {
  opacity: 0;
  transform: scale(0.92);
}

.modal__close {
  position: absolute;
  top: 12px;
  right: 12px;
  width: 34px;
  height: 34px;
  border-radius: 50%;
  border: 1px solid rgba(255, 255, 255, 0.12);
  background: rgba(0, 0, 0, 0.55);
  color: rgba(255, 255, 255, 0.8);
  font-size: 20px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 10;
  transition: background var(--transition-fast), border-color var(--transition-fast), color var(--transition-fast);
  line-height: 1;
  padding: 0;
}

.modal__close:hover {
  background: rgba(255, 23, 68, 0.8);
  border-color: var(--accent-red);
  color: #fff;
}

.modal__body {
  display: flex;
  gap: 24px;
  padding: 28px;
}

.modal__cover {
  flex-shrink: 0;
  width: 170px;
}

.modal__img {
  width: 100%;
  aspect-ratio: 3 / 4;
  object-fit: cover;
  border-radius: var(--radius-md);
  box-shadow: 0 4px 24px rgba(0, 0, 0, 0.5);
}

.modal__info {
  flex: 1;
  display: flex;
  flex-direction: column;
  min-width: 0;
  padding-top: 4px;
}

.modal__title {
  font-size: 22px;
  font-weight: 800;
  color: var(--text-primary);
  margin-bottom: 12px;
  line-height: 1.3;
}

.modal__desc {
  font-size: 13.5px;
  line-height: 1.75;
  color: var(--text-secondary);
  margin-bottom: 16px;
  overflow-y: auto;
  max-height: 180px;
  padding-right: 4px;
}

.modal__desc::-webkit-scrollbar {
  width: 3px;
}

.modal__desc::-webkit-scrollbar-track {
  background: transparent;
}

.modal__desc::-webkit-scrollbar-thumb {
  background: rgba(255, 255, 255, 0.12);
  border-radius: 3px;
}

.modal__tags {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 20px;
}

.modal__tag {
  padding: 4px 12px;
  border-radius: var(--radius-full);
  font-size: 12px;
  font-weight: 500;
  border: 1px solid rgba(255, 255, 255, 0.1);
  color: var(--text-secondary);
  background: rgba(255, 255, 255, 0.03);
  transition: border-color var(--transition-fast);
}

.modal__tag:hover {
  border-color: rgba(255, 215, 0, 0.3);
}

.modal__tag--eps {
  border-color: rgba(255, 23, 68, 0.3);
  color: var(--accent-red);
  background: rgba(255, 23, 68, 0.06);
}

.modal__play-btn {
  width: 100%;
  padding: 14px 0;
  border: none;
  border-radius: var(--radius-md);
  background: linear-gradient(135deg, var(--accent-red), #D50000);
  color: #fff;
  font-size: 15px;
  font-weight: 700;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  transition: transform var(--transition-fast), box-shadow var(--transition-fast);
  margin-top: auto;
  font-family: var(--font-cn);
}

.modal__play-btn:hover {
  transform: translateY(-2px);
  box-shadow: 0 6px 24px rgba(255, 23, 68, 0.4);
}

.modal__play-btn:active {
  transform: scale(0.97);
}

/* Mobile Modal Full-Screen Adaptation */
@media (max-width: 639px) {
  .modal__content {
    width: 100%;
    max-width: 100%;
    max-height: 100vh;
    border-radius: 0;
    height: 100vh;
  }

  .modal__body {
    flex-direction: column;
    padding: 20px 16px;
    max-height: 100vh;
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
  }

  .modal__cover {
    width: 130px;
    align-self: center;
  }

  .modal__title {
    font-size: 19px;
    text-align: center;
    margin-top: 12px;
  }

  .modal__desc {
    max-height: none;
    overflow-y: visible;
  }

  .modal__tags {
    justify-content: center;
  }

  .modal__close {
    top: 16px;
    right: 16px;
    z-index: 20;
  }
}

/* ============================================
   6. Footer
   ============================================ */
.footer {
  margin-top: 48px;
  padding: 32px 16px;
  background: #060606;
  border-top: 1px solid rgba(255, 255, 255, 0.04);
}

.footer__content {
  max-width: var(--container-max);
  margin: 0 auto;
}

.footer__top {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 20px;
  margin-bottom: 24px;
}

.footer__brand {
  display: flex;
  align-items: center;
  gap: 8px;
}

.footer__logo {
  width: 28px;
  height: 28px;
  background: linear-gradient(135deg, var(--accent-red), var(--accent-orange));
  border-radius: 6px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 13px;
  font-weight: 900;
  color: #fff;
}

.footer__brand-name {
  font-size: 15px;
  font-weight: 700;
  color: var(--text-primary);
}

.footer__links {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 16px;
  font-size: 12px;
  color: var(--text-muted);
}

.footer__link {
  transition: color var(--transition-fast);
}

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

.footer__divider {
  width: 100%;
  height: 1px;
  background: rgba(255, 255, 255, 0.04);
  margin-bottom: 16px;
}

.footer__bottom {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 10px;
}

.footer__lang {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 4px 12px;
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid rgba(255, 255, 255, 0.06);
  border-radius: var(--radius-full);
  font-size: 11px;
  color: var(--text-muted);
  cursor: pointer;
  transition: all var(--transition-fast);
}

.footer__lang:hover {
  background: rgba(255, 255, 255, 0.07);
  color: var(--text-secondary);
}

.footer__copyright {
  font-size: 11px;
  color: var(--text-muted);
  text-align: center;
}

/* ============================================
   Animations
   ============================================ */
@keyframes fadeInUp {
  from {
    opacity: 0;
    transform: translateY(20px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@keyframes blink {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.3; }
}

.reveal {
  opacity: 0;
  transform: translateY(20px);
  transition: opacity 0.5s ease-out, transform 0.5s ease-out;
}

.reveal.visible {
  opacity: 1;
  transform: translateY(0);
}

/* ============================================
   Responsive - Tablet (≥640px)
   ============================================ */
@media (min-width: 640px) {
  .container {
    padding: 0 24px;
  }

  .header {
    height: 60px;
  }

  .header__nav {
    display: flex;
  }

  .header__search {
    display: none;
  }

  .banner__slide {
    aspect-ratio: 21 / 9;
  }

  .banner__content {
    padding: 0 24px 36px;
  }

  .banner__title {
    font-size: 32px;
  }

  .banner__desc {
    font-size: 14px;
    -webkit-line-clamp: 3;
  }

  .drama-grid__container {
    grid-template-columns: repeat(auto-fill, minmax(160px, 1fr));
    gap: 16px;
    padding: 0 24px;
  }

  .drama-grid__header {
    padding: 0 24px;
  }

  .drama-grid__title {
    font-size: 22px;
  }
}

/* ============================================
   Responsive - Desktop (≥1024px)
   ============================================ */
@media (min-width: 1024px) {
  .container {
    padding: 0 40px;
  }

  .header {
    height: 64px;
  }

  .banner__slide {
    aspect-ratio: 21 / 8;
  }

  .banner__content {
    padding: 0 40px 48px;
    max-width: 600px;
  }

  .banner__title {
    font-size: 40px;
  }

  .banner__desc {
    font-size: 15px;
  }

  .drama-grid__container {
    grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
    gap: 20px;
    padding: 0 40px;
  }

  .drama-grid__header {
    padding: 0 40px;
  }

  .drama-grid__title {
    font-size: 24px;
  }

  .drama-card:hover {
    transform: translateY(-4px);
  }

  .drama-card__name {
    font-size: 14px;
  }

  .drama-card__eps {
    font-size: 11px;
    bottom: 10px;
    right: 10px;
  }

  .footer__top {
    flex-direction: row;
    justify-content: space-between;
  }

  .footer__bottom {
    flex-direction: row;
    justify-content: space-between;
  }
}

/* ============================================
   Responsive - Large Desktop (≥1280px)
   ============================================ */
@media (min-width: 1280px) {
  .drama-grid__container {
    grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
    gap: 24px;
  }
}
