/* ================================================================
   stylesTraductor.css — Módulo del Traductor Braille
   Complementa styles.css · Solo afecta a traductorBraille.html
   Paleta del proyecto:
     #2f2c2b  → oscuro (header, celdas)
     #4a3728  → marrón medio (puntos inactivos, fondos de control)
     #79451d  → marrón claro (fondo de página)
     #fd8d32  → naranja (acento principal)
     aliceblue → texto claro
   ================================================================ */


/* ── Área de resultado ─────────────────────────────────────────── */

.resultado_braille_texto {
    display: flex;
    flex-wrap: wrap;
    align-items: flex-end;
    gap: 6px;
    padding: 20px 16px;
    min-height: 100px;
    background-color: #2f2c2b;
    border: 2px solid #fd8d32;
    border-radius: 8px;
    margin-top: 10px;
}

/* Mensaje vacío cuando aún no hay traducción */
.resultado_braille_texto:empty::after {
    content: 'El resultado aparecerá aquí…';
    color: #6a5540;
    font-family: 'Courier New', monospace;
    font-size: 14px;
    font-style: italic;
    margin: auto;
}


/* ── Celda individual (SVG + etiqueta) ────────────────────────── */

.celda-wrapper {
    display: flex;
    flex-direction: column-reverse;
    align-items: center;
    gap: 4px;
    transition: transform 0.15s;
}

.celda-wrapper:hover {
    transform: scale(1.1);
}

/* Etiqueta de letra sobre el SVG */
.celda-label {
    font-family: 'Courier New', Courier, monospace;
    font-size: 18px;
    color: #fd8d32;
    line-height: 1;
    user-select: none;
}

/* Separador entre palabras */
.celda-espacio {
    display: inline-block;
    align-self: flex-end;
}

/* Indicador de carácter sin representación Braille */
.celda-nosoport {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 44px;
    height: 60px;
    border: 2px dashed rgba(253, 141, 50, 0.5);
    border-radius: 6px;
    color: #fd8d32;
    font-family: 'Courier New', monospace;
    font-size: 20px;
    font-weight: bold;
    opacity: 0.6;
}


/* ── Panel de configuración ──────────────────────────────────── */

.cfg-panel {
    background: #2f2c2b;
    border: 1px solid rgba(253, 141, 50, 0.25);
    border-radius: 8px;
    padding: 14px 18px;
    margin: 20px 0;
    overflow: hidden;
    transition: padding 0.2s;
}

/* Título / botón de colapso */
.cfg-titulo {
    font-family: 'Courier New', Courier, monospace;
    font-size: 18px;
    font-weight: bold;
    color: #fd8d32;
    letter-spacing: 1px;
    text-transform: uppercase;
    display: flex;
    align-items: center;
    gap: 8px;
    cursor: pointer;
    user-select: none;
    margin: 0;
}

/* Flecha que rota al cerrar */
.cfg-titulo::after {
    content: '▾';
    margin-left: auto;
    font-size: 14px;
    transition: transform 0.2s;
}

.cfg-panel.cerrado .cfg-titulo::after {
    transform: rotate(-90deg);
}

/* Ocultar la grilla cuando el panel está cerrado */
.cfg-panel.cerrado .cfg-grid {
    display: none;
}

/* Grilla de controles */
.cfg-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 28px 20px;
    margin-top: 16px;
}

/* Cada par label + control */
.cfg-item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
}

.cfg-item label {
    font-family: 'Courier New', Courier, monospace;
    font-size: 18px;
    color: aliceblue;
    margin: 0;
    line-height: 1.4;
    cursor: pointer;
}


/* ── Toggle switch ─────────────────────────────────────────────── */

.toggle-wrap {
    position: relative;
    width: 42px;
    height: 24px;
    flex-shrink: 0;
}

.toggle-wrap input[type="checkbox"] {
    opacity: 0;
    width: 0;
    height: 0;
    position: absolute;
}

