/**
 * Voice Stories Recorder Styles
 */

/* Container */
.vs-recorder-container {
    max-width: 600px;
    margin: 0 auto;
    padding: 30px;
    background: #ffffff;
    border-radius: 12px;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.08);
}

/* Form Groups */
.vs-form-group {
    margin-bottom: 20px;
}

.vs-form-group label {
    display: block;
    font-weight: 600;
    margin-bottom: 8px;
    color: #333;
}

.vs-form-group .required {
    color: #e74c3c;
}

.vs-form-group .optional {
    color: #888;
    font-weight: normal;
    font-size: 0.9em;
}

.vs-form-group input[type="text"] {
    width: 100%;
    padding: 12px 15px;
    border: 2px solid #e0e0e0;
    border-radius: 8px;
    font-size: 16px;
    transition: border-color 0.2s, box-shadow 0.2s;
}

.vs-form-group input[type="text"]:focus {
    outline: none;
    border-color: #4a90d9;
    box-shadow: 0 0 0 3px rgba(74, 144, 217, 0.1);
}

/* Prompt Selector */
.vs-prompt-selector {
    margin-bottom: 25px;
}

.vs-prompt-selector label {
    display: block;
    font-weight: 600;
    margin-bottom: 8px;
    color: #333;
}

.vs-prompt-selector select {
    width: 100%;
    padding: 12px 15px;
    border: 2px solid #e0e0e0;
    border-radius: 8px;
    font-size: 16px;
    background: #fff;
    cursor: pointer;
}

.vs-prompt-selector select:focus {
    outline: none;
    border-color: #4a90d9;
}

.vs-random-prompt {
    margin-top: 12px;
}

.vs-prompt-suggestion {
    margin-top: 10px;
    padding: 15px;
    background: #f8f9fa;
    border-left: 4px solid #4a90d9;
    border-radius: 0 8px 8px 0;
    font-style: italic;
    color: #555;
}

/* Recording Controls */
.vs-recorder-controls {
    text-align: center;
    padding: 20px 0;
}

/* Visualizer */
.vs-visualizer-container {
    position: relative;
    margin-bottom: 20px;
}

#vs-visualizer {
    width: 100%;
    height: 100px;
    background: #f5f5f5;
    border-radius: 8px;
}

.vs-time-display {
    position: absolute;
    bottom: 10px;
    right: 10px;
    background: rgba(0, 0, 0, 0.6);
    color: #fff;
    padding: 4px 10px;
    border-radius: 4px;
    font-family: monospace;
    font-size: 18px;
}

/* Status */
.vs-status {
    margin-bottom: 20px;
    padding: 10px 20px;
    border-radius: 20px;
    display: inline-block;
    font-weight: 500;
}

.vs-status-recording {
    background: #fee2e2;
    color: #dc2626;
    animation: pulse 1.5s infinite;
}

.vs-status-recording::before {
    content: '';
    display: inline-block;
    width: 10px;
    height: 10px;
    background: #dc2626;
    border-radius: 50%;
    margin-right: 8px;
    animation: blink 1s infinite;
}

.vs-status-paused {
    background: #fef3c7;
    color: #d97706;
}

@keyframes pulse {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.8; }
}

@keyframes blink {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.3; }
}

/* Buttons */
.vs-buttons {
    display: flex;
    justify-content: center;
    gap: 12px;
    flex-wrap: wrap;
}

.vs-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 14px 28px;
    border: none;
    border-radius: 8px;
    font-size: 16px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s;
    gap: 8px;
}

.vs-btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

