/**
 * Estilos para el frontend de AI Voice News Reader
 */

/* Contenedor principal del player */
.ai-voice-player-container {
    margin: 20px 0;
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
}

.ai-voice-player {
    background: #fff;
    border: 1px solid #e1e5e9;
    border-radius: 12px;
    overflow: hidden;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
    transition: box-shadow 0.3s ease;
}

.ai-voice-player:hover {
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.15);
}

/* Estilos por tema */
.ai-voice-player[data-player-style="default"] {
    /* Estilo por defecto */
    background: #fff;
    border: 1px solid #e1e5e9;
    border-radius: 12px;
}

.ai-voice-player[data-player-style="minimal"] {
    border: none;
    box-shadow: none;
    background: transparent;
}

.ai-voice-player[data-player-style="modern"] {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    border: none;
    color: #fff;
}

.ai-voice-player[data-player-style="modern"] .player-title h4,
.ai-voice-player[data-player-style="modern"] .player-meta span {
    color: #fff;
}

/* Header del player */
.player-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    padding: 20px;
    background: #f8f9f9;
    border-bottom: 1px solid #e1e5e9;
}

.ai-voice-player[data-player-style="minimal"] .player-header {
    padding: 15px;
    background: transparent;
    border-bottom: none;
}

.ai-voice-player[data-player-style="modern"] .player-header {
    background: rgba(255, 255, 255, 0.1);
    border-bottom: 1px solid rgba(255, 255, 255, 0.2);
}

.player-title {
    flex: 1;
    margin-right: 20px;
}

.player-title h4 {
    margin: 0 0 8px 0;
    font-size: 1.2em;
    line-height: 1.3;
    color: #1d2327;
}

.player-meta {
    display: flex;
    flex-wrap: wrap;
    gap: 15px;
    font-size: 0.9em;
    color: #646970;
}

.player-meta span {
    display: flex;
    align-items: center;
    gap: 5px;
}

.player-meta .dashicons {
    font-size: 14px;
    width: 14px;
    height: 14px;
}

.player-controls {
    display: flex;
    gap: 8px;
    align-items: center;
}

.player-controls button,
.player-controls a.download-button {
    background: #0073aa;
    color: #fff;
    border: none;
    border-radius: 6px;
    padding: 8px 12px;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: 0.9em;
    text-decoration: none;
    transition: all 0.2s ease;
    min-width: 44px;
    justify-content: center;
}

.player-controls button:hover,
.player-controls a.download-button:hover {
    background: #005a87;
    transform: translateY(-1px);
}

.player-controls button:disabled {
    background: #94a5b6;
    cursor: not-allowed;
    transform: none;
}

.player-controls .dashicons {
    font-size: 16px;
    width: 16px;
    height: 16px;
}

.player-controls .button-text {
    font-weight: 500;
}

.ai-voice-player[data-player-style="minimal"] .player-controls button,
.ai-voice-player[data-player-style="minimal"] .player-controls a.download-button {
    background: #0073aa;
    border-radius: 50%;
    width: 40px;
    height: 40px;
    padding: 0;
}

.ai-voice-player[data-player-style="minimal"] .player-controls .button-text {
    display: none;
}

.ai-voice-player[data-player-style="modern"] .player-controls button,
.ai-voice-player[data-player-style="modern"] .player-controls a.download-button {
    background: rgba(255, 255, 255, 0.2);
    backdrop-filter: blur(10px);
    border: 1px solid rgba(255, 255, 255, 0.3);
}

.ai-voice-player[data-player-style="modern"] .player-controls button:hover,
.ai-voice-player[data-player-style="modern"] .player-controls a.download-button:hover {
    background: rgba(255, 255, 255, 0.3);
}

/* Barra de progreso */
.player-progress {
    padding: 20px;
    background: #fff;
}

.ai-voice-player[data-player-style="minimal"] .player-progress {
    padding: 10px 20px;
}

.ai-voice-player[data-player-style="modern"] .player-progress {
    background: rgba(255, 255, 255, 0.05);
}

.progress-bar {
    background: #e1e5e9;
    height: 6px;
    border-radius: 3px;
    overflow: hidden;
    margin-bottom: 10px;
    cursor: pointer;
}

