/* ==========================================
   ⚙️ AJUSTES — POPUP DISEÑO INTEGRAL
   ========================================== */

/* === OVERLAY BASE === */
.st-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: radial-gradient(circle, rgba(10, 8, 15, 0.35) 0%, rgba(0, 0, 0, 0.8) 100%);
    backdrop-filter: blur(10px);
    z-index: 25000;
    display: flex;
    justify-content: center;
    align-items: center;
    font-family: system-ui, -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    color: #e0d5c0;
    animation: stFadeIn 0.3s ease-out;
}

/* === VENTANA PRINCIPAL === */
.st-window {
    width: 680px;
    max-width: 95vw;
    max-height: 85vh;
    background: #0d0a08;
    border: 2px solid #5a4632;
    box-shadow: 0 0 80px rgba(0, 0, 0, 1), inset 0 0 40px rgba(0, 0, 0, 0.6);
    display: flex;
    flex-direction: column;
    position: relative;
    border-radius: 4px;
    overflow: hidden;
    animation: stSlideIn 0.35s ease-out;
}

/* Esquinas doradas */
.st-corner {
    position: absolute;
    width: 28px;
    height: 28px;
    border: 2px solid #ccaa4b;
    z-index: 10;
    pointer-events: none;
}
.st-corner.tl { top: -3px; left: -3px; border-right: none; border-bottom: none; }
.st-corner.tr { top: -3px; right: -3px; border-left: none; border-bottom: none; }
.st-corner.bl { bottom: -3px; left: -3px; border-right: none; border-top: none; }
.st-corner.br { bottom: -3px; right: -3px; border-left: none; border-top: none; }

/* === HEADER === */
.st-header {
    padding: 14px 22px;
    background: linear-gradient(to bottom, #1a120b, #0d0a08);
    border-bottom: 2px solid #ccaa4b;
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-shrink: 0;
}

.st-title {
    color: #ccaa4b;
    font-size: 1.4rem;
    letter-spacing: 3px;
    text-shadow: 0 0 8px rgba(204, 170, 75, 0.3);
    display: flex;
    align-items: center;
    gap: 10px;
    text-transform: uppercase;
    font-weight: bold;
}

.st-title-icon {
    font-size: 1.3rem;
}

.st-btn-close {
    background: none;
    border: none;
    color: #5a4632;
    font-size: 2rem;
    cursor: pointer;
    transition: 0.3s;
    line-height: 1;
    padding: 0 4px;
}

.st-btn-close:hover {
    color: #ff4d4d;
    transform: rotate(90deg);
}

/* === TABS === */
.st-tabs {
    display: flex;
    background: #0a0705;
    border-bottom: 1px solid #332518;
    flex-shrink: 0;
}

.st-tab {
    padding: 11px 22px;
    color: #666;
    cursor: pointer;
    font-size: 0.82rem;
    text-transform: uppercase;
    letter-spacing: 0.8px;
    border-bottom: 2px solid transparent;
    transition: all 0.2s;
    white-space: nowrap;
    display: flex;
    align-items: center;
    gap: 7px;
    background: none;
    border-top: none;
    border-left: none;
    border-right: none;
    font-family: inherit;
    flex: 1;
    justify-content: center;
}

.st-tab:hover {
    color: #ccaa4b;
    background: rgba(204, 170, 75, 0.05);
}

.st-tab.active {
    color: #ccaa4b;
    border-bottom-color: #ccaa4b;
    background: rgba(204, 170, 75, 0.08);
}

.st-tab-icon {
    font-size: 1rem;
}

/* === BODY / CONTENIDO === */
.st-body {
    flex: 1;
    overflow-y: auto;
    padding: 20px 24px;
    scrollbar-width: thin;
    scrollbar-color: #4b3621 rgba(0, 0, 0, 0.2);
}

.st-body::-webkit-scrollbar {
    width: 6px;
}
.st-body::-webkit-scrollbar-track {
    background: rgba(0, 0, 0, 0.2);
}
.st-body::-webkit-scrollbar-thumb {
    background: #4b3621;
    border-radius: 3px;
}

/* Panel de sección */
.st-panel {
    display: none;
}

.st-panel.active {
    display: block;
    animation: stContentFadeIn 0.25s ease-out;
}

/* === SECCIÓN: PERSONALIZACIÓN (FUENTES) === */
.st-section-title {
    color: #ccaa4b;
    font-size: 0.85rem;
    text-transform: uppercase;
    letter-spacing: 1.5px;
    margin-bottom: 14px;
    padding-bottom: 8px;
    border-bottom: 1px solid #332518;
    display: flex;
    align-items: center;
    gap: 8px;
}

.st-section-title-icon {
    font-size: 0.9rem;
    opacity: 0.7;
}

/* Grid de fuentes */
.st-font-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 8px;
}

