/* ==========================================================================
   CSS ESTILOS: CARRUSEL DE CURSOS UNIVERSIDAD DE CHILE (ESTILO MODERNO SHADCN)
   TEMA CLARO / FONDO BLANCO CON IMAGEN INSTITUCIONAL
   ========================================================================== */

/* Variables de Diseño e Identidad (Tema Claro) */
:root {
  --font-family: 'Inter', system-ui, -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, Cantarell, sans-serif;
  
  /* Paleta U. de Chile */
  --primary-blue: #003B7C;       /* Azul Escudo Oficial */
  --light-blue: #1F5592;         /* Azul Secundario / Pantone 287c */
  --accent-gold: #C5A028;        /* Amarillo Oro oscuro para legibilidad */
  --accent-gold-light: #F7CE65;  /* Amarillo Oro original */
  
  /* Colores de Fondo y UI (Modern Light Theme) */
  --bg-light: #ffffff;
  --bg-light-accent: #f8fafc;    /* Gris azulado muy claro */
  --border-glass: rgba(0, 59, 124, 0.1);
  --border-glass-active: rgba(31, 85, 146, 0.45);
  
  /* Colores de Texto */
  --text-dark: #0f172a;          /* Slate 900 */
  --text-muted: #475569;         /* Slate 600 */
  --text-white: #ffffff;
  
  /* Sombras y Efectos */
  --shadow-lg: 0 10px 30px -5px rgba(0, 59, 124, 0.12), 0 8px 12px -6px rgba(0, 59, 124, 0.08);
  --shadow-glow: 0 0 25px rgba(31, 85, 146, 0.22);
  --shadow-glow-gold: 0 0 20px rgba(247, 206, 101, 0.35);
}

/* Reset y Base */
* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

body {
  font-family: var(--font-family);
  background-color: var(--bg-light);
  color: var(--text-dark);
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  overflow-x: hidden;
  
  /* Imagen de fondo (Casa Central) con un degradado blanco semi-transparente superpuesto */
  background-image: 
    linear-gradient(rgba(255, 255, 255, 0.93), rgba(255, 255, 255, 0.93)),
    url('img/casa_central.jpeg');
  background-size: cover;
  background-position: center;
  background-attachment: fixed;
}

/* Grid decorativo de fondo */
body::before {
  content: "";
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background-image: radial-gradient(rgba(0, 59, 124, 0.04) 1.5px, transparent 1.5px);
  background-size: 32px 32px;
  pointer-events: none;
  z-index: 0;
}

/* Contenedor Principal */
header, main, footer {
  position: relative;
  z-index: 1;
}

/* ==========================================================================
   HEADER / NAVEGACIÓN
   ========================================================================== */
header {
  border-bottom: 1px solid var(--border-glass);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  background-color: rgba(255, 255, 255, 0.85);
  position: sticky;
  top: 0;
}

