/* --- Transition Curtain (Between Videos) --- */
#transition-curtain {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: #fff;
  display: flex;
  justify-content: center;
  align-items: center;
  z-index: var(--z-curtain);
  opacity: 0;
  visibility: hidden;
  transition: opacity var(--transition-slow), visibility var(--transition-slow);
  pointer-events: none;
  will-change: opacity, visibility;
}

#transition-curtain.active {
  opacity: 1;
  visibility: visible;
  pointer-events: auto;
}

.transition-logo {
  width: 250px;
  height: auto;
  transform: scale(0.8);
  opacity: 0;
  transition: transform 0.8s cubic-bezier(0.2, 0.8, 0.2, 1), opacity 0.6s ease;
}

#transition-curtain.active .transition-logo {
  transform: scale(1);
  opacity: 1;
}

/* --- Simple Loader (Phase 1) --- */
#preloader {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: #fff;
  display: flex;
  justify-content: center;
  align-items: center;
  z-index: var(--z-preloader);
  transition: opacity 0.8s ease, visibility 0.8s;
  will-change: opacity, visibility;
}

#preloader.fade-out {
  opacity: 0;
  visibility: hidden;
}

.preloader-content {
  text-align: center;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 30px;
}

.preloader-logo-pulse {
  width: 180px;
  height: auto;
  animation: logoSoftPulse 2s infinite ease-in-out;
}

@keyframes logoSoftPulse {

  0%,
  100% {
    transform: scale(1);
    opacity: 0.8;
  }

  50% {
    transform: scale(1.05);
    opacity: 1;
  }
}

.preloader-spinner {
  width: 50px;
  height: 2px;
  background: rgba(0, 0, 0, 0.05);
  position: relative;
  overflow: hidden;
}

.preloader-spinner::after {
  content: '';
  position: absolute;
  top: 0;
  left: -100%;
  width: 100%;
  height: 100%;
  background: var(--synapse-pink);
  animation: loadingBar 1.8s infinite ease-in-out;
}

@keyframes loadingBar {
  0% {
    left: -100%;
  }

  50% {
    left: 0;
  }

  100% {
    left: 100%;
  }
}

/* Responsivo para móviles */
@media (max-width: 900px) {
  .preloader-content {
    flex-direction: column;
    justify-content: center;
    align-items: center;
    text-align: center;
  }

  .preloader-brand {
    position: static;
    transform: none;
    margin-top: 50px;
  }

  .preloader-main-title {
    font-size: 48px;
  }

  .preloader-sub-title {
    font-size: 16px;
    width: 100%;
  }

  .preloader-brand .preloader-logo-light {
    width: 200px;
  }
}

/* --- Intro / Cover Screen (Phase 2) --- */
#intro-cta {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  z-index: var(--z-intro);
  display: flex;
  justify-content: center;
  align-items: center;
  opacity: 0;
  visibility: hidden;
  transition: opacity 1s ease, visibility 1s;
  background: #fff;
  will-change: opacity, visibility;
}

#intro-cta.show {
  opacity: 1;
  visibility: visible;
}

.intro-background {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background-image: url('media/synapse_office_bg.png');
  background-size: cover;
  background-position: center;
  filter: brightness(1.1) contrast(1.05);
}

.intro-overlay {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: linear-gradient(90deg, rgba(255, 255, 255, 0.95) 0%, rgba(255, 255, 255, 0.5) 100%);
}

.intro-overlay::after {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(186, 45, 116, 0.08);
  mix-blend-mode: multiply;
}

.intro-content-wrapper {
  position: relative;
  z-index: 5;
  width: 100%;
  height: 100%;
  padding-left: 420px;
  /* Offset for the sidebar width to center in remaining space */
  display: flex;
  align-items: center;
  justify-content: center;
}

/* Remove titles side styles */

.intro-play-side {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 30px;
  /* Even tighter spacing */
}

.intro-cta-texts {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 12px;
  text-align: center;
}

