/* Voice Recording Styles - Using Survey Layout */
.survey-container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 20px;
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    background: linear-gradient(135deg, #f5f7fa 0%, #c3cfe2 100%);
    min-height: 100vh;
}

.survey-header {
    text-align: center;
    margin-bottom: 40px;
    padding: 30px;
    background: rgba(255, 255, 255, 0.95);
    border-radius: 15px;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.1);
    backdrop-filter: blur(10px);
}

.survey-header h1 {
    color: #2c3e50;
    margin-bottom: 15px;
    font-size: 2.8em;
    font-weight: 700;
    text-shadow: 2px 2px 4px rgba(0, 0, 0, 0.1);
}

.survey-subtitle {
    color: #7f8c8d;
    font-size: 1.2em;
    line-height: 1.6;
    margin: 0;
}

.survey-section {
    background: rgba(255, 255, 255, 0.95);
    border-radius: 15px;
    padding: 30px;
    margin-bottom: 25px;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.1);
    backdrop-filter: blur(10px);
    border: 1px solid rgba(255, 255, 255, 0.2);
}

.survey-section h3 {
    color: #2c3e50;
    margin-bottom: 20px;
    font-size: 1.5em;
    font-weight: 600;
    text-align: center;
    border-bottom: 2px solid #3498db;
    padding-bottom: 10px;
}

/* Prompt Section - Updated for survey layout */
.prompt-section h3 {
    color: #2c3e50;
    margin-bottom: 20px;
    font-size: 1.5em;
    font-weight: 600;
    text-align: center;
    border-bottom: 2px solid #3498db;
    padding-bottom: 10px;
}

.prompt-display {
    background: white;
    border: 2px solid #e0e0e0;
    border-radius: 12px;
    padding: 25px;
    margin-bottom: 25px;
    position: relative;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.1);
    transition: all 0.3s ease;
}

.prompt-display:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(0, 0, 0, 0.15);
}

.prompt-text {
    font-size: 1.2em;
    line-height: 1.8;
    color: #2c3e50;
    margin-bottom: 20px;
    text-align: justify;
    font-weight: 400;
}

.prompt-metadata {
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
}

.language-badge, .difficulty-badge, .category-badge {
    padding: 4px 12px;
    border-radius: 20px;
    font-size: 0.8em;
    font-weight: 600;
    text-transform: uppercase;
}

.language-badge {
    background: #3498db;
    color: white;
}

.difficulty-badge {
    background: #e74c3c;
    color: white;
}

.category-badge {
    background: #27ae60;
    color: white;
}

.prompt-controls {
    display: flex;
    gap: 20px;
    justify-content: center;
    margin-top: 20px;
}

.new-prompt-btn, .custom-prompt-btn {
    padding: 15px 30px;
    border: none;
    border-radius: 8px;
    font-size: 16px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.1);
}

.new-prompt-btn:hover, .custom-prompt-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(0, 0, 0, 0.15);
}

.new-prompt-btn {
    background: #3498db;
    color: white;
}

.new-prompt-btn:hover {
    background: #2980b9;
}

.custom-prompt-btn {
    background: #95a5a6;
    color: white;
}

.custom-prompt-btn:hover {
    background: #7f8c8d;
}

.custom-prompt-input {
    margin-top: 20px;
    padding: 20px;
    background: white;
    border: 2px solid #e0e0e0;
    border-radius: 8px;
}

.custom-prompt-input label {
    display: block;
    margin-bottom: 8px;
    font-weight: 600;
    color: #2c3e50;
}

.custom-prompt-input textarea {
    width: 100%;
    padding: 12px;
    border: 2px solid #e0e0e0;
    border-radius: 6px;
    font-size: 14px;
    resize: vertical;
    font-family: inherit;
}

.custom-prompt-input textarea:focus {
    outline: none;
    border-color: #3498db;
    box-shadow: 0 0 0 3px rgba(52, 152, 219, 0.1);
}

.custom-prompt-buttons {
    display: flex;
    gap: 10px;
    margin-top: 15px;
}

.use-custom-btn, .cancel-custom-btn {
    padding: 8px 16px;
    border: none;
    border-radius: 4px;
    font-size: 13px;
    cursor: pointer;
    transition: all 0.3s ease;
}

.use-custom-btn {
    background: #27ae60;
    color: white;
}

.use-custom-btn:hover {
    background: #229954;
}

.cancel-custom-btn {
    background: #e74c3c;
    color: white;
}

.cancel-custom-btn:hover {
    background: #c0392b;
}

