@import './tokens.css';

/* ==========================================================================
   RESET Y ESTILOS BASE
   ========================================================================== */
*, *::before, *::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

html {
  scroll-behavior: smooth;
  color-scheme: dark;
}

body {
  background-color: var(--color-background);
  color: var(--color-foreground);
  font-family: var(--font-sans);
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  overflow-x: hidden;
  min-height: 100vh;
}

img, video {
  max-width: 100%;
  height: auto;
  display: block;
}

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

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

/* ==========================================================================
   SCROLLBAR PERSONALIZADA
   ========================================================================== */
::-webkit-scrollbar {
  width: 10px;
}

::-webkit-scrollbar-track {
  background: var(--color-background);
}

::-webkit-scrollbar-thumb {
  background: var(--color-border);
  border-radius: 8px;
}

::-webkit-scrollbar-thumb:hover {
  background: hsla(var(--primary) / 0.5);
}

/* ==========================================================================
   LAYOUT Y CONTENEDORES
   ========================================================================== */
.container {
  width: 100%;
  max-width: 1280px;
  margin-left: auto;
  margin-right: auto;
  padding-left: 1.25rem;
  padding-right: 1.25rem;
}

@media (min-width: 768px) {
  .container {
    padding-left: 2rem;
    padding-right: 2rem;
  }
}

.section {
  padding: 5rem 0;
  position: relative;
}

@media (min-width: 768px) {
  .section {
    padding: 7rem 0;
  }
}

.section-muted {
  background-color: hsla(var(--muted) / 0.3);
}

.text-center {
  text-align: center;
}

/* ==========================================================================
   EFECTOS GLASSMORPHISM
   ========================================================================== */
.glass {
  background-color: hsla(var(--background) / 0.7);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  border: 1px solid hsla(var(--border) / 0.35);
}

.glass-primary {
  background-color: hsla(var(--primary) / 0.1);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  border: 1px solid hsla(var(--primary) / 0.25);
}

/* ==========================================================================
   TIPOGRAFÍA
   ========================================================================== */
h1, h2, h3, h4 {
  color: var(--color-foreground);
  font-weight: 700;
  line-height: 1.2;
}

.title-hero {
  font-size: 2.25rem;
  font-weight: 800;
  letter-spacing: -0.02em;
  margin-bottom: 1.5rem;
}

@media (min-width: 768px) {
  .title-hero {
    font-size: 3.75rem;
  }
}

@media (min-width: 1024px) {
  .title-hero {
    font-size: 4.5rem;
  }
}

.title-section {
  font-size: 2rem;
  font-weight: 700;
  letter-spacing: -0.01em;
  margin-bottom: 1rem;
}

@media (min-width: 768px) {
  .title-section {
    font-size: 2.75rem;
  }
}

.subtitle-hero {
  font-size: 1.25rem;
  color: rgba(255, 255, 255, 0.9);
  max-width: 42rem;
  margin-left: auto;
  margin-right: auto;
  margin-bottom: 2rem;
}

@media (min-width: 768px) {
  .subtitle-hero {
    font-size: 1.5rem;
  }
}

.text-lead {
  font-size: 1.125rem;
  color: hsla(var(--foreground) / 0.82);
  line-height: 1.7;
}

.text-muted {
  color: var(--color-muted-foreground);
}

/* ==========================================================================
   BOTONES
   ========================================================================== */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.75rem;
  padding: 1rem 2rem;
  font-size: 1rem;
  font-weight: 600;
  border-radius: var(--radius);
  transition: all 0.25s cubic-bezier(0.16, 1, 0.3, 1);
  text-decoration: none;
  cursor: pointer;
  border: none;
}

.btn-primary {
  background-color: var(--color-primary);
  color: #ffffff;
  box-shadow: var(--shadow-primary);
}

.btn-primary:hover {
  background-color: var(--color-primary-hover);
  transform: translateY(-2px);
  box-shadow: 0 14px 28px -4px hsla(var(--primary) / 0.6);
}

.btn-primary:active {
  transform: translateY(0);
}

/* ==========================================================================
   NAVBAR
   ========================================================================== */
.navbar {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 50;
  padding: 1.5rem 0;
  transition: all 0.3s ease;
  background-color: transparent;
}

.navbar.scrolled {
  padding: 1rem 0;
  background-color: hsla(var(--background) / 0.85);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  border-bottom: 1px solid hsla(var(--border) / 0.4);
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.3);
}

