/* ============================================
   ROSE STREAM — Netflix-Style Streaming UI
   ============================================ */

/* --- CSS Variables --- */
:root {
  --bg-primary: #0a0a0a;
  --bg-secondary: #141414;
  --bg-card: #1a1a1a;
  --red-accent: #E50914;
  --red-hover: #ff1a25;
  --red-dark: #b20710;
  --text-primary: #ffffff;
  --text-secondary: #b3b3b3;
  --text-muted: #757575;
  --shadow-heavy: 0 8px 32px rgba(0, 0, 0, 0.6);
  --shadow-card: 0 4px 16px rgba(0, 0, 0, 0.4);
  --shadow-glow: 0 0 40px rgba(229, 9, 20, 0.3);
  --radius-sm: 4px;
  --radius-md: 8px;
  --radius-lg: 12px;
  --transition-fast: 0.2s ease;
  --transition-med: 0.35s cubic-bezier(0.25, 0.46, 0.45, 0.94);
  --transition-slow: 0.5s cubic-bezier(0.25, 0.46, 0.45, 0.94);
  --header-height: 68px;
  --font-display: 'Bebas Neue', 'Impact', sans-serif;
  --font-body: 'DM Sans', 'Segoe UI', sans-serif;
}

/* --- Google Fonts Import --- */
@import url('https://fonts.googleapis.com/css2?family=Bebas+Neue&family=DM+Sans:wght@400;500;600;700&display=swap');

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

