// ==============================
// VARIABLES GLOBALES
// ==============================
$color-primary: #61b89a;
$color-secondary: #f3972d;
$color-gray: #dddddd;
$color-eval: #e35c62;
$color-objetivos-bg: #6b4c9a;
$color-objetivos-icon: #4b2f6b;
$color-exploremos-bg: #5b95d1;
$color-exploremos-icon: #2e6fa7;
$color-recordemos-bg: #dc5a7dff;
$color-recordemos-icon: #ae1442ff;
$color-contenido-bg: #719768;
$color-contenido-icon: #69bd61;
$color-observacion-bg: #009ab6;
$color-observacion-icon: #016a7d;
$color-instruccion-bg: #eb8c47;
$color-instruccion-icon: #ad5f27;
$color-ejemplo-bg: #0d9488;
$color-ejemplo-icon: #0f766e;
$color-practica: #f0a33a;
$color-herramientas: #c94f5c;

$font-main: "Segoe UI", sans-serif;
$font-aux: "Helvetica Neue", "Segoe UI", Arial, sans-serif;

// Tamaños
$font-normal: 1.12rem;
$font-semilarge: 1.14rem;
$font-dialog: 1.16rem;
$font-large: 1.24rem;
$icon-size: 45px;

.que.description {
  margin-bottom: 0.14rem !important;
  padding-bottom: 0.14rem !important;
}

.que .formulation { 
margin-bottom: 0px;
border-color: #fff !important;
background-color: #fff !important; 
border-radius: 0px !important;

margin-bottom:  0.14rem !important;
padding-bottom: 0.14rem !important;
}

// ==============================
// MIXINS
// ==============================
@mixin circle($size) {
  width: $size;
  height: $size;
  border-radius: 50%;
  display: flex;
  justify-content: center;
  align-items: center;
}

@mixin capsule-header-base {
  color: white;
  display: flex;
  align-items: center;
  font-size: 20px;
font-weight: bold;
  padding: 20px 20px 20px 64px;
  position: relative;
  border-bottom: none;
  border-top-left-radius: 25px;
}

@mixin bubble {
  padding: 18px 22px;
  border-radius: 16px;
  font-size: $font-dialog;
  line-height: 1.45em;
  background: #ECECEC;
}


// ==============================
// ESTILOS BASE — GENERALES
// ==============================

/* Page Title*/
.page-header-headings .text-muted {
color: #fff !important;
}

@media (max-width: 800px) {
  center img.img-fluid {
    width: 100% !important;
    max-width: 100% !important;
    height: auto;
  }
}
.breadcrumb {
    background-color: #f3f4f6 !important;
   }
   
header ol.breadcrumb{
     color: #d45762;
   }

#page-mod-quiz-attempt #responseform {
  max-width: 1264px;
  margin-left: auto;
  margin-right: auto;
}

@media (min-width: 1200px) {
  #page-mod-quiz-attempt
  .answer,
  #page-mod-quiz-attempt
  .problemcontent,
  #page-mod-quiz-attempt
  .im-controls,
  #page-mod-quiz-attempt
  .table-responsive {
    padding-left: 82px;
  }
}

.problemcontent p, 
.contextcontent p, 
.pagecontent p,
form select option,
li,
.rightanswer {
  font-size: $font-normal;
}


// =============================
// ETIQUETAS DE TRABAJO
// =============================
.etiqueta-trabajo {
  display: inline-flex;
  align-items: center;
  background: $color-secondary;
  padding: 8px 20px 8px 12px;
  border-radius: 0px 12px 12px 0px;
  font-family: $font-main;
  color: white;
  font-weight: bold;
  gap: 12px;

  .etiqueta-barra {
    width: 6px;
    height: 45px;
    background: white;
    border-radius: 3px;
  }

  .etiqueta-icono {
    width: 45px;
    height: 100%;
  }

  .etiqueta-texto {
    font-size: 24px;
  }
}


// =============================
// ENUNCIADOS
// =============================