.vs-btn-record {
    background: linear-gradient(135deg, #dc2626 0%, #b91c1c 100%);
    color: #fff;
    min-width: 180px;
}

.vs-btn-record:hover:not(:disabled) {
    background: linear-gradient(135deg, #ef4444 0%, #dc2626 100%);
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(220, 38, 38, 0.4);
}

.vs-btn-stop {
    background: #374151;
    color: #fff;
}

.vs-btn-stop:hover:not(:disabled) {
    background: #1f2937;
}

.vs-btn-secondary {
    background: #f3f4f6;
    color: #374151;
    border: 2px solid #e5e7eb;
}

.vs-btn-secondary:hover:not(:disabled) {
    background: #e5e7eb;
}

.vs-btn-primary {
    background: linear-gradient(135deg, #4a90d9 0%, #3b7dc4 100%);
    color: #fff;
}

.vs-btn-primary:hover:not(:disabled) {
    background: linear-gradient(135deg, #5a9fe8 0%, #4a90d9 100%);
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(74, 144, 217, 0.4);
}

/* Icons */
.vs-icon {
    width: 20px;
    height: 20px;
    display: inline-block;
}

.vs-icon-mic::before {
    content: '🎤';
}

.vs-icon-stop::before {
    content: '⏹';
}

.vs-icon-pause::before {
    content: '⏸';
}

.vs-icon-play::before {
    content: '▶';
}

/* Preview Section */
.vs-preview {
    margin-top: 30px;
    padding: 25px;
    background: #f8f9fa;
    border-radius: 12px;
}

.vs-preview h3 {
    margin: 0 0 20px 0;
    color: #333;
}

.vs-preview audio {
    width: 100%;
    margin-bottom: 20px;
}

/* Trim Controls */
.vs-trim-controls {
    margin-bottom: 25px;
    padding: 20px;
    background: #fff;
    border-radius: 8px;
    border: 1px solid #e5e7eb;
}

.vs-trim-controls h4 {
    margin: 0 0 15px 0;
    font-size: 14px;
    color: #666;
}

.vs-trim-slider-container {
    position: relative;
    height: 40px;
    margin-bottom: 10px;
}

.vs-trim-waveform {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 30px;
    background: #e5e7eb;
    border-radius: 4px;
}

.vs-trim-slider {
    position: absolute;
    width: 100%;
    top: 10px;
    -webkit-appearance: none;
    background: transparent;
    pointer-events: none;
}

.vs-trim-slider::-webkit-slider-thumb {
    -webkit-appearance: none;
    width: 16px;
    height: 40px;
    background: #4a90d9;
    border-radius: 4px;
    cursor: ew-resize;
    pointer-events: auto;
}

.vs-trim-slider::-moz-range-thumb {
    width: 16px;
    height: 40px;
    background: #4a90d9;
    border-radius: 4px;
    cursor: ew-resize;
    pointer-events: auto;
    border: none;
}

.vs-trim-times {
    display: flex;
    justify-content: space-between;
    font-family: monospace;
    color: #666;
}

.vs-preview-buttons {
    display: flex;
    gap: 12px;
    justify-content: center;
}

/* Upload Progress */
.vs-upload-progress {
    text-align: center;
    padding: 40px 20px;
}

.vs-progress-bar {
    height: 8px;
    background: #e5e7eb;
    border-radius: 4px;
    overflow: hidden;
    margin-bottom: 15px;
}

.vs-progress-fill {
    height: 100%;
    background: linear-gradient(90deg, #4a90d9 0%, #3b7dc4 100%);
    width: 0%;
    transition: width 0.3s;
    animation: progress-animation 2s infinite;
}

@keyframes progress-animation {
    0% { width: 0%; }
    50% { width: 70%; }
    100% { width: 100%; }
}

#vs-upload-status {
    color: #666;
    margin: 0;
}

/* Success Message */
.vs-success-message {
    text-align: center;
    padding: 40px 20px;
}

.vs-success-icon {
    width: 80px;
    height: 80px;
    background: #10b981;
    color: #fff;
    font-size: 40px;
    line-height: 80px;
    border-radius: 50%;
    margin: 0 auto 20px;
}

.vs-success-message h3 {
    margin: 0 0 10px 0;
    color: #10b981;
}

.vs-success-message p {
    color: #666;
    margin-bottom: 20px;
}

/* Error Message */
.vs-error-message {
    text-align: center;
    padding: 40px 20px;
    background: #fee2e2;
    border-radius: 12px;
}

.vs-error-message p {
    color: #dc2626;
    margin-bottom: 20px;
}

/* Responsive */
@media (max-width: 600px) {
    .vs-recorder-container {
        padding: 20px;
        margin: 10px;
        border-radius: 8px;
    }

    .vs-buttons {
        flex-direction: column;
    }

    .vs-btn {
        width: 100%;
    }

    .vs-preview-buttons {
        flex-direction: column;
    }
}
