/**
 * N8N Chat Voice Recorder Styles
 * Enhanced manual recording UI
 *
 * @package    N8N_Chat_Interface_Pro
 * @since      1.0.2
 */

/* Recording UI Container */
.n8n-recording-ui {
    background: linear-gradient(135deg, #F9FAFB 0%, #F3F4F6 100%);
    border: 2px solid #0084FF;
    border-radius: 12px;
    padding: 20px;
    margin-bottom: 16px;
    animation: n8n-slideDown 0.3s ease;
    box-shadow: 0 4px 6px rgba(0, 132, 255, 0.1);
}

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

/* Recording Header */
.n8n-recording-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 16px;
}

.n8n-recording-indicator {
    display: flex;
    align-items: center;
    gap: 10px;
}

.n8n-recording-dot {
    width: 14px;
    height: 14px;
    background: #EF4444;
    border-radius: 50%;
    animation: n8n-pulse 1.5s infinite;
    box-shadow: 0 0 0 0 rgba(239, 68, 68, 0.7);
}

@keyframes n8n-pulse {
    0%, 100% {
        opacity: 1;
        transform: scale(1);
    }
    50% {
        opacity: 0.6;
        transform: scale(1.2);
        box-shadow: 0 0 0 6px rgba(239, 68, 68, 0);
    }
}

.n8n-recording-label {
    font-weight: 600;
    color: #EF4444;
    font-size: 15px;
    letter-spacing: 0.5px;
}

.n8n-recording-timer {
    display: flex;
    align-items: center;
    gap: 6px;
    font-family: 'Courier New', 'Courier', monospace;
}

.n8n-timer-display {
    font-size: 20px;
    font-weight: 700;
    color: #1F2937;
}

.n8n-timer-max {
    font-size: 13px;
    color: #6B7280;
}

/* Waveform Visualization */
.n8n-recording-waveform {
    margin: 16px 0;
    background: #FFFFFF;
    border-radius: 8px;
    padding: 12px;
    box-shadow: inset 0 2px 4px rgba(0, 0, 0, 0.05);
}

.n8n-waveform-canvas {
    width: 100%;
    height: 60px;
    display: block;
}

/* Progress Bar */
.n8n-recording-progress-bar {
    height: 6px;
    background: #E5E7EB;
    border-radius: 3px;
    overflow: hidden;
    margin: 16px 0;
}