.st-font-btn {
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid #2a1f14;
    border-radius: 6px;
    padding: 12px 14px;
    cursor: pointer;
    transition: all 0.2s ease;
    display: flex;
    align-items: center;
    gap: 10px;
    color: #bbb;
    font-size: 0.88rem;
    text-align: left;
    font-family: inherit;
}

.st-font-btn:hover {
    background: rgba(204, 170, 75, 0.06);
    border-color: #5a4632;
    transform: translateY(-1px);
}

.st-font-btn.active {
    border-color: #ccaa4b;
    background: rgba(204, 170, 75, 0.1);
    color: #ccaa4b;
    box-shadow: 0 0 10px rgba(204, 170, 75, 0.15);
}

.st-font-btn-indicator {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    border: 1px solid #555;
    flex-shrink: 0;
    transition: all 0.2s;
}

.st-font-btn.active .st-font-btn-indicator {
    background: #ccaa4b;
    border-color: #ccaa4b;
    box-shadow: 0 0 6px rgba(204, 170, 75, 0.4);
}

.st-font-btn-name {
    flex: 1;
    line-height: 1.2;
}

.st-font-btn-preview {
    font-size: 0.7rem;
    color: #666;
    margin-top: 2px;
}

/* === SECCIÓN: AUDIO === */
.st-audio-group {
    margin-bottom: 22px;
}

.st-audio-group:last-child {
    margin-bottom: 0;
}

/* Cabecera de cada control de audio */
.st-audio-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 10px;
}

.st-audio-label {
    display: flex;
    align-items: center;
    gap: 8px;
    color: #ccc;
    font-size: 0.88rem;
}

.st-audio-label-icon {
    font-size: 1.1rem;
    width: 24px;
    text-align: center;
}

.st-audio-value {
    font-size: 0.8rem;
    color: #ccaa4b;
    background: rgba(204, 170, 75, 0.1);
    padding: 2px 10px;
    border-radius: 10px;
    min-width: 42px;
    text-align: center;
    font-weight: bold;
    letter-spacing: 0.5px;
}

/* Contenedor del slider */
.st-slider-wrap {
    display: flex;
    align-items: center;
    gap: 12px;
}

.st-slider-icon {
    font-size: 0.9rem;
    color: #555;
    width: 18px;
    text-align: center;
    flex-shrink: 0;
}

/* === SLIDER PERSONALIZADO === */
.st-slider {
    -webkit-appearance: none;
    appearance: none;
    width: 100%;
    height: 6px;
    background: #1a1510;
    border: 1px solid #332518;
    border-radius: 3px;
    outline: none;
    cursor: pointer;
    transition: all 0.2s;
}

.st-slider:hover {
    border-color: #5a4632;
}

/* Track (WebKit) */
.st-slider::-webkit-slider-runnable-track {
    height: 6px;
    border-radius: 3px;
}