.navbar-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.navbar-brand {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  transition: opacity 0.2s ease;
}

.navbar-brand:hover {
  opacity: 0.85;
}

.navbar-logo {
  height: 2.25rem;
  width: auto;
}

@media (min-width: 768px) {
  .navbar-logo {
    height: 2.6rem;
  }
}

.navbar-nav {
  display: none;
  align-items: center;
  gap: 2rem;
}

@media (min-width: 768px) {
  .navbar-nav {
    display: flex;
  }
}

.nav-link {
  color: hsla(var(--foreground) / 0.8);
  font-weight: 500;
  font-size: 0.95rem;
  transition: color 0.2s ease;
  position: relative;
}

.nav-link:hover {
  color: var(--color-primary);
}

/* ==========================================================================
   HERO SECTION
   ========================================================================== */
.hero-section {
  position: relative;
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
  padding: 6rem 0;
}

.hero-video-bg {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  z-index: 1;
}

.hero-overlay {
  position: absolute;
  inset: 0;
  background-color: rgba(0, 0, 0, 0.75);
  z-index: 2;
}

.hero-content {
  position: relative;
  z-index: 10;
  text-align: center;
  max-width: 900px;
  margin: 0 auto;
}

.hero-logo {
  height: 5rem;
  width: auto;
  margin: 0 auto 2rem auto;
}

@media (min-width: 768px) {
  .hero-logo {
    height: 7.5rem;
  }
}

.scroll-indicator {
  position: absolute;
  bottom: 2rem;
  left: 50%;
  transform: translateX(-50%);
  z-index: 10;
  animation: bounce 2s infinite;
}

.scroll-mouse {
  width: 1.5rem;
  height: 2.5rem;
  border: 2px solid rgba(255, 255, 255, 0.5);
  border-radius: 9999px;
  display: flex;
  justify-content: center;
  padding-top: 0.5rem;
}

.scroll-wheel {
  width: 0.375rem;
  height: 0.75rem;
  background-color: rgba(255, 255, 255, 0.6);
  border-radius: 9999px;
}

@keyframes bounce {
  0%, 20%, 50%, 80%, 100% {
    transform: translate(-50%, 0);
  }
  40% {
    transform: translate(-50%, -12px);
  }
  60% {
    transform: translate(-50%, -6px);
  }
}

/* ==========================================================================
   CORTO CONCEPTUAL
   ========================================================================== */
.conceptual-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 3rem;
  align-items: center;
}

@media (min-width: 768px) {
  .conceptual-grid {
    grid-template-columns: 1fr 1fr;
    gap: 3.5rem;
  }
}

.video-card-wrapper {
  position: relative;
  cursor: pointer;
  border-radius: var(--radius);
  overflow: hidden;
}

.video-card {
  position: relative;
  aspect-ratio: 16 / 9;
  border-radius: var(--radius);
  overflow: hidden;
  background-color: #000000;
  box-shadow: var(--shadow-card);
}

.video-card video {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.video-card-overlay {
  position: absolute;
  inset: 0;
  background-color: rgba(0, 0, 0, 0.4);
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background-color 0.3s ease;
}

.video-card-wrapper:hover .video-card-overlay {
  background-color: rgba(0, 0, 0, 0.28);
}

.play-circle-btn {
  width: 4.75rem;
  height: 4.75rem;
  background-color: hsla(var(--primary) / 0.9);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: var(--shadow-primary);
  transition: transform 0.25s cubic-bezier(0.16, 1, 0.3, 1);
  color: #ffffff;
}

.video-card-wrapper:hover .play-circle-btn {
  transform: scale(1.1);
  background-color: var(--color-primary-hover);
}

.video-card-label {
  text-align: center;
  margin-top: 1rem;
  color: var(--color-muted-foreground);
  font-size: 0.95rem;
}

/* ==========================================================================
   SECCIÓN HISTORIA
   ========================================================================== */
.story-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 3rem;
  align-items: center;
}

@media (min-width: 768px) {
  .story-grid {
    grid-template-columns: 2fr 3fr;
    gap: 3.5rem;
  }
}

.story-card-image {
  border-radius: var(--radius);
  overflow: hidden;
  box-shadow: var(--shadow-card);
}

.story-card-image img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.4s ease;
}

.story-card-image:hover img {
  transform: scale(1.02);
}

.story-content {
  display: flex;
  flex-direction: column;
  gap: 1.5rem;
  align-items: flex-start;
}

