/* ============================================================
   NETFLIX CLONE — STYLE.CSS
   ============================================================ */

@import url('https://fonts.googleapis.com/css2?family=Netflix+Sans:wght@400;500;700&display=swap');

/* Netflix uses its own "Netflix Sans" — we'll fall back to a close match */
:root {
  --netflix-red:    #E50914;
  --netflix-red-hover: #F40612;
  --bg-black:       #141414;
  --bg-dark:        #181818;
  --bg-card:        #2F2F2F;
  --text-white:     #FFFFFF;
  --text-grey:      #808080;
  --text-light:     #B3B3B3;
  --rating-green:   #46D369;
  --overlay-start:  rgba(20,20,20,0);
  --overlay-end:    rgba(20,20,20,1);
  --font:           'Helvetica Neue', Helvetica, Arial, sans-serif;
  --transition:     0.2s ease;
  --border-radius:  4px;
}

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

html { scroll-behavior: smooth; }

body {
  background: var(--bg-black);
  color: var(--text-white);
  font-family: var(--font);
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
}

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

/* ── SCROLLBAR ───────────────────────────────────────────── */
::-webkit-scrollbar { width: 6px; height: 6px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: #555; border-radius: 3px; }

/* ============================================================
   NAVBAR
   ============================================================ */
.navbar {
  position: fixed;
  top: 0; left: 0; right: 0;
  z-index: 1000;
  display: flex;
  align-items: center;
  padding: 0 60px;
  height: 68px;
  transition: background 0.4s ease;
}
.navbar.scrolled,
.navbar.solid {
  background: var(--bg-black);
}
.navbar:not(.scrolled):not(.solid) {
  background: linear-gradient(180deg, rgba(0,0,0,0.7) 0%, transparent 100%);
}

.navbar__logo {
  flex-shrink: 0;
  margin-right: 28px;
}
.navbar__logo svg {
  width: 92px;
  height: auto;
}

.navbar__links {
  display: flex;
  gap: 20px;
  list-style: none;
}
.navbar__links a {
  font-size: 14px;
  color: var(--text-light);
  transition: color var(--transition);
}
.navbar__links a:hover,
.navbar__links a.active { color: var(--text-white); }

.navbar__right {
  margin-left: auto;
  display: flex;
  align-items: center;
  gap: 20px;
}
.navbar__search-icon,
.navbar__bell-icon {
  cursor: pointer;
  opacity: 0.9;
  transition: opacity var(--transition);
}
.navbar__search-icon:hover,
.navbar__bell-icon:hover { opacity: 1; }

.navbar__avatar {
  width: 32px;
  height: 32px;
  border-radius: 4px;
  object-fit: cover;
  cursor: pointer;
}

.navbar__profile-menu {
  position: relative;
  display: flex;
  align-items: center;
  gap: 8px;
  cursor: pointer;
}
.navbar__profile-menu svg { transition: transform 0.2s; }
.navbar__profile-menu:hover svg { transform: rotate(180deg); }

.profile-dropdown {
  position: absolute;
  top: calc(100% + 12px);
  right: 0;
  background: rgba(0,0,0,0.9);
  border: 1px solid #333;
  min-width: 200px;
  padding: 8px 0;
  display: none;
  flex-direction: column;
}
.navbar__profile-menu:hover .profile-dropdown { display: flex; }

.profile-dropdown__item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px 16px;
  font-size: 13px;
  color: var(--text-light);
  transition: color var(--transition);
}
.profile-dropdown__item:hover { color: var(--text-white); }
.profile-dropdown__item img {
  width: 28px; height: 28px; border-radius: 4px; object-fit: cover;
}
.profile-dropdown__divider {
  border: none;
  border-top: 1px solid #333;
  margin: 8px 0;
}

/* ============================================================
   HERO / BILLBOARD
   ============================================================ */
.hero {
  position: relative;
  height: 80vh;
  min-height: 500px;
  display: flex;
  align-items: flex-end;
  padding-bottom: 100px;
  overflow: hidden;
}

.hero__backdrop {
  position: absolute;
  inset: 0;
  background-size: cover;
  background-position: center top;
  transition: opacity 1s ease;
}
.hero__backdrop::after {
  content: '';
  position: absolute;
  inset: 0;
  background: 
    linear-gradient(77deg, rgba(0,0,0,0.6) 0%, transparent 50%),
    linear-gradient(180deg, transparent 50%, rgba(20,20,20,0.8) 80%, var(--bg-black) 100%);
}

.hero__content {
  position: relative;
  z-index: 2;
  padding: 0 60px;
  max-width: 640px;
}

.hero__logo-img {
  max-width: 380px;
  margin-bottom: 20px;
  filter: drop-shadow(2px 4px 6px rgba(0,0,0,0.4));
}

