body {
    min-height: 100vh;
    background-image: linear-gradient(to bottom, #561eaa 50vh, white 50vh);
    font-family: "Assistant", sans-serif;
    font-optical-sizing: auto;
    font-weight: 600;
    font-style: normal;
}

.botonesPrincipalesNavegacion{
    margin: 0 !important;
}

.cke_editable {
    font-family: "Assistant", sans-serif !important;
    font-optical-sizing: auto !important;
    font-weight: 600 !important;
    font-style: normal !important;
}

.auth-input {
    border: none !important;
    border-bottom: 1px solid #561eaa !important;
    font-size: 20px !important;
    background-color: transparent !important;
    border-radius: 0 !important;
}

.auth-input {
    outline: none !important;
    box-shadow: none !important;
}

.logo {
    width: 100px;
    height: auto;
}

header {
    height: 15vh;
}

.headerMainClass {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 10px 4vw;
    background-color: white;
    border-bottom: 1px solid #ccc;
    height: 60%;
}

.header1 {
    background-color: #561eaa;
    height: 40%;
}

main {
    min-height: 75vh;
}

footer {
    background-color: #220f3f;
}

.btn {
    cursor: pointer;
    border: 0;
    border-radius: 4px;
    font-weight: 600;
    margin: 0 10px;
    width: 200px;
    padding: 10px 0;
    box-shadow: 0 0 20px rgba(104, 85, 224, 0.2);
    transition: 0.4s;
}

.btn1 {
    border: 1px solid #561eaa;
}

.btn1:hover {
    color: white;
    box-shadow: 0 0 20px rgba(104, 85, 224, 0.6);
    background-color: #561eaa;
}

.google {
    --bs-text-opacity: 1;
    color: rgba(var(--bs-dark-rgb), var(--bs-text-opacity)) !important;
}

.google:hover {
    color: white !important;
}

.btn2 {
    background-color: rgb(255, 115, 0) !important;
    color: white !important;
    border: 1px solid rgb(255, 115, 0) !important;
}

.btn2:hover {
    background-color: white !important;
    color: black !important;
    border: 1px solid rgb(255, 115, 0) !important;
}

.btn3 {
    background-color: transparent;
    color: rgb(255, 115, 0);
    border: 1px solid rgb(255, 115, 0);
}

.btn4 {
    background-color: transparent;
    color: red;
    border: 1px solid red;
    width: 100px;
}

.btn4:hover {
    background-color: red;
    color: white;
}

.btn3:hover {
    background-color: rgb(255, 115, 0);
    color: #561eaa;
    border: 1px solid rgb(255, 115, 0);
}

/* 
.input-group {
    width: 200px;
} */
/* clases de inputs arreglados */


/* input type text */

.inputTextLong {
    /* width: 200px; */
    border: none !important;
    border-bottom: 1px solid #561eaa !important;
    font-size: 20px !important;
    background-color: transparent !important;
    border-radius: 0 !important;
}


/* input type radio */

.inputRadioPurple {
    appearance: none !important;
    width: 1.2rem !important;
    height: 1.2rem !important;
    border: 2px solid #561eaa !important;
    border-radius: 50% !important;
    position: relative !important;
    margin-right: .5rem !important;
    cursor: pointer !important;
    outline: none !important;
}

.inputRadioPurple:checked::before {
    content: '' !important;
    position: absolute !important;
    top: 50% !important;
    left: 50% !important;
    transform: translate(-50%, -50%) !important;
    width: .6rem !important;
    height: .6rem !important;
    background-color: #561eaa !important;
    border-radius: 50% !important;
}


/* input type checkbox */

.inputCheckboxPurple {
    appearance: none !important;
    /* width: 1.2rem !important;
    height: 1.2rem !important; */
    border: 2px solid #561eaa !important;
    border-radius: .25rem !important;
    position: relative !important;
    margin-right: .5rem !important;
    cursor: pointer !important;
    outline: none !important;
}

.inputCheckboxPurple:checked::before {
    content: '✔' !important;
    position: absolute !important;
    top: 50% !important;
    left: 50% !important;
    transform: translate(-50%, -50%) !important;
    font-size: .8rem !important;
    color: #561eaa !important;
}

.inputRadioPurple:hover,
.inputCheckboxPurple:hover {
    border-color: rgb(255, 115, 0) !important;
}

.inputRadioPurple:checked,
.inputCheckboxPurple {
    /* border-color: rgb(255, 115, 0) !important; */
    background: none !important;
    background-color: transparent !important;
}

.divRegistro {
    background-color: white;
    border: 20px solid #561eaa;
    border-radius: 30px !important;
}

.card_informativo1 {
    background-color: #2F075B;
    font-size: x-large;
}

.card_informativo2 {
    background-color: rgb(255, 115, 0);
    font-size: x-large;
}

.textCardInfo {
    text-align: justify
}

.textOrange {
    color: rgb(255, 115, 0);
}

.textBlue {
    color: #561eaa;
}

.backgroundBlue {
    background-color: #561eaa;
}

.loginModal {
    background-color: white;
    border: 20px solid #561eaa;
    color: black;
    border-radius: 30px;
}

.form-label {
    margin-bottom: 0 !important;
}

.profile-card {
    background: white;
    border: none;
    border-radius: 15px;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
    transition: all 0.3s ease;
    overflow: hidden;
    position: relative;
}

.profile-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: linear-gradient(45deg, rgba(86, 30, 170, 0.1), rgba(255, 115, 0, 0.1));
    opacity: 0;
    transition: opacity 0.3s ease;
    pointer-events: none;
}

