/* ===================== BASE ===================== */
* { margin: 0; padding: 0; box-sizing: border-box; }

html {
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  text-rendering: optimizeLegibility;
}

body {
  background-color: #0A1931;
  font-family: Arial, sans-serif;
  color: white;
  text-align: center;
  overflow-x: hidden;
}



/* ===================== HOME LAYOUT ===================== */
.home-container {
  width: 100%;
  min-height: 100vh;
  padding-bottom: 35px;
}

/* Header */
.header {
  position: absolute;
  top: 1px;
  left: 2px;
  z-index: 10;
}

.logo-text {
  font-size: 1.1rem;
  font-weight: bold;
  color: white;
}

/* User button */
.user-button {
  position: absolute;
  top: 8px;
  right: 8px;
  width: 30px;
  height: 30px;
  border-radius: 50%;
  background-image: url('../img/user-icon.webp');
  background-size: cover;
  background-position: center;
  cursor: pointer;
  z-index: 999;
  border: 1px solid rgb(255, 255, 255);
}

/* ===================== UPGRADE PILL (TOP CENTER) ===================== */
.upgrade-pill{
  position: absolute;
  top: 6px;
  left: 50%;
  transform: translateX(-50%);
  z-index: 1000;

  padding: 8px 16px;
  border-radius: 999px;

  border: 2px solid #008ab9;
  background: rgba(0, 138, 185, 0.18);

  color: #e9fbff;
  font-weight: 700;
  font-size: 0.95rem;

  cursor: pointer;
  user-select: none;

  transition: transform 0.15s ease, background 0.15s ease, opacity 0.15s ease;
    display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  min-width: 150px; 

}

.upgrade-pill-icon{
  width: 16px;
  height: 16px;
  object-fit: contain;
  display: none;

  position: relative;
  top: -1px; /* 🔼 súbela 1px (pon -2px si la quieres 2px arriba) */
}

.upgrade-pill-text{
  line-height: 1;
}


.upgrade-pill:hover{
  background: rgba(0, 138, 185, 0.28);
  transform: translateX(-50%) scale(1.02);
}

.upgrade-pill:active{
  opacity: 0.9;
  transform: translateX(-50%) scale(0.99);
}

.upgrade-pill:focus{
  outline: none;
}

.upgrade-pill:focus-visible{
  outline: 2px solid rgba(0, 138, 185, 0.8);
  outline-offset: 2px;
}



/* Hero */
.hero-section {
  position: relative;
  height: 70vh;
  background: url('../img/home-bg.webp') no-repeat center center/cover;
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  text-align: center;
  padding: 20px;
  z-index: 1;
}

