/**
 * Enhanced Voice Recorder Styles
 *
 * @package TutorSkillTest
 * @since 1.0.0
 */

/* Enhanced Recording Controls */
.enhanced-recording-controls {
    background: #f8f9fa;
    border: 2px solid #e9ecef;
    border-radius: 12px;
    padding: 20px;
    margin: 20px 0;
}

.recording-status-display {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
    padding: 15px;
    background: white;
    border-radius: 8px;
    border: 1px solid #e9ecef;
}

.microphone-status {
    display: flex;
    align-items: center;
    gap: 10px;
}

.mic-icon {
    font-size: 24px;
    color: #6c757d;
    transition: all 0.3s ease;
}

.mic-icon.recording {
    color: #dc3545;
    animation: pulse 1.5s infinite;
}

.status-text {
    font-weight: 500;
    color: #333;
}

.recording-timer-display {
    text-align: right;
}

.timer {
    font-size: 1.5rem;
    font-weight: bold;
    color: #2c5aa0;
    font-family: 'Courier New', monospace;
}

.recording-controls-row {
    display: flex;
    gap: 10px;
    margin-bottom: 20px;
    flex-wrap: wrap;
}

.recording-controls-row .btn {
    flex: 1;
    min-width: 150px;
    justify-content: center;
}

/* Recording Visualizer */
.recording-visualizer {
    background: white;
    border: 1px solid #e9ecef;
    border-radius: 8px;
    padding: 20px;
    margin-bottom: 20px;
}

.waveform-canvas {
    width: 100%;
    height: 100px;
    border: 1px solid #e9ecef;
    border-radius: 4px;
    background: #f8f9fa;
    display: block;
    margin: 0 auto 15px;
}

.recording-level {
    display: flex;
    align-items: center;
    gap: 15px;
}

.level-label {
    font-weight: 500;
    color: #333;
    min-width: 100px;
}

.level-bar {
    flex: 1;
    height: 20px;
    background: #e9ecef;
    border-radius: 10px;
    overflow: hidden;
    position: relative;
}

.level-fill {
    height: 100%;
    background: linear-gradient(90deg, #28a745 0%, #ffc107 70%, #dc3545 100%);
    width: 0%;
    transition: width 0.1s ease;
    border-radius: 10px;
}

/* Recording Settings */
.recording-settings {
    background: white;
    border: 1px solid #e9ecef;
    border-radius: 8px;
    padding: 15px;
}

.setting-item {
    margin-bottom: 10px;
}

.setting-item:last-child {
    margin-bottom: 0;
}

.setting-item label {
    display: flex;
    align-items: center;
    gap: 10px;
    font-weight: 500;
    color: #333;
    cursor: pointer;
}

.setting-item input[type="checkbox"] {
    margin: 0;
    transform: scale(1.2);
}

.setting-item select {
    padding: 5px 10px;
    border: 1px solid #e9ecef;
    border-radius: 4px;
    background: white;
    font-size: 0.9rem;
}

/* File Management */
.uploaded-files {
    margin-top: 20px;
    background: white;
    border: 1px solid #e9ecef;
    border-radius: 8px;
    padding: 15px;
}

.uploaded-files h5 {
    margin: 0 0 15px 0;
    color: #333;
    font-size: 1rem;
}

.files-list {
    max-height: 200px;
    overflow-y: auto;
}

.file-item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 12px;
    background: #f8f9fa;
    border: 1px solid #e9ecef;
    border-radius: 6px;
    margin-bottom: 10px;
    transition: all 0.3s ease;
}

.file-item:hover {
    background: #e9ecef;
    transform: translateY(-1px);
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
}

.file-info {
    display: flex;
    align-items: center;
    gap: 10px;
    flex: 1;
}

.file-info .dashicons {
    color: #2c5aa0;
    font-size: 20px;
}

.file-name {
    font-weight: 500;
    color: #333;
}

.file-size {
    color: #6c757d;
    font-size: 0.9rem;
}

.file-actions {
    display: flex;
    gap: 5px;
}

.file-actions .btn {
    padding: 6px 12px;
    font-size: 0.8rem;
    min-width: auto;
}

.no-files {
    text-align: center;
    color: #6c757d;
    font-style: italic;
    padding: 20px;
}

/* Audio Player */
.audio-player {
    margin: 20px 0;
    padding: 20px;
    background: white;
    border-radius: 8px;
    border: 1px solid #e9ecef;
}

.audio-player h4 {
    margin: 0 0 15px 0;
    color: #333;
}

.audio-player audio {
    width: 100%;
    height: 40px;
}

/* Responsive Design */
@media (max-width: 768px) {
    .recording-status-display {
        flex-direction: column;
        gap: 15px;
        text-align: center;
    }
    
    .recording-controls-row {
        flex-direction: column;
    }
    
    .recording-controls-row .btn {
        min-width: auto;
    }
    
    .recording-level {
        flex-direction: column;
        gap: 10px;
    }
    
    .level-label {
        min-width: auto;
    }
    
    .file-item {
        flex-direction: column;
        gap: 10px;
        text-align: center;
    }
    
    .file-actions {
        justify-content: center;
    }
}

/* Animation for recording indicator */
@keyframes pulse {
    0% {
        opacity: 1;
        transform: scale(1);
    }
    50% {
        opacity: 0.7;
        transform: scale(1.1);
    }
    100% {
        opacity: 1;
        transform: scale(1);
    }
}

/* Loading states */
.btn .spinner {
    display: inline-block;
    width: 16px;
    height: 16px;
    border: 2px solid transparent;
    border-top: 2px solid currentColor;
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

/* Success/Error states */
.btn:disabled {
    opacity: 0.6;
    cursor: not-allowed;
}

.recording-success {
    border-color: #28a745;
    background-color: #d4edda;
}

.recording-error {
    border-color: #dc3545;
    background-color: #f8d7da;
}

/* Microphone permission states */
.microphone-permission-required {
    background: #fff3cd;
    border: 1px solid #ffeaa7;
    color: #856404;
    padding: 15px;
    border-radius: 8px;
    margin-bottom: 20px;
}

.microphone-permission-required .dashicons {
    color: #f39c12;
    margin-right: 8px;
}

.microphone-denied {
    background: #f8d7da;
    border: 1px solid #f5c6cb;
    color: #721c24;
    padding: 15px;
    border-radius: 8px;
    margin-bottom: 20px;
}

.microphone-denied .dashicons {
    color: #dc3545;
    margin-right: 8px;
}