.profile-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 8px 15px rgba(0, 0, 0, 0.2);
}

.profile-card:hover::before {
    opacity: 1;
}

.profile-card .card-body {
    position: relative;
    z-index: 1;
}

.profile-card i {
    transition: transform 0.3s ease;
}

.profile-card:hover i {
    transform: scale(1.2);
}

.profile-card .card-title {
    transition: color 0.3s ease;
}

.profile-card:hover .card-title {
    color: #561eaa;
}

.breadcrumb-item+.breadcrumb-item::before,
.breadcrumb-item>a {
    color: white !important;
    text-decoration: none !important;
}

.breadcrumb-item {
    color: rgb(255, 115, 0) !important;
}

.cke_notifications_area {
    display: none;
}

#title {
    border-bottom: 1px solid white !important
}

#title:focus {
    outline: 0 !important;
    box-shadow: none;
}

.imgCourse {
    width: 100%;
    height: 100%;
    object-fit: cover;
    border-top-left-radius: 5px;
    border-top-right-radius: 5px;
}

.card-body-course {
    padding: 0
}

.padding-card {
    padding-left: 20px;
    padding-bottom: 10px;
    margin-bottom: 0;
}

.header-info-user {
    background-color: rgb(255, 115, 0);
}

.padding-title,
.label-filter {
    padding-bottom: 10px;
}

.exercise.attempted {
    background-color: #f5f5f5;
    padding: 1rem;
    border-radius: 0.25rem;
    opacity: 0.8;
}

.exercise.completed {
    border: 2px solid #28a745;
    background-color: #eaffea;
    padding: 1rem;
    border-radius: 0.25rem;
}

.exercise.completed input.form-control {
    border-color: #28a745;
    background-color: #eaffea;
    box-shadow: none;
}

.exercise.completed .form-check-input {
    border-color: #28a745;
}

#cookie-banner {
    position: fixed;
    bottom: 0;
    left: 0;
    width: 100%;
    background: rgba(86, 30, 170, 0.85);
    color: #fff;
    padding: 0.75rem 1rem;
    display: flex;
    justify-content: center;
    align-items: center;
    font-size: 0.9rem;
    z-index: 9999;
}

#cookie-banner button {
    margin-left: 1rem;
    background: #2F075B;
}

#register-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.6);
    z-index: 9998;
    display: none;
}

#register-popup {
    position: fixed;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    background: white;
    padding: 1.5rem;
    border-radius: .5rem;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3);
    z-index: 9999;
    display: none;
    max-width: 90%;
    width: 320px;
    text-align: center;
}

#register-popup h4 {
    margin-bottom: 1rem;
}

#register-popup button {
    margin: .5rem;
}

/* input[type="text"],
input[type="email"],
input[type="number"],
textarea {
    border: none !important;
    border-bottom: 1px solid #561eaa !important;
    font-size: 20px !important;
    background-color: transparent !important;
    border-radius: 0 !important;
} */

#createUserPassword {
    border: none !important;
    border-bottom: 1px solid #561eaa !important;
    font-size: 20px !important;
    background-color: transparent !important;
    border-radius: 0 !important;
}

#createUserPasswordConfirmation {
    border: none !important;
    border-bottom: 1px solid #561eaa !important;
    font-size: 20px !important;
    background-color: transparent !important;
    border-radius: 0 !important;
}

#createUserPasswordConfirmation {
    border: none !important;
    border-bottom: 1px solid #561eaa !important;
    font-size: 20px !important;
    background-color: transparent !important;
    border-radius: 0 !important;
}


/* Progreso boton y contenedor */

input[type="radio"] {
    appearance: none !important;
    width: 1.2rem !important;
    height: 1.2rem !important;
    border: 2px solid #561eaa !important;
    border-radius: 50% !important;
    position: relative !important;
    margin-right: .5rem !important;
    cursor: pointer !important;
    outline: none !important;
}

input[type="radio"]:checked::before {
    content: '' !important;
    position: absolute !important;
    top: 50% !important;
    left: 50% !important;
    transform: translate(-50%, -50%) !important;
    width: .6rem !important;
    height: .6rem !important;
    background-color: #561eaa !important;
    border-radius: 50% !important;
}


/* Checkboxes personalizados */

