@import url('https://fonts.googleapis.com/css2?family=Mont:wght@700&family=Inter:wght@400;500;700&display=swap');

:root {
    --primary-color: #6622CF;
    --secondary-color: #00CCFE;
    --accent-color: #FFD24C;
    --text-color: #333;
    --bg-color: #ffffff;
    --card-bg: #f9f9f9;
}

body {
    margin: 0;
    padding: 0;
    font-family: 'Inter', sans-serif;
    background-color: var(--bg-color);
    color: var(--text-color);
}

/* NAVBAR FIJA SUPERIOR */
.navbar-fixed {
    position: fixed;
    top: 0;
    width: 100%;
    height: 70px;
    background-color: var(--primary-color);
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0 20px;
    z-index: 1000;
    box-shadow: 0 2px 5px rgba(0,0,0,0.1);
}

.navbar-logo img {
    height: 40px;
}

.navbar-menu {
    display: flex;
    gap: 20px;
}

.navbar-menu a {
    color: white;
    font-weight: 500;
    text-decoration: none;
    font-size: 16px;
    transition: color 0.3s;

    display: flex;
    gap: 10px;
    align-items: center;
}

.navbar-menu a:hover {
    color: var(--accent-color);
}

.lesson-name-navbar{

    color: #fff;
}



.navbar-user {
    display: flex;
    align-items: center;
    gap: 15px;
}

.navbar-user img {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    cursor: pointer;
}


.back-button-circle {
    width: 40px;
    height: 40px;
    background-color: white;
    border-radius: 50%;
    color: var(--primary-color);
    display: flex;
    align-items: center;
    justify-content: center;
    text-decoration: none;
    font-size: 18px;
    box-shadow: 0 2px 6px rgba(0,0,0,0.15);
    transition: background-color 0.3s ease, transform 0.2s ease;
    text-decoration: none !important;
}

.back-button-circle:hover {
    background-color: #f1f1f1;
    transform: scale(1.05);
    text-decoration: none !important;
}


/* HEADER DE SALUDO */
.header {
    margin-top: 90px;
    padding: 20px;
    text-align: center;
}

.header h1 {
    font-family: 'Mont', sans-serif;
    font-size: 28px;
    color: var(--text-color);
    margin: 0;
}

/* CONTENIDO PRINCIPAL */
.workspace-container {
  position: absolute;
  top: 70px;
  left: 0;
  width: 100%;
  height: calc(100vh - 70px);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: flex-start;
  background-image: url('/img/wallia2.png?v=<?php echo $timestamp; ?>');
  background-size: cover;
  background-position: center;
  background-repeat: no-repeat;
  padding: 40px 20px;
  overflow-y: auto;
  text-align: center;
}

h2{

    color:white;
    background: rgba(0,0,0,0.7);
    padding: 15px 25px;
    border-radius: 12px;
}


.content {
    padding: 20px;
    max-width: 900px;
    margin: 0 auto;
}

.content h2 {
    font-family: 'Mont', sans-serif;
    font-size: 22px;
    margin-bottom: 20px;
    color: var(--primary-color);
    font-weight: 700;
    text-align: left;
}

/* CARDS DE CURSOS */
.card {
    border: none;
    border-radius: 20px;
    background-color: var(--card-bg);
    box-shadow: 0 4px 10px rgba(0,0,0,0.05);
    overflow: hidden;
}

.card-title {
    font-family: 'Mont', sans-serif;
    font-size: 20px; /* Aumentamos ligeramente el tamaño */
    font-weight: 700; /* Le damos mayor grosor */
    color: var(--primary-color);
    letter-spacing: 0.5px; /* Separación sutil entre letras */
    text-shadow: 0 1px 1px rgba(0, 0, 0, 0.1); /* Ligera sombra para más volumen */
    margin-bottom: 0.75rem;
}


.card-text {
    font-size: 14px;
    color: #666;
}