.enunciado-container {
  display: grid;
  grid-template-columns: 75px 1fr;
  column-gap: 20px;
  align-items: start;
  font-family: $font-main;
  position: relative;

  /* -----------------------------
     NÚMERO
  ----------------------------- */
  .enunciado-numero {
    @include circle(75px);
    background: $color-primary;
    color: white;
    font-size: 2rem;
    font-weight: bold;

    display: flex;
    align-items: center;
    justify-content: center;
  }

  /* -----------------------------
     LÍNEA
  ----------------------------- */
  .enunciado-linea {
    width: 25%;
    height: 8px;
    background: $color-primary;
    border-radius: 6px;
    position: absolute;
    top: 0;
    left: 36px;
  }

  /* -----------------------------
     TEXTO
  ----------------------------- */
  .enunciado-texto {
    font-size: $font-large;
    color: #333;
    font-weight: 700;
    line-height: 1.4;
    text-align: justify;

    margin-top: calc(75px / 2 - 0.7em);
  }


  /* =============================
     VARIANTES
  ============================= */
  &.eval {
    .enunciado-numero,
    .enunciado-linea {
      background: $color-eval;
    }
  }

    &.practica {
    .enunciado-numero,
    .enunciado-linea {
      background: $color-practica;
    }
  }


}

/* =============================
     SEPARADOR
  =============================*/
 hr.questionseparator {
  border: 3px solid #e35c62;
  border-radius: 4px;
  background-color: #e35c62;
opacity: 1;
margin-top: 1rem;
margin-bottom: 2.14rem;

}

/* =============================
   OCULTAR EN RESPUESTAS
============================= */
/*
.feedback .rightanswer {
  display: none;
}
*/

.feedback .rightanswer .enunciado-container {
  display: none;
}

// =============================
// BOTONES
// =============================
.submit.btn.btn-secondary,
.retrobutton {
  border-radius: 8px;
  font-weight: 700;
  font-size: $font-normal;
  background-color: $color-primary;
color: #fff;
}


// =============================
// CÁPSULAS BASE
// =============================
.capsula-container {
  overflow: visible;
  font-family: $font-aux;
  margin: 24px 32px;
  position: relative;

  .capsula-header {
    @include capsule-header-base;
  }

  .capsula-icon {
    @include circle(90px);
    position: absolute;
    left: -45px;
    top: 50%;
    transform: translateY(-50%);

    img {
      width: 45px;
      height: 45px;
    }
  }

  .capsula-content {
    padding: 30px 30px 40px;
    background: white;
    color: #333;
    line-height: 1.5;
    border: 2px solid #ddd;
    border-top: none;
    border-bottom-left-radius: 25px;
    border-bottom-right-radius: 25px;
font-size: $font-normal;

  }
}


// =============================
// HEADER
// =============================

$purpura: #4b2f6b;
$blanco: #ffffff;
$font-main: 'Montserrat', 'Helvetica', sans-serif;

.unidad-header {
  position: relative;
  background-color: $purpura;
  color: $blanco;
  padding: 48px 64px 56px 96px;
  font-family: $font-main;
  overflow: hidden;

  .barra-lateral {
    position: absolute;
    left: 32px;
    top: 32px;
    bottom: 32px;
    width: 12px;
    background-color: $blanco;
  }

.barra-lateral.practica {
  background-color: $color-practica;
}
.barra-lateral.herramientas {
  background-color: $color-herramientas;
}

  .contenido {
    display: flex;
    flex-direction: column;
    gap: 32px;
 text-transform: uppercase;
text-align: left;
  }

  .unidad {
    font-size: 1.12rem;
    letter-spacing: 0.04em;
    text-transform: uppercase;
    opacity: 0.95;
  }

  .tema {
    font-size: 2rem;
    font-weight: 800;
    line-height: 1.15;
    margin: 0;
    color: $blanco;

    span {
      display: block;
      margin-top: 8px;
    }
  }

  .leccion {
    font-size: 1.64rem;
    font-weight: 700;
    line-height: 1.25;
    margin: 0;
  }
}