/* input[type="checkbox"] {
    appearance: none !important;
    width: 1.2rem !important;
    height: 1.2rem !important;
    border: 2px solid #561eaa !important;
    border-radius: .25rem !important;
    position: relative !important;
    margin-right: .5rem !important;
    cursor: pointer !important;
    outline: none !important;
}

input[type="checkbox"]:checked::before {
    content: '✔' !important;
    position: absolute !important;
    top: 50% !important;
    left: 50% !important;
    transform: translate(-50%, -50%) !important;
    font-size: .8rem !important;
    color: #561eaa !important;
} */


/* Hover en naranja */

/* input[type="radio"]:hover,
input[type="checkbox"]:hover {
    border-color: rgb(255, 115, 0) !important;
} */


/* Cuando está seleccionado, el borde y el interior pasan a naranja */


/* Radio seleccionado */

/* input[type="radio"]:checked {
    border-color: rgb(255, 115, 0) !important;
} */
.progressSideBarBTN {
    position: fixed;
    top: 50%;
    right: -40px;
    transform: translateY(-50%);
    width: 40px;
    height: 120px;
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 1055;
    background-color: rgb(255, 115, 0);
    color: white;
    transition: background-color 0.2s;
    border-top-right-radius: 8px;
    border-bottom-right-radius: 8px;
    border-left: none;
    text-decoration: none;
    text-orientation: mixed;
    margin: 0;
    border-top-left-radius: 0;
    border-bottom-left-radius: 0;
}

.progressSideBarBTN:hover {
    background-color: white !important;
    border: 3px solid rgb(255, 115, 0);
    border-left: none;
    color: rgb(255, 115, 0);
    cursor: pointer;
}

.progressSideBarBTN:active {
    background-color: white !important;
    border: 3px solid rgb(255, 115, 0);
    border-left: none;
    color: rgb(255, 115, 0) !important;
}

.progress-sidebar {
    position: fixed;
    top: 0;
    left: 0;
    width: 250px;
    height: 100%;
    background-color: white !important;
    z-index: 1050;
    transform: translateX(-100%);
    transition: transform 0.3s ease-in-out;
    border-right: 3px solid rgb(255, 115, 0);
}

.progress-sidebar.active {
    transform: translateX(0);
}

.progressContent {
    overflow-y: scroll !important;
    overflow-x: hidden !important;
    height: 93%;
    /* o usa height: calc(100% - altura_header) si hay un header dentro */
}

.progressContent::-webkit-scrollbar {
    display: none;
}


/* Barra de progreso */

.vertical-progress-bar {
    position: relative;
    width: 40px;
    display: flex;
    flex-direction: column;
    align-items: center;
}

.progress-item {
    display: flex;
    align-items: center;
    height: 54px;
    position: relative;
    text-decoration: none;
    justify-content: center;
}

.circle-container {
    width: 40px;
    /* Este ancho fija la columna de los círculos */
    display: flex;
    justify-content: center;
    align-items: center;
    flex-shrink: 0;
}

.chapterProgress-title {
    position: absolute;
    left: 100%;
    top: 50%;
    transform: translateY(-50%);
    padding: 5px 10px;
    border-radius: 5px;
    z-index: 10;
    font-size: larger;
    max-width: 200px;
    box-sizing: border-box;
    overflow: visible;
    /* Deja visible el fondo extendido */
}


/* Fondo extendido */

.chapterProgress-title::before {
    content: '';
    position: absolute;
    top: 0;
    left: -110vw;
    width: 200vw;
    height: 100%;
    background: rgb(194, 194, 194);
    border-radius: 5px;
    z-index: -1;
    opacity: 0;
    transition: opacity 0.2s ease;
    pointer-events: none;
    -webkit-mask-image: linear-gradient(to bottom, transparent, black 10%, black 90%, transparent);
    mask-image: linear-gradient(to bottom, transparent, black 10%, black 90%, transparent);
}


/* Hover para mostrar fondo */

.progress-item:hover .makeBiggerCircle-progress:not(.NOTmakeBiggerCircle-progress)~.chapterProgress-title::before {
    opacity: 1;
}


/* Texto con puntos suspensivos */

.chapterProgress-text {
    display: block;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    color: #561eaa;
}

.chapterProgress-title:hover .makeBiggerCircle-progress {
    transform: scale(1.5);
}

.courseTitle-progressSidebar {
    color: white;
    background-color: #561eaa;
    height: 7%;
    display: flex;
    justify-content: center;
    align-items: center;
    overflow-x: hidden;
}

.progress-circle {
    width: 26px;
    height: 26px;
    border: 3px solid #ccc;
    border-radius: 50%;
    background-color: white;
    color: #000;
    text-align: center;
    line-height: 20px;
    /* Asegura que el número se vea bien */
    font-size: 14px;
    z-index: 20;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: bold;
}

.makeBiggerCircle-progress {
    transition: transform 0.2s ease;
    /* Agrega la transición para el tamaño */
    cursor: pointer;
}