.card-featured {
    display: flex;
    flex-direction: row; /* fuerza layout horizontal */
    align-items: stretch; /* imagen y contenido tengan misma altura */
    background: linear-gradient(135deg, #ede8fb, #e3f2fb);
    border: none;
    border-radius: 20px;
    box-shadow: 0 2px 5px rgba(102, 34, 207, 0.1);
    overflow: hidden;
    padding: 0;
    flex-wrap: nowrap; /* ¡evita que se apilen! */
}

.card-featured .card-image {
    width: 120px;
    background-color: #fff;
    display: flex;
    align-items: center;
    justify-content: center;
    border-right: 1px solid #eee;
    overflow: hidden; /* oculta cualquier exceso de imagen */
}

.card-featured .card-image img {
    width: 100%;
    height: 100%;
    object-fit: cover; /* rellena el espacio sin deformarse */
    display: block;
}


.card-featured .card-body {
    flex: 1;
    padding: 20px;
    display: flex;
    flex-direction: column;
    justify-content: center;
}

/* Barra de progreso */
.card-featured .progress-bar {
    background: #FFD24C;
}





.progress {
    height: 20px;
    border-radius: 10px;
    background-color: #fff;
    overflow: hidden;
    margin-top: 10px;
}

.progress-bar {
    background-color: var(--primary-color);
    font-weight: bold;
    text-align: center;
    line-height: 20px;
}

.progress-complete {
    background-color: #55ce63 !important;
}




.btn-floating-rounded {
    width: 56px;
    height: 56px;
    border-radius: 50%;
    background-color: #00CCFE; /* azul de la paleta */
    color: white;
    font-size: 22px;
    display: flex;
    align-items: center;
    justify-content: center;
    text-decoration: none !important; /* evitar subrayado incluso en <a> */
    border: none;
    box-shadow: 0 4px 10px rgba(0, 204, 254, 0.3);
    margin: auto 20px 20px auto;
    transition: background-color 0.3s ease, transform 0.3s ease;
    position: relative;
    z-index: 1;
}

.btn-floating-rounded:hover {
    background-color: #009ac0; /* azul más oscuro */
    transform: scale(1.05);
    text-decoration: none; /* aseguramos que no se subraye */
}









.lesson-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 20px;
    padding: 20px 0;
}

.lesson-card {
    position: relative;
    background-color: #fff;
    border-radius: 15px;
    padding: 20px;
    text-align: center;
    flex: 1 1 calc(25% - 20px);
    box-shadow: 0 4px 8px rgba(0,0,0,0.05);
    display: flex;
    flex-direction: column;
    justify-content: center;
    text-decoration: none;
    color: inherit;
    border: 1px solid transparent;
    transition: transform 0.2s ease, border 0.2s ease;
}

.lesson-card:hover {
    transform: scale(1.03);
    text-decoration: none;
    border: 2px solid #6622CF; /* Borde morado */
}


.lesson-check {
    position: absolute;
    top: 10px;
    right: 10px;
    background-color: rgb(44, 187, 69);
    color: #fff;
    width: 24px;
    height: 24px;
    border-radius: 50%;
    font-size: 14px;
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 2;
}

.lesson-card .lesson-number {
    font-family: 'Mont', sans-serif;
    font-size: 36px;
    color: var(--primary-color);
    font-weight: bold;
    margin-bottom: 10px;
}

.lesson-card .lesson-name {
    font-family: 'Inter', sans-serif;
    font-size: 14px;
    font-weight: 500;
    color: #666;
}

.module-title {
    grid-column: 1 / -1;
    font-family: 'Mont', sans-serif;
    font-size: 20px;
    font-weight: bold;
    color: var(--primary-color);
    padding: 10px 0;
    margin-top: 30px;
    border-bottom: 2px solid rgba(102, 34, 207, 0.1);
}

.lesson-card.lesson-completed {
    background-color: #6622CF;
    color: white;
    border: 1px solid transparent;
}

.lesson-card.lesson-completed .lesson-number,
.lesson-card.lesson-completed .lesson-name {
    color: white;
}



/* Botones circulares para ejercicios */
.exercise-circle {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background-color: #ffffff; /* Fondo blanco por defecto */
    border: 2px solid var(--primary-color); /* Borde morado */
    display: flex;
    justify-content: center;
    align-items: center;
    margin: 0 5px;
    font-size: 16px;
    font-weight: bold;
    transition: background-color 0.3s, color 0.3s;
}

.exercise-circle a {
    color: var(--primary-color); /* Texto morado por defecto */
    text-decoration: none;
    display: flex;
    justify-content: center;
    align-items: center;
    width: 100%;
    height: 100%;
}

/* Ejercicios completados */
.exercise-circle.active-exercise {
    background-color: rgb(44, 187, 69); /* Verde completado */
    border-color: rgb(44, 187, 69);
}

.exercise-circle.active-exercise a {
    color: #ffffff; /* Texto blanco cuando está completado */
}

/* Hover */
.exercise-circle:hover {
    background-color: #f1f1f1;
}


.control-bar {
    position: fixed;
    bottom: 0;
    left: 0;
    width: 100%;
    display: flex;
    justify-content: center;
    gap: 10px;
    background-color: var(--primary-color);
    padding: 10px 0;
    z-index: 1000; /* Asegura que esté por encima de otros elementos */
    box-shadow: 0 -2px 10px rgba(0, 0, 0, 0.1); /* Sombra suave opcional */
}


.control-btn {
    width: 80px;
    height: 80px;
    background-color: transparent;
    background-size: contain;
    background-repeat: no-repeat;
    background-position: center;
    border: none;
    border-radius: 10%;
    cursor: pointer;
    transition: transform 0.2s, filter 0.2s, z-index 0.2s;
    position: relative;
    z-index: 1;
}