/* Thumb (WebKit) */
.st-slider::-webkit-slider-thumb {
    -webkit-appearance: none;
    appearance: none;
    width: 18px;
    height: 18px;
    background: radial-gradient(circle at 35% 35%, #e8d48b, #ccaa4b 50%, #a08530);
    border: 2px solid #ccaa4b;
    border-radius: 50%;
    cursor: pointer;
    margin-top: -6px;
    box-shadow: 0 0 8px rgba(204, 170, 75, 0.3), 0 1px 3px rgba(0, 0, 0, 0.5);
    transition: all 0.15s ease;
}

.st-slider::-webkit-slider-thumb:hover {
    transform: scale(1.15);
    box-shadow: 0 0 14px rgba(204, 170, 75, 0.5), 0 1px 4px rgba(0, 0, 0, 0.6);
}

.st-slider:active::-webkit-slider-thumb {
    transform: scale(1.05);
    background: radial-gradient(circle at 35% 35%, #f0e0a0, #dbb85a 50%, #b09540);
}

/* Thumb (Firefox) */
.st-slider::-moz-range-thumb {
    width: 16px;
    height: 16px;
    background: radial-gradient(circle at 35% 35%, #e8d48b, #ccaa4b 50%, #a08530);
    border: 2px solid #ccaa4b;
    border-radius: 50%;
    cursor: pointer;
    box-shadow: 0 0 8px rgba(204, 170, 75, 0.3), 0 1px 3px rgba(0, 0, 0, 0.5);
}

.st-slider::-moz-range-thumb:hover {
    transform: scale(1.15);
    box-shadow: 0 0 14px rgba(204, 170, 75, 0.5);
}

/* Track (Firefox) */
.st-slider::-moz-range-track {
    height: 6px;
    background: #1a1510;
    border: 1px solid #332518;
    border-radius: 3px;
}

/* Slider desactivado */
.st-slider:disabled {
    opacity: 0.3;
    cursor: not-allowed;
}

.st-slider:disabled::-webkit-slider-thumb {
    background: #555;
    border-color: #555;
    box-shadow: none;
    cursor: not-allowed;
}

.st-slider:disabled::-moz-range-thumb {
    background: #555;
    border-color: #555;
    box-shadow: none;
    cursor: not-allowed;
}

/* === TOGGLE SWITCH === */
.st-toggle-wrap {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-top: 8px;
}

.st-toggle {
    position: relative;
    width: 44px;
    height: 22px;
    flex-shrink: 0;
}

.st-toggle input {
    opacity: 0;
    width: 0;
    height: 0;
}

.st-toggle-track {
    position: absolute;
    cursor: pointer;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: #1a1510;
    border: 1px solid #332518;
    border-radius: 11px;
    transition: all 0.3s;
}

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

.st-toggle input:checked + .st-toggle-track {
    background: rgba(204, 170, 75, 0.2);
    border-color: #ccaa4b;
}

.st-toggle input:checked + .st-toggle-track::after {
    transform: translateX(22px);
    background: #ccaa4b;
    box-shadow: 0 0 6px rgba(204, 170, 75, 0.4);
}

.st-toggle-label {
    font-size: 0.78rem;
    color: #888;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    user-select: none;
    cursor: pointer;
}

.st-toggle-label.enabled {
    color: #ccaa4b;
}

/* === SEPARADOR === */
.st-divider {
    height: 1px;
    background: #332518;
    margin: 18px 0;
    border: none;
}

/* === BOTÓN TOGGLE (ESQUINA SUPERIOR DERECHA) === */
.st-settings-btn {
    position: fixed;
    top: 25px;
    right: 25px;
    width: 50px;
    height: 45px;
    padding: 8px;
    background: #2a2a2a;
    border: 2px solid #13878b;
    color: #e0e0e0;
    border-radius: 6px;
    cursor: pointer;
    font-size: 1.2rem;
    z-index: 1000;
    transition: all 0.3s ease;
    line-height: 1;
}

.st-settings-btn:hover {
    background: #13878b;
    transform: scale(1.1);
}

/* === FOOTER DEL POPUP === */
.st-footer {
    padding: 10px 22px;
    background: rgba(0, 0, 0, 0.3);
    border-top: 1px solid #332518;
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-shrink: 0;
}

.st-footer-hint {
    font-size: 0.7rem;
    color: #555;
    display: flex;
    align-items: center;
    gap: 6px;
}

.st-footer-hint kbd {
    background: rgba(255, 255, 255, 0.06);
    border: 1px solid #332518;
    padding: 1px 6px;
    border-radius: 3px;
    font-size: 0.65rem;
    color: #888;
}

.st-footer-version {
    font-size: 0.65rem;
    color: #444;
    letter-spacing: 0.5px;
}

/* === ANIMACIONES === */
@keyframes stFadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

@keyframes stSlideIn {
    from { opacity: 0; transform: translateY(12px) scale(0.98); }
    to { opacity: 1; transform: translateY(0) scale(1); }
}

@keyframes stContentFadeIn {
    from { opacity: 0; transform: translateY(4px); }
    to { opacity: 1; transform: translateY(0); }
}

/* === RESPONSIVE === */
@media (max-width: 768px) {
    .st-window {
        width: 100vw;
        max-width: 100vw;
        max-height: 100vh;
        height: 100vh;
        border-radius: 0;
    }

    .st-corner {
        display: none;
    }

    .st-font-grid {
        grid-template-columns: 1fr;
    }

    .st-body {
        padding: 16px;
    }
}

@media (max-width: 480px) {
    .st-tab {
        padding: 9px 12px;
        font-size: 0.75rem;
    }

    .st-title {
        font-size: 1.1rem;
        letter-spacing: 2px;
    }
}