.progress-item:hover .makeBiggerCircle-progress:not(.NOTmakeBiggerCircle-progress) {
    transform: scale(1.5);
}

.NOTmakeBiggerCircle-progress:hover {
    transform: scale(1) !important;
    cursor: default;
}

.progress-circle.completed {
    background-color: #28a745;
    color: white;
    border-color: #28a745;
}

.progress-circle.current {
    border-color: #ff7300;
    box-shadow: 0 0 5px rgba(255, 115, 0, 0.8);
}

/* input[type="radio"]:checked::before {
    background-color: rgb(255, 115, 0) !important;
} */


/* Checkbox seleccionado */

/* input[type="checkbox"]:checked {
    border-color: rgb(255, 115, 0) !important;
} */
.progress-circle.progressCircleExam {
    background-color: #ff7300;
    color: white;
    font-size: smaller;
    transform: scale(1.4) !important;
}

.progress-line-background {
    position: absolute;
    top: 0;
    left: 50%;
    transform: translateX(-50%);
    width: 4px;
    background-color: #ccc;
    z-index: 10;
    border-radius: 2px;
    height: 100%;
}

.progress-line-fill {
    position: absolute;
    top: 0;
    left: 50%;
    transform: translateX(-50%);
    width: 4px;
    background-color: #28a745;
    z-index: 15;
    border-radius: 2px;
    transition: height 0.4s ease;
}

/* input[type="checkbox"]:checked::before { */
    /* si usas ✔, recoloreamos la marca */
    /* color: rgb(255, 115, 0) !important; */
/* } */

.progress-line-background,
.progress-line-fill {
    top: 13px;
    /* En vez de top: 0 */
    height: calc(100% - 26px);
    /* 13px arriba y 13px abajo */
}

.progress-circle.user-progress {
    background-color: #561eaa;
    /* naranja clarito */
    color: white;
}

.chapter-content {
    background-color: #ffffff !important;
    border: 3px solid rgb(255, 115, 0) !important;
    /* naranja */
    border-radius: 0 !important;
    /* sin redondear */
    padding: 1.5rem;
    /* espacio interior */
    margin-bottom: 2rem;
    /* separación con lo que venga debajo */
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.1);
}

.custom-alert {
    position: fixed;
    top: 20px;
    left: 50%;
    transform: translateX(-50%);
    background-color: rgb(255, 115, 0);
    color: #fff;
    padding: 0.75rem 1.25rem;
    border-radius: 0.25rem;
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.2);
    font-size: 1rem;
    z-index: 9999;
    opacity: 1;
    transition: opacity 0.5s ease;
}

#togglePassword {
    float: right;
    margin-left: -25px;
    margin-top: -30px;
    right: 10px;
    position: relative;
    z-index: 2;
    cursor: pointer;
}

#togglePassword2 {
    float: right;
    margin-left: -25px;
    right: 10px;
    position: relative;
    z-index: 2;
    cursor: pointer;
}

#togglePassword3 {
    float: right;
    margin-left: -25px;
    right: 10px;
    position: relative;
    z-index: 2;
    cursor: pointer;
}

#togglePassword4 {
    float: right;
    margin-left: -25px;
    right: 10px;
    position: relative;
    z-index: 2;
    cursor: pointer;
}

#togglePassword5 {
    float: right;
    margin-left: -25px;
    right: 10px;
    position: relative;
    z-index: 2;
    cursor: pointer;
}

#notasContainer {
    opacity: 95% !important;
}

.notes-sidebar {
    position: fixed;
    top: 0;
    right: 0;
    width: 400px;
    height: 100%;
    background-color: white;
    z-index: 1050;
    transform: translateX(100%);
    transition: transform 0.3s ease-in-out;
}

.notes-sidebar.active {
    transform: translateX(0);
}

#notesContent>.row>.col-12>.card>.card-footer>.btn,
#notesContent>.row>.col-12>.card>.card-footer>form>.btn {
    width: 40% !important;
}

.contenedorInfoCurso{
    min-height: 69vh;
}

/* Corazón por defecto (no favorito) */

.corazon {
    width: 20px;
    height: 20px;
    fill: transparent;
    stroke: #6f42c1;
    /* Rojo desactivado */
    stroke-width: 2;
    transition: fill 0.4s, stroke 0.4s;
    cursor: pointer;
}

/* Estilo cuando el botón del acordeón está expandido */
.accordion-button:not(.collapsed) {
    background-color: #6f42c1 !important; /* Lila oscuro */
    color: #fff !important;               /* Texto blanco */
}
/* Cuando está activo (favorito) */

.corazon.active {
    fill: #561eaa;
    /* Relleno rojo */
    stroke: #561eaa;
    /* Borde rojo */
}


/* Hover solo si NO está activo */

.favorite-btn:hover .corazon:not(.active) {
    fill: #561eaa;
    stroke: #561eaa;
}