/* Botones específicos */
.control-btn.up {
    background-image: url('/img/cbup.png?v=<?php echo $timestamp; ?>');
}
.control-btn.left {
    background-image: url('/img/cbleft.png?v=<?php echo $timestamp; ?>');
}
.control-btn.right {
    background-image: url('/img/cbright.png?v=<?php echo $timestamp; ?>');
}
.control-btn.down {
    background-image: url('/img/cbdown.png?v=<?php echo $timestamp; ?>');
}
.control-btn.undo {
    background-image: url('/img/cbundo.png?v=<?php echo $timestamp; ?>');
}

.control-btn.key {
    background-image: url('/img/cbkey.png?v=<?php echo $timestamp; ?>');
}

.control-btn.bulb {
    background-image: url('/img/cbbulb.png?v=<?php echo $timestamp; ?>');
}

.control-btn.alien {
    background-image: url('/img/cbalien.png?v=<?php echo $timestamp; ?>');
}

.control-btn.planet {
    background-image: url('/img/cbplanet.png?v=<?php echo $timestamp; ?>');
}




.control-btn:hover:not(.disabled) {
    transform: scale(1.1);
    z-index: 10;
    filter: brightness(1.1);
}

/* Estilo cuando el botón está deshabilitado */
.control-btn.disabled {
    filter: grayscale(1) opacity(0.5);
    pointer-events: none;
    z-index: 0;
}




#sequence-bar {
    position: fixed;
    bottom: 100px; /* Ajustado para quedar arriba del control-bar */
    left: 0;
    width: 100%;
    padding: 5px 20px;
    background-color: #ffffff;
    display: flex;
    justify-content: flex-start; /* Alinea a la izquierda */
    gap: 10px;
    z-index: 999; /* Debajo del control-bar si este usa 1000 */
    box-shadow: 0 -1px 8px rgba(0, 0, 0, 0.05); /* Sombra sutil opcional */
}


.sequence-step {
    width: 60px;
    height: 60px;
    background-size: contain;
    background-position: center;
    background-repeat: no-repeat;
    border-radius: 10px;
    margin-left: -10px;
}

.seqsfirst{
    margin: left 0px !important;
}




.modal {
    display: none;
    position: fixed;
    z-index: 1000;
    left: 50%;
    top: 50%;
    transform: translate(-50%, -50%);
    width: 90%;
    max-width: 400px;
    background: white;
    border-radius: 15px;
    box-shadow: 0 6px 15px rgba(0, 0, 0, 0.2);
    text-align: center;
    padding: 30px 20px;
    height: auto !important;
    max-height: 80vh;
    overflow-y: auto;
}


.modal h2 {
    font-size: 24px;
    margin-bottom: 10px;
    color: #602B7A;
}

.modal p {
    font-size: 16px;
    margin-bottom: 15px;
}

.modal button {
    background-color: #602B7A;
    color: white;
    border: none;
    padding: 10px 20px;
    border-radius: 5px;
    font-size: 16px;
    cursor: pointer;
}

.modal button:hover {
    background-color: #4c2062;
}

/* Animación de entrada */
@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translate(-50%, -60%);
    }
    to {
        opacity: 1;
        transform: translate(-50%, -50%);
    }
}





/* RESPONSIVE */
@media (max-width: 768px) {
    .navbar-menu {
        gap: 12px;
    }

    .navbar-menu a {
        font-size: 14px;
    }

    .header h1 {
        font-size: 22px;
    }

    .content {
        padding: 15px;
    }

    .card-title {
        font-size: 16px;
        font-weight: 400;
    }
}


.falling-planet {
    position: absolute;
    top: -50px;
    font-size: 60px;
    animation: fallDown 4s linear forwards;
    z-index: 999;
}

@keyframes fallDown {
    0% {
        transform: translateY(0) scale(1);
        opacity: 1;
    }
    100% {
        transform: translateY(120vh) scale(0.5);
        opacity: 0;
    }
}


@keyframes shake {
    0% { transform: translate(0); }
    25% { transform: translateX(-5px); }
    50% { transform: translateX(5px); }
    75% { transform: translateX(-5px); }
    100% { transform: translateX(0); }
}

.shake {
    animation: shake 0.3s;
}


button {
  background-color: #602B7A;
  color: white;
  border: none;
  padding: 12px 20px;
  border-radius: 10px;
  cursor: pointer;
  font-weight: bold;
  margin-top: 15px;
}

button:hover {
  background-color: #FFD24C;
  color: black;
}


.lesson-card-wrapper {
    position: relative;
}

.lesson-lock {
    position: absolute;
    top: 8px;
    right: 8px;
    font-size: 16px;
}


.modal-backdrop {
  z-index: 1040 !important;
}

