/* ============================================================
   Suite360 — Tutoriales (tour guiado + video simulado)
   Estilos de ambos motores. Prefijos: .t360- (tour), .p360- (player)
   ============================================================ */

/* ---------- TOUR GUIADO (t360) ---------- */

.t360-highlight {
    position: fixed;
    z-index: 10050;
    border-radius: 6px;
    box-shadow: 0 0 0 4px rgba(220, 53, 69, .55), 0 0 0 9999px rgba(15, 18, 24, .62);
    pointer-events: none;
    transition: all .35s cubic-bezier(.4, 0, .2, 1);
}

.t360-popover {
    position: fixed;
    z-index: 10060;
    width: 340px;
    max-width: calc(100vw - 24px);
    background: #fff;
    border-radius: 10px;
    box-shadow: 0 12px 40px rgba(0, 0, 0, .35);
    font-family: 'Source Sans Pro', system-ui, sans-serif;
    animation: t360-pop .25s ease;
    overflow: hidden;
}

@keyframes t360-pop {
    from { opacity: 0; transform: translateY(8px) scale(.97); }
    to   { opacity: 1; transform: none; }
}

.t360-popover__head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
    padding: 12px 14px 0;
}

.t360-popover__title {
    font-weight: 700;
    font-size: 1.05rem;
    color: #212529;
    margin: 0;
}

.t360-popover__step {
    font-size: .75rem;
    color: #6c757d;
    white-space: nowrap;
}

.t360-popover__body {
    padding: 8px 14px 12px;
    font-size: .92rem;
    color: #495057;
    line-height: 1.45;
}

.t360-popover__foot {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 10px 14px;
    background: #f8f9fa;
    border-top: 1px solid #e9ecef;
}

.t360-btn {
    border: 0;
    border-radius: 6px;
    padding: 6px 14px;
    font-size: .85rem;
    font-weight: 600;
    cursor: pointer;
    transition: background .15s ease, color .15s ease;
}