/* Quitar el color azul del borde/focus */
.accordion-button:focus {
    box-shadow: none;
    border-color: #6f42c1;
}
/* Hover cuando SÍ está activo: mantener el color */

.favorite-btn:hover .corazon.active {
    fill: #561eaa;
    stroke: #561eaa;
}

.disabled {
    background-color: #e9ecef !important;
}

.modal {
    pointer-events: none !important;
    background: transparent !important;
}


/* Pero el modal sí puede recibir clics y ser interactivo */

.modal-dialog {
    pointer-events: auto;
    /* position: absolute; */
    /* Necesario para draggable */
    z-index: 1060;
}

.modal-dialog2 {
    position: absolute;
}

#viewNoteModal {
    display: block !important;
    /* desactiva centramiento por flex */
}

#viewNoteModal .modal-dialog {
    margin: 0 !important;
}

#viewNoteModal:not(.show) .modal-dialog {
    width: 0 !important;
    height: 0 !important;
    overflow: hidden;
    margin: 0 !important;
    padding: 0 !important;
    pointer-events: none;
    opacity: 0;
}


/* ---------------------------- Botón de IA ----------------------------- */

#ai-chat-container {
  position: fixed;
  bottom: 20px;
  right: 20px;
  width: 60px;
  height: 60px;
  border-radius: 50%;
  background-color: #561eaa;
  box-shadow: 0 4px 8px rgba(0, 0, 0, 0.2);
  overflow: hidden;
  transition:
    width 0.4s ease,
    height 0.4s ease,
    border-radius 0.4s ease,
    background-color 0.4s ease,
    box-shadow 0.4s ease,
    bottom 0.4s ease,
    right 0.4s ease;
  display: flex;
  flex-direction: column;
  z-index: 1035;
}

/* Ajuste si hay otro botón flotante */
body:has(#quickNotes-button) #ai-chat-container {
  bottom: 95px !important;
}

#quickNotes-button {
  position: fixed;
  bottom: 20px;
  right: 20px;
  width: 60px;
  height: 60px;
  border: none;
  border-radius: 50%;
  background-color: rgb(255, 115, 0);
  color: white;
  font-size: 1.5rem;
  cursor: pointer;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  box-shadow: 0 4px 8px rgba(0, 0, 0, 0.2);
  overflow: hidden;
  z-index: 100;
  transition:
    width 0.4s ease,
    height 0.4s ease,
    border-radius 0.4s ease,
    background-color 0.4s ease,
    box-shadow 0.4s ease,
    bottom 0.4s ease,
    right 0.4s ease;
}


#quickNotes-button i {
    transition: transform 0.3s ease;
}

#quickNotes-button:hover i {
    transform: scale(1.2);
}
#quickNotes-button:hover {
    background-color: rgb(141, 63, 0);
}

#ai-chat-button {
  width: 100%;
  height: 100%;
  background: transparent;
  border: none;
  border-radius: inherit;
  color: white;
  font-size: 1.5rem;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: opacity 0.2s ease;
  z-index: 2;
}

#ai-chat-button:hover {
  background-color: #3a0b80;
  transform: scale(1.1);
}

.ai-chat-icon-animate {
  font-size: 1.5rem;
  background-image: linear-gradient(to top, white 50%, rgb(255, 115, 0) 50%);
  background-size: 100% 200%;
  background-position: bottom;
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
  transition: background-position 0.4s ease, transform 0.4s ease;
}

#ai-chat-button:hover .ai-chat-icon-animate {
  background-position: top;
  transform: scale(1.2);
}

#ai-chat-container.expanded {
  width: 50vw;
  height: calc(100vh - 120px);
  border-radius: 16px;
  background-color: #fff;
  box-shadow: 0 0 10px 10px rgba(130, 119, 255, 0.715);
  bottom: 20px;
  right: 20px;
}

#ai-chat-container.expanded #ai-chat-expanded {
  display: flex;
  z-index: 1;
}

#ai-chat-container.expanded #ai-chat-button {
  background-color: #3a0b80 !important;
  transform: none !important;
  cursor: default;
}

#ai-chat-container.expanded #ai-chat-button:hover .ai-chat-icon-animate {
  background-position: bottom !important;
  transform: none !important;
}

#ai-chat-expanded {
  display: none;
  flex-direction: column;
  flex-grow: 1;
  overflow: hidden;
  box-sizing: border-box;
  color: #333;
}

.ai-chat-header {
  background-color: #3a0b80;
  color: white;
  padding: 0.75rem 1rem;
  font-weight: bold;
  font-size: 1.2rem;
  border-radius: 16px 16px 0 0;
  display: flex;
  align-items: center;
  flex-shrink: 0;
}

.ai-chat-close {
  position: absolute;
  top: 12px;
  right: 16px;
  font-size: 1.2rem;
  color: white;
  cursor: pointer;
  z-index: 10;
  user-select: none;
  background: transparent;
  border: none;
  padding: 0;
  display: none; /* Oculto por defecto */
  transition: color 0.2s ease;
}

