/*
 * Vistas de la presentación: clasificador, esquema, página de notas y lectura.
 *
 * Todas se montan dentro del área del lienzo, en un contenedor `.view` que el
 * gestor de vistas crea y destruye; la vista Normal no necesita ninguno porque
 * es el propio lienzo de la ventana.
 */

.view {
    position: absolute;
    inset: 0;
    display: flex;
    overflow: auto;
    background: var(--ppt-stage-bg);
}

/* ---------- Clasificador de diapositivas ---------- */

.sorter {
    display: block;
    padding: 22px;
    outline: none;
}

.sorter__grid {
    display: flex;
    flex-wrap: wrap;
    align-content: flex-start;
    gap: 22px;
}

.sorter__item {
    position: relative;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 4px;
    padding: 4px;
    border: 2px solid transparent;
    border-radius: var(--ppt-radius-sm);
    cursor: pointer;
    user-select: none;
}

.sorter__item:hover { background: rgba(0, 0, 0, 0.04); }

.sorter__item.is-selected {
    background: rgba(196, 62, 28, 0.10);
    border-color: rgba(196, 62, 28, 0.45);
}

.sorter__item.is-active { border-color: var(--ppt-shape-selection); }

.sorter__frame {
    position: relative;
    overflow: hidden;
    background: var(--ppt-slide-bg);
    box-shadow: var(--ppt-slide-shadow);
}

.sorter__item.is-hidden .sorter__frame { opacity: 0.45; }

.sorter__num {
    font-size: var(--ppt-font-size-ui-sm);
    line-height: 16px;
    color: var(--ppt-text-muted);
}

.sorter__item.is-active .sorter__num {
    font-weight: 600;
    color: var(--ppt-text);
}

.sorter__hidden-mark {
    position: absolute;
    right: 4px;
    bottom: 2px;
    font-size: 20px;
    color: var(--ppt-text-muted);
}

.sorter__transition {
    position: absolute;
    top: 6px;
    left: -6px;
    padding: 0;
    font-size: 13px;
    line-height: 1;
    color: var(--ppt-text-accent);
    background: none;
    border: 0;
    cursor: pointer;
}

/* Línea de inserción del arrastre, a un lado u otro de la miniatura. */
.sorter__item.is-drop-before::before,
.sorter__item.is-drop-after::after {
    position: absolute;
    top: 4px;
    bottom: 20px;
    width: 3px;
    background: var(--ppt-shape-selection);
    border-radius: 2px;
    content: "";
}

.sorter__item.is-drop-before::before { left: -12px; }
.sorter__item.is-drop-after::after { right: -12px; }

/* ---------- Vista de esquema ---------- */

.outline {
    display: grid;
    grid-template-columns: 1fr 320px;
    overflow: hidden;
    background: var(--ppt-panel-bg);
}

.outline__tree {
    padding: 16px 12px 24px;
    overflow: auto;
}

.outline__row {
    display: flex;
    gap: 6px;
    align-items: baseline;
    min-height: 24px;
    padding-right: 12px;
    border-left: 2px solid transparent;
}

.outline__row.is-active { border-left-color: var(--ppt-shape-selection); }
.outline__row.is-editing { background: rgba(15, 108, 189, 0.06); }

.outline__marker {
    flex: 0 0 auto;
    min-width: 16px;
    font-size: var(--ppt-font-size-ui-sm);
    color: var(--ppt-text-muted);
    text-align: right;
}

.outline__row--title .outline__marker {
    font-weight: 600;
    color: var(--ppt-text-2);
}

.outline__text {
    flex: 1 1 auto;
    min-width: 0;
    padding: 2px 4px;
    font-family: var(--ppt-font-slide);
    font-size: 14px;
    color: var(--ppt-text);
    background: none;
    border: 0;
    border-radius: var(--ppt-radius-sm);
    outline: none;
}

.outline__row--title .outline__text {
    font-size: 18px;
    font-weight: 600;
}

.outline__text:focus { background: #FFFFFF; box-shadow: inset 0 0 0 1px var(--ppt-focus); }
.outline__text::placeholder { color: var(--ppt-text-disabled); }

.outline__preview {
    display: flex;
    flex-direction: column;
    align-items: center;
    padding: 16px;
    overflow: auto;
    background: var(--ppt-stage-bg);
    border-left: 1px solid var(--ppt-border);
}

.outline__slide {
    position: relative;
    overflow: hidden;
    box-shadow: var(--ppt-slide-shadow);
}

/* ---------- Página de notas ---------- */

.notespage {
    justify-content: center;
    align-items: flex-start;
    padding: 24px;
}

.notespage__scaler { flex: 0 0 auto; }

.notespage__page {
    position: relative;
    overflow: hidden;
    background: #FFFFFF;
    box-shadow: var(--ppt-slide-shadow);
    transform-origin: top left;
}

.notespage__header,
.notespage__footer {
    position: absolute;
    left: 0;
    right: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    font-family: var(--ppt-font-slide);
    font-size: 11px;
    color: var(--ppt-text-muted);
}

.notespage__header { top: 0; }
.notespage__footer { bottom: 0; height: 32px; }

.notespage__slide {
    position: absolute;
    overflow: hidden;
    box-shadow: 0 0 0 1px var(--ppt-border);
}

.notespage__input {
    position: absolute;
    padding: 8px;
    font-family: var(--ppt-font-slide);
    font-size: 13px;
    line-height: 1.5;
    color: var(--ppt-text);
    resize: none;
    background: none;
    border: 1px dashed transparent;
    outline: none;
}

.notespage__input:hover { border-color: var(--ppt-border-soft); }
.notespage__input:focus { border-color: var(--ppt-focus); border-style: solid; }
.notespage__input::placeholder { color: var(--ppt-text-disabled); }

/* ---------- Vista de lectura ---------- */

.reading {
    flex-direction: column;
    overflow: hidden;
    background: #4B4A48;
    outline: none;
}

.reading__stage {
    display: flex;
    flex: 1 1 auto;
    align-items: center;
    justify-content: center;
    min-height: 0;
    overflow: hidden;
}

.reading__slide {
    position: relative;
    overflow: hidden;
    background: var(--ppt-slide-bg);
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.45);
}

.reading__bar {
    display: flex;
    flex: 0 0 40px;
    gap: 2px;
    align-items: center;
    height: 40px;
    padding: 0 10px;
    color: #F3F2F1;
    background: #3B3A39;
}

.reading__counter {
    font-size: var(--ppt-font-size-ui);
    color: #D2D0CE;
}

.reading__spacer { flex: 1 1 auto; }

.reading__btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 30px;
    height: 26px;
    color: inherit;
    background: none;
    border: 0;
    border-radius: var(--ppt-radius-sm);
    cursor: pointer;
}

.reading__btn:hover:not(:disabled) { background: rgba(255, 255, 255, 0.14); }
.reading__btn:disabled { color: #8A8886; cursor: default; }
.reading__btn--prev svg { transform: rotate(180deg); }

/* ---------- Impresión de la página de notas ---------- */

@media print {
    .view.view--notes {
        position: static;
        display: block;
        padding: 0;
        overflow: visible;
        background: none;
    }

    .notespage__page {
        box-shadow: none;
        transform: none;
        page-break-after: always;
    }

    .notespage__input {
        overflow: visible;
        border-color: transparent;
    }
}