.hero__title {
  font-size: 52px;
  font-weight: 700;
  line-height: 1.1;
  margin-bottom: 16px;
  text-shadow: 2px 2px 4px rgba(0,0,0,0.6);
}

.hero__meta {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 16px;
  font-size: 14px;
}
.hero__match { color: var(--rating-green); font-weight: 700; }
.hero__year, .hero__duration { color: var(--text-light); }
.hero__hd {
  border: 1px solid var(--text-light);
  padding: 1px 5px;
  font-size: 11px;
  color: var(--text-light);
  border-radius: 2px;
}

.hero__description {
  font-size: 16px;
  line-height: 1.5;
  color: #ddd;
  margin-bottom: 24px;
  display: -webkit-box;
  -webkit-line-clamp: 3;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.hero__buttons {
  display: flex;
  gap: 12px;
}

.btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 0 28px;
  height: 46px;
  border-radius: var(--border-radius);
  font-size: 16px;
  font-weight: 700;
  transition: all var(--transition);
  white-space: nowrap;
}
.btn--play {
  background: var(--text-white);
  color: #000;
}
.btn--play:hover { background: rgba(255,255,255,0.75); }

.btn--info {
  background: rgba(109,109,110,0.7);
  color: var(--text-white);
}
.btn--info:hover { background: rgba(109,109,110,0.5); }

/* ============================================================
   ROW / SLIDER
   ============================================================ */
.rows-section {
  padding-bottom: 60px;
  margin-top: -60px;
  position: relative;
  z-index: 10;
}

.row {
  margin-bottom: 3vw;
  padding: 0;
}
.row__header {
  display: flex;
  align-items: center;
  padding: 0 60px;
  margin-bottom: 10px;
}
.row__title {
  font-size: 20px;
  font-weight: 700;
  color: #e5e5e5;
}
.row__see-all {
  margin-left: 12px;
  font-size: 13px;
  color: var(--netflix-red);
  opacity: 0;
  transform: translateX(-6px);
  transition: all 0.3s;
  display: flex;
  align-items: center;
  gap: 4px;
}
.row:hover .row__see-all {
  opacity: 1;
  transform: translateX(0);
}

.row__track-wrap {
  position: relative;
  overflow: hidden;
}
.row__track-wrap:hover .row__arrow { opacity: 1; }

.row__track {
  display: flex;
  gap: 4px;
  padding: 0 60px;
  transition: transform 0.5s cubic-bezier(0.25, 0.46, 0.45, 0.94);
}

.row__arrow {
  position: absolute;
  top: 0; bottom: 0;
  width: 60px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(20,20,20,0.5);
  cursor: pointer;
  z-index: 10;
  opacity: 0;
  transition: opacity var(--transition), background var(--transition);
}
.row__arrow:hover { background: rgba(20,20,20,0.8); }
.row__arrow--left { left: 0; }
.row__arrow--right { right: 0; }
.row__arrow svg { color: white; }

/* ── CARD ────────────────────────────────────────────────── */
.card {
  flex-shrink: 0;
  width: calc((100vw - 120px - 4*4px) / 5);
  aspect-ratio: 16/9;
  border-radius: var(--border-radius);
  overflow: visible;
  position: relative;
  cursor: pointer;
  transition: transform 0.3s ease, z-index 0s 0.3s;
  transform-origin: center center;
}
.card:first-child { transform-origin: left center; }
.card:last-child  { transform-origin: right center; }

.card__img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  border-radius: var(--border-radius);
  display: block;
}

.card:hover {
  transform: scale(1.5);
  z-index: 100;
  transition: transform 0.3s ease 0.3s, z-index 0s;
}

.card__hover {
  position: absolute;
  inset: 0;
  border-radius: var(--border-radius);
  background: var(--bg-dark);
  box-shadow: 0 8px 24px rgba(0,0,0,0.8);
  opacity: 0;
  transform: scaleY(1);
  transform-origin: top;
  transition: opacity 0.3s ease 0.3s;
  overflow: hidden;
  top: 0;
  display: flex;
  flex-direction: column;
}
.card:hover .card__hover { opacity: 1; }

.card__preview {
  width: 100%;
  aspect-ratio: 16/9;
  object-fit: cover;
  border-radius: var(--border-radius) var(--border-radius) 0 0;
  display: block;
}