.ai-chat-close:hover {
  color: #9269cf;
}

.ai-chat-body {
  flex: 1;
  overflow-y: auto;
  padding: 1rem;
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
  background-color: #f4f4f8;
  /* Scrollbar personalizado para WebKit (Chrome, Safari, Edge) */
  scrollbar-width: thin;               /* Firefox */
  scrollbar-color: #7a5cff transparent; /* Firefox */
}

/* Scroll del body de la ia */

/* WebKit Browsers */
.ai-chat-body::-webkit-scrollbar {
  width: 8px;
}

.ai-chat-body::-webkit-scrollbar-track {
  background: transparent;
}

.ai-chat-body::-webkit-scrollbar-thumb {
  background-color: #7a5cff;
  border-radius: 4px;
  border: 2px solid transparent; /* espacio alrededor del thumb */
  background-clip: content-box;
}

/* Hover para dar feedback */
.ai-chat-body::-webkit-scrollbar-thumb:hover {
  background-color: #5a3dcc;
}

.ai-chat-message {
  max-width: 75%;
  padding: 0.6rem 1rem;
  border-radius: 16px;
  line-height: 1.4;
  word-wrap: break-word;
  padding-top: 16px;
  margin-bottom: 5px;
}

.ai-chat-message-user {
  align-self: flex-end;
  background-color: #d6bbfb;
  color: #2d0c57;
  border-bottom-right-radius: 0;
}

.ai-chat-message-assistant {
  align-self: flex-start;
  background-color: white;
  color: #333;
  border-bottom-left-radius: 0;
  box-shadow: 0 0 10px 5px rgba(130, 119, 255, 0.715);
  position: relative; /* Para que el botón se posicione relativo a este contenedor */
}

.ai-chat-message-assistant:has(.ai-speaker-button) {
    padding-bottom: 36px; /* Espacio extra abajo para que no tape texto */
}

.header-icon {
  font-size: 1.5rem;
  margin-right: 0.5rem;
  color: rgb(255, 115, 0);
  background-size: 100% 200%;
  background-position: top;
  user-select: none;
}

.loader-wrapper {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
}

.loader-circle {
  position: absolute;
  width: 48px;
  height: 48px;
  border: 4px solid transparent;
  border-top-color: rgb(255, 115, 0);
  border-radius: 50%;
  animation: spin1 1s linear infinite;
  pointer-events: none;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
}

@keyframes spin1 {
  0% { transform: translate(-50%, -50%) rotate(0deg); }
  100% { transform: translate(-50%, -50%) rotate(360deg); }
}

/* Botón reintentar mejorado */
#retry-button {
  position: absolute;
  top: 70%; /* justo debajo del icono */
  left: 50%;
  transform: translateX(-50%);
  background-color: transparent;
  border: 1px solid rgb(255, 115, 0); /* borde naranja */
  color: rgb(255, 115, 0); /* texto naranja */
  font-weight: bold;
  cursor: pointer;
  font-size: 0.9rem;
  z-index: 3;
  padding: 4px 10px;
  border-radius: 6px;
  display: none;
  transition: background-color 0.3s ease, color 0.3s ease, border-color 0.3s ease;
}

#retry-button:hover {
  background-color: rgb(255, 115, 0); /* fondo naranja */
  color: #3a0b80; /* texto lila */
}


#ai-chat-container.expanded .ai-chat-icon-animate {
  background: none !important;
  -webkit-background-clip: unset !important;
  background-clip: unset !important;
  color: rgb(255, 115, 0) !important; /* o el color que prefieras */
}

.ai-chat-footer {
  padding: 0.5rem 1rem;
  background-color: #f9f9f9;
  border-top: 1px solid #ddd;
  gap: 0.5rem;
}

.ai-chat-textarea {
  flex-grow: 1;
  resize: none;
  overflow: hidden;
  font-size: 1rem;
  padding: 0.5rem 0.75rem;
  border-radius: 10px;
  border: 1px solid #825fff;
  transition: border-color 0.3s ease;
  min-height: 38px; /* approx 1 row */
  max-height: 150px; /* max grow */
  line-height: 1.4;
  font-family: inherit;
  overflow-y: hidden;
  scrollbar-width: thin;                 /* Firefox */
  scrollbar-color: #aaa transparent;    /* Thumb gris claro, track transparente */
}

.ai-chat-textarea:focus {
  border-color: #2d138b;
  outline: none;
  box-shadow: 0 0 5px rgba(130, 95, 255, 0.5);
}

/* Scroll para textarea ia */

/* WebKit Browsers */
.ai-chat-input-textarea::-webkit-scrollbar {
  width: 6px;
}

.ai-chat-input-textarea::-webkit-scrollbar-track {
  background: transparent;
}

.ai-chat-input-textarea::-webkit-scrollbar-thumb {
  background-color: #aaa;
  border-radius: 3px;
  border: 1.5px solid transparent;
  background-clip: content-box;
}