/* ==========================================================================
   SECCIÓN PLAYLIST
   ========================================================================== */
.playlist-header {
  text-align: center;
  margin-bottom: 3.5rem;
}

.playlist-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 1.5rem;
}

@media (min-width: 768px) {
  .playlist-grid {
    grid-template-columns: repeat(2, 1fr);
  }
}

@media (min-width: 1024px) {
  .playlist-grid {
    grid-template-columns: repeat(3, 1fr);
  }
}

.track-card {
  border-radius: var(--radius);
  padding: 1.5rem;
  display: flex;
  flex-direction: column;
  gap: 1.25rem;
  transition: border-color 0.25s ease, transform 0.25s ease;
}

.track-card:hover {
  border-color: hsla(var(--primary) / 0.35);
  transform: translateY(-2px);
}

.track-header {
  display: flex;
  align-items: flex-start;
  gap: 1rem;
}

.track-id {
  flex-shrink: 0;
  width: 3rem;
  height: 3rem;
  border-radius: 50%;
  background-color: hsla(var(--primary) / 0.18);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.25rem;
  font-weight: 700;
  color: var(--color-primary);
}

.track-info {
  flex: 1;
}

.track-title {
  font-size: 1.125rem;
  font-weight: 600;
  margin-bottom: 0.25rem;
}

.track-status {
  display: none;
  align-items: center;
  gap: 0.5rem;
  color: var(--color-primary);
  font-size: 0.85rem;
  font-weight: 500;
}

.track-status.is-playing {
  display: flex;
}

/* Ecualizador animado */
.equalizer-bars {
  display: flex;
  gap: 3px;
  align-items: flex-end;
  height: 14px;
}

.equalizer-bar {
  width: 3px;
  background-color: var(--color-primary);
  border-radius: 2px;
  animation: equalize 1s infinite alternate ease-in-out;
}

.equalizer-bar:nth-child(1) { height: 60%; animation-delay: 0.1s; }
.equalizer-bar:nth-child(2) { height: 100%; animation-delay: 0.3s; }
.equalizer-bar:nth-child(3) { height: 40%; animation-delay: 0.2s; }

@keyframes equalize {
  0% { transform: scaleY(0.3); }
  100% { transform: scaleY(1); }
}

/* ==========================================================================
   REPRODUCTOR DE AUDIO PERSONALIZADO
   ========================================================================== */
.audio-player {
  width: 100%;
}

.player-controls {
  display: flex;
  align-items: center;
  gap: 1rem;
}

.player-btn-play {
  flex-shrink: 0;
  width: 3rem;
  height: 3rem;
  border-radius: 50%;
  background-color: var(--color-primary);
  color: #ffffff;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background-color 0.2s ease, transform 0.15s ease;
}

.player-btn-play:hover {
  background-color: var(--color-primary-hover);
  transform: scale(1.05);
}

.player-progress-area {
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
}

.player-time-display {
  display: flex;
  justify-content: space-between;
  font-size: 0.75rem;
  color: var(--color-muted-foreground);
  font-variant-numeric: tabular-nums;
}

/* Estilos de input range para seek y volumen */
.custom-range {
  -webkit-appearance: none;
  appearance: none;
  width: 100%;
  height: 6px;
  background-color: hsla(var(--muted) / 0.8);
  border-radius: 8px;
  outline: none;
  cursor: pointer;
  transition: background-color 0.2s ease;
}

.custom-range::-webkit-slider-thumb {
  -webkit-appearance: none;
  appearance: none;
  width: 14px;
  height: 14px;
  border-radius: 50%;
  background-color: var(--color-primary);
  cursor: pointer;
  transition: transform 0.15s ease, background-color 0.2s;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.4);
}

.custom-range::-moz-range-thumb {
  width: 14px;
  height: 14px;
  border-radius: 50%;
  background-color: var(--color-primary);
  border: none;
  cursor: pointer;
  transition: transform 0.15s ease;
}

.custom-range:hover::-webkit-slider-thumb {
  transform: scale(1.2);
  background-color: var(--color-primary-hover);
}

.player-volume-control {
  display: none;
  align-items: center;
  gap: 0.5rem;
  width: 7.5rem;
}

@media (min-width: 768px) {
  .player-volume-control {
    display: flex;
  }
}

.volume-icon {
  color: var(--color-muted-foreground);
  flex-shrink: 0;
}