.card__info {
  padding: 8px 10px 10px;
  flex: 1;
}
.card__actions {
  display: flex;
  align-items: center;
  gap: 6px;
  margin-bottom: 8px;
}
.card__action-btn {
  width: 30px; height: 30px;
  border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  transition: background var(--transition), border-color var(--transition);
}
.card__action-btn--play {
  background: var(--text-white);
  color: #000;
}
.card__action-btn--play:hover { background: rgba(255,255,255,0.75); }
.card__action-btn--secondary {
  background: transparent;
  border: 2px solid rgba(255,255,255,0.5);
  color: var(--text-white);
}
.card__action-btn--secondary:hover {
  border-color: var(--text-white);
}
.card__action-btn--more {
  margin-left: auto;
  background: transparent;
  border: 2px solid rgba(255,255,255,0.5);
  color: var(--text-white);
}
.card__action-btn--more:hover { border-color: var(--text-white); }

.card__match { color: var(--rating-green); font-size: 11px; font-weight: 700; margin-bottom: 4px; }
.card__title-text { font-size: 11px; font-weight: 700; margin-bottom: 4px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.card__tags {
  display: flex;
  flex-wrap: wrap;
  gap: 4px;
}
.card__tag {
  font-size: 10px;
  color: var(--text-light);
}
.card__tag:not(:last-child)::after { content: ' •'; margin-left: 4px; }

/* ============================================================
   MODAL (FICHE FILM)
   ============================================================ */
.modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.75);
  z-index: 2000;
  display: flex;
  align-items: flex-start;
  justify-content: center;
  padding: 40px 0 80px;
  overflow-y: auto;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.3s ease;
}
.modal-overlay.open {
  opacity: 1;
  pointer-events: all;
}

.modal {
  background: #181818;
  border-radius: 8px;
  width: 850px;
  max-width: 95vw;
  position: relative;
  transform: scale(0.95);
  transition: transform 0.3s ease;
  overflow: hidden;
}
.modal-overlay.open .modal { transform: scale(1); }

.modal__close {
  position: absolute;
  top: 16px; right: 16px;
  z-index: 10;
  width: 36px; height: 36px;
  border-radius: 50%;
  background: #181818;
  color: white;
  display: flex; align-items: center; justify-content: center;
  transition: background var(--transition);
}
.modal__close:hover { background: #333; }

/* Hero video/image area */
.modal__hero {
  position: relative;
  aspect-ratio: 16/9;
  background: #000;
  overflow: hidden;
}
.modal__hero-img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}
.modal__hero-video {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: none;
}
.modal__hero-video.active { display: block; }
.modal__hero-img.hidden { display: none; }

.modal__hero-gradient {
  position: absolute;
  bottom: 0; left: 0; right: 0;
  height: 40%;
  background: linear-gradient(transparent, #181818);
  pointer-events: none;
}

.modal__hero-content {
  position: absolute;
  bottom: 0; left: 0; right: 0;
  padding: 20px 48px 20px;
}

.modal__movie-logo {
  max-width: 260px;
  max-height: 100px;
  object-fit: contain;
  margin-bottom: 16px;
  filter: drop-shadow(0 2px 4px rgba(0,0,0,0.6));
}
.modal__movie-logo-text {
  font-size: 28px;
  font-weight: 900;
  margin-bottom: 16px;
  line-height: 1;
}

.modal__hero-buttons {
  display: flex;
  align-items: center;
  gap: 10px;
}
.modal__hero-buttons .btn {
  height: 40px;
  font-size: 15px;
  padding: 0 22px;
}
.modal__icon-btn {
  width: 40px; height: 40px;
  border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  border: 2px solid rgba(255,255,255,0.6);
  background: transparent;
  color: white;
  transition: border-color var(--transition);
}
.modal__icon-btn:hover { border-color: white; }
.modal__mute-btn {
  margin-left: auto;
}

/* Modal body */
.modal__body {
  padding: 24px 48px 40px;
}
.modal__columns {
  display: grid;
  grid-template-columns: 1fr 340px;
  gap: 32px;
}

.modal__left {}
.modal__badges {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 16px;
  flex-wrap: wrap;
}
.modal__match { color: var(--rating-green); font-size: 17px; font-weight: 700; }
.modal__year, .modal__duration { font-size: 14px; color: var(--text-light); }
.modal__hd {
  border: 1px solid var(--text-light);
  padding: 1px 6px;
  font-size: 11px;
  color: var(--text-light);
  border-radius: 2px;
}
.modal__age {
  background: rgba(255,255,255,0.15);
  padding: 1px 8px;
  font-size: 12px;
  border-radius: 2px;
}

.modal__synopsis {
  font-size: 15px;
  line-height: 1.6;
  color: #ddd;
  margin-bottom: 24px;
}

.modal__right {
  font-size: 13px;
  line-height: 1.8;
  color: var(--text-light);
}
.modal__right strong { color: var(--text-white); }
.modal__right p { margin-bottom: 8px; }

.modal__divider {
  border: none;
  border-top: 1px solid #333;
  margin: 24px 0;
}

.modal__section-title {
  font-size: 20px;
  font-weight: 700;
  margin-bottom: 16px;
}

/* Similar movies row inside modal */
.modal__similar-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 8px;
}
.modal__similar-card {
  background: #2F2F2F;
  border-radius: 4px;
  overflow: hidden;
  cursor: pointer;
  transition: opacity var(--transition);
}
.modal__similar-card:hover { opacity: 0.8; }
.modal__similar-card img {
  width: 100%;
  aspect-ratio: 16/9;
  object-fit: cover;
}
.modal__similar-info {
  padding: 10px;
}
.modal__similar-meta {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 6px;
}
.modal__similar-match { color: var(--rating-green); font-size: 13px; font-weight: 700; }
.modal__similar-duration { font-size: 12px; color: var(--text-light); }
.modal__similar-desc {
  font-size: 12px;
  color: var(--text-light);
  line-height: 1.4;
  display: -webkit-box;
  -webkit-line-clamp: 3;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

/* ============================================================
   PROFILES PAGE
   ============================================================ */
.profiles-page {
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  background: var(--bg-black);
}

.profiles-page__logo {
  position: absolute;
  top: 32px; left: 50%;
  transform: translateX(-50%);
}
.profiles-page__logo svg { width: 120px; }

.profiles-page__title {
  font-size: 48px;
  font-weight: 400;
  margin-bottom: 40px;
  color: var(--text-white);
  letter-spacing: -0.5px;
}

.profiles-grid {
  display: flex;
  gap: 24px;
  flex-wrap: wrap;
  justify-content: center;
  max-width: 900px;
  margin-bottom: 48px;
}

.profile-item {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 14px;
  cursor: pointer;
  width: 160px;
}

.profile-item__avatar-wrap {
  position: relative;
  width: 160px;
  height: 160px;
  border-radius: 8px;
  overflow: hidden;
  transition: outline 0.2s;
  outline: 4px solid transparent;
}
.profile-item:hover .profile-item__avatar-wrap {
  outline-color: var(--text-white);
}
.profile-item__avatar-wrap img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}
.profile-item__avatar-overlay {
  position: absolute;
  inset: 0;
  background: rgba(0,0,0,0.5);
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 0;
  transition: opacity var(--transition);
}
.profile-item:hover .profile-item__avatar-overlay { opacity: 1; }