.ai-chat-input-textarea::-webkit-scrollbar-thumb:hover {
  background-color: #888;
}

.ai-chat-btn {
  background-color: #3a0b80;
  border: none;
  color: white;
  width: 38px;
  height: 38px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: background-color 0.3s ease;
  padding: 0;
}

.ai-chat-btn:hover {
  background-color: #1c053f;
  color: rgb(255, 115, 0);
}

.ai-chat-btn i {
  font-size: 1.2rem;
  pointer-events: none;
  user-select: none;
}

.ai-speaker-button {
  position: absolute;
  bottom: 8px;    /* Separado un poco del borde inferior */
  left: 8px;      /* Separado un poco del borde izquierdo */
  width: 28px;
  height: 28px;
  border-radius: 50%;
  border: none;
  background-color: #3a0b80;
  color: white;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.15);
  transition: background-color 0.2s ease;
  transition: transform 0.2s ease;
}

.ai-speaker-button:hover {
  background-color: rgb(255, 115, 0);
  transform: scale(1.1);
}

.ai-speaker-button:focus {
  border: none;
}

/* Ajusta el icono para que encaje bien */
.ai-speaker-button .bi-mic-fill {
  font-size: 16px;
  pointer-events: none; /* Para que el click pase al botón, no al icono */
}

/* -------------------------------------------------------- */

/* Boton de escuchar IA */
.loader-button-small {
  width: 16px;
  height: 16px;
  border: 2px solid #ccc;
  border-top: 2px solid #333;
  border-radius: 50%;
  animation: spin2 0.6s linear infinite;
  display: inline-block;
}

@keyframes spin2 {
  0% { transform: rotate(0deg); }
  100% { transform: rotate(360deg); }
}

/* Estilos para chat/forum */

.forum-section {
  position: relative; /* necesario para footer absolute */
  width: 100%;
  height: 100vh;
  display: flex;
  flex-direction: column;
  background-color: #fff;
  /* border-left: 15px solid #561eaa;
  border-right: 15px solid #561eaa;
  border-bottom: 25px solid #561eaa; */
}

.forum-messages {
  flex: 1;
  overflow-y: auto;
  padding-top: 1rem;
  padding-bottom: 70px !important;
  background-color: white;
}

.forum-messages::after {
  content: "";
  position: sticky;
  bottom: 0;
  left: 0;
  width: 100%;
  height: 3rem; /* altura del degradado, ajusta a gusto */
  pointer-events: none; /* para que no interfiera con scroll o clicks */
  background: linear-gradient(
    to bottom,
    rgba(124, 87, 178, 0),   /* transparente arriba */
    rgba(124, 87, 178, 0.55), /* semitransparente en medio */
    rgba(124, 87, 178, 0.85)  /* color sólido abajo */
  );
  z-index: 10;
}

.forum-header {
  background-color: #561eaa;
  color: white;
  padding: 0.75rem 1rem;
  display: flex;
  align-items: center;
  justify-content: space-between; /* espacios entre los 3 elementos */
  border-bottom: 1px solid rgba(255, 255, 255, 0.2);
  position: relative;
}

/* Botón a la izquierda */
.center-btn {
  background: transparent;
  border: none;
  color: white;
  font-size: 1.5rem;
  cursor: pointer;
  padding: 0;
  margin: 0;
  width: 2rem;
  height: 2rem;
  display: flex;
  align-items: center; /* centra verticalmente */
  justify-content: center; /* centra horizontalmente */
  transition: color 0.2s ease;
}
.center-btn:hover {
    color: rgb(189, 135, 255);
}