/* Recording Section - Updated for survey layout */
.recording-section h3 {
    color: #2c3e50;
    margin-bottom: 20px;
    font-size: 1.5em;
    font-weight: 600;
    text-align: center;
    border-bottom: 2px solid #3498db;
    padding-bottom: 10px;
}

.recording-controls {
    display: flex;
    flex-direction: column;
    gap: 20px;
    margin-bottom: 30px;
    padding: 20px;
    background: rgba(248, 249, 250, 0.8);
    border-radius: 12px;
    border: 1px solid rgba(0, 0, 0, 0.05);
}

.recording-controls-row {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 20px;
}

.format-selector, .duration-control, .device-selector, .gain-control {
    display: flex;
    flex-direction: column;
}

.format-selector label, .duration-control label, .device-selector label, .gain-control label {
    margin-bottom: 8px;
    font-weight: 600;
    color: #2c3e50;
}

.format-selector select, .duration-control select, .device-selector select {
    padding: 10px;
    border: 2px solid #e0e0e0;
    border-radius: 6px;
    font-size: 14px;
    background: white;
    cursor: pointer;
}

.gain-control input[type="range"] {
    padding: 10px 0;
    cursor: pointer;
}

.recording-buttons {
    display: flex;
    gap: 15px;
    justify-content: center;
    margin-bottom: 20px;
}

.record-btn, .stop-btn {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 18px 35px;
    border: none;
    border-radius: 12px;
    font-size: 18px;
    font-weight: 700;
    cursor: pointer;
    transition: all 0.3s ease;
    box-shadow: 0 6px 20px rgba(0, 0, 0, 0.15);
    text-transform: uppercase;
    letter-spacing: 1px;
}

.record-btn:hover, .stop-btn:hover {
    transform: translateY(-3px);
    box-shadow: 0 8px 25px rgba(0, 0, 0, 0.2);
}

.record-btn {
    background: #e74c3c;
    color: white;
}

.record-btn:hover {
    background: #c0392b;
    transform: translateY(-2px);
}

.stop-btn {
    background: #95a5a6;
    color: white;
}

.stop-btn:hover {
    background: #7f8c8d;
}

.recording-status {
    text-align: center;
    margin-bottom: 10px;
    font-weight: 600;
    color: #2c3e50;
}

.recording-timer {
    text-align: center;
    font-size: 1.2em;
    font-weight: 600;
    color: #e74c3c;
    margin-bottom: 15px;
}

.audio-level-container {
    text-align: center;
    margin-bottom: 20px;
}

.audio-level-label {
    margin-bottom: 10px;
    font-weight: 600;
    color: #2c3e50;
}

.audio-level-bar {
    width: 100%;
    height: 20px;
    background: #ecf0f1;
    border-radius: 10px;
    overflow: hidden;
    position: relative;
}

.audio-level-indicator {
    height: 100%;
    background: linear-gradient(90deg, #27ae60, #f39c12, #e74c3c);
    width: 0%;
    transition: width 0.1s ease;
}

/* Preview Section - Updated for survey layout */
.preview-section h3 {
    color: #2c3e50;
    margin-bottom: 20px;
    font-size: 1.5em;
    font-weight: 600;
    text-align: center;
    border-bottom: 2px solid #3498db;
    padding-bottom: 10px;
}

.preview-section audio {
    width: 100%;
    margin-bottom: 25px;
    border-radius: 8px;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.1);
}



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

.save-btn, .rerecord-btn {
    padding: 12px 20px;
    border: none;
    border-radius: 6px;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
}

.save-btn {
    background: #27ae60;
    color: white;
}

.save-btn:hover {
    background: #229954;
}

.rerecord-btn {
    background: #95a5a6;
    color: white;
}

.rerecord-btn:hover {
    background: #7f8c8d;
}

/* Loading Indicator */
.loading-indicator {
    text-align: center;
    padding: 40px;
    background: #f8f9fa;
    border-radius: 12px;
    margin-bottom: 20px;
}