/* ==========================================================================
   SECCIÓN PROYECTO
   ========================================================================== */
.project-card-center {
  max-width: 48rem;
  margin: 0 auto;
  text-align: center;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 1.75rem;
}

.project-icon-badge {
  width: 5.5rem;
  height: 5.5rem;
  border-radius: 50%;
  background-color: hsla(var(--primary) / 0.18);
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--color-primary);
  margin-bottom: 0.5rem;
}

/* ==========================================================================
   FOOTER
   ========================================================================== */
.footer {
  background-color: var(--color-background);
  border-top: 1px solid var(--color-border);
  padding: 3.5rem 0;
}

.footer-content {
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  gap: 1.5rem;
}

.footer-logo {
  height: 3rem;
  width: auto;
}

.footer-credits {
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
  color: hsla(var(--foreground) / 0.8);
}

.footer-credits strong {
  color: var(--color-foreground);
}

.footer-copy {
  font-size: 0.875rem;
  color: var(--color-muted-foreground);
}

/* ==========================================================================
   MODALES
   ========================================================================== */
.modal-overlay {
  position: fixed;
  inset: 0;
  z-index: 100;
  display: flex;
  align-items: center;
  justify-content: center;
  background-color: rgba(0, 0, 0, 0.92);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  padding: 1.25rem;
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.3s ease, visibility 0.3s ease;
}

.modal-overlay.active {
  opacity: 1;
  visibility: visible;
}

.modal-container {
  position: relative;
  width: 100%;
  border-radius: var(--radius);
  transform: scale(0.92);
  transition: transform 0.3s cubic-bezier(0.16, 1, 0.3, 1);
}

.modal-overlay.active .modal-container {
  transform: scale(1);
}

.modal-video-container {
  max-width: 64rem;
}

.modal-story-container {
  max-width: 56rem;
  max-height: 90vh;
  display: flex;
  flex-direction: column;
  background-color: hsla(var(--background) / 0.8);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border: 1px solid hsla(var(--border) / 0.4);
  overflow: hidden;
}

.modal-close-btn {
  position: absolute;
  top: -3rem;
  right: 0;
  color: #ffffff;
  background: none;
  border: none;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: color 0.2s ease, transform 0.2s ease;
  z-index: 110;
}

.modal-close-btn:hover {
  color: var(--color-primary);
  transform: scale(1.1);
}

.modal-video-wrapper {
  aspect-ratio: 16 / 9;
  background-color: #000000;
  border-radius: var(--radius);
  overflow: hidden;
  box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.7);
}

.modal-video-wrapper video {
  width: 100%;
  height: 100%;
  display: block;
}

.modal-story-body {
  flex: 1;
  overflow-y: auto;
  padding: 2rem 1.5rem;
}

@media (min-width: 768px) {
  .modal-story-body {
    padding: 3rem 3.5rem;
  }
}

.story-text-container {
  max-width: 48rem;
  margin: 0 auto;
}

.story-text-container p {
  margin-bottom: 1.5rem;
  font-size: 1.125rem;
  line-height: 1.8;
  color: hsla(var(--foreground) / 0.9);
}

.modal-story-footer {
  padding: 1.25rem 1.5rem;
  background-color: hsla(var(--background) / 0.9);
  border-top: 1px solid hsla(var(--border) / 0.35);
}

@media (min-width: 768px) {
  .modal-story-footer {
    padding: 1.5rem 3rem;
  }
}

/* ==========================================================================
   ANIMACIONES DE SCROLL (REVEAL)
   ========================================================================== */
.reveal {
  opacity: 0;
  transform: translateY(30px);
  transition: opacity 0.7s cubic-bezier(0.16, 1, 0.3, 1), transform 0.7s cubic-bezier(0.16, 1, 0.3, 1);
}

.reveal-left {
  opacity: 0;
  transform: translateX(-40px);
  transition: opacity 0.7s cubic-bezier(0.16, 1, 0.3, 1), transform 0.7s cubic-bezier(0.16, 1, 0.3, 1);
}

.reveal-right {
  opacity: 0;
  transform: translateX(40px);
  transition: opacity 0.7s cubic-bezier(0.16, 1, 0.3, 1), transform 0.7s cubic-bezier(0.16, 1, 0.3, 1);
}

.reveal.active,
.reveal-left.active,
.reveal-right.active {
  opacity: 1;
  transform: translate(0, 0);
}