.modal {
  z-index: 1050 !important;
}


/* FAB */
  .ia-fab {
    position: fixed; right: 22px; bottom: 22px;
    width: 56px; height: 56px; border-radius: 50%;
    background: #6c63ff; color:#fff; border:none;
    display:flex; align-items:center; justify-content:center;
    box-shadow: 0 10px 20px rgba(0,0,0,.25);
    cursor:pointer; z-index: 1030; transition: transform .12s ease;
  }
  .ia-fab:hover { transform: translateY(-2px); }

  /* Modal */
  .ia-backdrop {
    position: fixed; inset: 0; background: rgba(0,0,0,.55);
    display: none; align-items: center; justify-content: center; z-index: 1040;
  }
  .ia-modal {
    background: #fff; color:#222; width: 96%; max-width: 820px;
    border-radius: 14px; box-shadow: 0 10px 30px rgba(0,0,0,.35);
    display:flex; flex-direction: column; overflow: hidden;
    font-family: system-ui, -apple-system, "Segoe UI", Roboto, Arial, sans-serif;
  }
  .ia-header {
    display:flex; align-items:center; justify-content:space-between;
    padding: 12px 16px; background: #6c63ff; color:#fff;
  }
  .ia-header h3 { margin:0; font-size:1.05rem; }
  .ia-close {
    background: transparent; color:#fff; border:none; font-size:1.2rem; cursor:pointer;
  }

  /* Chat */
  .ia-chat-wrap {
    display:flex; flex-direction: column; gap: 0;
    background:#fafafe;
  }
  .ia-chat {
    height: 320px; overflow-y: auto; padding: 14px 16px;
    display:flex; flex-direction: column; gap: 10px;
  }
  .ia-msg {
    max-width: 78%; padding: 10px 12px; border-radius: 14px;
    box-shadow: 0 1px 0 rgba(0,0,0,.04); white-space: pre-wrap;
    line-height: 1.35; font-size: .98rem;
  }
  .ia-msg.ai {
    background:#ffffff; border:1px solid #e6e8f0; color:#1f235a;
    align-self: flex-start; border-top-left-radius: 6px;
  }
  .ia-msg.user {
    background:#6c63ff; color:#fff; align-self: flex-end;
    border-top-right-radius: 6px;
  }
  .ia-typing {
    display:inline-flex; gap:4px; align-items:center;
  }
  .ia-dot {
    width:6px; height:6px; border-radius:50%; background:#6c63ff; opacity:.6;
    animation: ia-bounce 1.2s infinite ease-in-out;
  }
  .ia-dot:nth-child(2){ animation-delay: .15s; }
  .ia-dot:nth-child(3){ animation-delay: .3s; }
  @keyframes ia-bounce {
    0%, 80%, 100% { transform: translateY(0); opacity:.4; }
    40% { transform: translateY(-6px); opacity:1; }
  }

  .ia-input {
    display:flex; gap:10px; padding: 10px 12px; border-top:1px solid #ececf4; background:#fff;
  }
  .ia-input textarea {
    flex:1; min-height: 44px; max-height: 120px; resize: vertical;
    border-radius: 10px; border:1px solid #dcdcff; padding:10px; font-size:.98rem;
  }
  .ia-actions { display:flex; gap:8px; align-items:flex-end; }
  .ia-btn {
    border-radius:10px; padding:10px 14px; font-weight:700; cursor:pointer; border:none;
  }
  .ia-btn-send { background:#6c63ff; color:#fff; }
  .ia-btn-clear {
    background:#fff; color:#6c63ff; border:2px solid #6c63ff;
  }


  /* Oculta texto para accesibilidad */
.sr-only {
  position:absolute;
  width:1px; height:1px;
  padding:0; margin:-1px;
  overflow:hidden; clip:rect(0,0,0,0);
  white-space:nowrap; border:0;
}

/* El FAB ya es circular; ahora usamos la imagen como fondo */
.ia-fab.ia-fab--img {
  background: url('/img/kbot.png') center/cover no-repeat;
  /* opcional: anillo sutil para que se vea nítido en cualquier fondo */
  box-shadow:
    0 10px 20px rgba(0,0,0,.25),
    0 0 0 2px rgba(255,255,255,.85) inset;
}

/* Hover/active conservan el ligero movimiento si ya lo tenías */
.ia-fab.ia-fab--img:hover { transform: translateY(-2px); }
.ia-fab.ia-fab--img:active { transform: translateY(0); }


.local-clock {
    position: fixed;
    bottom: 20px;
    left: 20px;
    background: rgba(0,0,0,0.55);
    color: #fff;
    font-size: 14px;
    font-weight: 600;
    font-family: 'Inter', sans-serif;
    padding: 6px 12px;
    border-radius: 12px;
    z-index: 1050;
    pointer-events: none; /* no estorba clics */
  }




