/* tts-styles.css - Estilos para la interfaz de Text-to-Speech */
/* 🎤 Estilos del sistema TTS del Compendio RV1960 */

/* Contenedor principal */
.tts-controls {
    position: fixed;
    top: 60px; /* Bajado 40px (aproximadamente 1cm) */
    right: 20px;
    width: 320px;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    border-radius: 15px;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.3);
    z-index: 10000;
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    color: white;
    overflow: hidden;
    transition: all 0.3s ease;
}

.tts-controls.minimized {
    width: 200px;
}

/* Header */
.tts-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 15px 20px;
    background: rgba(255, 255, 255, 0.1);
    backdrop-filter: blur(10px);
}

.tts-title {
    display: flex;
    align-items: center;
    gap: 8px;
    font-weight: 600;
    font-size: 1.1em;
}

.tts-title i {
    font-size: 1.2em;
    color: #ffeb3b;
}

.tts-controls-buttons {
    display: flex;
    gap: 5px;
}

/* Botones */
.tts-btn {
    background: rgba(255, 255, 255, 0.2);
    border: none;
    border-radius: 8px;
    color: white;
    cursor: pointer;
    padding: 8px 12px;
    font-size: 14px;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    min-width: 36px;
    height: 36px;
}

.tts-btn:hover {
    background: rgba(255, 255, 255, 0.3);
    transform: translateY(-2px);
}

.tts-btn:active {
    transform: translateY(0);
}

.tts-btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
    transform: none;
}

