/* ─── RESET & BASE ─── */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

:root {
  --red:    #e50914;
  --pink:   #e91e8c;
  --dark:   #141414;
  --card-w: 200px;
  --card-h: 112px;
}

html, body {
  font-family: 'Helvetica Neue', Arial, sans-serif;
  background: var(--dark);
  color: #fff;
  overflow-x: hidden;
  min-height: 100vh;
}

.hidden { display: none !important; }
.fade-in { animation: fadeIn .35s ease; }

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

/* ══════════════════════════════════════
   PANTALLA DE PERFIL
══════════════════════════════════════ */
#profile-screen {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  min-height: 100vh;
  background: radial-gradient(ellipse at center, #1a0010 0%, #000 70%);
  gap: 40px;
  animation: fadeIn .6s ease;
}

.profile-logo {
  font-size: 3rem;
  font-weight: 900;
  letter-spacing: -2px;
  background: linear-gradient(90deg, var(--pink), #ff6b6b);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  text-shadow: none;
}

.profile-title {
  font-size: 1.6rem;
  font-weight: 400;
  color: #ccc;
  letter-spacing: 3px;
  text-transform: uppercase;
}

.profiles {
  display: flex;
  gap: 40px;
  flex-wrap: wrap;
  justify-content: center;
}

.profile-card {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 12px;
  cursor: pointer;
  transition: transform .25s;
}

.profile-card:hover { transform: scale(1.1); }
.profile-card:hover .profile-avatar { border-color: #fff; }
.profile-card:hover p { color: #fff; }

.profile-avatar {
  width: 130px;
  height: 130px;
  border-radius: 8px;
  border: 3px solid transparent;
  background-size: cover;
  background-position: center;
  background-repeat: no-repeat;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 3.5rem;
  transition: border-color .25s;
}

.profile-card p {
  color: #aaa;
  font-size: 1rem;
  letter-spacing: 1px;
  transition: color .25s;
}

/* ══════════════════════════════════════
   ANIMACIÓN DE TRANSICIÓN
══════════════════════════════════════ */
#transition-screen {
  display: none;
  position: fixed;
  inset: 0;
  background: #000;
  align-items: center;
  justify-content: center;
  z-index: 9999;
}

#transition-screen.active { display: flex; }

.transition-logo {
  font-size: 5rem;
  font-weight: 900;
  letter-spacing: -3px;
  background: linear-gradient(90deg, var(--pink), #ff6b6b);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  animation: logoReveal 2s ease forwards;
  opacity: 0;
}

@keyframes logoReveal {
  0%   { opacity: 0; transform: scale(2) ; filter: blur(20px); }
  40%  { opacity: 1; transform: scale(1.1); filter: blur(0); }
  70%  { opacity: 1; transform: scale(1); }
  100% { opacity: 0; transform: scale(.8); }
}

/* ══════════════════════════════════════
   NAVBAR
══════════════════════════════════════ */
.navbar {
  position: fixed;
  top: 0; left: 0; right: 0;
  z-index: 100;
  display: flex;
  align-items: center;
  padding: 16px 48px;
  gap: 32px;
  background: linear-gradient(to bottom, rgba(0,0,0,.9) 0%, transparent 100%);
  transition: background .3s;
}

.navbar.scrolled { background: rgba(20,20,20,.97); }
.discover-tools {
  display: flex;
  align-items: center;
  gap: 10px;
}
.discover-tools input,
.sort-trigger {
  background: linear-gradient(180deg, rgba(255,255,255,.14), rgba(255,255,255,.06));
  border: 1px solid rgba(255,255,255,.24);
  color: #fff;
  border-radius: 10px;
  padding: 9px 12px;
  font-size: .84rem;
  backdrop-filter: blur(8px);
  box-shadow: inset 0 1px 0 rgba(255,255,255,.12), 0 4px 14px rgba(0,0,0,.22);
}
.discover-tools input { width: 240px; }
.sort-dropdown { position: relative; }
.sort-trigger {
  min-width: 132px;
  text-align: left;
  cursor: pointer;
  position: relative;
  padding-right: 34px;
}
.sort-trigger::after {
  content: "▾";
  position: absolute;
  right: 12px;
  top: 50%;
  transform: translateY(-50%);
  opacity: .9;
}
.sort-menu {
  position: absolute;
  top: calc(100% + 8px);
  right: 0;
  width: 160px;
  background: rgba(16,16,16,.98);
  border: 1px solid rgba(255,255,255,.2);
  border-radius: 10px;
  padding: 6px;
  box-shadow: 0 12px 30px rgba(0,0,0,.5);
  z-index: 300;
}
.sort-item {
  width: 100%;
  border: 0;
  background: transparent;
  color: #f2f2f2;
  text-align: left;
  padding: 9px 10px;
  border-radius: 8px;
  cursor: pointer;
  font-size: .85rem;
}
.sort-item:hover { background: rgba(255,255,255,.1); }
.sort-item.active {
  background: rgba(229,9,20,.2);
  color: #fff;
}
.discover-tools input:focus,
.sort-trigger:focus {
  outline: none;
  border-color: rgba(229,9,20,.8);
  box-shadow: 0 0 0 2px rgba(229,9,20,.28), inset 0 1px 0 rgba(255,255,255,.15);
}

.nav-logo {
  font-size: 1.8rem;
  font-weight: 900;
  letter-spacing: -1px;
  background: linear-gradient(90deg, var(--pink), #ff6b6b);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  flex-shrink: 0;
}

.nav-links {
  display: flex;
  list-style: none;
  gap: 24px;
  flex: 1;
}

.nav-links li {
  cursor: pointer;
  font-size: .9rem;
  color: #ccc;
  transition: color .2s;
}
.nav-links li:hover { color: #fff; }

.nav-profile {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-left: auto;
}

.nav-profile span {
  font-size: .85rem;
  color: #ccc;
}

.nav-avatar {
  width: 34px;
  height: 34px;
  border-radius: 6px;
  background-size: cover;
  background-position: center;
  background-repeat: no-repeat;
  font-size: 1.2rem;
  display: flex;
  align-items: center;
  justify-content: center;
}

/* ══════════════════════════════════════
   HERO
══════════════════════════════════════ */
.hero {
  position: relative;
  width: 100%;
  height: 90vh;
  overflow: hidden;
  background: #000;
}

.hero-video {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.hero-overlay {
  position: absolute;
  inset: 0;
  background:
    linear-gradient(to right,  rgba(20,20,20,.95) 0%, rgba(20,20,20,.3) 60%, transparent 100%),
    linear-gradient(to top,    rgba(20,20,20,1)   0%, transparent 60%);
}

.hero-content {
  position: absolute;
  bottom: 20%;
  left: 5%;
  max-width: 500px;
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.hero-badge {
  display: inline-block;
  font-size: .65rem;
  font-weight: 700;
  letter-spacing: 3px;
  color: #ccc;
  border: 1px solid #555;
  padding: 4px 10px;
  width: fit-content;
}

.hero-title {
  font-size: clamp(2rem, 5vw, 3.5rem);
  font-weight: 800;
  line-height: 1.1;
  text-shadow: 2px 2px 8px rgba(0,0,0,.8);
}

.hero-desc {
  font-size: 1rem;
  color: #ddd;
  line-height: 1.5;
  text-shadow: 1px 1px 4px rgba(0,0,0,.8);
}

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

.btn-play, .btn-info {
  padding: 12px 28px;
  border: none;
  border-radius: 4px;
  font-size: 1rem;
  font-weight: 700;
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 8px;
  transition: opacity .2s;
}
.btn-play:hover, .btn-info:hover { opacity: .85; }

.btn-play {
  background: #fff;
  color: #000;
}

.btn-info {
  background: rgba(109,109,110,.7);
  color: #fff;
}

/* Hero sin video */
.hero-placeholder {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  background: linear-gradient(135deg, #1a0010 0%, #0d0d2b 100%);
}

.hero-placeholder-emoji {
  font-size: 12rem;
  opacity: .15;
}

/* ══════════════════════════════════════
   FILAS DE CARDS
══════════════════════════════════════ */
.rows-container {
  padding: 0 48px 80px;
  display: flex;
  flex-direction: column;
  gap: 32px;
  margin-top: -80px;
  position: relative;
  z-index: 1;
}

.row-title {
  font-size: 1.3rem;
  font-weight: 700;
  margin-bottom: 14px;
  color: #e5e5e5;
  letter-spacing: .5px;
}

.row-cards {
  display: flex;
  gap: 6px;
  overflow-x: auto;
  padding-bottom: 12px;
  scrollbar-width: thin;
}

/* ─── CARD ─── */
.card {
  flex-shrink: 0;
  width: var(--card-w);
  height: var(--card-h);
  border-radius: 4px;
  overflow: hidden;
  cursor: pointer;
  position: relative;
  background: #1a1a2e;
  transition: transform .3s, z-index 0s .3s;
}

.card:hover {
  transform: scale(1.4) translateY(-15%);
  z-index: 10;
  transition: transform .3s, z-index 0s;
  box-shadow: 0 20px 40px rgba(0,0,0,.8);
}

.card video, .card img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}
.continue-bar {
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  height: 4px;
  background: rgba(255,255,255,.18);
  z-index: 2;
}
.continue-bar > div {
  height: 100%;
  background: var(--red);
}
.empty-search {
  color: #bcbcbc;
  padding: 24px 8px;
  font-size: .95rem;
}
.card.skeleton {
  background: linear-gradient(90deg, #1f1f1f 25%, #2b2b2b 50%, #1f1f1f 75%);
  background-size: 200% 100%;
  animation: shimmer 1.1s linear infinite;
}

.card-overlay {
  position: absolute;
  inset: 0;
  background: linear-gradient(to top, rgba(0,0,0,.85) 0%, transparent 60%);
  opacity: 0;
  transition: opacity .3s;
  display: flex;
  flex-direction: column;
  justify-content: flex-end;
  padding: 10px;
  gap: 6px;
}

.card:hover .card-overlay { opacity: 1; }

.card-title {
  font-size: .75rem;
  font-weight: 700;
  line-height: 1.2;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.card-actions {
  display: flex;
  gap: 6px;
}

.card-btn {
  width: 28px;
  height: 28px;
  border-radius: 50%;
  border: 2px solid rgba(255,255,255,.7);
  background: rgba(0,0,0,.5);
  color: #fff;
  padding: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: .75rem;
  line-height: 1;
  text-align: center;
  cursor: pointer;
  transition: background .2s, border-color .2s;
}
.card-btn.play { background: #fff; color: #000; border-color: #fff; }
.card-btn:hover { background: rgba(255,255,255,.2); }
.card-btn.play:hover { background: rgba(255,255,255,.8); }

/* Thumbnail placeholder */
.card-thumb-placeholder {
  width: 100%;
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 2.5rem;
}

/* ══════════════════════════════════════
   EMPTY STATE
══════════════════════════════════════ */
.empty-state {
  text-align: center;
  padding: 60px 20px;
  color: #666;
}
.empty-state .empty-icon { font-size: 4rem; margin-bottom: 16px; }
.empty-state h3 { font-size: 1.4rem; color: #888; margin-bottom: 8px; }
.empty-state p  { font-size: .9rem; line-height: 1.6; }
.empty-state code {
  display: inline-block;
  margin-top: 12px;
  background: #222;
  padding: 8px 16px;
  border-radius: 4px;
  font-size: .85rem;
  color: var(--pink);
}

/* ══════════════════════════════════════
   MODAL / REPRODUCTOR
══════════════════════════════════════ */
.modal {
  position: fixed;
  inset: 0;
  background: #000;
  z-index: 500;
  display: flex;
  align-items: center;
  justify-content: center;
  animation: fadeIn .2s ease;
}

.modal-box {
  position: relative;
  width: 100vw;
  height: 100vh;
  background: #000;
  overflow: hidden;
}

.modal-close {
  background: transparent;
  border: 2px solid rgba(255,255,255,.7);
  color: #fff;
  width: 40px; height: 40px;
  border-radius: 50%;
  font-size: 1.05rem;
  line-height: 1;
  text-align: center;
  padding: 0;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background .2s, border-color .2s;
}
.modal-close:hover { background: rgba(255,255,255,.16); border-color: #fff; }

.modal-video-wrap {
  position: relative;
  width: 100vw;
  height: 100vh;
  background: #000;
}

.modal-video-wrap.controls-hidden .player-top,
.modal-video-wrap.controls-hidden .player-controls {
  opacity: 0;
  pointer-events: none;
}

.modal-video-wrap video {
  width: 100%;
  height: 100%;
  object-fit: contain;
}

.player-top {
  position: absolute;
  left: 0;
  right: 0;
  top: 0;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 20px 26px;
  background: linear-gradient(to bottom, rgba(0,0,0,.92), rgba(0,0,0,0));
  transition: opacity .22s ease;
  z-index: 4;
}

.player-title {
  font-size: 1.15rem;
  font-weight: 700;
  color: #fff;
  letter-spacing: .2px;
}

.player-controls {
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 18px 24px 24px;
  background: linear-gradient(to top, rgba(0,0,0,.92), rgba(0,0,0,.35));
  z-index: 4;
  transition: opacity .22s ease;
}

.player-progress-wrap {
  position: relative;
  flex: 1;
}

.player-btn {
  border: 1px solid rgba(255,255,255,.5);
  background: rgba(32,32,32,.8);
  color: #fff;
  width: 34px;
  height: 34px;
  border-radius: 50%;
  padding: 0;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: .9rem;
  line-height: 1;
  text-align: center;
}

.player-btn:hover {
  background: rgba(255,255,255,.2);
}

.player-time {
  min-width: 94px;
  font-size: .8rem;
  color: #e5e5e5;
  font-variant-numeric: tabular-nums;
}

.player-progress {
  width: 100%;
  accent-color: var(--red);
  cursor: pointer;
}

.progress-preview {
  position: absolute;
  bottom: 34px;
  transform: translateX(-50%);
  width: 168px;
  background: rgba(0,0,0,.9);
  border: 1px solid rgba(255,255,255,.28);
  border-radius: 8px;
  padding: 6px;
  display: flex;
  flex-direction: column;
  gap: 4px;
  pointer-events: none;
  z-index: 6;
}

.progress-preview canvas {
  width: 156px;
  height: 88px;
  border-radius: 4px;
  background: #101010;
}

.progress-preview span {
  text-align: center;
  font-size: .74rem;
  color: #ddd;
}

.player-volume {
  position: relative;
}

.volume-panel {
  position: absolute;
  right: 0;
  bottom: 48px;
  width: 140px;
  padding: 10px;
  background: rgba(0,0,0,.88);
  border: 1px solid rgba(255,255,255,.25);
  border-radius: 8px;
}

.volume-panel input {
  width: 100%;
  accent-color: var(--red);
}

.player-overlay-toggle {
  position: absolute;
  inset: 0;
  margin: auto;
  width: 88px;
  height: 88px;
  border-radius: 50%;
  border: 2px solid rgba(255,255,255,.7);
  background: rgba(0,0,0,.5);
  color: #fff;
  font-size: 2rem;
  line-height: 1;
  text-align: center;
  padding: 0;
  display: grid;
  place-items: center;
  cursor: pointer;
  opacity: 0;
  pointer-events: none;
  transition: opacity .2s;
  z-index: 3;
}

.player-overlay-toggle.show {
  opacity: 1;
}

.tap-zone {
  display: none;
}

.info-modal {
  position: fixed;
  inset: 0;
  z-index: 600;
  background: rgba(0,0,0,.72);
  display: grid;
  place-items: center;
  padding: 20px;
}

.info-box {
  width: min(720px, 96vw);
  background: #181818;
  border-radius: 12px;
  padding: 24px;
  position: relative;
  border: 1px solid rgba(255,255,255,.12);
}

.info-close {
  position: absolute;
  top: 12px;
  right: 12px;
  width: 36px;
  height: 36px;
  border-radius: 50%;
  border: none;
  background: rgba(255,255,255,.15);
  color: #fff;
  line-height: 1;
  text-align: center;
  padding: 0;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
}

.info-box h2 { font-size: 1.5rem; margin-bottom: 8px; }
.info-box p { color: #c7c7c7; margin-bottom: 16px; }

.info-meta {
  color: #b5b5b5;
  font-size: .9rem;
  margin-bottom: 18px;
}

.info-play {
  display: inline-flex;
}

/* ══════════════════════════════════════
   ANIMACIONES GLOBALES
══════════════════════════════════════ */
@keyframes fadeIn {
  from { opacity: 0; }
  to   { opacity: 1; }
}
@keyframes shimmer {
  from { background-position: 200% 0; }
  to { background-position: -200% 0; }
}

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

/* ══════════════════════════════════════
   RESPONSIVE
══════════════════════════════════════ */
@media (max-width: 768px) {
  .navbar { padding: 12px 20px; }
  .discover-tools { width: 100%; order: 3; }
  .discover-tools input { width: 100%; }
  .nav-links { display: none; }
  .rows-container { padding: 0 16px 60px; }
  .hero-content { bottom: 25%; left: 5%; max-width: 90%; }
  :root { --card-w: 150px; --card-h: 84px; }
  .player-controls {
    gap: 10px;
    padding: 14px 12px 18px;
  }
  .player-btn {
    width: 42px;
    height: 42px;
    font-size: 1rem;
  }
  .player-time {
    min-width: 82px;
    font-size: .75rem;
  }
  .tap-zone {
    display: block;
    position: absolute;
    top: 0;
    bottom: 0;
    width: 38%;
    z-index: 2;
    border: 0;
    background: transparent;
  }
  .tap-zone.left { left: 0; }
  .tap-zone.right { right: 0; }
}