.intro-cta-phrase {
  font-size: 38px;
  /* Even smaller and more elegant */
  font-weight: 800;
  background: linear-gradient(135deg, #BA2D74 0%, #4A90E2 80%);
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
  line-height: 1.1;
  margin: 0;
  letter-spacing: -1.2px;
  /* Sombra más definida para mejorar legibilidad sobre fondos claros */
  filter: drop-shadow(0 10px 20px rgba(0, 0, 0, 0.15)) drop-shadow(0 2px 4px rgba(186, 45, 116, 0.1));
  opacity: 0;
}

.intro-cta-subtitle {
  color: #666;
  font-size: 14px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 1.5px;
  margin: 0;
  opacity: 0;
  padding: 0 10px;
}

/* Disparo de animación premium */
#intro-cta.show .intro-cta-phrase {
  animation: premiumEntrance 1.2s cubic-bezier(0.19, 1, 0.22, 1) forwards 0.3s;
}

#intro-cta.show .intro-cta-subtitle {
  animation: premiumEntrance 1.2s cubic-bezier(0.19, 1, 0.22, 1) forwards 0.5s;
}

@keyframes premiumEntrance {
  0% {
    opacity: 0;
    transform: translateY(30px) scale(0.98);
  }

  100% {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
}



.play-pulse-btn {
  width: 75px;
  /* Even smaller button as requested */
  height: 75px;
  background: var(--synapse-pink);
  border-radius: 50%;
  border: none;
  cursor: pointer;
  display: flex;
  justify-content: center;
  align-items: center;
  box-shadow: 0 0 0 0 rgba(186, 45, 116, 0.6);
  animation: introPlayPulse 2s infinite;
  transition: all 0.3s ease;
  position: relative;
}

.play-pulse-btn:hover {
  transform: scale(1.1);
  box-shadow: 0 0 30px rgba(186, 45, 116, 0.4);
}

.play-pulse-btn .main-play-icon {
  width: 30px;
  /* Adjusted icon to fit smaller button */
  height: 30px;
  fill: #fff;
  margin-left: 3px;
}

.audio-badge-cta {
  position: absolute;
  bottom: 5px;
  right: 5px;
  background: #fff;
  width: 32px;
  height: 32px;
  border-radius: 50%;
  display: flex;
  justify-content: center;
  align-items: center;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.2);
  border: 2px solid var(--synapse-pink);
}

.audio-badge-cta svg {
  width: 18px;
  height: 18px;
  fill: var(--synapse-pink);
}

.intro-cta-subtitle {
  color: #666;
  /* Grey for subtitle to keep it subtle */
  font-size: 14px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 1.5px;
  margin: 0;
}

@media (max-width: 900px) {
  .intro-cta-phrase {
    font-size: 28px;
    padding: 0 20px;
  }
}

@keyframes introPlayPulse {
  0% {
    box-shadow: 0 0 0 0 rgba(186, 45, 116, 0.7);
  }

  70% {
    box-shadow: 0 0 0 30px rgba(186, 45, 116, 0);
  }

  100% {
    box-shadow: 0 0 0 0 rgba(186, 45, 116, 0);
  }
}

@media (max-width: 1100px) and (orientation: landscape) {
  .intro-content-wrapper {
    padding-left: 65vw !important;
    /* Forzamos para sobreescribir los 420px */
    padding-right: 0;
    padding-bottom: 0;
    display: flex;
    justify-content: center;
    align-items: center;
    text-align: center;
    gap: 20px;
  }

  .intro-play-side {
    transform: none;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 25px;
  }

  .intro-cta-phrase {
    font-size: 26px;
    max-width: 280px;
    text-align: center;
    margin: 0;
  }

  .intro-cta-subtitle {
    font-size: 13px;
    text-align: center;
  }

  .play-pulse-btn {
    width: 75px;
    height: 75px;
  }

  .play-pulse-btn .main-play-icon {
    width: 30px;
    height: 30px;
  }
}