.profile-item__name {
  font-size: 16px;
  color: var(--text-grey);
  transition: color var(--transition);
  text-align: center;
}
.profile-item:hover .profile-item__name { color: var(--text-white); }

.profile-item--add .profile-item__avatar-wrap {
  background: #333;
  display: flex;
  align-items: center;
  justify-content: center;
}
.profile-item--add .profile-item__avatar-wrap svg {
  color: var(--text-grey);
  transition: color var(--transition);
}
.profile-item--add:hover .profile-item__avatar-wrap svg { color: var(--text-white); }
.profile-item--add .profile-item__name { color: var(--text-grey); }

.profiles-page__manage-btn {
  background: transparent;
  border: 1px solid var(--text-grey);
  color: var(--text-grey);
  padding: 12px 32px;
  font-size: 16px;
  letter-spacing: 1px;
  transition: all var(--transition);
}
.profiles-page__manage-btn:hover {
  border-color: var(--text-white);
  color: var(--text-white);
  background: rgba(255,255,255,0.05);
}

/* ============================================================
   FOOTER
   ============================================================ */
.footer {
  padding: 60px;
  color: var(--text-grey);
  font-size: 13px;
}
.footer__links {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 8px;
  margin-bottom: 20px;
  list-style: none;
  max-width: 700px;
}
.footer__links a:hover { text-decoration: underline; }
.footer__country {
  margin-bottom: 12px;
  font-size: 13px;
}

/* ============================================================
   RESPONSIVE
   ============================================================ */
@media (max-width: 1100px) {
  .card {
    width: calc((100vw - 120px - 3*4px) / 4);
  }
  .modal__columns {
    grid-template-columns: 1fr;
  }
  .modal__similar-grid {
    grid-template-columns: repeat(2, 1fr);
  }
}

@media (max-width: 768px) {
  .navbar { padding: 0 24px; }
  .hero__content { padding: 0 24px; }
  .hero__title { font-size: 32px; }
  .row__header { padding: 0 24px; }
  .row__track { padding: 0 24px; }
  .card {
    width: calc((100vw - 48px - 2*4px) / 3);
  }
  .profiles-page__title { font-size: 32px; }
  .profile-item { width: 100px; }
  .profile-item__avatar-wrap { width: 100px; height: 100px; }
  .modal__body { padding: 20px 24px 30px; }
  .modal__hero-content { padding: 16px 24px; }
  .footer { padding: 40px 24px; }
  .footer__links { grid-template-columns: repeat(2, 1fr); }
}