.t360-btn--primary { background: #dc3545; color: #fff; }
.t360-btn--primary:hover { background: #c82333; }
.t360-btn--ghost { background: transparent; color: #6c757d; }
.t360-btn--ghost:hover { color: #343a40; }
.t360-btn:disabled { opacity: .4; cursor: default; }

.t360-btn--icon {
    background: transparent;
    color: #6c757d;
    padding: 4px 8px;
    font-size: .95rem;
}
.t360-btn--icon:hover { color: #dc3545; }
.t360-btn--icon.is-on { color: #dc3545; }

.t360-progress {
    height: 4px;
    background: #e9ecef;
}
.t360-progress__bar {
    height: 100%;
    background: #dc3545;
    transition: width .3s ease;
}

/* ---------- VIDEO SIMULADO (p360) ---------- */

.p360-overlay {
    position: fixed;
    inset: 0;
    z-index: 10100;
    background: rgba(10, 12, 16, .88);
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px;
    animation: p360-fade .25s ease;
    font-family: 'Source Sans Pro', system-ui, sans-serif;
}

@keyframes p360-fade { from { opacity: 0; } to { opacity: 1; } }

.p360-modal {
    width: min(1080px, 100%);
    background: #101319;
    border-radius: 12px;
    overflow: hidden;
    box-shadow: 0 20px 60px rgba(0, 0, 0, .6);
    display: flex;
    flex-direction: column;
    max-height: calc(100vh - 40px);
}

.p360-titlebar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 10px 16px;
    color: #e9ecef;
    background: #171b23;
}

.p360-titlebar h5 { margin: 0; font-size: 1rem; font-weight: 700; }
.p360-titlebar .p360-close {
    background: transparent; border: 0; color: #adb5bd;
    font-size: 1.25rem; cursor: pointer; line-height: 1;
}
.p360-titlebar .p360-close:hover { color: #fff; }

/* Escenario 16:9 donde se dibuja la pantalla simulada */
.p360-stage {
    position: relative;
    aspect-ratio: 16 / 9;
    background: #0b0d11;
    overflow: hidden;
    flex: 0 1 auto;
    min-height: 0;
}

/* Pantalla simulada del sistema (mini AdminLTE) */
.p360-screen {
    position: absolute;
    inset: 0;
    display: grid;
    grid-template-rows: 34px 1fr;
    grid-template-columns: 150px 1fr;
    background: #f4f6f9;
    animation: p360-scene .45s ease;
    font-size: 12px;
    color: #343a40;
}

@keyframes p360-scene {
    from { opacity: 0; transform: scale(1.015); }
    to   { opacity: 1; transform: none; }
}

.p360-screen__nav {
    grid-column: 1 / 3;
    background: #dc3545;
    color: #fff;
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 0 12px;
    font-weight: 700;
}
.p360-screen__nav .fa-bars { opacity: .8; }
.p360-screen__nav .p360-screen__user {
    margin-left: auto;
    font-weight: 400;
    opacity: .9;
    font-size: 11px;
}

.p360-screen__side {
    background: #343a40;
    color: #c2c7d0;
    padding: 10px 0;
    overflow: hidden;
}
.p360-screen__side .item {
    padding: 6px 12px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}
.p360-screen__side .item.active {
    background: #dc3545;
    color: #fff;
    border-radius: 4px;
    margin: 0 6px;
    padding: 6px 8px;
}
.p360-screen__side .item i { width: 14px; margin-right: 6px; }

.p360-screen__main {
    padding: 12px 14px;
    overflow: hidden;
    display: flex;
    flex-direction: column;
    gap: 10px;
}
.p360-screen__title {
    font-size: 15px;
    font-weight: 700;
    color: #212529;
    display: flex;
    align-items: baseline;
    gap: 8px;
}
.p360-screen__crumb { font-size: 10px; color: #6c757d; font-weight: 400; }

/* Elementos del DSL de pantalla */
.p360-el { animation: p360-scene .4s ease; }

.p360-kpis { display: flex; gap: 8px; }
.p360-kpi {
    flex: 1;
    background: #fff;
    border-radius: 6px;
    padding: 8px 10px;
    box-shadow: 0 1px 3px rgba(0,0,0,.08);
    border-left: 3px solid #dc3545;
}
.p360-kpi b { display: block; font-size: 15px; color: #212529; }
.p360-kpi span { font-size: 10px; color: #6c757d; }

.p360-botones { display: flex; gap: 8px; flex-wrap: wrap; }
.p360-boton {
    border-radius: 5px;
    padding: 6px 12px;
    font-weight: 600;
    font-size: 11px;
    background: #e9ecef;
    color: #495057;
    box-shadow: 0 1px 2px rgba(0,0,0,.1);
}
.p360-boton--primario { background: #dc3545; color: #fff; }
.p360-boton--exito    { background: #28a745; color: #fff; }
.p360-boton--info     { background: #17a2b8; color: #fff; }

.p360-tabla {
    background: #fff;
    border-radius: 6px;
    box-shadow: 0 1px 3px rgba(0,0,0,.08);
    overflow: hidden;
    width: 100%;
    border-collapse: collapse;
    font-size: 11px;
}
.p360-tabla th {
    background: #f8f9fa;
    text-align: left;
    padding: 6px 8px;
    color: #495057;
    border-bottom: 1px solid #dee2e6;
}
.p360-tabla td { padding: 5px 8px; border-bottom: 1px solid #f1f3f5; }
.p360-badge {
    display: inline-block;
    border-radius: 10px;
    padding: 1px 8px;
    font-size: 10px;
    font-weight: 700;
    color: #fff;
    background: #6c757d;
}
.p360-badge--verde { background: #28a745; }
.p360-badge--rojo { background: #dc3545; }
.p360-badge--amarillo { background: #ffc107; color: #212529; }
.p360-badge--azul { background: #17a2b8; }

.p360-form {
    background: #fff;
    border-radius: 6px;
    box-shadow: 0 1px 3px rgba(0,0,0,.08);
    padding: 10px 12px;
}
.p360-form__titulo { font-weight: 700; margin-bottom: 8px; color: #212529; }
.p360-form__grid { display: grid; grid-template-columns: 1fr 1fr; gap: 6px 12px; }
.p360-campo label { display: block; font-size: 10px; color: #6c757d; margin: 0 0 2px; }
.p360-campo .valor {
    background: #fff;
    border: 1px solid #ced4da;
    border-radius: 4px;
    padding: 4px 8px;
    min-height: 22px;
    font-size: 11px;
    color: #212529;
}

.p360-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(72px, 1fr)); gap: 8px; }
.p360-celda {
    border-radius: 6px;
    padding: 10px 6px;
    text-align: center;
    font-weight: 700;
    font-size: 11px;
    color: #fff;
    background: #28a745;
    box-shadow: 0 1px 3px rgba(0,0,0,.15);
}
.p360-celda--ocupada { background: #dc3545; }
.p360-celda--limpieza { background: #ffc107; color: #212529; }
.p360-celda--reservada { background: #17a2b8; }
.p360-celda small { display: block; font-weight: 400; font-size: 9px; opacity: .9; }

.p360-texto {
    background: #fff;
    border-radius: 6px;
    box-shadow: 0 1px 3px rgba(0,0,0,.08);
    padding: 10px 12px;
    font-size: 11.5px;
    line-height: 1.5;
    color: #495057;
}

/* Portada (escena sin pantalla de sistema) */
.p360-cover {
    position: absolute;
    inset: 0;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 12px;
    text-align: center;
    color: #fff;
    background: radial-gradient(1200px 500px at 50% -10%, #3d1216, #101319 70%);
    animation: p360-scene .5s ease;
    padding: 24px;
}
.p360-cover i { font-size: 46px; color: #dc3545; }
.p360-cover h2 { font-size: 26px; font-weight: 700; margin: 0; }
.p360-cover p { color: #adb5bd; max-width: 560px; margin: 0; font-size: 14px; }

/* Resaltado dentro de la pantalla simulada */
.p360-focus {
    position: relative;
    z-index: 5;
    box-shadow: 0 0 0 3px rgba(220, 53, 69, .85), 0 0 18px rgba(220, 53, 69, .5) !important;
    border-radius: 6px;
    transition: box-shadow .3s ease;
}

.p360-press { transform: scale(.94); transition: transform .12s ease; }

/* Cursor falso */
.p360-cursor {
    position: absolute;
    z-index: 20;
    width: 22px;
    height: 22px;
    pointer-events: none;
    transition: left .7s cubic-bezier(.5, 0, .3, 1), top .7s cubic-bezier(.5, 0, .3, 1);
    filter: drop-shadow(0 2px 3px rgba(0,0,0,.4));
}
.p360-cursor svg { width: 100%; height: 100%; }

.p360-click-pulse {
    position: absolute;
    z-index: 19;
    width: 36px;
    height: 36px;
    margin: -18px 0 0 -18px;
    border-radius: 50%;
    border: 3px solid #dc3545;
    pointer-events: none;
    animation: p360-pulse .55s ease-out forwards;
}
@keyframes p360-pulse {
    from { transform: scale(.3); opacity: 1; }
    to   { transform: scale(1.6); opacity: 0; }
}

/* Subtítulos */
.p360-subs {
    position: absolute;
    left: 50%;
    bottom: 14px;
    transform: translateX(-50%);
    max-width: 86%;
    background: rgba(10, 12, 16, .82);
    color: #fff;
    padding: 7px 14px;
    border-radius: 6px;
    font-size: clamp(12px, 1.6vw, 16px);
    line-height: 1.4;
    text-align: center;
    z-index: 30;
    pointer-events: none;
}
.p360-subs.is-hidden { display: none; }

/* Controles del reproductor */
.p360-controls {
    background: #171b23;
    padding: 10px 14px 12px;
    color: #ced4da;
}

.p360-progress {
    display: flex;
    gap: 4px;
    height: 6px;
    margin-bottom: 10px;
    cursor: pointer;
}
.p360-progress__seg {
    flex: 1;
    background: #343a40;
    border-radius: 3px;
    overflow: hidden;
}
.p360-progress__seg > i {
    display: block;
    height: 100%;
    width: 0;
    background: #dc3545;
    transition: width .25s linear;
}
.p360-progress__seg.is-done > i { width: 100%; }

.p360-controls__row {
    display: flex;
    align-items: center;
    gap: 6px;
}

.p360-ctl {
    background: transparent;
    border: 0;
    color: #ced4da;
    font-size: 1rem;
    padding: 6px 9px;
    border-radius: 6px;
    cursor: pointer;
}
.p360-ctl:hover { background: #232936; color: #fff; }
.p360-ctl.is-on { color: #dc3545; }
.p360-ctl--play { font-size: 1.2rem; }

.p360-scene-label {
    font-size: .8rem;
    color: #868e96;
    margin-left: 4px;
    flex: 1;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.p360-chapters {
    position: relative;
}
.p360-chapters__menu {
    position: absolute;
    right: 0;
    bottom: 40px;
    background: #232936;
    border-radius: 8px;
    box-shadow: 0 8px 24px rgba(0,0,0,.5);
    min-width: 230px;
    max-height: 260px;
    overflow: auto;
    padding: 6px 0;
    display: none;
    z-index: 40;
}
.p360-chapters__menu.is-open { display: block; }
.p360-chapters__menu button {
    display: block;
    width: 100%;
    text-align: left;
    background: transparent;
    border: 0;
    color: #ced4da;
    padding: 7px 14px;
    font-size: .85rem;
    cursor: pointer;
}
.p360-chapters__menu button:hover { background: #2c3341; color: #fff; }
.p360-chapters__menu button.is-current { color: #dc3545; font-weight: 700; }

/* Tarjetas del centro de tutoriales */
.tut-card { transition: transform .15s ease, box-shadow .15s ease; }
.tut-card:hover { transform: translateY(-3px); box-shadow: 0 8px 22px rgba(0,0,0,.12); }
.tut-card .tut-icon {
    width: 46px; height: 46px;
    border-radius: 10px;
    display: flex; align-items: center; justify-content: center;
    background: rgba(220,53,69,.1);
    color: #dc3545;
    font-size: 1.3rem;
}
.tut-variante {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
    padding: 7px 10px;
    border: 1px solid #e9ecef;
    border-radius: 8px;
    margin-bottom: 6px;
    background: #fff;
}
.tut-variante:hover { border-color: #dc3545; }
.tut-variante .titulo { font-size: .9rem; font-weight: 600; color: #343a40; }
.tut-variante .desc { font-size: .78rem; color: #6c757d; }

@media (max-width: 640px) {
    .p360-overlay { padding: 6px; }
    .p360-screen { grid-template-columns: 0 1fr; }
    .p360-screen__side { display: none; }
    .t360-popover { width: 300px; }
}