.header-container {
  max-width: 1400px;
  margin: 0 auto;
  padding: 16px 24px;
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.logo-container {
  display: flex;
  align-items: center;
  gap: 14px;
}

/* Escudo estilizado minimalista de la U. de Chile */
.escudo-svg {
  width: 42px;
  height: 42px;
  filter: drop-shadow(0 2px 4px rgba(0, 59, 124, 0.15));
}

.logo-text {
  display: flex;
  flex-direction: column;
}

.logo-main {
  font-weight: 800;
  font-size: 16px;
  letter-spacing: 0.5px;
  color: var(--primary-blue);
  text-transform: uppercase;
  font-family: 'Timeless', Georgia, 'Times New Roman', Times, serif;
}

.logo-sub {
  font-weight: 500;
  font-size: 11px;
  letter-spacing: 2px;
  color: var(--accent-gold);
  text-transform: uppercase;
}

.header-tag {
  background: rgba(0, 59, 124, 0.04);
  border: 1px solid var(--border-glass);
  padding: 6px 14px;
  border-radius: 9999px;
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 0.5px;
  color: var(--primary-blue);
}

/* ==========================================================================
   SECCIÓN HÉROE / TITULAR
   ========================================================================== */
.hero-section {
  text-align: center;
  padding: 40px 24px 10px 24px;
  max-width: 800px;
  margin: 0 auto;
}

.badge-vti {
  display: inline-block;
  background: rgba(31, 85, 146, 0.08);
  border: 1px solid rgba(31, 85, 146, 0.2);
  color: var(--light-blue);
  font-size: 12px;
  font-weight: 700;
  padding: 6px 16px;
  border-radius: 9999px;
  margin-bottom: 16px;
  letter-spacing: 1.5px;
  text-transform: uppercase;
}

.hero-section h1 {
  font-size: 38px;
  font-weight: 800;
  letter-spacing: -0.5px;
  margin-bottom: 12px;
  background: linear-gradient(135deg, var(--primary-blue) 40%, var(--light-blue) 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
}

.hero-section p {
  color: var(--text-muted);
  font-size: 16px;
  line-height: 1.6;
}

/* ==========================================================================
   CARRUSEL (ESTILO SHADCN)
   ========================================================================== */
.carousel-wrapper {
  flex-grow: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px 24px 40px 24px;
  position: relative;
}

.carousel-container {
  width: 100%;
  max-width: 1200px;
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: center;
}

/* Track de las tarjetas */
.carousel-track {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 18px;
  width: 100%;
  height: 480px;
  position: relative;
  padding: 10px 0;
  cursor: grab;
  user-select: none;
  touch-action: pan-y;
  transition: transform 0.18s ease-out;
}

.carousel-track.dragging {
  cursor: grabbing;
  transition: none;
}

/* Tarjeta de Curso */
.course-card {
  position: relative;
  height: 440px;
  width: 110px; /* Ancho colapsado */
  border-radius: 20px;
  overflow: hidden;
  background-color: var(--bg-light-accent);
  border: 1px solid var(--border-glass);
  cursor: grab;
  display: flex;
  flex-direction: column;
  justify-content: flex-end;
  text-decoration: none;
  
  /* Transiciones fluidas */
  transition: 
    width 0.6s cubic-bezier(0.16, 1, 0.3, 1),
    opacity 0.6s cubic-bezier(0.16, 1, 0.3, 1),
    filter 0.6s cubic-bezier(0.16, 1, 0.3, 1),
    transform 0.6s cubic-bezier(0.16, 1, 0.3, 1),
    border-color 0.4s,
    box-shadow 0.4s;
    
  /* Estados iniciales (Inactiva) */
  opacity: 0.6;
  filter: grayscale(40%) blur(0.5px);
  box-shadow: var(--shadow-lg);
  pointer-events: none; /* Deshabilita clicks e interacción en tarjetas colapsadas */
}

.carousel-track.dragging .course-card {
  cursor: grabbing;
}

/* Hover general en tarjetas inactivas (sutil realce) */
.course-card:not(.active) {
  transform: translateY(0);
}

.carousel-track:hover .course-card:not(.active) {
  opacity: 0.45; /* Atenúa las demás cuando se interactúa */
}

/* Tarjeta Activa */
.course-card.active {
  width: 530px; /* Ancho expandido */
  opacity: 1;
  filter: grayscale(0%) blur(0);
  border-color: var(--border-glass-active);
  box-shadow: var(--shadow-lg), var(--shadow-glow);
  pointer-events: auto; /* Habilita clicks e interacciones */
  z-index: 10;
  transform: translateY(-8px);
}

/* Bloqueo en hover de tarjeta activa */
.course-card.active:hover {
  border-color: var(--primary-blue);
  box-shadow: var(--shadow-lg), var(--shadow-glow), var(--shadow-glow-gold);
  transform: translateY(-12px);
}

/* Imagen de fondo de la tarjeta */
.card-bg {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background-size: cover;
  background-position: center;
  transition: transform 0.8s cubic-bezier(0.16, 1, 0.3, 1);
  z-index: 1;
}

.course-card.active:hover .card-bg {
  transform: scale(1.05); /* Zoom sutil en hover */
}

/* Superposición de degradado para legibilidad del texto en las tarjetas (mantiene interior oscuro) */
.card-overlay {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: linear-gradient(
    to top,
    rgba(3, 10, 22, 0.95) 0%,
    rgba(3, 10, 22, 0.7) 40%,
    rgba(3, 10, 22, 0.2) 75%,
    rgba(3, 10, 22, 0) 100%
  );
  z-index: 2;
  transition: opacity 0.5s;
}

.course-card.active .card-overlay {
  background: linear-gradient(
    to top,
    rgba(0, 45, 114, 0.96) 0%,  /* Mezcla azul U. de Chile en la activa */
    rgba(3, 10, 22, 0.78) 45%,
    rgba(3, 10, 22, 0.2) 75%,
    rgba(3, 10, 22, 0.0) 100%
  );
}

/* ==========================================================================
   CONTENIDO DE LA TARJETA
   ========================================================================== */

/* Título vertical para tarjetas colapsadas (en color institucional azul para el tema claro) */
.card-vertical-title {
  position: absolute;
  bottom: 40px;
  left: 50%;
  transform: translateX(-50%) rotate(-90deg);
  transform-origin: center center;
  white-space: nowrap;
  color: var(--primary-blue);
  font-size: 14px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 2px;
  z-index: 3;
  transition: opacity 0.4s, color 0.4s;
  width: 350px;
  text-align: left;
  opacity: 0.8;
}

.course-card:hover .card-vertical-title {
  color: var(--light-blue);
  opacity: 1;
}

.course-card.active .card-vertical-title {
  opacity: 0;
  pointer-events: none;
}

/* Contenido Principal (Activo) */
.card-content {
  position: relative;
  z-index: 4;
  padding: 36px;
  width: 100%;
  opacity: 0;
  transform: translateY(20px);
  transition: 
    opacity 0.4s cubic-bezier(0.16, 1, 0.3, 1), 
    transform 0.5s cubic-bezier(0.16, 1, 0.3, 1);
  pointer-events: none;
}

.course-card.active .card-content {
  opacity: 1;
  transform: translateY(0);
  transition-delay: 0.15s;
  pointer-events: auto;
}

/* Subtítulo / Facultad */
.card-subtitle {
  color: var(--accent-gold-light);
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 1.5px;
  margin-bottom: 8px;
  display: block;
}

/* Título del Curso */
.card-title {
  color: var(--text-white);
  font-size: 24px;
  font-weight: 800;
  line-height: 1.25;
  margin-bottom: 12px;
}

/* Descripción */
.card-description {
  color: rgba(255, 255, 255, 0.8);
  font-size: 14px;
  line-height: 1.5;
  margin-bottom: 24px;
}

/* Botón de Acción */
.card-btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  background-color: var(--accent-gold-light);
  color: var(--primary-blue);
  padding: 10px 20px;
  border-radius: 8px;
  font-size: 13px;
  font-weight: 700;
  text-decoration: none;
  transition: all 0.3s;
  box-shadow: 0 4px 12px rgba(247, 206, 101, 0.2);
  border: 1px solid transparent;
}

.course-card.active:hover .card-btn {
  background-color: var(--text-white);
  color: var(--primary-blue);
  box-shadow: 0 4px 15px rgba(255, 255, 255, 0.35);
  transform: translateY(-2px);
}

.card-btn svg {
  width: 16px;
  height: 16px;
  transition: transform 0.3s;
}

.course-card.active:hover .card-btn svg {
  transform: translateX(4px);
}

/* ==========================================================================
   DECORACIONES DEL CARRUSEL (ESTILO SHADCN)
   ========================================================================== */

/* Botones de navegación (Flechas estilo Shadcn adaptadas a tema claro) */
.carousel-nav {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  width: 44px;
  height: 44px;
  border-radius: 50%;
  background-color: rgba(255, 255, 255, 0.9);
  border: 1px solid var(--border-glass);
  color: var(--primary-blue);
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: all 0.3s;
  z-index: 20;
  backdrop-filter: blur(8px);
  box-shadow: 0 4px 12px rgba(0, 59, 124, 0.08);
}

.carousel-nav:hover {
  background-color: var(--primary-blue);
  border-color: var(--primary-blue);
  color: var(--text-white);
  box-shadow: var(--shadow-glow);
}

.carousel-nav.prev {
  left: -60px;
}

.carousel-nav.next {
  right: -60px;
}

.carousel-nav svg {
  width: 18px;
  height: 18px;
  fill: none;
  stroke: currentColor;
  stroke-width: 2.5;
  stroke-linecap: round;
  stroke-linejoin: round;
}

/* Indicadores de Puntos en Tema Claro */
.carousel-indicators {
  display: flex;
  justify-content: center;
  gap: 8px;
  margin-top: 24px;
  z-index: 15;
}

.indicator-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background-color: rgba(0, 59, 124, 0.15);
  cursor: pointer;
  transition: all 0.3s cubic-bezier(0.16, 1, 0.3, 1);
}