@media (max-width: 768px) {
  .unidad-header {
    padding: 32px 24px;

    .barra-lateral {
      display: none;
    }

    .contenido {
      gap: 24px;
    }

    .tema {
      font-size: 1.6rem;
    }

    .leccion {
      font-size: 1.35rem;
    }
  }
}

/*Hide extra buttons on submit files*/
.ablock .answer .attachments .buttonsets {
  display: none;
}


/*Flex responsive images*/
.imagenes-flex {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 1rem;
}

/* valor por defecto: 2 imágenes */
.imagenes-flex img {
  flex: 1 1 45%;
  max-width: 45%;
}

/* EXACTAMENTE 3 imágenes */
.imagenes-flex img:first-child:nth-last-child(3),
.imagenes-flex img:first-child:nth-last-child(3) ~ img {
  flex: 1 1 30%;
  max-width: 30%;
}

/* EXACTAMENTE 4 imágenes */
.imagenes-flex img:first-child:nth-last-child(4),
.imagenes-flex img:first-child:nth-last-child(4) ~ img {
  flex: 1 1 22%;
  max-width: 22%;
}

/* EXACTAMENTE 5 imágenes */
.imagenes-flex img:first-child:nth-last-child(5),
.imagenes-flex img:first-child:nth-last-child(5) ~ img {
  flex: 1 1 18%;
  max-width: 18%;
}

/* móviles */
@media (max-width: 800px) {
  .imagenes-flex img,
  .imagenes-flex img:first-child:nth-last-child(3),
  .imagenes-flex img:first-child:nth-last-child(3) ~ img,
  .imagenes-flex img:first-child:nth-last-child(4),
  .imagenes-flex img:first-child:nth-last-child(4) ~ img,
  .imagenes-flex img:first-child:nth-last-child(5),
  .imagenes-flex img:first-child:nth-last-child(5) ~ img {
    max-width: 100%;
    flex: 1 1 auto;
  }

  .imagenes-flex {
    flex-direction: column;
    align-items: center;
  }
}

.path-mod-feedback div.feedback_is_dependent {
  background: #e3e5e7 !important;
}

/*FRACCIONES*/

.fraction {
  display:inline-block;
  vertical-align:middle;
  text-align:center;
  line-height:10px;
  font-size:14px
}

.fraction>span {
  display:block;
  margin-top:0px;
  margin-bottom:0px
}

.fraction span.bar {
  background-color:#737373;
  height:1px;
  width:100%;
  margin:1px;
  margin-bottom:2px;
  overflow:hidden
}

.fraction_grande {
  display:inline-block;
  vertical-align:middle;
  text-align:center;
  line-height:20px;
  font-size:16px
}

.fraction_grande>span {
  display:block;
  margin-top:0px;
  margin-bottom:0px;
  width:24px;
  font-weight:bold
}

.fraction_grande span.bar {
  background-color:#737373;
  height:1px;
  width:100%;
  margin:1px;
  margin-bottom:2px;
  overflow:hidden
}

.dimmed_text{
 color:  #d45762 !important;
}

.breadcrumb .breadcrumb-item.dimmed_text > a {
  color: #4f684b !important;
}

// =============================
// HOME
// =============================
.promobox-left a {
  background-color: #423475;
  color: white;
}

// =============================
// LOGIN
// =============================

#loginlogo #logoimage {
  max-width: 200px;
  margin: 20px 0;
}

.loginform > div:nth-child(3) {
  display: none;
}

.loginform > div:nth-child(4) {
  display: none !important;
}

// =============================
// =============================
// SEGUNDA PARTE 
// =============================
// =============================


// =============================
CÁPSULAS (variantes)
// =============================

.exploremos {
  .capsula-header { background: $color-exploremos-bg; }
  .capsula-icon { background: $color-exploremos-icon; }
}

.objetivos {
  .capsula-header { background: $color-objetivos-bg; }
  .capsula-icon { background: $color-objetivos-icon; }
}

.recordemos {
  .capsula-header { background: $color-recordemos-bg; }
  .capsula-icon { background: $color-recordemos-icon; }
}

.contenido {
  .capsula-header { background: $color-contenido-bg; }
  .capsula-icon { background: $color-contenido-icon; }
}

