/* ═══════════════════════════════════════════════════════════════════════════════
   ESTILOS BASE (DESKTOP)
   ═══════════════════════════════════════════════════════════════════════════════ */

/* ---- Controles inferiores izquierdos (Desktop) ---- */
#controls-bottom-left {
    position: absolute;
    bottom: 10px;
    left: 12px;
    z-index: 10;
    display: flex;
    flex-direction: row;
    /* Uno al lado del otro */
    gap: 10px;
}

#bottom-zoom-container {
    position: static;
    /* Hereda la posición del padre */
    display: flex;
    align-items: center;
}


/* ---- Botón ajustes (Desktop) ---- */
#btn-settings-toggle {
    width: 44px;
    height: 44px;
}

#settings-logo {
    width: 40px;
    height: 40px;
}


/* ═══════════════════════════════════════════════════════════════════════════════
   RESPONSIVE – TELÉFONOS MÓVILES (max‑width: 768px)
   ═══════════════════════════════════════════════════════════════════════════════ */
@media (max-width: 768px) {

    #btn-settings-toggle {
        position: fixed;
        top: -6px;
        left: -3px;
        z-index: 9999;
        width: 44px;
        height: 44px;
    }

    /* ---- Modal y cuadros de confirmación ---- */
    .modal-content,
    .confirm-box {
        padding: 15px;
        width: 90%;
        max-height: 85vh;
    }

    .modal-header h2 {
        font-size: 18px;
        margin-bottom: 4px;
    }

    .modal-header .subtitle {
        font-size: 11px;
    }

    /* ---- Grid del tutorial (1 columna) ---- */
    .tutorial-grid {
        grid-template-columns: 1fr;
        gap: 8px;
        margin: 15px 0;
    }

    .tutorial-item {
        padding: 10px 12px;
    }

    .tutorial-item h3 {
        font-size: 13px;
        margin-bottom: 4px;
    }

    .tutorial-item h3 svg {
        width: 18px;
        height: 18px;
    }

    .tutorial-item p {
        font-size: 11px;
    }

    /* ---- Barra de presentación (centrada abajo) ---- */
    #presentation-toolbar {
        position: fixed !important;
        top: auto !important;
        bottom: 70px !important;
        left: 50% !important;
        transform: translateX(-50%) !important;
        width: fit-content !important;
        z-index: 100 !important;
        background: var(--bg-panel);
        padding: 5px;
        border-radius: var(--r);
        box-shadow: var(--shadow);
        border: var(--border);
    }

    #presentation-toolbar button {
        width: 42px !important;
        height: 42px !important;
    }

    /* ---- Controles inferiores izquierdos (móvil: solo zoom, arriba-derecha) ---- */
    #controls-bottom-left {
        position: fixed !important;
        top: 10px !important;
        right: 15px !important;
        bottom: auto !important;
        left: auto !important;
        flex-direction: row !important;
        gap: 8px !important;
        z-index: 2000 !important;
        align-items: flex-start !important;
    }

    #bottom-zoom-container {
        position: static !important;
        display: flex !important;
        flex-direction: row !important;
        align-items: center !important;
        width: fit-content !important;
        gap: 5px !important;
    }

    /* ---- Botones de zoom (móvil: más pequeños) ---- */
    #bottom-zoom-container button {
        width: 30px !important;
        height: 30px !important;
        font-size: 18px !important;
    }

    /* ---- Botones de historial (móvil: más pequeños) ---- */
    #history-container {
        position: fixed !important;

        top: 10px !important;
        right: 145px !important;

        bottom: auto !important;
        left: auto !important;

        display: flex !important;
        flex-direction: row !important;
        align-items: center !important;

        gap: 4px !important;
        z-index: 2000 !important;
    }

    /* ---- Barra de herramientas inferior (centrada abajo) ---- */
    #toolbar-wrapper {
        position: fixed !important;
        top: auto !important;
        bottom: 6px !important;
        left: 50% !important;
        transform: translateX(-50%) !important;
        width: fit-content !important;
        z-index: 1000 !important;
        background: var(--bg-panel);
        padding: 2px;
    }

    #toolbar-wrapper button {
        width: 45px !important;
        height: 30px !important;
    }

    /* ---- Menú de ajustes de página (móvil: compacto) ---- */
    #page-settings-menu {
        position: fixed !important;
        top: 40px !important;
        left: -5px !important;
        width: 100px !important;
        padding: 12px !important;
        font-size: 10px !important;
    }

    #premium-selection-menu {
        position: fixed !important;
        bottom: 60px !important;
        left: 33% !important;
        transform: translateX(-50%) !important;
        width: 210px !important;
        padding: 12px !important;
        gap: 6px !important;
        font-size: 14px !important;
    }

    #page-settings-menu label,
    #premium-selection-menu label {
        font-size: 10px !important;
        margin-top: 0px !important;
        display: block;
        font-weight: bold;
        color: #555;
    }

    #contextual-toolbar {
        position: fixed !important;
        top: 60px !important;
        left: 10px !important;
        z-index: 3000 !important;
        pointer-events: auto !important;
    }

    body.dark-mode #bottom-zoom-container button {
        color: white;
    }

    .panel-action-btn {
        height: 32px !important;
        font-size: 12px !important;
    }

    .theme-btn,
    .style-bg-btn {
        width: 32px !important;
        height: 32px !important;
    }

    .language-select-native {
        width: 100% !important;
        padding: 4px !important;
        font-size: 12px !important;
    }

    #tools-selection-menu {
        position: fixed !important;
        top: 60px !important;
        left: 10px !important;
        bottom: auto !important;
        transform: none !important;
        margin-bottom: 0 !important;
    }

    /* ---- Cartel "Modo Zen" en móvil: posición según se active o desactive ---- */

    /* Al ACTIVAR el modo Zen (body ya tiene .zen-mode): arriba del todo */
    body.zen-mode #zen-toast {
        top: 20px !important;
        bottom: auto !important;
        transform: translateX(-50%) translateY(-80px) !important;
    }

    body.zen-mode #zen-toast.show {
        transform: translateX(-50%) translateY(0) !important;
    }

    /* Al DESACTIVAR el modo Zen (body ya no tiene .zen-mode): arriba de la toolbar */
    #zen-toast {
        top: auto !important;
        bottom: 70px !important;
        transform: translateX(-50%) translateY(50px) !important;
    }

    #zen-toast.show {
        transform: translateX(-50%) translateY(0) !important;
    }

    /* ---- Botón "Comenzar a dibujar" del tutorial (móvil: ancho completo, una sola línea) ---- */
    .tutorial-btn-container {
        flex-direction: column !important;
        align-items: stretch !important;
        gap: 10px !important;
    }

    .tutorial-skip {
        margin-right: 0 !important;
        justify-content: center !important;
    }

    #close-tutorial {
        width: 100% !important;
        padding: 12px 8px !important;
        font-size: 12px !important;
        white-space: nowrap !important;
        gap: 6px !important;
    }

    #close-tutorial svg {
        width: 18px !important;
        height: 18px !important;
    }
}