.indicator-dot:hover {
  background-color: rgba(0, 59, 124, 0.35);
}

.indicator-dot.active {
  background-color: var(--primary-blue);
  width: 24px; /* Punto estirado (estilo Shadcn) */
  border-radius: 4px;
  box-shadow: 0 2px 8px rgba(0, 59, 124, 0.25);
}

/* ==========================================================================
   PIE DE PÁGINA (FOOTER)
   ========================================================================== */
footer {
  border-top: 1px solid var(--border-glass);
  padding: 24px;
  text-align: center;
  background-color: rgba(255, 255, 255, 0.85);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  margin-top: auto;
}

.footer-content {
  max-width: 1400px;
  margin: 0 auto;
  display: flex;
  flex-direction: column;
  gap: 8px;
  align-items: center;
}

.footer-text {
  font-size: 13px;
  color: var(--text-muted);
}

.footer-links {
  display: flex;
  gap: 16px;
}

.footer-link {
  font-size: 12px;
  color: var(--primary-blue);
  text-decoration: none;
  font-weight: 600;
  transition: color 0.3s;
}

.footer-link:hover {
  color: var(--accent-gold);
  text-decoration: underline;
}

/* ==========================================================================
   RESPONSIVIDAD
   ========================================================================== */

/* Pantallas grandes y medianas */
@media (max-width: 1320px) {
  .carousel-nav.prev { left: 10px; }
  .carousel-nav.next { right: 10px; }
  .carousel-track { padding: 10px 40px; }
}