.hero-section::after {
  content: "";
  position: absolute;
  bottom: 0; left: 0;
  width: 100%;
  height: 20%;
  background: linear-gradient(rgba(0, 0, 0, 0), #0A1931);
  z-index: 0;
}

.hero-text {
  font-size: 1.5rem;
  font-weight: bold;
  max-width: 80%;
  margin-top: auto;
  margin-bottom: 1vh;
  z-index: 2;
}

/* ===================== CARRUSELES ===================== */
.course-section {
  width: 100%;
  padding: 20px;
  text-align: left;
}

.course-title {
  font-size: 1rem;
  font-weight: bold;
  margin-bottom: 15px;
  padding-left: 1%;
}

.course-slider {
  display: flex;
  overflow-x: auto;
  scroll-snap-type: x mandatory;
  -webkit-overflow-scrolling: touch;
  gap: 15px;
  padding: 0 0%;
  scrollbar-width: none;
}

.course-slider::-webkit-scrollbar { display: none; }

.course {
  flex: 0 0 auto;
  width: 43%;
  max-width: 200px;
  height: 200px;
  border-radius: 10px;
  display: flex;
  align-items: center;
  justify-content: center;
  text-align: center;
  font-size: 1rem;
  font-weight: bold;
  color: white;
  cursor: pointer;
  scroll-snap-align: center;
  transition: transform 0.3s ease-in-out;
}

/* ===================== CARRUSEL 2: etiqueta ABAJO (fuera de la imagen) ===================== */

/* El item ahora es "contenedor": imagen (arriba) + etiqueta (abajo) */
.course-slider-c2 .course{
  width: 38vw;
  max-width: 160px;

  height: auto;
  background: none !important;

  display: flex;
  flex-direction: column;
  align-items: stretch;
  justify-content: flex-start;

  /* Ajusta a voluntad la distancia entre imagen y etiqueta */
  --label-gap: 12px;
}

/* La imagen vive aquí (así NO cambias el HTML) */
.course-slider-c2 .course::before{
  content: "";
  display: block;
  width: 100%;
  aspect-ratio: 5 / 4;   /* tu proporción del carrusel 2 */
  border-radius: 10px;

  background-position: center;
  background-size: cover;
}

/* Etiqueta debajo */
.course-slider-c2 .course span{
  display: block; /* importante */

  margin-top: var(--label-gap);
  padding: 6px 8px;

  background: rgba(0,0,0,.01);
  border-radius: 0;

  text-align: center;
  line-height: 1.1;

  /* tamaño tipo tu mockup */
  font-size: clamp(1rem, 3.2vw, 1.5rem);

  font-weight: 800;

  /* por si "Historia Universal" ocupa 2 líneas */
  white-space: normal;
}


/* Carrusel 1: tarjetas con proporción 1000x1500 (2:3) */
.course-slider-c1 .course {
  width: clamp(150px, 45vw, 230px);
  aspect-ratio: 2 / 3;
  height: auto;
}







.course:hover { transform: scale(1.05); }

.course span {
  background: rgba(0, 0, 0, 0.6);
  color: white;
  padding: 5px 10px;
  border-radius: 5px;
}


/* ===================== CARRUSEL Materias que menos has estudiado ===================== */

.course-slider-menos .course{
  /* más grande que carrusel 2 */
  width: 46vw;
  max-width: 210px;

  height: auto;
  background: none !important;

  display: flex;
  flex-direction: column;
  align-items: stretch;
  justify-content: flex-start;

  /* separación etiqueta */
  --label-gap: 12px;
}

/* La imagen vive aquí (igual que C2) */
.course-slider-menos .course::before{
  content: "";
  display: block;
  width: 100%;
  aspect-ratio: 5 / 4;   /* misma proporción que C2 */
  border-radius: 10px;

  background-position: center;
  background-size: cover;

  /* 👇 lo importante: imagen dinámica desde JS */
 background-image: var(--menos-bg);


}

/* Etiqueta abajo (similar a C2) */
.course-slider-menos .course span{
  display: block;

  margin-top: var(--label-gap);
  padding: 6px 8px;

  background: rgba(0,0,0,.01);
  border-radius: 0;

  text-align: center;
  line-height: 1.1;

  /* un pelín más grande que C2 */
  font-size: clamp(1.05rem, 3.6vw, 1.65rem);
  font-weight: 800;

  white-space: normal;
}




/* Carrusel 1: imágenes específicas (_c1) */
.course-slider-c1 .course:nth-child(1) { background: url('../img/biologia_c1.webp') no-repeat center center/cover; }
.course-slider-c1 .course:nth-child(2) { background: url('../img/quimica_c1.webp') no-repeat center center/cover; }
.course-slider-c1 .course:nth-child(3) { background: url('../img/literatura_c1.webp') no-repeat center center/cover; }
.course-slider-c1 .course:nth-child(4) { background: url('../img/espanol_c1.webp') no-repeat center center/cover; }
.course-slider-c1 .course:nth-child(5) { background: url('../img/historiademexico_c1.webp') no-repeat center center/cover; }
.course-slider-c1 .course:nth-child(6) { background: url('../img/historia_c1.webp') no-repeat center center/cover; }
.course-slider-c1 .course:nth-child(7) { background: url('../img/matematicas_c1.webp') no-repeat center center/cover; }
.course-slider-c1 .course:nth-child(8) { background: url('../img/geografia_c1.webp') no-repeat center center/cover; }
.course-slider-c1 .course:nth-child(9) { background: url('../img/fisica_c1.webp') no-repeat center center/cover; }




/* Carrusel 2: imágenes específicas (_c2) */
.course-slider-c2 .course:nth-child(1)::before { background-image: url('../img/quimica_c2.webp'); }
.course-slider-c2 .course:nth-child(2)::before { background-image: url('../img/fisica_c2.webp'); }
.course-slider-c2 .course:nth-child(3)::before { background-image: url('../img/matematicas_c2.webp'); }
.course-slider-c2 .course:nth-child(4)::before { background-image: url('../img/biologia_c2.webp'); }
.course-slider-c2 .course:nth-child(5)::before { background-image: url('../img/espanol_c2.webp'); }
.course-slider-c2 .course:nth-child(6)::before { background-image: url('../img/historia_c2.webp'); }
.course-slider-c2 .course:nth-child(7)::before { background-image: url('../img/literatura_c2.webp'); }
.course-slider-c2 .course:nth-child(8)::before { background-image: url('../img/historiademexico_c2.webp'); }
.course-slider-c2 .course:nth-child(9)::before { background-image: url('../img/geografia_c2.webp'); }










/* ===================== CARRUSEL INTELIGENTE: CONTINUAR VIENDO ===================== */

.course-slider-continuar{
  /* hereda flex/scroll de .course-slider */
  gap: 15px;
}

/* Card personalizada (NO usamos .course para no heredar estilos raros) */
.continue-card{
  flex: 0 0 auto;
  width: 49vw;
  max-width: 200px;

  display: flex;
  flex-direction: column;

  scroll-snap-align: center;
  cursor: pointer;
}

/* Imagen */
.continue-thumb{
  width: 100%;
  aspect-ratio: 5 / 4;
  border-radius: 10px;

  background-position: center;
  background-size: cover;

  position: relative;
  overflow: hidden;
}

/* Barra de progreso (estilo nuevo: pill + separación inferior) */
.continue-progress{
  position: absolute;
  left: 10px;
  right: 10px;

  bottom: 2px;              /* separación del borde inferior */
  height: 4px;              /* entre 8 y 10px, aquí lo dejamos en 9 */

  background: rgba(0,0,0,0.30); /* base con 30% opacidad */
  border-radius: 999px;         /* bordes totalmente redondos */

  overflow: hidden;             /* importante para recortar el relleno */
}

.continue-progress-bar{
  height: 100%;
  width: 0%;
  background: #33d8f8;      /* color del progreso */
  border-radius: 999px;     /* relleno también tipo pill   box-shadow: inset 0 0 0 0.3px #004d5a;
  box-sizing: border-box; */
  

}


/* Etiqueta debajo */
.continue-label{
  margin-top: 12px;
  padding: 6px 8px;

  background: rgba(0,0,0,0.01);
  border-radius: 0;

  text-align: center;
  line-height: 1.05;

  font-size: clamp(0.95rem, 3vw, 1.25rem);
  font-weight: 800;
}

/* ===================== CARRUSEL INTELIGENTE: PARA TI ===================== */

.course-slider-para-ti{
  gap: 15px; /* igual que continuar viendo */
}

/* Card propia (independiente) */
.foryou-card{
  flex: 0 0 auto;
  width: 49vw;
  max-width: 200px;

  display: flex;
  flex-direction: column;

  scroll-snap-align: center;
  cursor: pointer;
}

/* Imagen */
.foryou-thumb{
  width: 100%;
  aspect-ratio: 5 / 4;
  border-radius: 10px;

  background-position: center;
  background-size: cover;

  position: relative;
  overflow: hidden;
}

/* Etiqueta abajo */
.foryou-label{
  margin-top: 12px;
  padding: 6px 8px;

  background: rgba(0,0,0,0.01);
  border-radius: 0;

  text-align: center;
  line-height: 1.05;

  font-size: clamp(0.95rem, 3vw, 1.25rem);
  font-weight: 800;
}





/* ===================== BOTONES CARRUSEL DESKTOP ===================== */
.carousel-next, .carousel-prev { display: none; }

@media (min-width: 1024px) {
  .carousel-next, .carousel-prev {
    display: flex;
    justify-content: center;
    align-items: center;
    position: absolute;
    top: 55%;
    transform: translateY(-50%);
    width: 40px;
    height: 40px;
    border: none;
    border-radius: 50%;
    background: rgba(0, 0, 0, 0.55);
    color: #fff;
    font-size: 1.4rem;
    cursor: pointer;
    transition: background 0.2s;
    z-index: 5;
  }
  .carousel-next { right: 8px; }
  .carousel-prev { left: 8px; }

  .carousel-next:hover, .carousel-prev:hover {
    background: rgba(0, 0, 0, 0.8);
  }

   /* ✅ SOLO PC: TÍTULOS de carrusel normales / más grandes */
  .course-title{
    font-size: 1.15rem;   /* prueba 1.10rem o 1.25rem */
    margin-bottom: 15px;
    line-height: 1.2;
  }
  /* ✅ SOLO PC: letra de MATERIAS (labels) más pequeña */

  /* Carrusel 1 (Amor a la Biología) -> labels dentro de .course span */
  .course-slider-c1 .course span{
    font-size: 0.95rem;  /* prueba 0.90rem si lo quieres más chico */
    line-height: 1.05;
  }

  /* Carrusel 2 (Elige tu materia favorita) */
  .course-slider-c2 .course span{
    font-size: 0.95rem;
    line-height: 1.05;
  }

  /* Carrusel 5 (Materias que menos has estudiado) */
  .course-slider-menos .course span{
    font-size: 0.95rem;
    line-height: 1.05;
  }

  /* Carrusel inteligente: Para ti */
  .foryou-label{
    font-size: 0.95rem;
    line-height: 1.05;
  }

  /* Carrusel inteligente: Continuar viendo */
  .continue-label{
    font-size: 0.95rem;
    line-height: 1.05;
  }



    /* ✅ SOLO PC: etiquetas (texto) de las tarjetas en Carrusel 2 */
  .course-slider-c2 .course span{
    font-size: 1.05rem; /* prueba 1.0rem si lo quieres aún más pequeño */
  }

  /* ✅ SOLO PC: etiquetas (texto) de las tarjetas en “Materias que menos has estudiado” */
  .course-slider-menos .course span{
    font-size: 1.10rem; /* prueba 1.05rem si lo quieres más pequeño */
  }


}

/* ===================== BOTTOM NAV ===================== */
.espaciador { height: 55px; }

.bottom-nav {
  position: fixed;
  bottom: 0; left: 0; right: 0;
  height: 50px;
  background-color: rgba(0, 0, 0, 0.7);
  display: flex;
  justify-content: space-around;
  align-items: center;
  z-index: 9999;
}

.bottom-nav .nav-item {
  display: inline-flex;
  justify-content: center;
  align-items: center;
  text-decoration: none;
  color: #ffffff;
  flex: 1;
}

.bottom-nav .nav-item svg { width: 24px; height: 24px; }

.bottom-nav .nav-item .nav-icon{
  width: 24px;
  height: 24px;
  object-fit: contain;
  display: block;
}

.bottom-nav .nav-item-copito .nav-icon{
  width: 21px;
  height: 21px;
}


/* ===================== COPITO ===================== */
.copito-bubble-wrapper {
  position: fixed;
  left: 10px;
  bottom: 80px;
  display: flex;
  flex-direction: row;
  align-items: center;
  gap: 8px;
  z-index: 10002;
  font-family: Arial, sans-serif;
  touch-action: none;

  transition:
    left 0.45s ease-out,
    right 0.45s ease-out,
    top 0.45s ease-out,
    bottom 0.45s ease-out,
    opacity 0.3s ease,
    transform 0.3s ease;
}

.copito-bubble-wrapper.copito-right { flex-direction: row-reverse; }
.copito-bubble-wrapper.copito-right .copito-message::before {
  left: auto;
  right: -6px;
  border-color: transparent transparent transparent #1d4ed8;
}

.copo-hidden {
  opacity: 0;
  pointer-events: none;
  transform: translateY(10px);
}

.copo-visible {
  opacity: 1;
  pointer-events: auto;
  transform: translateY(0);
  transition: opacity 0.3s ease, transform 0.3s ease;
}

.copito-avatar {
  position: relative;
  width: 50px;
  height: 50px;
  border-radius: 50%;
  background: #ffffff;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 4px 10px rgba(0,0,0,0.4);
  cursor: pointer;
}

.copito-avatar img {
  width: 60px;
  height: 60px;
  border-radius: 50%;
  object-fit: cover;
}

.copito-badge {
  position: absolute;
  top: -4px;
  right: -4px;
  min-width: 18px;
  height: 18px;
  padding: 0 4px;
  border-radius: 999px;
  background: #ff3b30;
  color: #fff;
  font-size: 11px;
  font-weight: bold;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 0 0 2px #0A1931;
}

.copito-message {
  background: #1d4ed8;
  color: #fff;
  font-size: 0.85rem;
  padding: 8px 12px;
  border-radius: 14px;
  max-width: 180px;
  box-shadow: 0 4px 10px rgba(0,0,0,0.3);
  cursor: pointer;
  position: relative;
}

.copito-message::before {
  content: "";
  position: absolute;
  left: -6px;
  top: 50%;
  transform: translateY(-50%);
  border-width: 6px;
  border-style: solid;
  border-color: transparent #1d4ed8 transparent transparent;
}

.copito-message.copo-message-hidden { display: none; }
.copito-badge.copo-badge-hidden { display: none; }

.copito-bubble-wrapper,
.copito-avatar,
.copito-message {
  outline: none;
  user-select: none;
  -webkit-tap-highlight-color: transparent;
}

/* Trash */
.copito-trash {
  position: fixed;
  left: 50%;
  bottom: 70px;
  transform: translate(-50%, 20px);
  opacity: 0;
  pointer-events: none;
  z-index: 10001;
  transition: opacity 0.25s ease, transform 0.25s ease;
}

.copito-trash-visible {
  opacity: 1;
  transform: translate(-50%, 0);
}

.copito-trash-inner {
  width: 64px;
  height: 64px;
  border-radius: 50%;
  background: rgba(0, 0, 0, 0.65);
  border: 2px solid rgba(255, 255, 255, 0.8);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 28px;
  font-weight: bold;
  color: #ffffff;
  box-shadow: 0 4px 10px rgba(0,0,0,0.4);
}

.copito-trash.copito-trash-active .copito-trash-inner {
  background: rgba(220, 38, 38, 0.95);
  box-shadow: 0 0 0 4px rgba(220, 38, 38, .4);
  transform: scale(1.08);
}

@media (max-width: 480px) {
  .copito-bubble-wrapper { left: 8px; bottom: 75px; }
}
