:root {
    --fj-primary: #4a3aff;
    --fj-primary-dark: #2f24b3;
    --fj-accent: #ffb703;
    --fj-bg: #f4f6fb;
    /* Colores Kahoot */
    --k-red: #e21b3c;
    --k-blue: #1368ce;
    --k-yellow: #d89e00;
    --k-green: #26890c;
    --k-purple: #6c2eb9;
    --k-pink: #c0388f;
}

html { font-size: 15px; }
@media (min-width: 768px) { html { font-size: 16px; } }

body {
    background-color: var(--fj-bg);
    color: #2b2d42;
}

/* ---------- Navbar / Footer ---------- */
.fj-navbar {
    background: linear-gradient(90deg, var(--fj-primary) 0%, var(--fj-primary-dark) 100%);
}
.fj-navbar .nav-link { color: rgba(255,255,255,.85) !important; font-weight: 500; border-radius: .5rem; padding: .4rem .8rem !important; }
.fj-navbar .nav-link:hover, .fj-navbar .nav-link.active { color: #fff !important; background: rgba(255,255,255,.15); }
.fj-navbar .navbar-brand { color: #fff !important; }
.fj-footer { background: var(--fj-primary-dark); }

/* ---------- Cards / botones generales ---------- */
.card { border: none; border-radius: 1rem; box-shadow: 0 .4rem 1.2rem rgba(33,37,75,.08); }
.btn { border-radius: .6rem; font-weight: 600; }
.btn-primary { background-color: var(--fj-primary); border-color: var(--fj-primary); }
.btn-primary:hover { background-color: var(--fj-primary-dark); border-color: var(--fj-primary-dark); }
.page-title { font-weight: 800; color: var(--fj-primary-dark); }

/* ---------- Hero (reemplaza jumbotron de BS4) ---------- */
.jumbotron, .fj-hero {
    padding: 3rem 2rem;
    border-radius: 1.5rem;
    background: linear-gradient(120deg, var(--fj-primary), var(--fj-primary-dark));
    color: #fff;
}
.jumbo-image, .fj-hero-img {
    background-image: linear-gradient(rgba(47,36,179,.55), rgba(47,36,179,.55)), url("../images/leccion.jpg");
    background-size: cover;
    background-position: center;
    color: #fff;
}

/* ---------- Mosaicos estilo Kahoot ---------- */
.kahoot-grid {
    display: grid;
    grid-template-columns: 1fr;
    gap: 1rem;
}
@media (min-width: 768px) { .kahoot-grid { grid-template-columns: 1fr 1fr; } }

.kahoot-tile {
    display: flex;
    align-items: center;
    gap: .9rem;
    min-height: 110px;
    padding: 1.2rem 1.4rem;
    border: none;
    border-radius: 1rem;
    color: #fff !important;
    font-size: 1.25rem;
    font-weight: 700;
    text-align: left;
    cursor: pointer;
    box-shadow: 0 .35rem 0 rgba(0,0,0,.25);
    transition: transform .08s ease, filter .15s ease;
    width: 100%;
}
.kahoot-tile:hover { filter: brightness(1.07); }
.kahoot-tile:active { transform: translateY(3px); box-shadow: 0 .1rem 0 rgba(0,0,0,.25); }
.kahoot-tile .k-shape { font-size: 1.5rem; }
.kahoot-tile img { max-height: 90px; border-radius: .5rem; }

/* Estado SELECCIONADO: anillo blanco+oscuro, se agranda y muestra un check */
.kahoot-tile.selected {
    transform: translateY(-2px) scale(1.02);
    filter: brightness(1.12) saturate(1.15);
    box-shadow: 0 0 0 4px #fff, 0 0 0 8px #1b1b1b, 0 .45rem 0 rgba(0,0,0,.25);
}
.kahoot-tile.selected::after {
    content: "\2713";
    margin-left: auto;
    flex: 0 0 auto;
    width: 2.1rem;
    height: 2.1rem;
    border-radius: 50%;
    background: #fff;
    color: #1b1b1b;
    font-size: 1.4rem;
    font-weight: 900;
    display: flex;
    align-items: center;
    justify-content: center;
}

.k-c0 { background: var(--k-red); }
.k-c1 { background: var(--k-blue); }
.k-c2 { background: var(--k-yellow); }
.k-c3 { background: var(--k-green); }
.k-c4 { background: var(--k-purple); }
.k-c5 { background: var(--k-pink); }

/* Estado correcto / incorrecto al revisar */
.kahoot-tile.correct { background: var(--k-green) !important; }
.kahoot-tile.wrong { background: var(--k-red) !important; opacity: .85; }
.kahoot-tile.dim { opacity: .45; }

/* ---------- Temporizador ---------- */
.k-timer {
    width: 64px; height: 64px; border-radius: 50%;
    background: var(--fj-primary); color: #fff;
    display: flex; align-items: center; justify-content: center;
    font-size: 1.6rem; font-weight: 800;
}

/* ---------- Badges de tipo de pregunta ---------- */
.badge-tipo { font-size: .8rem; padding: .4em .7em; border-radius: .5rem; }

/* ---------- Reporte en árbol ---------- */
.tree-node { margin: .15rem 0; }
.tree-summary {
    cursor: pointer;
    padding: .45rem .6rem;
    border-radius: .5rem;
    list-style: none;
    display: flex;
    align-items: center;
    gap: .4rem;
    flex-wrap: wrap;
}
.tree-summary::-webkit-details-marker { display: none; }
.tree-summary::before {
    content: "\25B6"; /* triángulo */
    font-size: .7rem;
    color: #94a3b8;
    transition: transform .15s ease;
}
details[open] > .tree-summary::before { transform: rotate(90deg); }
.tree-summary:hover { background: #eef1f8; }
.tree-children {
    margin-left: 1rem;
    padding-left: .9rem;
    border-left: 2px solid #e5e7eb;
}
.tree-leaf {
    padding: .35rem .6rem .35rem 1.6rem;
    display: flex;
    align-items: center;
    gap: .4rem;
    flex-wrap: wrap;
}
/* Colores por nivel */
.nodo-superadmin > i, .nodo-superadmin strong { color: var(--k-purple); }
.nodo-departamental > i { color: var(--fj-primary); }
.nodo-pastor > i { color: var(--k-blue); }
.nodo-instructor > i { color: var(--k-green); }
.nodo-estudiante > i { color: var(--k-yellow); }

/* ---------- Menú contextual (reset de contraseña) ---------- */
.resettable { cursor: context-menu; }
.ctx-menu {
    display: none;
    position: absolute;
    z-index: 1080;
    background: #fff;
    border: 1px solid #e5e7eb;
    border-radius: .6rem;
    padding: .3rem;
    min-width: 200px;
}
.ctx-item {
    display: flex;
    align-items: center;
    gap: .5rem;
    width: 100%;
    border: none;
    background: transparent;
    padding: .5rem .7rem;
    border-radius: .4rem;
    font-size: .95rem;
    text-align: left;
    color: #2b2d42;
}
.ctx-item:hover { background: var(--fj-primary); color: #fff; }

/* ---------- Guías ilustradas (manual sencillo) ---------- */
.guia-paso {
    display: flex; gap: 1rem; align-items: flex-start;
    background: #fff; border-radius: 1rem; padding: 1.2rem 1.4rem;
    box-shadow: 0 .4rem 1.2rem rgba(33,37,75,.08); margin-bottom: 1.1rem;
}
.guia-num {
    flex: 0 0 auto; width: 3rem; height: 3rem; border-radius: 50%;
    background: var(--fj-primary); color: #fff; font-size: 1.5rem; font-weight: 800;
    display: flex; align-items: center; justify-content: center;
}
.guia-ico { font-size: 2rem; color: var(--fj-primary); }
.guia-paso h5 { margin: 0 0 .3rem; font-weight: 800; color: var(--fj-primary-dark); }
.guia-paso p { margin: 0; font-size: 1.05rem; }
/* Botón de ejemplo (imita la interfaz real) */
.btn-demo {
    display: inline-flex; align-items: center; gap: .4rem;
    padding: .3rem .7rem; border-radius: .5rem; font-weight: 600; font-size: .9rem;
    color: #fff; background: var(--fj-primary); margin-top: .5rem;
}
.btn-demo.verde { background: var(--k-green); }
.btn-demo.gris { background: #6c757d; }
.menu-demo { display:inline-block; background: var(--fj-primary-dark); color:#fff; padding:.25rem .6rem; border-radius:.5rem; font-weight:600; }

/* ---------- Editor de texto enriquecido ---------- */
.rt-bar { display: flex; flex-wrap: wrap; gap: .3rem; margin-bottom: .4rem; }
.rt-editor { min-height: 120px; overflow-y: auto; }
.rt-editor:focus { outline: 2px solid var(--fj-primary); }
/* Contenido HTML renderizado en las vistas */
.contenido-html img { max-width: 100%; height: auto; }

/* ---------- Compatibilidad: clases ef-* heredadas ---------- */
.ef-bg1 { background-color: #78A8E3 !important; }
.ef-bg2 { background-color: var(--fj-primary) !important; }
.ef-bg3 { background-color: #52749E !important; }
.ef-bg4 { background-color: #304969 !important; }
.ef-bg5 { background-color: #26364A !important; }
.ef-cl1 { color: #78A8E3 !important; }
.ef-cl2 { color: var(--fj-primary) !important; }
.ef-cl3 { color: #52749E !important; }
.ef-cl4 { color: #304969 !important; }
.ef-cl5 { color: #26364A !important; }