html {
  scroll-behavior: smooth;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

body {
  font-family: var(--font-body);
  background-color: var(--bg-primary);
  color: var(--text-primary);
  overflow-x: hidden;
  min-height: 100vh;
}

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

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

/* --- Scrollbar Styling --- */
::-webkit-scrollbar {
  width: 6px;
  height: 6px;
}

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

::-webkit-scrollbar-thumb {
  background: #444;
  border-radius: 3px;
}

::-webkit-scrollbar-thumb:hover {
  background: #666;
}

/* ============================================
   LOADER
   ============================================ */
.loader-overlay {
  position: fixed;
  inset: 0;
  background: var(--bg-primary);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 9999;
  transition: opacity 0.5s ease, visibility 0.5s ease;
}

.loader-overlay.hidden {
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
}

.loader-spinner {
  width: 48px;
  height: 48px;
  border: 3px solid #333;
  border-top-color: var(--red-accent);
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
}

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

/* ============================================
   HEADER / NAVBAR
   ============================================ */
.header {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  height: var(--header-height);
  z-index: 1000;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 4%;
  transition: background var(--transition-med);
}

/* Transparent on top, solid on scroll */
.header.scrolled {
  background: rgba(10, 10, 10, 0.95);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  box-shadow: 0 2px 20px rgba(0, 0, 0, 0.5);
}

.logo {
  font-family: var(--font-display);
  font-size: 2rem;
  letter-spacing: 2px;
  color: var(--red-accent);
  cursor: pointer;
  user-select: none;
  transition: transform var(--transition-fast);
}

.logo:hover {
  transform: scale(1.05);
}

.logo span {
  color: var(--text-primary);
}

.nav-links {
  display: flex;
  align-items: center;
  gap: 28px;
  list-style: none;
}

.nav-links a {
  font-size: 0.875rem;
  font-weight: 500;
  color: var(--text-secondary);
  letter-spacing: 0.3px;
  transition: color var(--transition-fast);
  position: relative;
}

.nav-links a::after {
  content: '';
  position: absolute;
  bottom: -4px;
  left: 0;
  width: 0;
  height: 2px;
  background: var(--red-accent);
  transition: width var(--transition-med);
}

.nav-links a:hover,
.nav-links a.active {
  color: var(--text-primary);
}

.nav-links a:hover::after,
.nav-links a.active::after {
  width: 100%;
}

/* Mobile menu toggle */
.mobile-toggle {
  display: none;
  background: none;
  border: none;
  cursor: pointer;
  padding: 8px;
}

.mobile-toggle span {
  display: block;
  width: 22px;
  height: 2px;
  background: var(--text-primary);
  margin: 5px 0;
  transition: var(--transition-fast);
  border-radius: 2px;
}

/* ============================================
   HERO SECTION
   ============================================ */
.hero {
  position: relative;
  width: 100%;
  height: 85vh;
  min-height: 500px;
  max-height: 800px;
  overflow: hidden;
}

.hero-backdrop {
  position: absolute;
  inset: 0;
  background-size: cover;
  background-position: center 20%;
  background-repeat: no-repeat;
  transform: scale(1.02);
  transition: transform 8s ease;
}

.hero:hover .hero-backdrop {
  transform: scale(1.06);
}

/* Gradient overlays for readability */
.hero-overlay {
  position: absolute;
  inset: 0;
  background:
    linear-gradient(to top, var(--bg-primary) 0%, transparent 50%),
    linear-gradient(to right, rgba(0,0,0,0.85) 0%, rgba(0,0,0,0.3) 50%, transparent 100%),
    linear-gradient(to bottom, rgba(0,0,0,0.4) 0%, transparent 30%);
}

.hero-content {
  position: absolute;
  bottom: 18%;
  left: 4%;
  max-width: 550px;
  z-index: 2;
  animation: fadeSlideUp 0.8s ease-out;
}

@keyframes fadeSlideUp {
  from {
    opacity: 0;
    transform: translateY(30px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.hero-tag {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 0.75rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 1.5px;
  color: var(--red-accent);
  margin-bottom: 12px;
}

.hero-tag::before {
  content: '';
  width: 18px;
  height: 2px;
  background: var(--red-accent);
}

.hero-title {
  font-family: var(--font-display);
  font-size: clamp(2.5rem, 5vw, 4.5rem);
  line-height: 1;
  letter-spacing: 3px;
  text-transform: uppercase;
  margin-bottom: 16px;
  text-shadow: 0 4px 20px rgba(0, 0, 0, 0.7);
}

.hero-desc {
  font-size: 0.95rem;
  color: var(--text-secondary);
  line-height: 1.6;
  margin-bottom: 28px;
  max-width: 420px;
}

.hero-buttons {
  display: flex;
  gap: 14px;
  flex-wrap: wrap;
}

.btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 12px 28px;
  border: none;
  border-radius: var(--radius-sm);
  font-family: var(--font-body);
  font-size: 0.9rem;
  font-weight: 600;
  cursor: pointer;
  transition: all var(--transition-fast);
  letter-spacing: 0.5px;
}

.btn-play {
  background: var(--text-primary);
  color: var(--bg-primary);
}

.btn-play:hover {
  background: #e0e0e0;
  transform: scale(1.03);
}

.btn-play svg {
  width: 20px;
  height: 20px;
  fill: var(--bg-primary);
}

.btn-info {
  background: rgba(255, 255, 255, 0.15);
  color: var(--text-primary);
  backdrop-filter: blur(4px);
}

.btn-info:hover {
  background: rgba(255, 255, 255, 0.25);
}

/* ============================================
   CONTENT ROWS
   ============================================ */
.content-section {
  position: relative;
  padding: 0 4%;
  margin-top: -60px;
  z-index: 5;
}

.content-row {
  margin-bottom: 48px;
  animation: fadeIn 0.6s ease-out both;
}

@keyframes fadeIn {
  from { opacity: 0; transform: translateY(20px); }
  to { opacity: 1; transform: translateY(0); }
}

.row-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 14px;
}

.row-title {
  font-family: var(--font-display);
  font-size: 1.45rem;
  letter-spacing: 1.5px;
  text-transform: uppercase;
  color: var(--text-primary);
}

.row-title::before {
  content: '';
  display: inline-block;
  width: 4px;
  height: 20px;
  background: var(--red-accent);
  margin-right: 10px;
  vertical-align: middle;
  border-radius: 2px;
}

/* Slider container */
.slider-wrapper {
  position: relative;
}

.slider {
  display: flex;
  gap: 10px;
  overflow-x: auto;
  overflow-y: hidden;
  scroll-behavior: smooth;
  padding: 16px 0;
  -webkit-overflow-scrolling: touch;
  scrollbar-width: none;
}

.slider::-webkit-scrollbar {
  display: none;
}

/* Scroll arrow buttons */
.slider-arrow {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  width: 44px;
  height: 100%;
  border: none;
  background: rgba(0, 0, 0, 0.6);
  color: white;
  font-size: 1.4rem;
  cursor: pointer;
  z-index: 10;
  opacity: 0;
  transition: opacity var(--transition-fast);
  display: flex;
  align-items: center;
  justify-content: center;
}

.slider-wrapper:hover .slider-arrow {
  opacity: 1;
}

.slider-arrow:hover {
  background: rgba(0, 0, 0, 0.85);
}

.slider-arrow.left {
  left: 0;
  border-radius: 0 var(--radius-sm) var(--radius-sm) 0;
}

.slider-arrow.right {
  right: 0;
  border-radius: var(--radius-sm) 0 0 var(--radius-sm);
}

/* ============================================
   MOVIE CARDS
   ============================================ */
.card {
  flex: 0 0 auto;
  width: 220px;
  border-radius: var(--radius-md);
  overflow: hidden;
  cursor: pointer;
  position: relative;
  transition: transform var(--transition-med), box-shadow var(--transition-med), z-index 0s;
}

.card:hover {
  transform: scale(1.15);
  z-index: 20;
  box-shadow: var(--shadow-heavy);
}

.card-img-wrapper {
  position: relative;
  width: 100%;
  aspect-ratio: 2 / 3;
  background: var(--bg-card);
  overflow: hidden;
}

.card-img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform var(--transition-slow), filter var(--transition-med);
}

.card:hover .card-img {
  transform: scale(1.08);
  filter: brightness(0.65);
}

/* Card overlay on hover */
.card-info {
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  padding: 40px 14px 14px;
  background: linear-gradient(to top, rgba(0,0,0,0.95) 0%, rgba(0,0,0,0.5) 60%, transparent 100%);
  opacity: 0;
  transform: translateY(8px);
  transition: all var(--transition-med);
}

.card:hover .card-info {
  opacity: 1;
  transform: translateY(0);
}

.card-title {
  font-size: 0.82rem;
  font-weight: 600;
  line-height: 1.3;
  margin-bottom: 8px;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.card-play-icon {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  border: 2px solid #fff;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all var(--transition-fast);
}

.card:hover .card-play-icon {
  background: var(--red-accent);
  border-color: var(--red-accent);
  box-shadow: var(--shadow-glow);
}

.card-play-icon svg {
  width: 12px;
  height: 12px;
  fill: white;
  margin-left: 2px;
}

/* Fallback image styling */
.card-img-wrapper.broken {
  display: flex;
  align-items: center;
  justify-content: center;
  background: linear-gradient(135deg, #1a1a1a, #2a2a2a);
}

.card-img-wrapper.broken::after {
  content: '🎬';
  font-size: 2.5rem;
  opacity: 0.3;
}

/* ============================================
   FOOTER
   ============================================ */
.footer {
  padding: 60px 4% 30px;
  border-top: 1px solid #222;
  margin-top: 40px;
}

.footer-content {
  max-width: 900px;
  margin: 0 auto;
  text-align: center;
}

.footer-brand {
  font-family: var(--font-display);
  font-size: 1.6rem;
  letter-spacing: 2px;
  color: var(--red-accent);
  margin-bottom: 8px;
}

.footer-text {
  font-size: 0.8rem;
  color: var(--text-muted);
  line-height: 1.6;
}

/* ============================================
   PLAYER PAGE
   ============================================ */
.player-page {
  position: fixed;
  inset: 0;
  background: #000;
  display: flex;
  flex-direction: column;
}

.player-header {
  display: flex;
  align-items: center;
  padding: 12px 20px;
  background: rgba(0, 0, 0, 0.8);
  z-index: 10;
}

.player-back {
  display: flex;
  align-items: center;
  gap: 8px;
  background: none;
  border: none;
  color: var(--text-primary);
  font-family: var(--font-body);
  font-size: 0.9rem;
  cursor: pointer;
  padding: 8px 12px;
  border-radius: var(--radius-sm);
  transition: background var(--transition-fast);
}

.player-back:hover {
  background: rgba(255, 255, 255, 0.1);
}

.player-back svg {
  width: 20px;
  height: 20px;
  fill: currentColor;
}

.player-title {
  margin-left: 16px;
  font-size: 0.95rem;
  font-weight: 500;
  color: var(--text-secondary);
}

.player-frame-wrapper {
  flex: 1;
  position: relative;
}

.player-frame-wrapper iframe {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  border: none;
}

/* Player loading state */
.player-loading {
  position: absolute;
  inset: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 16px;
  background: #000;
  z-index: 5;
}

.player-loading .loader-spinner {
  width: 40px;
  height: 40px;
}

.player-loading-text {
  font-size: 0.85rem;
  color: var(--text-muted);
}

/* ============================================
   RESPONSIVE — TABLET
   ============================================ */
@media (max-width: 1024px) {
  .card {
    width: 180px;
  }

  .hero {
    height: 70vh;
  }

  .hero-content {
    max-width: 420px;
  }
}

/* ============================================
   RESPONSIVE — MOBILE
   ============================================ */
@media (max-width: 768px) {
  :root {
    --header-height: 56px;
  }

  .nav-links {
    display: none;
    position: fixed;
    top: var(--header-height);
    left: 0;
    right: 0;
    background: rgba(10, 10, 10, 0.98);
    backdrop-filter: blur(16px);
    flex-direction: column;
    padding: 20px 4%;
    gap: 18px;
    border-bottom: 1px solid #222;
  }

  .nav-links.open {
    display: flex;
  }

  .mobile-toggle {
    display: block;
  }

  .hero {
    height: 60vh;
    min-height: 380px;
  }

  .hero-content {
    bottom: 14%;
    max-width: 85%;
  }

  .hero-desc {
    display: none;
  }

  .hero-buttons .btn {
    padding: 10px 20px;
    font-size: 0.82rem;
  }

  .content-section {
    margin-top: -40px;
  }

  .card {
    width: 140px;
  }

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

  .slider-arrow {
    display: none;
  }

  .row-title {
    font-size: 1.15rem;
  }

  .player-header {
    padding: 8px 12px;
  }
}

@media (max-width: 480px) {
  .card {
    width: 120px;
  }

  .hero {
    height: 55vh;
    min-height: 320px;
  }

  .hero-title {
    font-size: 2rem;
  }

  .logo {
    font-size: 1.6rem;
  }
}