@media (max-width: 900px) {
  .intro-content-wrapper {
    flex-direction: column;
    justify-content: center;
    text-align: center;
    gap: 30px;
    padding: 20px;
  }

  .intro-play-side {
    gap: 20px;
  }

  /* Portrait mobile: center and push up slightly */
  @media (orientation: portrait) {
    .intro-content-wrapper {
      justify-content: flex-start;
      padding-top: 10vh;
    }

    .intro-cta-phrase {
      font-size: 28px;
      max-width: 260px;
    }
  }
}

/* Custom properties matching Synapse Corporate Identity */
:root {
  /* Colors */
  --synapse-pink: #BA2D74;
  --synapse-dark: #333333;
  --glass-bg: rgba(255, 255, 255, 0.65);
  --glass-border: rgba(255, 255, 255, 0.8);
  --glass-shadow: 0 8px 32px rgba(0, 0, 0, 0.08);

  /* Performance & Transitions */
  --transition-fast: 0.2s ease;
  --transition-normal: 0.3s ease;
  --transition-slow: 0.5s cubic-bezier(0.2, 0.8, 0.2, 1);
  --transition-spring: 0.6s cubic-bezier(0.34, 1.56, 0.64, 1);

  /* Z-Index Layers */
  --z-base: 1;
  --z-slides: 2;
  --z-content: 5;
  --z-intro: 50;
  --z-ui: 60;
  --z-curtain: 100;
  --z-preloader: 9999;
  --z-warning: 10000;
}

* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

body {
  font-family: 'Outfit', sans-serif;
  background-color: #000;
  /* Dark background before video loads */
  color: var(--synapse-dark);
  overflow: hidden;
  /* Prevent scrolling for immersive full-screen experience */
  width: 100vw;
  height: 100vh;
}