.n8n-progress-fill {
    height: 100%;
    background: linear-gradient(90deg, #0084FF 0%, #00C6FF 100%);
    border-radius: 3px;
    transition: width 0.1s linear;
}

/* Recording Actions */
.n8n-recording-actions {
    display: flex;
    gap: 12px;
    justify-content: center;
    margin-top: 16px;
}

.n8n-btn-cancel-recording,
.n8n-btn-stop-recording {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 12px 24px;
    border: none;
    border-radius: 8px;
    font-size: 15px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s ease;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

.n8n-btn-cancel-recording {
    background: #F3F4F6;
    color: #6B7280;
}

.n8n-btn-cancel-recording:hover {
    background: #E5E7EB;
    color: #4B5563;
    transform: translateY(-1px);
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.15);
}

.n8n-btn-stop-recording {
    background: linear-gradient(135deg, #10B981 0%, #059669 100%);
    color: #FFFFFF;
}

.n8n-btn-stop-recording:hover {
    background: linear-gradient(135deg, #059669 0%, #047857 100%);
    transform: translateY(-1px);
    box-shadow: 0 4px 6px rgba(16, 185, 129, 0.3);
}

.n8n-btn-cancel-recording .n8n-icon,
.n8n-btn-stop-recording .n8n-icon {
    font-size: 18px;
    line-height: 1;
}

/* Processing UI */
.n8n-processing-ui {
    text-align: center;
    padding: 20px;
}

.n8n-processing-spinner {
    width: 48px;
    height: 48px;
    border: 4px solid #E5E7EB;
    border-top-color: #0084FF;
    border-radius: 50%;
    animation: n8n-spin 1s linear infinite;
    margin: 0 auto 16px;
}

@keyframes n8n-spin {
    to {
        transform: rotate(360deg);
    }
}

.n8n-processing-text {
    font-size: 15px;
    color: #6B7280;
    font-weight: 500;
    margin-bottom: 16px;
}

.n8n-processing-progress {
    max-width: 300px;
    margin: 0 auto;
}

.n8n-processing-progress .n8n-progress-bar {
    height: 6px;
    background: #E5E7EB;
    border-radius: 3px;
    overflow: hidden;
}

.n8n-processing-progress .n8n-progress-fill.n8n-animated {
    width: 100%;
    background: linear-gradient(90deg, #0084FF 0%, #00C6FF 50%, #0084FF 100%);
    background-size: 200% 100%;
    animation: n8n-progress-wave 1.5s ease-in-out infinite;
}

@keyframes n8n-progress-wave {
    0% {
        background-position: 100% 0;
    }
    100% {
        background-position: -100% 0;
    }
}

/* Error Notification */
.n8n-voice-error-notification {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 16px;
    background: #FEE2E2;
    border: 1px solid #FECACA;
    border-radius: 8px;
    margin-bottom: 16px;
    animation: n8n-slideDown 0.3s ease;
    box-shadow: 0 2px 4px rgba(239, 68, 68, 0.1);
}

.n8n-error-icon {
    font-size: 24px;
    line-height: 1;
}

.n8n-error-message {
    flex: 1;
    color: #991B1B;
    font-size: 14px;
    font-weight: 500;
}

/* Session Restore Loader */
.n8n-session-restore-loader {
    text-align: center;
    padding: 32px 16px;
    animation: n8n-fadeIn 0.3s ease;
}

@keyframes n8n-fadeIn {
    from {
        opacity: 0;
    }
    to {
        opacity: 1;
    }
}

.n8n-loader-spinner {
    width: 40px;
    height: 40px;
    border: 3px solid #E5E7EB;
    border-top-color: #0084FF;
    border-radius: 50%;
    animation: n8n-spin 0.8s linear infinite;
    margin: 0 auto 12px;
}

.n8n-loader-text {
    font-size: 14px;
    color: #6B7280;
    font-weight: 500;
}

/* Responsive Design */
@media (max-width: 640px) {
    .n8n-recording-ui {
        padding: 16px;
    }

    .n8n-recording-header {
        flex-direction: column;
        gap: 12px;
        align-items: flex-start;
    }

    .n8n-recording-actions {
        flex-direction: column;
        width: 100%;
    }

    .n8n-btn-cancel-recording,
    .n8n-btn-stop-recording {
        width: 100%;
        justify-content: center;
    }

    .n8n-waveform-canvas {
        height: 40px;
    }
}

/* Dark Mode Support */
@media (prefers-color-scheme: dark) {
    .n8n-recording-ui {
        background: linear-gradient(135deg, #1F2937 0%, #111827 100%);
        border-color: #3B82F6;
    }

    .n8n-recording-waveform {
        background: #111827;
    }

    .n8n-timer-display {
        color: #F3F4F6;
    }

    .n8n-timer-max {
        color: #9CA3AF;
    }

    .n8n-recording-progress-bar {
        background: #374151;
    }

    .n8n-btn-cancel-recording {
        background: #374151;
        color: #D1D5DB;
    }

    .n8n-btn-cancel-recording:hover {
        background: #4B5563;
        color: #F3F4F6;
    }

    .n8n-processing-text {
        color: #D1D5DB;
    }

    .n8n-processing-spinner {
        border-color: #374151;
        border-top-color: #3B82F6;
    }

    .n8n-loader-text {
        color: #D1D5DB;
    }
}

/* Accessibility */
.n8n-btn-cancel-recording:focus,
.n8n-btn-stop-recording:focus {
    outline: 2px solid #0084FF;
    outline-offset: 2px;
}

.n8n-recording-ui button:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

/* Animations - Reduced motion */
@media (prefers-reduced-motion: reduce) {
    .n8n-recording-ui,
    .n8n-voice-error-notification,
    .n8n-session-restore-loader {
        animation: none;
    }

    .n8n-recording-dot {
        animation: none;
    }

    .n8n-processing-spinner,
    .n8n-loader-spinner {
        animation: none;
        border-top-color: transparent;
    }
}