.toggle-track {
    position: absolute;
    inset: 0;
    background: #4a3728;
    border-radius: 99px;
    cursor: pointer;
    transition: background-color 0.2s;
    border: 1px solid rgba(253, 141, 50, 0.3);
}

.toggle-wrap input:checked + .toggle-track {
    background: #fd8d32;
}

.toggle-track::after {
    content: '';
    position: absolute;
    top: 3px;
    left: 3px;
    width: 16px;
    height: 16px;
    background: white;
    border-radius: 50%;
    transition: transform 0.2s;
    box-shadow: 0 1px 3px rgba(0,0,0,0.3);
}

.toggle-wrap input:checked + .toggle-track::after {
    transform: translateX(18px);
}


/* ── Select de tamaño ──────────────────────────────────────────── */

.cfg-select {
    background: #4a3728;
    color: aliceblue;
    border: 1px solid rgba(253, 141, 50, 0.6);
    border-radius: 4px;
    padding: 5px 8px;
    font-family: 'Courier New', monospace;
    font-size: 15px;
    cursor: pointer;
    outline: none;
    transition: border-color 0.2s;
}

.cfg-select:focus {
    border-color: #fd8d32;
}


/* ── Color picker ──────────────────────────────────────────────── */

.cfg-color {
    width: 38px;
    height: 30px;
    padding: 2px;
    border: 2px solid rgba(253, 141, 50, 0.6);
    border-radius: 4px;
    background: none;
    cursor: pointer;
    transition: border-color 0.2s;
}

.cfg-color:focus {
    border-color: #fd8d32;
    outline: none;
}


/* ── Barra de exportar ─────────────────────────────────────────── */

.export-bar {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    margin-top: 20px;
}

.btn-export {
    display: inline-flex;
    align-items: center;
    gap: 7px;
    padding: 9px 20px;
    font-family: 'Courier New', Courier, monospace;
    font-size: 16px;
    font-weight: bold;
    color: #ffffff;
    background: #2f2c2b;
    border: 2px solid #fd8d32;
    border-radius: 6px;
    cursor: pointer;
    transition: background-color 0.2s, color 0.2s;
    white-space: nowrap;
}

.btn-export:hover {
    background-color: #fd8d32;
    color: #ffffff;
}

.btn-export:active {
    transform: scale(0.97);
}


/* ── Toast de notificaciones ───────────────────────────────────── */

.braille-toast {
    position: fixed;
    bottom: 28px;
    left: 50%;
    transform: translateX(-50%);
    padding: 10px 24px;
    border-radius: 99px;
    font-family: 'Courier New', Courier, monospace;
    font-size: 14px;
    opacity: 0;
    transition: opacity 0.3s;
    pointer-events: none;
    z-index: 9999;
    max-width: 90vw;
    text-align: center;
    white-space: pre-wrap;
    word-break: break-all;
    box-shadow: 0 4px 16px rgba(0,0,0,0.4);
}

.toast-ok   { background: #fd8d32; color: #2f2c2b; }
.toast-warn { background: #2f2c2b; color: aliceblue; border: 1px solid #fd8d32; }


/* ── Responsive ────────────────────────────────────────────────── */

/* Textarea que se estira según el contenido */
.input-textarea {
    resize: none;
    overflow: hidden;
    min-height: 40px;
    line-height: 1.5;
    padding: 10px 14px;
    font-size: 16px;
    margin: 0;
}

@media (max-width: 768px) {
    .cfg-grid {
        grid-template-columns: 1fr;
        gap: 10px;
    }

    .cfg-panel {
        padding: 10px 12px;
    }

    .export-bar {
        flex-direction: column;
    }

    .btn-export {
        justify-content: center;
        width: 100%;
    }

    .resultado_braille_texto {
        padding: 14px 10px;
    }

    .input-textarea {
        padding: 10px 12px;
        font-size: 15px;
    }

    .cfg-item label {
        font-size: 15px;
    }

    .cfg-titulo {
        font-size: 16px;
    }

    .cfg-select {
        font-size: 14px;
    }
}