/* Brand positioning inside player */
.brand-container {
  margin-bottom: 12px;
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.contact-toggle {
  background: var(--synapse-pink) !important;
  color: white !important;
  box-shadow: 0 4px 15px rgba(186, 45, 116, 0.3);
  width: 48px;
  height: 48px;
}

.contact-toggle:hover {
  transform: scale(1.18) rotate(5deg);
  box-shadow: 0 8px 20px rgba(186, 45, 116, 0.5);
}

.sidebar-footer {
  margin-top: auto;
  padding-top: 20px;
  border-top: 2px solid rgba(0, 0, 0, 0.08);
  display: flex;
  justify-content: flex-end;
}

/* --- Contact Modal --- */
.modal-overlay {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(0, 0, 0, 0.4);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  z-index: var(--z-warning);
  display: flex;
  justify-content: center;
  align-items: center;
  opacity: 0;
  visibility: hidden;
  transition: all 0.4s ease;
}

.modal-overlay.active {
  opacity: 1;
  visibility: visible;
}

.modal-card {
  background: white;
  width: 90%;
  max-width: 450px;
  border-radius: 20px;
  padding: 40px;
  position: relative;
  box-shadow: 0 20px 50px rgba(0, 0, 0, 0.2);
  transform: translateY(20px);
  transition: transform 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

.modal-overlay.active .modal-card {
  transform: translateY(0);
}

.modal-close {
  position: absolute;
  top: 15px;
  right: 15px;
  background: none;
  border: none;
  font-size: 24px;
  cursor: pointer;
  color: #999;
  transition: color 0.2s;
}

.modal-close:hover {
  color: var(--synapse-pink);
}

.modal-header h2 {
  font-size: 28px;
  color: var(--synapse-pink);
  margin-bottom: 5px;
}

.modal-header p {
  font-size: 14px;
  color: #666;
  line-height: 1.4;
}

.modal-body {
  margin: 30px 0;
  display: flex;
  flex-direction: column;
  gap: 20px;
}

.contact-info-item {
  display: flex;
  align-items: center;
  gap: 15px;
  color: var(--synapse-dark);
}

.contact-info-item svg {
  width: 20px;
  height: 20px;
  fill: var(--synapse-pink);
  flex-shrink: 0;
}

.contact-info-item span,
.contact-info-item a {
  font-weight: 500;
  font-size: 15px;
  color: inherit;
  text-decoration: none;
  transition: color 0.2s;
}

.contact-info-item a:hover {
  color: var(--synapse-pink);
}

.modal-cta {
  display: block;
  width: 100%;
  background: var(--synapse-pink);
  color: white;
  text-align: center;
  padding: 15px;
  border-radius: 12px;
  text-decoration: none;
  font-weight: 600;
  transition: all 0.3s ease;
  box-shadow: 0 5px 15px rgba(186, 45, 116, 0.3);
}

.modal-cta:hover {
  transform: translateY(-2px);
  box-shadow: 0 8px 20px rgba(186, 45, 116, 0.5);
}

.player-logo {
  width: 180px;
  height: auto;
  opacity: 0.9;
}


/* Slider Container full size */
.slider-container {
  position: absolute;
  top: 0;
  left: 0;
  width: 100vw;
  height: 100vh;
  z-index: var(--z-base);
}

.slide {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  opacity: 0;
  background: #000;
  overflow: hidden;
  /* Evitar que el desenfoque se salga */
  /* Smooth crossfade and slight zoom out effect for premium feel */
  transition: opacity 1s ease-in-out, transform 1.2s ease-out;
  transform: scale(1.03);
  pointer-events: none;
  will-change: opacity, transform;
}

.slide.active {
  opacity: 1;
  transform: scale(1);
  pointer-events: auto;
  z-index: var(--z-slides);
}

.slide .ambient-canvas {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  filter: blur(100px) brightness(2);
  /* Mayor desenfoque para suavizar el pixelado del canvas */
  opacity: 0.8;
  z-index: var(--z-base);
  pointer-events: none;
  will-change: filter;
}

.slide video.video-main {
  position: relative;
  width: 100%;
  height: 100%;
  object-fit: contain;
  /* Asegura que el vídeo se vea completo sin cortes */
  z-index: var(--z-slides);
  box-shadow: 0 0 50px rgba(0, 0, 0, 0.5);
  /* Sombra para separar del fondo */
}

/* Glass Overlay Container - vertical sidebar on the left */
.glass-overlay {
  position: absolute;
  top: 40px;
  bottom: 40px;
  left: -200px;
  /* Buffer de seguridad para el rebote */
  z-index: var(--z-ui);
  display: flex;
  flex-direction: column;
  width: 620px;
  /* Reverted to 420px visible + 200px buffer for desktop */
  transition: opacity 0.5s ease, transform var(--transition-spring);
  will-change: transform, opacity;
}

/* Ocultar parcialmente mientras se reproduce el vídeo */
.glass-overlay.playing {
  opacity: 0.65;
  transform: translateX(-380px);
  /* Leaves only 40px visible on desktop */
}

/* Solo aplicamos hover en dispositivos que lo soporten (Desktop), 
   en móviles el toque no debe dejar la lengüeta abierta */
@media (hover: hover) {
  .glass-overlay.playing:hover {
    opacity: 1;
    transform: translateX(0);
  }
}



/* Specific Glass Design requested by user:
   "Cristal extra-claro con títulos negros y texto Ink Black, sombra gris sutil." */
.glass-card {
  background: var(--glass-bg);
  backdrop-filter: blur(24px);
  -webkit-backdrop-filter: blur(24px);
  border: 1px solid var(--glass-border);
  border-left: none;
  /* Pegado al borde para efecto lengüeta */
  border-radius: 0 20px 20px 0;
  box-shadow: var(--glass-shadow);
  padding: 30px 30px 30px 230px;
  /* 30px padding original + 200px buffer */
}

.glass-card {
  height: 100%;
  width: 100%;
  display: flex;
  flex-direction: column;
  /* Revert to column for desktop fixed-width sidebar */
  padding: 30px 30px 30px 230px;
  /* Original padding */
}

/* Indicador de acción (CTA) para el botón play inicial */
#play-btn.cta-pulse {
  animation: ctaPulse 2s infinite;
  background: var(--synapse-pink);
  color: #fff;
}

#play-btn.cta-pulse svg {
  fill: #fff;
}