.observacion {
  .capsula-header { background: $color-observacion-bg; }
  .capsula-icon { background: $color-observacion-icon; }
}

.instruccion {
  .capsula-header { background: $color-instruccion-bg; }
  .capsula-icon { background: $color-instruccion-icon; }
}

.ejemplo {
  .capsula-header { background: $color-ejemplo-bg; }
  .capsula-icon { background: $color-ejemplo-icon; }
}

// =============================
// TABLAS REDONDEADAS
// =============================
.roundedtable {
  border-collapse: separate;
  border-spacing: 0;
  font-family: $font-aux;
  color: #333;
  margin: 20px 0;
  border: 1px solid #ddd;
  border-radius: 12px;
  overflow: hidden;

  th {
    background-color: #d9d9d9ff;
    font-weight: 600;
    padding: 12px 15px;
    border-bottom: 1px solid #ddd;
  }

  td {
    padding: 12px 15px;
    border-bottom: 1px solid #eee;

    &:last-child {
      border-bottom: none;
    }
  }
}


// =============================
// DIÁLOGOS DE PERSONAJES
// =============================
.dialog {
  display: flex;
  align-items: flex-start;
  margin: 25px 0;
  gap: 15px;

  &.right {
    flex-direction: row-reverse;
  }

  .avatar {
    width: 80px;
    text-align: center;

    img {
      width: 75px;
      height: 75px;
      object-fit: scale-down;
    }

    .name {
      padding: 4px 8px;
      font-size: 14px;
      color: white;
      font-weight: 600;
      border-radius: 12px;
    }
  }

  .bubble {
    max-width: 800px;
    @include bubble;
  }
}


// =============================
// CAROUSELS
// =============================
.carouselSYS,
.carouselSYStable,
.carousel-carpeta {
  position: relative;
  width: 95%;
  margin: 0 auto;
  overflow: hidden;
}

.carouselSYS-container,
.carouselSYStable-container {
  display: flex;
  transition: transform 0.5s ease;
}

.carouselSYS-slide,
.carouselSYStable-slide {
  min-width: 100%;
  display: flex;
  justify-content: center;
  align-items: center;

  img {
    max-width: 100%;
    height: auto;
  }
}

.carouselSYS-prev,
.carouselSYS-next,
.carouselSYStable-prev,
.carouselSYStable-next {
  position: absolute;
  top: 50%;
  background: none !important;
  box-shadow: none !important;
  border: none;
  font-size: 24px !important;
  cursor: pointer;
  transform: translateY(-50%);
  color: gray;
  padding: 4px 4px 8px;
}

.carouselSYS-prev { left: 10px; }
.carouselSYS-next { right: 10px; }

.carouselSYStable-prev,
.carouselSYStable-next {
  color: $color-primary;
}

.carouselSYS .carouselSYS-prev,
.carouselSYS .carouselSYS-next,
.carouselSYStable .carouselSYStable-prev,
.carouselSYStable .carouselSYStable-next {
  color: $color-primary;

  &:hover {
    background-color: $color-secondary;
  }
}

.carouselSYS-prev.disabled,
.carouselSYS-next.disabled,
.carouselSYStable-prev.disabled,
.carouselSYStable-next.disabled {
  color: gray !important;
  cursor: default !important;

  &:hover {
    background: none;
    color: gray;
  }
}

// =============================
// Carousel texto
// =============================

#moodleTextCarousel .flechacaro, #moodleTextCarousel .carousel-indicators button.active {
    color: #61b89a;
   }

#moodleTextCarousel .carousel-indicators button{
    color: #555;
   }

#moodleTextCarousel  .carousel-inner {
  width: 80%;
  overflow: hidden;
  height: 416px;
  border-color: #e8e8e8;
  border-style: solid;
  border-width: 4px;
}