.scroll-to-bottom {
  position: absolute;
  bottom: 80px;
  left: 50%;                     /* centro horizontal */
  transform: translateX(-50%);   /* ajusta al centro */
  background-color: #561eaa;
  color: white;
  border: none;
  border-radius: 50%;
  width: 2.5rem;
  height: 2.5rem;
  font-size: 1.5rem;
  display: none;
  cursor: pointer;
  box-shadow: 0 4px 6px rgba(0, 0, 0, 0.2);
  transition: opacity 0.3s ease, transform 0.2s ease;
  z-index: 20;

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

.scroll-to-bottom:hover {
  background-color: #431b8f;
  transform: translateX(-50%) scale(1.1); /* mantener centrado al escalar */
}



/* Título centrado */
.forum-header h5 {
  margin: 0;
  font-size: 1.25rem;
  font-weight: 600;
  position: absolute;
  left: 50%;
  transform: translateX(-50%);
  pointer-events: none; /* para que clics no afecten el título */
}

/* Espacio vacío a la derecha para equilibrar */
.right-space {
  width: 2rem; /* mismo ancho que el botón */
}


.forum-header i {
  font-size: 1.2rem;
}

/* Contenedor base de cada mensaje */
.forum-message {
  max-width: 60%;
  padding: 0.75rem 1rem;
  margin-bottom: 2rem;
  position: relative;
  background-color: white;
  font-size: 1rem;
  box-shadow: -10px 8px 5px 6px rgba(0, 0, 0, 0.16);
  width: fit-content;
  word-break: break-word;
  overflow-wrap: break-word;
  min-width: 15vw;
}

/* Mensajes de otros usuarios - izquierda */
.forum-message--other {
  border: 2px solid #ff7f50; /* borde naranja */
  border-radius: 1rem 1rem 1rem 0; /* sin curvar abajo izquierda */
  margin-right: auto;
  margin-left: 0;
  text-align: left;
}

/* Mensajes del usuario - derecha */
.forum-message--user {
  border: 2px solid #7c57b2; /* borde lila */
  border-radius: 1rem 1rem 0 1rem; /* sin curvar abajo derecha */
  margin-left: auto;
  margin-right: 0;
  text-align: left;
}

/* Mensajes del profesor - fondo naranja claro, mismo estilo que otros */
.forum-message--teacher {
  border: 2px solid #ff7f50; /* borde naranja */
  border-radius: 1rem 1rem 1rem 0;
  background-color: rgb(255, 211, 178); /* fondo naranja clarito */
  
  margin-right: auto;
  margin-left: 0;
  text-align: left;
}

.forum-message--other .forum-message__username,
.forum-message--teacher .forum-message__username {
  font-weight: 600;
  color: #7c57b2;
  margin-bottom: 0.15rem; /* menos espacio abajo */
  font-size: 0.85rem;
  line-height: 1; /* reduce espacio vertical */
  user-select: none;
}

.forum-message__timestamp {
  font-size: 0.75rem;
  color: #999999;
  user-select: none;
  text-align: right;
  margin-top: 0.1rem; /* menos espacio arriba */
  line-height: 1;
}

/* Contenedor de mensaje (solo para separar el texto y timestamp) */
.forum-message__content {
  margin-bottom: 0.5rem;
}

.course-forum-footer {
  position: absolute;
  bottom: 0;
  left: 0;
  width: 100%;
  height: 70px; /* igual que lo que restamos arriba */
  background-color: transparent;
  display: flex;
  align-items: center;
  padding-left: 5%;
  padding-right: 5%;
  box-sizing: border-box;
  /* si quieres sombra o borde para separar */
  z-index: 10;
}

.course-forum-input-wrapper {
  display: flex;
  align-items: center;
  background-color: transparent;
  overflow: hidden;
  width: 100%;
  margin: 0;
  border: none;
  padding-left: 5%;
  padding-right: 5%;
  padding-bottom: 20px;
}

.course-forum-input {
  flex: 1;
  min-width: 0;
  border: none;
  border-top: 2px solid #561eaa;
  border-bottom: 2px solid #561eaa;
  padding: 0.7rem 1rem;
  font-size: 1rem;
  outline: none;
  background-color: white;
  box-shadow: 0px 8px 6px 6px rgba(137, 70, 185, 0.368);
  position: relative;
  z-index: 1;
}

.course-forum-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background-color: #561eaa;
  color: white;
  border: none;
  padding: 0.65rem 1rem;
  cursor: pointer;
  transition: background-color 0.3s;
  font-size: 1.1rem;
  height: 100%;
}

.course-forum-btn:hover {
  background-color: #431b8f;
}

.course-forum-mic-btn {
  border-top-left-radius: 999px;
  border-bottom-left-radius: 999px;
  box-shadow: -12px 8px 6px 6px rgba(137, 70, 185, 0.368);
  position: relative;
  z-index: 2;
  border-top: 2px solid #561eaa;
  border-left: 2px solid #561eaa;
  border-bottom: 2px solid #561eaa;
}

.course-forum-send-btn {
  border-top-right-radius: 999px;
  border-bottom-right-radius: 999px;
  box-shadow: 12px 8px 6px 6px rgba(137, 70, 185, 0.368);
  position: relative;
  z-index: 2;
  border-top: 2px solid #561eaa;
  border-right: 2px solid #561eaa;
  border-bottom: 2px solid #561eaa;
}

/* RESPONSIVE */

@media (max-width: 768px) {
  #ai-chat-container.expanded {
    width: 90vw;
    left: 50%;
    right: auto;
    transform: translateX(-50%);
  }
}

@media (max-width: 768px) {
    .btn-header {
        width: 110px;
        margin: 5px;
    }
    .contenedorBotonesHeader {
        display: flex;
        flex-direction: row;
    }

    .btnHeader {
        width: 50px;
    }
    .hide {
        display: none;
    }
    .notes-sidebar {
        width: 100%;
    }
    .progress-sidebar {
        width: 50vw;
    }
    .chapterProgress-title {
        max-width: 40vw;
    }
    .modal-dialog {
        max-width: 100% !important;
        margin: 0;
        height: 100vh;
    }
    .modal-content {
        height: 100vh;
        border-radius: 0;
    }
}