@keyframes ctaPulse {
  0% {
    box-shadow: 0 0 0 0 rgba(186, 45, 116, 0.7);
  }

  70% {
    box-shadow: 0 0 0 15px rgba(186, 45, 116, 0);
  }

  100% {
    box-shadow: 0 0 0 0 rgba(186, 45, 116, 0);
  }
}



.sidebar-handle {
  position: absolute;
  top: 50%;
  right: 0;
  transform: translateY(-50%);
  width: 30px;
  height: 80px;
  background: transparent;
  border: none;
  cursor: pointer;
  display: flex;
  justify-content: center;
  align-items: center;
  padding: 0;
  z-index: 10;
  transition: all var(--transition-normal);
}

.handle-arrow {
  width: 48px;
  /* Doble de grande */
  height: 48px;
  fill: var(--synapse-pink);
  opacity: 0.6;
  transition: all var(--transition-spring);
  filter: drop-shadow(0 0 8px rgba(255, 30, 86, 0.3));
  will-change: transform, opacity;
}

.sidebar-handle:hover .handle-arrow {
  opacity: 1;
  transform: scale(1.2);
  filter: drop-shadow(0 0 8px rgba(255, 30, 86, 0.5));
}

/* Rotación de la flecha: Por defecto (abierto) mira a la izquierda. 
   Cuando está oculto (.playing), mira a la derecha para indicar 'abrir' */
.glass-overlay.playing .handle-arrow {
  transform: rotate(180deg);
  opacity: 0.8;
  animation: bounceArrow 2s infinite ease-in-out;
}

.glass-overlay.playing:hover .handle-arrow {
  transform: rotate(0deg) scale(1.1);
  /* Apunta a la izquierda cuando se despliega por hover */
  animation: none;
  opacity: 1;
}

@keyframes bounceArrow {

  0%,
  100% {
    transform: rotate(180deg) translateX(0);
  }

  50% {
    transform: rotate(180deg) translateX(-5px);
  }
}

/* Ocultamos el tirador en portrait ya que el despliegue es vertical */
@media (max-width: 900px) and (orientation: portrait) {
  .sidebar-handle {
    display: none;
  }
}


.glass-card h1 {
  font-size: 28px;
  font-weight: 700;
  margin-bottom: 12px;
  color: #000;
  line-height: 1.2;
}

.glass-card p {
  font-size: 16px;
  color: rgba(0, 0, 0, 0.7);
  line-height: 1.5;
  font-weight: 400;
}

.index-badge {
  font-weight: 700;
  font-size: 18px;
  margin-bottom: 8px;
  margin-top: 20px;
  color: var(--synapse-pink);
}

.total-badge {
  color: #666;
  font-weight: 500;
}

/* Player Controls inside glass card */
.player-controls {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-top: 8px;
  padding-top: 20px;
  border-top: 1px solid rgba(0, 0, 0, 0.05);
}

.icon-btn {
  background: rgba(255, 255, 255, 0.9);
  border: none;
  width: 48px;
  height: 48px;
  border-radius: 50%;
  display: flex;
  justify-content: center;
  align-items: center;
  cursor: pointer;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.06);
  transition: all var(--transition-fast);
  color: var(--synapse-pink);
}