/* Tablets e iPads */
@media (max-width: 992px) {
  .hero-section h1 { font-size: 32px; }
  .carousel-track { height: 420px; }
  .course-card { height: 380px; width: 75px; }
  .course-card.active { width: 380px; }
  .card-content { padding: 24px; }
  .card-title { font-size: 20px; }
  .card-description { font-size: 13px; margin-bottom: 16px; }
  .card-vertical-title { bottom: 30px; font-size: 12px; width: 280px; }
}

/* Móviles */
@media (max-width: 768px) {
  .header-container { flex-direction: column; gap: 12px; text-align: center; }
  .hero-section { padding-top: 24px; }
  .hero-section h1 { font-size: 26px; }
  .hero-section p { font-size: 14px; }
  
  /* Ajuste de carrusel en móvil */
  .carousel-track { 
    height: 380px;
    gap: 12px;
    padding: 10px 16px;
  }
  
  .course-card { 
    width: 50px; 
    height: 350px; 
  }
  .course-card.active { 
    width: 280px; 
    height: 350px;
  }
  .card-content { padding: 20px; }
  .card-title { font-size: 18px; }
  .card-description { display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; overflow: hidden; }
  .card-vertical-title { display: none; }
  .carousel-nav { display: none; }
}

@media (max-width: 480px) {
  .course-card {
    width: 40px;
  }
  .course-card.active {
    width: 220px;
  }
  .card-title { font-size: 16px; }
  .card-subtitle { font-size: 9px; }
}
