/**
 * HRW Audio Player Elementor Widget Styles
 */

/* Container styles */
.hrw-audio-container {
    position: relative;
    margin: 10px 0;
}

/* Audio element styles */
.hrw-audio-element {
    width: 100%;
    max-width: 100%;
    outline: none;
}

/* Editor mode info styles */
.hrw-audio-editor-info {
    background: #f8f9fa;
    border: 1px solid #e9ecef;
    border-radius: 4px;
    padding: 10px;
    margin-bottom: 10px;
    font-size: 12px;
    color: #6c757d;
}

.hrw-audio-editor-info p {
    margin: 0 0 5px 0;
}

.hrw-audio-editor-info p:last-child {
    margin-bottom: 0;
}

.hrw-audio-editor-info strong {
    color: #495057;
}

/* Placeholder styles */
.hrw-audio-placeholder {
    background: #fff3cd;
    border: 1px solid #ffeaa7;
    border-radius: 4px;
    padding: 20px;
    text-align: center;
    color: #856404;
    font-size: 14px;
}

/* Warning styles */
.hrw-audio-warning {
    background: #f8d7da;
    border: 1px solid #f5c6cb;
    border-radius: 4px;
    padding: 8px 12px;
    margin-top: 10px;
    color: #721c24;
    font-size: 12px;
}

/* Trigger button state styles */
.audio-button {
    transition: all 0.3s ease;
    position: relative;
    cursor: pointer;
}

/* Playing state */
.audio-button.audio-playing {
    opacity: 0.8;
}

.audio-button.audio-playing::after {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 0;
    height: 0;
    border-left: 6px solid currentColor;
    border-top: 4px solid transparent;
    border-bottom: 4px solid transparent;
    opacity: 0.7;
}

/* Paused state */
.audio-button.audio-paused {
    opacity: 1;
}

/* Loading state */
.audio-button.audio-loading {
    opacity: 0.6;
    cursor: wait;
}

.audio-button.audio-loading::after {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 12px;
    height: 12px;
    border: 2px solid currentColor;
    border-top: 2px solid transparent;
    border-radius: 50%;
    animation: audio-spinner 1s linear infinite;
}

/* Error state */
.audio-button.audio-error {
    opacity: 0.5;
    cursor: not-allowed;
}

.audio-button.audio-error::after {
    content: '⚠';
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    color: #dc3545;
    font-size: 14px;
    font-weight: bold;
}

/* Spinner animation */
@keyframes audio-spinner {
    0% { transform: translate(-50%, -50%) rotate(0deg); }
    100% { transform: translate(-50%, -50%) rotate(360deg); }
}

/* Custom audio controls (if needed in the future) */
.hrw-audio-controls {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-top: 10px;
    padding: 10px;
    background: #f8f9fa;
    border-radius: 4px;
    border: 1px solid #e9ecef;
}

.hrw-audio-control-btn {
    background: #007cba;
    color: white;
    border: none;
    border-radius: 4px;
    padding: 8px 12px;
    cursor: pointer;
    font-size: 12px;
    transition: background-color 0.3s ease;
}

.hrw-audio-control-btn:hover {
    background: #005a87;
}

.hrw-audio-control-btn:disabled {
    background: #6c757d;
    cursor: not-allowed;
}

/* Volume control */
.hrw-audio-volume {
    display: flex;
    align-items: center;
    gap: 5px;
}

.hrw-audio-volume input[type="range"] {
    width: 80px;
    height: 4px;
    background: #ddd;
    border-radius: 2px;
    outline: none;
}

/* Progress bar */
.hrw-audio-progress {
    flex: 1;
    height: 4px;
    background: #ddd;
    border-radius: 2px;
    position: relative;
    cursor: pointer;
}

.hrw-audio-progress-bar {
    height: 100%;
    background: #007cba;
    border-radius: 2px;
    transition: width 0.1s ease;
}

/* Time display */
.hrw-audio-time {
    font-size: 11px;
    color: #6c757d;
    font-family: monospace;
    min-width: 80px;
    text-align: center;
}

/* Responsive styles */
@media (max-width: 768px) {
    .hrw-audio-controls {
        flex-wrap: wrap;
        gap: 8px;
    }
    
    .hrw-audio-control-btn {
        font-size: 11px;
        padding: 6px 10px;
    }
    
    .hrw-audio-volume input[type="range"] {
        width: 60px;
    }
    
    .hrw-audio-time {
        font-size: 10px;
        min-width: 60px;
    }
}

/* Dark mode support */
@media (prefers-color-scheme: dark) {
    .hrw-audio-editor-info {
        background: #2d3748;
        border-color: #4a5568;
        color: #a0aec0;
    }
    
    .hrw-audio-editor-info strong {
        color: #e2e8f0;
    }
    
    .hrw-audio-controls {
        background: #2d3748;
        border-color: #4a5568;
    }
    
    .hrw-audio-time {
        color: #a0aec0;
    }
    
    .hrw-audio-progress {
        background: #4a5568;
    }
}

/* Accessibility improvements */
.hrw-audio-element:focus {
    outline: 2px solid #007cba;
    outline-offset: 2px;
}

.audio-button:focus {
    outline: 2px solid #007cba;
    outline-offset: 2px;
}

/* High contrast mode support */
@media (prefers-contrast: high) {
    .hrw-audio-editor-info {
        border-width: 2px;
    }
    
    .hrw-audio-warning {
        border-width: 2px;
    }
    
    .hrw-audio-controls {
        border-width: 2px;
    }
}

/* Print styles */
@media print {
    .hrw-audio-container {
        display: none;
    }
}