.icon-btn:hover {
  transform: scale(1.1);
  background: linear-gradient(135deg, var(--synapse-pink), #e0448a);
  color: #fff;
  box-shadow: 0 6px 16px rgba(186, 45, 116, 0.4);
}

.icon-btn svg {
  width: 22px;
  height: 22px;
  fill: currentColor;
}

/* Progress bar */
.progress-bar-container {
  width: 100%;
  height: 10px;
  margin-bottom: 20px;
  background: rgba(0, 0, 0, 0.1);
  border-radius: 3px;
  cursor: pointer;
  position: relative;
  overflow: hidden;
  transition: height 0.2s ease;
}

.progress-bar-container:hover {
  height: 20px;
}

.progress-bar-fill {
  height: 100%;
  background: var(--synapse-pink);
  width: 0%;
  border-radius: 3px;
  transition: width 0.1s linear;
}

/* Playlist panel - fixed vertical list */
.playlist-expanded {
  margin-top: 24px;
  flex-grow: 1;
  overflow-y: auto;
  padding-right: 8px;
}

/* Manual active state not needed if always visible, but we keep the class for logic */
.playlist-expanded.active {
  max-height: none;
}

.playlist-item {
  display: flex;
  align-items: center;
  padding: 12px;
  border-radius: 12px;
  cursor: pointer;
  transition: all 0.2s;
  margin-bottom: 8px;
  font-weight: 500;
  font-size: 20px;
  color: rgba(0, 0, 0, 0.7);
}

.playlist-item:hover {
  background: rgba(255, 255, 255, 0.6);
  color: #000;
  transform: translateX(4px);
}

.playlist-item.active {
  background: #fff;
  color: var(--synapse-pink);
  box-shadow: 0 2px 10px rgba(0, 0, 0, 0.05);
}

.playlist-item-index {
  opacity: 0.5;
  margin-right: 12px;
  font-weight: 600;
  font-size: 13px;
}

/* Custom Scrollbar for playlist */
.playlist-expanded::-webkit-scrollbar {
  width: 6px;
}

.playlist-expanded::-webkit-scrollbar-track {
  background: transparent;
}

.playlist-expanded::-webkit-scrollbar-thumb {
  background: rgba(0, 0, 0, 0.15);
  border-radius: 10px;
}

.playlist-expanded::-webkit-scrollbar-thumb:hover {
  background: rgba(0, 0, 0, 0.3);
}

/* Responsive adjustments */
@media (max-width: 1024px) and (orientation: landscape) {
  .glass-overlay {
    top: 20px;
    bottom: 20px;
    left: -200px;
    width: calc(65vw + 200px);
  }

  .glass-overlay.playing {
    transform: translateX(calc(-65vw + 40px));
  }

  .glass-card {
    padding: 15px 25px 15px 225px;
    display: grid;
    grid-template-columns: 2fr 3fr;
    grid-template-rows: auto auto auto auto 1fr auto;
    column-gap: 10px;
    row-gap: 0;
    align-items: start;
  }

  .brand-container {
    grid-column: 1;
    grid-row: 1;
  }

  #page-description {
    grid-column: 1;
    grid-row: 2;
    font-size: 13px;
    margin-bottom: 10px;
    opacity: 0.8;
  }

  .index-badge {
    grid-column: 1;
    grid-row: 3;
    margin-top: 0;
    margin-bottom: 0;
  }

  #video-title {
    grid-column: 1;
    grid-row: 4;
    margin-top: 5px;
  }

  .player-controls {
    grid-column: 1;
    grid-row: 5;
    margin-top: auto;
    padding-top: 10px;
    border-top: 1px solid rgba(0, 0, 0, 0.05);
    justify-content: flex-start;
  }

  .progress-bar-container {
    grid-column: 1;
    grid-row: 6;
  }

  #playlist-container {
    grid-column: 2;
    grid-row: 1 / span 5;
    /* Ocupa hasta la fila 5 */
    margin-top: 0;
    height: 100%;
    padding-left: 20px;
    display: flex;
    flex-direction: column;
  }

  .sidebar-footer {
    grid-column: 2;
    grid-row: 6;
    /* Se coloca en la fila 6, después de la playlist */
    margin-top: 0;
    padding-top: 10px;
    padding-left: 20px;
    border-top: 1px solid rgba(0, 0, 0, 0.05);
    justify-content: flex-end;
  }

  .playlist-expanded {
    max-height: calc(100vh - 120px);
    /* Ajustado para dejar espacio al footer */
    padding-right: 5px;
  }

  .icon-btn {
    width: 38px;
    height: 38px;
  }

  .icon-btn svg {
    width: 18px;
    height: 18px;
  }
}