.progress-fill {
    background: linear-gradient(90deg, #0073aa, #005a87);
    height: 100%;
    width: 0%;
    transition: width 0.1s linear;
    border-radius: 3px;
}

.ai-voice-player[data-player-style="modern"] .progress-fill {
    background: rgba(255, 255, 255, 0.8);
}

.time-display {
    display: flex;
    justify-content: space-between;
    font-size: 0.85em;
    color: #646970;
    font-family: monospace;
}

.ai-voice-player[data-player-style="modern"] .time-display {
    color: rgba(255, 255, 255, 0.8);
}

/* Controles adicionales */
.player-extra-controls {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 15px 20px;
    background: #f8f9f9;
    border-top: 1px solid #e1e5e9;
    flex-wrap: wrap;
    gap: 15px;
}

.ai-voice-player[data-player-style="minimal"] .player-extra-controls {
    padding: 10px 20px;
    background: transparent;
    border-top: none;
}

.ai-voice-player[data-player-style="modern"] .player-extra-controls {
    background: rgba(255, 255, 255, 0.05);
    border-top: 1px solid rgba(255, 255, 255, 0.2);
}

.volume-control,
.speed-control {
    display: flex;
    align-items: center;
    gap: 8px;
}

.volume-control .dashicons {
    color: #646970;
}

.ai-voice-player[data-player-style="modern"] .volume-control .dashicons {
    color: rgba(255, 255, 255, 0.8);
}

.volume-slider {
    width: 80px;
    height: 4px;
    -webkit-appearance: none;
    appearance: none;
    background: #e1e5e9;
    border-radius: 2px;
    outline: none;
}

.volume-slider::-webkit-slider-thumb {
    -webkit-appearance: none;
    appearance: none;
    width: 12px;
    height: 12px;
    background: #0073aa;
    border-radius: 50%;
    cursor: pointer;
}

.volume-slider::-moz-range-thumb {
    width: 12px;
    height: 12px;
    background: #0073aa;
    border-radius: 50%;
    cursor: pointer;
    border: none;
}

.ai-voice-player[data-player-style="modern"] .volume-slider::-webkit-slider-thumb,
.ai-voice-player[data-player-style="modern"] .volume-slider::-moz-range-thumb {
    background: rgba(255, 255, 255, 0.8);
}

.volume-value {
    font-size: 0.8em;
    color: #646970;
    min-width: 35px;
}

.ai-voice-player[data-player-style="modern"] .volume-value {
    color: rgba(255, 255, 255, 0.8);
}

.speed-control label {
    font-size: 0.85em;
    color: #646970;
    margin-right: 5px;
}

.ai-voice-player[data-player-style="modern"] .speed-control label {
    color: rgba(255, 255, 255, 0.8);
}

.speed-select {
    padding: 4px 8px;
    border: 1px solid #e1e5e9;
    border-radius: 4px;
    font-size: 0.85em;
    background: #fff;
}

.ai-voice-player[data-player-style="modern"] .speed-select {
    background: rgba(255, 255, 255, 0.2);
    border-color: rgba(255, 255, 255, 0.3);
    color: #fff;
}

.player-info {
    display: flex;
    align-items: center;
    gap: 15px;
    flex-wrap: wrap;
}

.generated-date {
    font-size: 0.8em;
    color: #646970;
    display: flex;
    align-items: center;
    gap: 5px;
}

.ai-voice-player[data-player-style="modern"] .generated-date {
    color: rgba(255, 255, 255, 0.8);
}

.generated-date .dashicons {
    font-size: 12px;
    width: 12px;
    height: 12px;
}

.regenerate-button {
    background: none;
    border: 1px solid #e1e5e9;
    border-radius: 4px;
    padding: 4px 8px;
    font-size: 0.8em;
    color: #646970;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 5px;
    transition: all 0.2s ease;
}

.regenerate-button:hover {
    background: #f8f9f9;
    border-color: #0073aa;
    color: #0073aa;
}

.ai-voice-player[data-player-style="modern"] .regenerate-button {
    border-color: rgba(255, 255, 255, 0.3);
    color: rgba(255, 255, 255, 0.8);
}

.ai-voice-player[data-player-style="modern"] .regenerate-button:hover {
    background: rgba(255, 255, 255, 0.2);
    border-color: rgba(255, 255, 255, 0.5);
    color: #fff;
}

/* Estados del player */
.player-status {
    padding: 20px;
    text-align: center;
    background: #f8f9f9;
}

.ai-voice-player[data-player-style="minimal"] .player-status {
    padding: 15px 20px;
    background: transparent;
}

.ai-voice-player[data-player-style="modern"] .player-status {
    background: rgba(255, 255, 255, 0.05);
}

.status-loading,
.status-error,
.status-no-audio {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 10px;
}

.status-loading .dashicons,
.status-error .dashicons,
.status-no-audio .dashicons {
    font-size: 24px;
    width: 24px;
    height: 24px;
}

.status-loading .dashicons {
    color: #0073aa;
}

.status-error .dashicons {
    color: #d63638;
}

.status-no-audio .dashicons {
    color: #646970;
}

.ai-voice-player[data-player-style="modern"] .status-loading .dashicons,
.ai-voice-player[data-player-style="modern"] .status-no-audio .dashicons {
    color: rgba(255, 255, 255, 0.8);
}

.ai-voice-player[data-player-style="modern"] .status-error .dashicons {
    color: #ff6b6b;
}

.status-loading span,
.status-error span,
.status-no-audio span {
    font-size: 0.9em;
    color: #646970;
}

.ai-voice-player[data-player-style="modern"] .status-loading span,
.ai-voice-player[data-player-style="modern"] .status-no-audio span {
    color: rgba(255, 255, 255, 0.8);
}

.ai-voice-player[data-player-style="modern"] .status-error span {
    color: #ff6b6b;
}

.generate-button,
.retry-button {
    background: #0073aa;
    color: #fff;
    border: none;
    border-radius: 6px;
    padding: 8px 16px;
    font-size: 0.9em;
    cursor: pointer;
    transition: all 0.2s ease;
}

.generate-button:hover,
.retry-button:hover {
    background: #005a87;
    transform: translateY(-1px);
}

.ai-voice-player[data-player-style="modern"] .generate-button,
.ai-voice-player[data-player-style="modern"] .retry-button {
    background: rgba(255, 255, 255, 0.2);
    backdrop-filter: blur(10px);
    border: 1px solid rgba(255, 255, 255, 0.3);
}

.ai-voice-player[data-player-style="modern"] .generate-button:hover,
.ai-voice-player[data-player-style="modern"] .retry-button:hover {
    background: rgba(255, 255, 255, 0.3);
}

/* Footer del player */
.player-footer {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 10px 20px;
    background: #f8f9f9;
    border-top: 1px solid #e1e5e9;
    font-size: 0.8em;
}

.ai-voice-player[data-player-style="minimal"] .player-footer {
    padding: 8px 20px;
    background: transparent;
    border-top: none;
}

.ai-voice-player[data-player-style="modern"] .player-footer {
    background: rgba(255, 255, 255, 0.05);
    border-top: 1px solid rgba(255, 255, 255, 0.2);
}

.ai-voice-info small,
.admin-actions small {
    color: #646970;
}

.ai-voice-player[data-player-style="modern"] .ai-voice-info small,
.ai-voice-player[data-player-style="modern"] .admin-actions small {
    color: rgba(255, 255, 255, 0.8);
}

.ai-voice-info a,
.admin-actions a {
    color: #0073aa;
    text-decoration: none;
}

.ai-voice-info a:hover,
.admin-actions a:hover {
    color: #005a87;
    text-decoration: underline;
}

.ai-voice-player[data-player-style="modern"] .ai-voice-info a,
.ai-voice-player[data-player-style="modern"] .admin-actions a {
    color: rgba(255, 255, 255, 0.8);
}

.ai-voice-player[data-player-style="modern"] .ai-voice-info a:hover,
.ai-voice-player[data-player-style="modern"] .admin-actions a:hover {
    color: #fff;
}

/* Estados del player */
.ai-voice-player.playing {
    border-color: #0073aa;
}

.ai-voice-player.playing .progress-fill {
    background: linear-gradient(90deg, #0073aa, #00a0d2);
}

.ai-voice-player[data-player-style="modern"].playing {
    border-color: rgba(255, 255, 255, 0.3);
}

/* Animaciones */
.spin {
    animation: spin 1s linear infinite;
}

@keyframes spin {
    from { transform: rotate(0deg); }
    to { transform: rotate(360deg); }
}

/* Responsive */
@media (max-width: 768px) {
    .ai-voice-player-container {
        margin: 15px 0;
    }
    
    .player-header {
        flex-direction: column;
        gap: 15px;
        padding: 15px;
    }
    
    .player-title {
        margin-right: 0;
    }
    
    .player-controls {
        width: 100%;
        justify-content: center;
    }
    
    .player-extra-controls {
        flex-direction: column;
        align-items: stretch;
        gap: 10px;
    }
    
    .player-info {
        justify-content: space-between;
    }
    
    .player-footer {
        flex-direction: column;
        gap: 8px;
        text-align: center;
    }
    
    .volume-slider {
        width: 60px;
    }
}

@media (max-width: 480px) {
    .player-title h4 {
        font-size: 1.1em;
    }
    
    .player-meta {
        gap: 10px;
        font-size: 0.85em;
    }
    
    .player-controls button,
    .player-controls a.download-button {
        padding: 6px 10px;
        font-size: 0.85em;
    }
    
    .player-controls .dashicons {
        font-size: 14px;
        width: 14px;
        height: 14px;
    }
    
    .ai-voice-player[data-player-style="minimal"] .player-controls button,
    .ai-voice-player[data-player-style="minimal"] .player-controls a.download-button {
        width: 36px;
        height: 36px;
    }
    
    .player-progress {
        padding: 15px;
    }
    
    .volume-slider {
        width: 50px;
    }
    
    .speed-select {
        font-size: 0.8em;
        padding: 3px 6px;
    }
}

/* Accesibilidad */
.ai-voice-player:focus-within {
    outline: 2px solid #0073aa;
    outline-offset: 2px;
}

.player-controls button:focus,
.player-controls a.download-button:focus,
.volume-slider:focus,
.speed-select:focus,
.generate-button:focus,
.retry-button:focus {
    outline: 2px solid #0073aa;
    outline-offset: 2px;
}

/* High contrast mode */
@media (prefers-contrast: high) {
    .ai-voice-player {
        border-width: 2px;
    }
    
    .player-controls button,
    .player-controls a.download-button {
        border: 2px solid #0073aa;
    }
    
    .progress-bar {
        border: 1px solid #1d2327;
    }
}

/* Modo oscuro */
@media (prefers-color-scheme: dark) {
    .ai-voice-player {
        background: #1d2327;
        border-color: #2c3e50;
        color: #f8f9f9;
    }
    
    .player-header {
        background: #2c3e50;
        border-color: #34495e;
    }
    
    .player-title h4 {
        color: #f8f9f9;
    }
    
    .player-meta span {
        color: #bdc3c7;
    }
    
    .player-progress {
        background: #2c3e50;
    }
    
    .progress-bar {
        background: #34495e;
    }
    
    .time-display {
        color: #bdc3c7;
    }
    
    .player-extra-controls {
        background: #2c3e50;
        border-color: #34495e;
    }
    
    .volume-control .dashicons {
        color: #bdc3c7;
    }
    
    .volume-slider {
        background: #34495e;
    }
    
    .volume-slider::-webkit-slider-thumb,
    .volume-slider::-moz-range-thumb {
        background: #0073aa;
    }
    
    .speed-control label {
        color: #bdc3c7;
    }
    
    .speed-select {
        background: #34495e;
        border-color: #2c3e50;
        color: #f8f9f9;
    }
    
    .generated-date {
        color: #bdc3c7;
    }
    
    .regenerate-button {
        border-color: #34495e;
        color: #bdc3c7;
    }
    
    .regenerate-button:hover {
        background: #34495e;
        border-color: #0073aa;
        color: #0073aa;
    }
    
    .player-status {
        background: #2c3e50;
    }
    
    .status-no-audio .dashicons {
        color: #bdc3c7;
    }
    
    .status-no-audio span {
        color: #bdc3c7;
    }
    
    .player-footer {
        background: #2c3e50;
        border-color: #34495e;
    }
    
    .ai-voice-info small,
    .admin-actions small {
        color: #bdc3c7;
    }
}