.spinner {
    border: 4px solid #f3f3f3;
    border-top: 4px solid #3498db;
    border-radius: 50%;
    width: 40px;
    height: 40px;
    animation: spin 1s linear infinite;
    margin: 0 auto 20px;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

/* Results Section - Updated for survey layout */
.results-section h3 {
    color: #27ae60;
    text-align: center;
    margin-bottom: 20px;
    font-size: 1.5em;
    font-weight: 600;
    border-bottom: 2px solid #27ae60;
    padding-bottom: 10px;
}

.success-message {
    display: flex;
    align-items: center;
    gap: 15px;
    background: white;
    border: 2px solid #27ae60;
    border-radius: 8px;
    padding: 20px;
    margin-bottom: 20px;
}

.success-icon {
    font-size: 2em;
    color: #27ae60;
    font-weight: bold;
}

.success-message p {
    margin: 0;
    color: #2c3e50;
    font-size: 1.1em;
}

.recording-details {
    background: white;
    border-radius: 8px;
    padding: 20px;
    margin-bottom: 20px;
}

.recording-details h4 {
    color: #2c3e50;
    margin-bottom: 15px;
}

.details-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 15px;
}

.detail-item {
    display: flex;
    flex-direction: column;
    gap: 5px;
}

.detail-label {
    font-weight: 600;
    color: #7f8c8d;
    font-size: 0.9em;
}

.detail-value {
    color: #2c3e50;
    font-size: 1em;
}

.action-buttons {
    display: flex;
    gap: 15px;
    justify-content: center;
}

.record-another-btn, .go-to-cloning-btn {
    padding: 12px 20px;
    border: none;
    border-radius: 6px;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
}

.record-another-btn {
    background: #3498db;
    color: white;
}

.record-another-btn:hover {
    background: #2980b9;
}

.go-to-cloning-btn {
    background: #9b59b6;
    color: white;
}

.go-to-cloning-btn:hover {
    background: #8e44ad;
}

/* Recordings Section - Updated for survey layout */
.recordings-section h3 {
    color: #2c3e50;
    margin-bottom: 20px;
    font-size: 1.5em;
    font-weight: 600;
    text-align: center;
    border-bottom: 2px solid #3498db;
    padding-bottom: 10px;
}

.recordings-controls {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
    flex-wrap: wrap;
    gap: 15px;
}

.refresh-btn {
    padding: 8px 16px;
    border: none;
    border-radius: 6px;
    background: #3498db;
    color: white;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
}

.refresh-btn:hover {
    background: #2980b9;
}

.test-audio-btn {
    padding: 8px 16px;
    border: none;
    border-radius: 6px;
    background: #27ae60;
    color: white;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
}

.test-audio-btn:hover {
    background: #229954;
}

.recordings-count {
    color: #7f8c8d;
    font-weight: 600;
    font-size: 14px;
}

.recordings-list {
    min-height: 100px;
}

.loading-recordings {
    text-align: center;
    padding: 40px;
    color: #7f8c8d;
}

.loading-recordings .spinner {
    margin-bottom: 15px;
}

.no-recordings {
    text-align: center;
    padding: 40px;
    color: #7f8c8d;
}

.no-recordings-icon {
    font-size: 3em;
    margin-bottom: 15px;
}

.recordings-container {
    display: flex;
    flex-direction: column;
    gap: 15px;
}

.recording-item {
    background: white;
    border: 2px solid #e0e0e0;
    border-radius: 8px;
    padding: 20px;
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    gap: 20px;
    transition: all 0.3s ease;
}

.recording-item:hover {
    border-color: #3498db;
    box-shadow: 0 2px 8px rgba(52, 152, 219, 0.1);
}

.recording-info {
    flex: 1;
    min-width: 0;
}

.recording-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 10px;
    flex-wrap: wrap;
    gap: 10px;
}

.recording-id {
    font-weight: 600;
    color: #2c3e50;
    font-size: 1.1em;
}

.recording-date {
    color: #7f8c8d;
    font-size: 0.9em;
}