/* Fix for very small landscape screens (like iPhone SE/8) */
@media (max-height: 500px) and (orientation: landscape) {
  .glass-overlay {
    top: 10px;
    bottom: 10px;
  }

  .glass-card {
    padding: 10px 20px 10px 215px;
    /* Tighter padding */
    row-gap: 4px;
  }

  .player-logo {
    width: 120px;
    /* Smaller logo */
  }

  .brand-container {
    margin-bottom: 8px;
  }

  .glass-card h1 {
    font-size: 20px;
    margin-bottom: 4px;
  }

  .index-badge {
    margin-top: 4px;
    font-size: 14px;
  }

  .player-controls {
    margin-top: 4px;
    padding-top: 4px;
    gap: 8px;
  }

  .playlist-item {
    padding: 6px 10px;
    font-size: 14px;
    margin-bottom: 4px;
  }

  .sidebar-footer {
    padding-top: 6px;
  }

  .contact-toggle {
    width: 36px;
    height: 36px;
  }

  .contact-toggle svg {
    width: 18px;
    height: 18px;
  }

  .playlist-expanded {
    max-height: calc(100% - 60px);
    /* Leave space for footer */
  }

  .progress-bar-container {
    height: 6px;
    margin-bottom: 5px;
  }
}

@media (max-width: 900px) and (orientation: portrait) {
  .glass-overlay {
    top: auto;
    bottom: 30px;
    left: 20px;
    right: 20px;
    width: auto;
    height: auto;
    transform: none;
    transition: transform 0.6s cubic-bezier(0.34, 1.56, 0.64, 1), opacity 0.5s ease;
  }

  .glass-overlay.playing {
    transform: translateY(calc(100% - 60px));
    /* En vertical asoma por abajo de forma sutil */
    opacity: 0.8;
  }

  @media (hover: hover) {
    .glass-overlay.playing:hover {
      transform: translateY(0);
      opacity: 1;
    }
  }

  .glass-card {
    height: auto;
    padding: 24px;
    max-width: 100%;
    border-radius: 20px;
    border-left: 1px solid var(--glass-border);
  }

  .playlist-expanded {
    max-height: 180px;
  }
}

@media (max-width: 600px) {
  #page-description {
    font-size: 14px;
    margin-bottom: 15px;
  }
}

/* --- Orientation Warning System --- */
.orientation-warning {
  position: fixed;
  top: 0;
  left: 0;
  width: 100vw;
  height: 100vh;
  z-index: var(--z-warning);
  /* Higher than preloader (9999) to be visible immediately */
  background: #fff;
  /* Fondo claro corporativo */
  display: flex;
  justify-content: center;
  align-items: center;
  flex-direction: column;
  color: var(--synapse-dark);
  /* Texto oscuro para legibilidad */
  text-align: center;
  padding: 40px;
  visibility: hidden;
  opacity: 0;
  transition: opacity var(--transition-slow);
  will-change: opacity, visibility;
}

.warning-content {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 35px;
  background: rgba(255, 255, 255, 0.8);
  padding: 40px;
  border-radius: 30px;
  box-shadow: 0 15px 45px rgba(0, 0, 0, 0.05);
  /* Sombra suave premium */
}

.phone-icon {
  width: 60px;
  height: 60px;
  fill: var(--synapse-pink);
  animation: rotatePhone 2.5s infinite ease-in-out;
}

.orientation-warning p {
  font-size: 18px;
  font-weight: 500;
  color: var(--synapse-dark);
  max-width: 280px;
  line-height: 1.5;
  margin: 0;
}

@keyframes rotatePhone {
  0% {
    transform: rotate(0deg);
  }

  35% {
    transform: rotate(-90deg);
  }

  65% {
    transform: rotate(-90deg);
  }

  100% {
    transform: rotate(0deg);
  }
}

/* Solo se activa en dispositivos móviles en VERTICAL */
@media (max-width: 1024px) and (orientation: portrait) {
  .orientation-warning {
    visibility: visible;
    opacity: 1;
  }
}