.tts-btn.tts-primary {
    background: linear-gradient(135deg, #4CAF50, #45a049);
    box-shadow: 0 4px 15px rgba(76, 175, 80, 0.3);
}

.tts-btn.tts-primary:hover {
    background: linear-gradient(135deg, #45a049, #3d8b40);
    box-shadow: 0 6px 20px rgba(76, 175, 80, 0.4);
}

.tts-btn.tts-secondary {
    background: linear-gradient(135deg, #f44336, #d32f2f);
    box-shadow: 0 4px 15px rgba(244, 67, 54, 0.3);
}

.tts-btn.tts-secondary:hover {
    background: linear-gradient(135deg, #d32f2f, #b71c1c);
    box-shadow: 0 6px 20px rgba(244, 67, 54, 0.4);
}

.tts-btn.tts-accent {
    background: linear-gradient(135deg, #ff9800, #f57c00);
    box-shadow: 0 4px 15px rgba(255, 152, 0, 0.3);
}

.tts-btn.tts-accent:hover {
    background: linear-gradient(135deg, #f57c00, #ef6c00);
    box-shadow: 0 6px 20px rgba(255, 152, 0, 0.4);
}

.tts-btn.tts-warning {
    background: linear-gradient(135deg, #ff5722, #d84315);
    box-shadow: 0 4px 15px rgba(255, 87, 34, 0.3);
}

.tts-btn.tts-warning:hover {
    background: linear-gradient(135deg, #d84315, #bf360c);
    box-shadow: 0 6px 20px rgba(255, 87, 34, 0.4);
}

.tts-btn.tts-info {
    background: linear-gradient(135deg, #2196F3, #1976D2);
    box-shadow: 0 4px 15px rgba(33, 150, 243, 0.3);
}

.tts-btn.tts-info:hover {
    background: linear-gradient(135deg, #1976D2, #1565C0);
    box-shadow: 0 6px 20px rgba(33, 150, 243, 0.4);
}

.tts-btn.tts-minimize,
.tts-btn.tts-close {
    background: rgba(255, 255, 255, 0.1);
    padding: 6px 8px;
    min-width: 28px;
    height: 28px;
}

.tts-btn.tts-close:hover {
    background: rgba(244, 67, 54, 0.8);
}

/* Contenido */
.tts-content {
    padding: 20px;
}

/* Controles principales */
.tts-main-controls {
    display: flex;
    gap: 10px;
    margin-bottom: 20px;
    justify-content: center;
}

.tts-main-controls .tts-btn {
    flex: 1;
    padding: 12px;
    font-size: 16px;
}

/* Configuraciones */
.tts-settings {
    margin-bottom: 20px;
}

.tts-setting-group {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 15px;
}

.tts-setting-group label {
    min-width: 70px;
    font-size: 0.9em;
    font-weight: 500;
}

.tts-select {
    flex: 1;
    background: rgba(255, 255, 255, 0.2);
    border: 1px solid rgba(255, 255, 255, 0.3);
    border-radius: 8px;
    color: white;
    padding: 8px 12px;
    font-size: 0.9em;
}

.tts-select option {
    background: #333;
    color: white;
}

.tts-slider {
    flex: 1;
    height: 6px;
    background: rgba(255, 255, 255, 0.2);
    border-radius: 3px;
    outline: none;
    -webkit-appearance: none;
}

.tts-slider::-webkit-slider-thumb {
    -webkit-appearance: none;
    appearance: none;
    width: 18px;
    height: 18px;
    background: #ffeb3b;
    border-radius: 50%;
    cursor: pointer;
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.3);
}

.tts-slider::-moz-range-thumb {
    width: 18px;
    height: 18px;
    background: #ffeb3b;
    border-radius: 50%;
    cursor: pointer;
    border: none;
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.3);
}

.tts-value {
    min-width: 50px;
    text-align: right;
    font-size: 0.9em;
    font-weight: 600;
    color: #ffeb3b;
}

/* Estado */
.tts-status {
    background: rgba(255, 255, 255, 0.1);
    border-radius: 10px;
    padding: 15px;
    backdrop-filter: blur(10px);
}

.tts-status-text {
    text-align: center;
    font-weight: 500;
    margin-bottom: 10px;
    font-size: 0.95em;
}

.tts-progress {
    width: 100%;
    height: 4px;
    background: rgba(255, 255, 255, 0.2);
    border-radius: 2px;
    overflow: hidden;
}

.tts-progress-bar {
    height: 100%;
    background: linear-gradient(90deg, #4CAF50, #8BC34A);
    width: 0%;
    transition: width 0.3s ease;
    border-radius: 2px;
}

/* Resaltado de texto */
.tts-highlight {
    background: rgba(255, 235, 59, 0.3) !important;
    border-radius: 3px;
    padding: 2px 4px;
    transition: all 0.3s ease;
}

/* Animaciones */
@keyframes tts-pulse {
    0% { transform: scale(1); }
    50% { transform: scale(1.05); }
    100% { transform: scale(1); }
}

.tts-btn.tts-primary:not(:disabled) {
    animation: tts-pulse 2s infinite;
}

/* Responsive */
@media (max-width: 768px) {
    .tts-controls {
        top: 50px; /* Bajado también en móviles */
        right: 10px;
        left: 10px;
        width: auto;
        max-width: 400px;
        margin: 0 auto;
    }
    
    .tts-main-controls {
        flex-direction: column;
    }
    
    .tts-setting-group {
        flex-direction: column;
        align-items: stretch;
        gap: 5px;
    }
    
    .tts-setting-group label {
        min-width: auto;
        text-align: center;
    }
}

/* Estados especiales */
.tts-controls.loading .tts-content {
    opacity: 0.5;
    pointer-events: none;
}

.tts-controls.error {
    border: 2px solid #f44336;
}

.tts-controls.error .tts-title {
    color: #ffcdd2;
}

/* Efectos de hover para el contenedor */
.tts-controls:hover {
    transform: translateY(-2px);
    box-shadow: 0 15px 40px rgba(0, 0, 0, 0.4);
}

/* Transiciones suaves */
.tts-controls * {
    transition: all 0.3s ease;
}

/* Mejoras de accesibilidad */
.tts-btn:focus,
.tts-select:focus,
.tts-slider:focus {
    outline: 2px solid #ffeb3b;
    outline-offset: 2px;
}

/* Modo oscuro compatible */
@media (prefers-color-scheme: dark) {
    .tts-controls {
        background: linear-gradient(135deg, #2c3e50 0%, #34495e 100%);
    }
}

/* Animación de entrada */
.tts-controls {
    animation: tts-slideIn 0.5s ease-out;
}

@keyframes tts-slideIn {
    from {
        transform: translateX(100%);
        opacity: 0;
    }
    to {
        transform: translateX(0);
        opacity: 1;
    }
}