.recording-details {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.recording-transcript {
    color: #2c3e50;
    line-height: 1.4;
}

.recording-meta {
    display: flex;
    gap: 15px;
    flex-wrap: wrap;
}

.recording-format, .recording-duration {
    padding: 4px 8px;
    border-radius: 4px;
    font-size: 0.8em;
    font-weight: 600;
    text-transform: uppercase;
}

.recording-format {
    background: #e8f4fd;
    color: #2980b9;
}

.recording-duration {
    background: #e8f5e8;
    color: #27ae60;
}

.recording-audio {
    margin-top: 12px;
    padding: 10px;
    background: #f8f9fa;
    border-radius: 6px;
    border: 1px solid #e0e0e0;
}

.recording-audio-player {
    width: 100% !important;
    height: 40px !important;
    outline: none;
    display: block !important;
    visibility: visible !important;
    opacity: 1 !important;
    background: white;
    border: 1px solid #ddd;
    border-radius: 4px;
}

.recording-audio-player::-webkit-media-controls-panel {
    background-color: #ffffff;
}

.recording-audio-player::-webkit-media-controls-play-button,
.recording-audio-player::-webkit-media-controls-pause-button {
    background-color: #3498db;
    border-radius: 50%;
}

.recording-audio-player::-webkit-media-controls-timeline {
    background-color: #ecf0f1;
    border-radius: 2px;
}

.recording-audio-player::-webkit-media-controls-current-time-display,
.recording-audio-player::-webkit-media-controls-time-remaining-display {
    color: #2c3e50;
    font-size: 12px;
}

.audio-error {
    display: flex;
    align-items: center;
    gap: 8px;
    color: #e74c3c;
    font-size: 14px;
    padding: 8px;
    background: #fdf2f2;
    border: 1px solid #f5c6cb;
    border-radius: 4px;
}

.audio-error .error-icon {
    font-size: 16px;
}

.audio-error .error-text {
    font-weight: 500;
}

.retry-audio-btn {
    margin-left: 10px;
    padding: 4px 8px;
    border: none;
    border-radius: 4px;
    background: #3498db;
    color: white;
    font-size: 12px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
}

.retry-audio-btn:hover {
    background: #2980b9;
}

/* Fallback Audio Player */
.fallback-audio-player {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 8px;
    background: white;
    border: 1px solid #ddd;
    border-radius: 4px;
}

.play-pause-btn {
    width: 32px;
    height: 32px;
    border: none;
    border-radius: 50%;
    background: #3498db;
    color: white;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 14px;
    transition: all 0.3s ease;
}

.play-pause-btn:hover {
    background: #2980b9;
    transform: scale(1.05);
}

.audio-progress {
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.progress-bar {
    width: 100%;
    height: 4px;
    background: #ecf0f1;
    border-radius: 2px;
    overflow: hidden;
    cursor: pointer;
}

.progress-fill {
    height: 100%;
    background: #3498db;
    transition: width 0.1s ease;
}

.time-display {
    font-size: 12px;
    color: #7f8c8d;
    font-weight: 500;
}

.hidden-audio {
    display: none;
}

.recording-actions {
    flex-shrink: 0;
}

.delete-recording-btn {
    padding: 8px 16px;
    border: none;
    border-radius: 6px;
    background: #e74c3c;
    color: white;
    font-size: 13px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
}

.delete-recording-btn:hover {
    background: #c0392b;
    transform: translateY(-1px);
}

.recordings-error {
    text-align: center;
    padding: 40px;
    color: #e74c3c;
}

.error-icon {
    font-size: 2em;
    margin-bottom: 15px;
}

.retry-btn {
    padding: 8px 16px;
    border: none;
    border-radius: 6px;
    background: #3498db;
    color: white;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    margin-top: 15px;
}

.retry-btn:hover {
    background: #2980b9;
}

.delete-success-message {
    background: #d4edda;
    border: 2px solid #27ae60;
    border-radius: 8px;
    padding: 15px;
    margin-bottom: 15px;
    display: flex;
    align-items: center;
    gap: 10px;
    color: #155724;
    animation: slideIn 0.3s ease;
}

.delete-success-message .success-icon {
    font-size: 1.2em;
    color: #27ae60;
}

@keyframes slideIn {
    from {
        opacity: 0;
        transform: translateY(-10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Info Section - Updated for survey layout */
.info-section h3 {
    color: #2c3e50;
    margin-bottom: 20px;
    font-size: 1.5em;
    font-weight: 600;
    text-align: center;
    border-bottom: 2px solid #3498db;
    padding-bottom: 10px;
}

.info-content {
    display: grid;
    gap: 20px;
    margin-bottom: 30px;
}

.info-item {
    display: flex;
    gap: 15px;
    align-items: center;
    background: white;
    border-radius: 8px;
    padding: 20px;
    text-align: center;
    justify-content: center;
}

.info-icon {
    font-size: 2em;
    flex-shrink: 0;
}

.info-text h4 {
    color: #2c3e50;
    margin-bottom: 8px;
    margin-top: 0;
    text-align: center;
}

.info-text p {
    color: #7f8c8d;
    margin: 0;
    line-height: 1.5;
    text-align: center;
}

.tips {
    background: white;
    border-radius: 8px;
    padding: 20px;
}

.tips h4 {
    color: #2c3e50;
    margin-bottom: 15px;
    text-align: center;
}

.tips ul {
    color: #7f8c8d;
    line-height: 1.6;
    padding-left: 0;
    list-style: none;
    text-align: center;
}

.tips li {
    margin-bottom: 8px;
    position: relative;
    padding-left: 20px;
}

.tips li::before {
    content: "•";
    color: #3498db;
    font-weight: bold;
    position: absolute;
    left: 0;
}

/* Responsive Design */
@media (max-width: 768px) {
    .survey-container {
        padding: 15px;
        max-width: 100%;
    }
    
    .survey-header {
        padding: 20px;
        margin-bottom: 25px;
    }
    
    .survey-header h1 {
        font-size: 2.2em;
    }
    
    .survey-section {
        padding: 20px;
        margin-bottom: 20px;
    }
    
    .recording-controls {
        gap: 15px;
        padding: 15px;
    }
    
    .recording-controls-row {
        grid-template-columns: 1fr;
        gap: 15px;
    }
    
    .details-grid {
        grid-template-columns: 1fr;
    }
    
    .prompt-controls {
        flex-direction: column;
        align-items: center;
        gap: 15px;
    }
    
    .new-prompt-btn, .custom-prompt-btn {
        width: 100%;
        max-width: 300px;
    }
    
    .preview-buttons, .action-buttons {
        flex-direction: column;
        align-items: center;
        gap: 15px;
    }
    
    .save-btn, .rerecord-btn, .record-another-btn, .go-to-cloning-btn {
        width: 100%;
        max-width: 300px;
    }
    
    .info-item {
        flex-direction: column;
        text-align: center;
    }
    
    .recordings-controls {
        flex-direction: column;
        align-items: stretch;
        text-align: center;
    }
    
    .recording-item {
        flex-direction: column;
        gap: 15px;
    }
    
    .recording-header {
        flex-direction: column;
        align-items: flex-start;
        gap: 5px;
    }
    
    .recording-actions {
        align-self: stretch;
    }
    
    .delete-recording-btn {
        width: 100%;
    }
    
    .recording-audio {
        margin-top: 10px;
    }
    
    .recording-audio-player {
        height: 35px;
    }
}

/* Upload Section Styles */
.upload-section {
    background: #f8f9fa;
    border-radius: 10px;
    padding: 20px;
    margin: 20px 0;
    border: 1px solid #e9ecef;
}

.upload-section h4 {
    color: #2c3e50;
    margin: 0 0 10px 0;
    font-size: 1.2em;
}

.upload-description {
    color: #6c757d;
    margin-bottom: 20px;
    font-size: 0.9em;
    line-height: 1.4;
}

.upload-container {
    position: relative;
}

.upload-area {
    border: 2px dashed #dee2e6;
    border-radius: 8px;
    padding: 40px 20px;
    text-align: center;
    background: white;
    cursor: pointer;
    transition: all 0.3s ease;
    position: relative;
}

.upload-area:hover {
    border-color: #3498db;
    background: #f8f9fa;
}

.upload-area.drag-over {
    border-color: #3498db;
    background: #e3f2fd;
    transform: scale(1.02);
}

.upload-icon {
    font-size: 3em;
    margin-bottom: 15px;
    opacity: 0.6;
}

.upload-text {
    color: #6c757d;
    margin-bottom: 15px;
    font-size: 1em;
}

.browse-btn {
    background: #3498db;
    color: white;
    border: none;
    padding: 10px 20px;
    border-radius: 6px;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    transition: background 0.3s ease;
}

.browse-btn:hover {
    background: #2980b9;
}

.upload-progress {
    margin-top: 20px;
}

.progress-bar {
    width: 100%;
    height: 8px;
    background: #e9ecef;
    border-radius: 4px;
    overflow: hidden;
    margin-bottom: 10px;
}

.progress-fill {
    height: 100%;
    background: #3498db;
    width: 0%;
    transition: width 0.3s ease;
}

.progress-text {
    text-align: center;
    color: #6c757d;
    font-size: 0.9em;
}

.upload-results {
    margin-top: 20px;
}

.upload-success {
    background: #d4edda;
    border: 1px solid #c3e6cb;
    border-radius: 6px;
    padding: 15px;
    display: flex;
    align-items: center;
    gap: 10px;
}

.success-icon {
    font-size: 1.2em;
}

.success-message {
    color: #155724;
    font-weight: 500;
}

.upload-error {
    background: #f8d7da;
    border: 1px solid #f5c6cb;
    border-radius: 6px;
    padding: 15px;
    display: flex;
    align-items: center;
    gap: 10px;
}

.error-icon {
    font-size: 1.2em;
}

.error-message {
    color: #721c24;
    font-weight: 500;
}