// =============================
// CARPETAS
// =============================
.carousel-carpeta {
  padding-top: 40px;

  .carousel-carpeta-container {
    background-color: #fffacd;
    border-radius: 10px;
    border: 2px solid black;
    padding: 24px;

    &.blanco {
      background-color: #fff;
    }
  }

  .carousel-carpeta-tabs {
    position: absolute;
    top: 2px;
    left: 8px;
    width: 100%;
    display: flex;
    z-index: 1;
    justify-content: flex-start;
  }

  .carousel-carpeta-tab {
    background-color: #d7cfa4 !important;
    border: 2px solid black !important;
    border-radius: 5px 5px 0 0 !important;
    padding: 5px 10px;
    cursor: pointer;
    font-size: 16px;
    color: #313131 !important;

    &:hover { background-color: #ffd700 !important; }

    &.active {
      background-color: #fffacd !important;
      font-weight: bold;
      border-bottom: none !important;
    }
  }
}


// =============================
// TABS SYS
// =============================
.tablatabSYS {
  .tab-content { display: none; }
  .tab-content.active { display: block; }

  .tabhead {
    padding: 10px;
    text-align: center;

    a {
      background: transparent;
      color: white;
      border-radius: 10px;
      padding: 10px;
      cursor: pointer;

      &.active {
        background-color: rgba(255, 255, 255, 0.2);
      }
    }
  }

  .tabmid {
    padding: 20px;
    margin-top: -2px;
    border-radius: 0 0 10px 10px;
  }

  &.azul {
    .tabhead { background-color: #0095DB; }
    .tabhead a.active { background-color: #007ab7; }
    .tabmid { border: 2px solid #0095DB; }
  }

  &.roja {
    .tabhead { background-color: #e71f24; }
    .tabmid { border: 2px solid #e71f24; }
  }

  &.morado {
    .tabhead { background-color: #800080; }
    .tabhead a.active { background-color: #660066; }
    .tabmid { border: 2px solid #800080; }
  }
}

.mtfgreyingout {
  display: none;
}


// =============================
// Recuadros
// =============================
.recuadroSYS {
  background-color: #f0f0f1;
  width: fit-content;
  margin-top: 30px;
  margin-bottom: 16px;
  padding: 30px;
    padding-bottom: 30px;
  padding-bottom: 12px;
  border-radius: 12px;
}

.recuadroSYS.rosado {
  background-color: #f7e5eb;
}

// ========================================
// FEEDBACK — ocultar texto PYE en ítems INFO (Encuestas)
// ========================================
.path-mod-feedback {
  .feedback-item-info {
    .felement {
      font-size: 0 !important;
      padding: 0 !important;
      min-height: 0 !important;
    }
  }
}

// ========================================
// botones siguiente y anterior pagina
// ========================================
.mod_quiz-prev-nav.btn,
.mod_quiz-next-nav.btn {
  padding: 12px 16px;
  font-size: $font-semilarge;
}


// ========================================
// bóton Descargar
// ========================================
.downloadbutton {
  display: inline-flex;
  align-items: center;
  gap: 0.75rem;

  padding: 0.85rem 1.4rem;
  border-radius: 12px;

  background-color: #423475;
  color: #fff !important;

  font-size: 1.16rem;
  font-weight: 700;
  text-decoration: none;

  transition: 
    background-color 0.2s ease,
    transform 0.2s ease;

  &::before {
    content: "";
    width: 24px;
    height: 24px;
    flex-shrink: 0;

    background-image: url("https://static.sumaysigue.uchile.cl/cmmtvo/assets/download_icon.png");
    background-size: contain;
    background-repeat: no-repeat;
    background-position: center;
  }

  &:hover {
    background-color: #34285e;
    transform: translateY(-2px);
    text-decoration: none;
    color: #fff;
  }
}


// ========================================
// bóton purpura
// ========================================
.botonpurpura {
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;

  padding: 0.85rem 1.4rem;
  border-radius: 12px;

  background-color: #423475;
  color: #fff !important;

  font-size: 1.1rem;
  font-weight: 700;
  text-decoration: none;
  text-align: center;

  transition:
    background-color 0.2s ease,
    transform 0.2s ease;

  &:hover {
    background-color: #34285e;
    transform: translateY(-2px);

    color: #fff;
    text-decoration: none;
  }
}


// =============================
// DROPDOWN SYS
// =============================

.dropdownSYS {
  width: 100%;
}

.dropdownSYS-toggle {
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: space-between;

  padding: 0.75rem 1rem;
  font-size: 1rem;
  font-weight: 600;
  color: white;

  background-color: #61b89a;

  border: none;
  border-radius: 0.75rem;

  cursor: pointer;
  user-select: none;

  transition: background-color 0.15s ease;

  &:hover {
    background-color: darken(#61b89a, 6%);
  }

  &:focus {
    outline: none;
    box-shadow: 0 0 0 3px rgba(97, 184, 154, 0.45);
  }

  /* Flecha con ::after — visible sin elemento en HTML */
  &::after {
    content: "";
    display: inline-block;
    width: 0.5rem;
    height: 0.5rem;
    margin-left: 0.5rem;
    border-right: 2px solid currentColor;
    border-bottom: 2px solid currentColor;
    color: inherit;
    transform: rotate(45deg);
    transition: transform 0.2s ease;
    flex-shrink: 0;
  }

  &[aria-expanded="true"]::after {
    transform: rotate(-135deg);
  }
}

/* Por si en el HTML se añade .dropdownSYS-arrow */
.dropdownSYS-arrow {
  display: inline-block;
  width: 0.5rem;
  height: 0.5rem;
  border-right: 2px solid currentColor;
  border-bottom: 2px solid currentColor;
  transform: rotate(45deg);
  transition: transform 0.2s ease;
  margin-left: 0.5rem;
  flex-shrink: 0;
}

.dropdownSYS-toggle[aria-expanded="true"] .dropdownSYS-arrow {
  transform: rotate(-135deg);
}


.dropdownSYS-content {
  margin-top: 0.75rem;
  padding: 0.75rem 1rem;
  border-left: 3px solid #61b89a;
}

// =============================
// TIPO LECCIÓN (PREHEADER)
// =============================

.tipoleccion {
  display: flex;
  align-items: center;
  width: 100%;
  height: 65px;
  font-family: $font-main;
  overflow: hidden;
  background: $color-gray; // 👈 fondo base gris

  // -----------------------------
  // ICONO
  // -----------------------------
  &-icono {
    width: 120px;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
   z-index: 2;
    clip-path: polygon(
      0 0,
      85% 0,
      100% 50%,
      85% 100%,
      0 100%
    );

    img {
      width: 50px;
      height: 50px;
      z-index: 2;
    }
  }

  // -----------------------------
  // CONTENIDO (COLOR)
  // -----------------------------
  &-contenido {
    display: inline-flex;
    align-items: center;
    height: 100%;
    padding-right: 40px; 
margin-left: -25px; 
  position: relative;
  z-index: 1; 
  }

  // -----------------------------
  // TEXTO
  // -----------------------------
  &-texto {
    padding-left: 40px;
    font-size: 1.64rem;
    font-weight: 800;
    letter-spacing: 1px;
    text-transform: uppercase;
    color: white;
    white-space: nowrap;
  }

  // =============================
  // VARIANTES
  // =============================

  &.practica {
    .tipoleccion-icono {
      background: darken($color-practica, 10%);
    }

    .tipoleccion-contenido {
      background: $color-practica;
    }
  }

  &.herramientas {
    .tipoleccion-icono {
      background: darken($color-herramientas, 10%);
    }

    .tipoleccion-contenido {
      background: $color-herramientas;
    }
  }
}

@media (max-width: 600px) { //Responsivo

  .tipoleccion {
    background: transparent; // quitamos el gris base
    height: auto;
  }

  .tipoleccion-icono {
    display: none;
  }

  .tipoleccion-contenido {
    margin-left: 0; 
    width: 100%;
    justify-content: center;
    padding: 12px 16px;
  }

  .tipoleccion-texto {
    padding-left: 0;
    font-size: 1.4rem; 
    text-align: center;
  }

  .tipoleccion.practica .tipoleccion-contenido {
    background: $color-practica;
  }

  .tipoleccion.herramientas .tipoleccion-contenido {
    background: $color-herramientas;
  }
}