/* Component-Specific Styles */

/* Status Indicator */
.status-indicator {
    display: flex;
    align-items: center;
    gap: var(--spacing-sm);
}

.status-light {
    width: 12px;
    height: 12px;
    border-radius: 50%;
    background: var(--border-medium);
    transition: all var(--transition-fast);
    position: relative;
}

.status-light::after {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 6px;
    height: 6px;
    border-radius: 50%;
    background: white;
    opacity: 0;
    transition: opacity var(--transition-fast);
}

.status-light.idle {
    background: var(--border-medium);
}

.status-light.ready {
    background: var(--info-color);
    box-shadow: 0 0 10px rgba(6, 182, 212, 0.3);
}

.status-light.recording {
    background: var(--success-color);
    box-shadow: 0 0 10px rgba(16, 185, 129, 0.3);
    animation: recording-pulse 2s infinite;
}

.status-light.processing {
    background: var(--warning-color);
    box-shadow: 0 0 10px rgba(245, 158, 11, 0.3);
    animation: processing-spin 1s linear infinite;
}

.status-light.error {
    background: var(--error-color);
    box-shadow: 0 0 10px rgba(239, 68, 68, 0.3);
    animation: error-blink 1s infinite;
}

.status-light.ready::after,
.status-light.recording::after,
.status-light.processing::after {
    opacity: 0.8;
}

.status-text {
    font-size: 0.875rem;
    font-weight: 500;
    color: var(--text-secondary);
    transition: color var(--transition-fast);
}

.status-indicator.recording .status-text {
    color: var(--success-color);
    font-weight: 600;
}

.status-indicator.processing .status-text {
    color: var(--warning-color);
    font-weight: 600;
}

.status-indicator.error .status-text {
    color: var(--error-color);
    font-weight: 600;
}

/* Connection Status */
.connection-status {
    display: flex;
    align-items: center;
    gap: var(--spacing-xs);
}

.connection-text {
    font-size: 0.75rem;
    color: var(--text-muted);
    transition: color var(--transition-fast);
}

.connection-status.connected .connection-text {
    color: var(--success-color);
}

.connection-status.disconnected .connection-text {
    color: var(--error-color);
}

.connection-status::before {
    content: '';
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: var(--border-medium);
    transition: background var(--transition-fast);
}

.connection-status.connected::before {
    background: var(--success-color);
}

.connection-status.disconnected::before {
    background: var(--error-color);
}

/* Toast Notifications */
.toast {
    background: white;
    border-radius: var(--radius-md);
    padding: var(--spacing-md) var(--spacing-lg);
    box-shadow: var(--shadow-lg);
    border: 1px solid var(--border-light);
    display: flex;
    align-items: center;
    gap: var(--spacing-sm);
    min-width: 300px;
    max-width: 400px;
    animation: slideIn var(--transition-normal);
    position: relative;
}

.toast.success {
    border-left: 4px solid var(--success-color);
}

.toast.warning {
    border-left: 4px solid var(--warning-color);
}

.toast.error {
    border-left: 4px solid var(--error-color);
}

.toast.info {
    border-left: 4px solid var(--info-color);
}

.toast-icon {
    font-size: 1.25rem;
    flex-shrink: 0;
}

.toast.success .toast-icon {
    color: var(--success-color);
}

.toast.warning .toast-icon {
    color: var(--warning-color);
}

.toast.error .toast-icon {
    color: var(--error-color);
}

.toast.info .toast-icon {
    color: var(--info-color);
}

.toast-content {
    flex: 1;
}

.toast-title {
    font-weight: 600;
    font-size: 0.875rem;
    margin-bottom: var(--spacing-xs);
    color: var(--text-primary);
}

.toast-message {
    font-size: 0.75rem;
    color: var(--text-secondary);
    line-height: 1.4;
}

.toast-close {
    background: none;
    border: none;
    padding: var(--spacing-xs);
    cursor: pointer;
    color: var(--text-muted);
    transition: color var(--transition-fast);
    border-radius: var(--radius-sm);
}

.toast-close:hover {
    color: var(--text-secondary);
    background: var(--bg-secondary);
}

/* Progress Indicators */
.progress-bar {
    width: 100%;
    height: 4px;
    background: var(--bg-tertiary);
    border-radius: 2px;
    overflow: hidden;
    margin: var(--spacing-sm) 0;
}

.progress-fill {
    height: 100%;
    background: linear-gradient(90deg, var(--primary-color), var(--info-color));
    border-radius: 2px;
    transition: width var(--transition-normal);
    transform-origin: left;
}

.progress-fill.indeterminate {
    animation: progress-indeterminate 1.5s infinite linear;
}

/* Loading Spinner */
.spinner {
    width: 20px;
    height: 20px;
    border: 2px solid var(--border-light);
    border-top: 2px solid var(--primary-color);
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

.spinner.small {
    width: 16px;
    height: 16px;
    border-width: 1.5px;
}

.spinner.large {
    width: 32px;
    height: 32px;
    border-width: 3px;
}

/* Modal Overlay (for future use) */
.modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.5);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 1000;
    animation: fadeIn var(--transition-normal);
}

.modal {
    background: white;
    border-radius: var(--radius-lg);
    padding: var(--spacing-xl);
    box-shadow: var(--shadow-lg);
    max-width: 500px;
    width: 90%;
    animation: modalSlideIn var(--transition-normal);
}

.modal-header {
    margin-bottom: var(--spacing-lg);
    padding-bottom: var(--spacing-md);
    border-bottom: 1px solid var(--border-light);
}

.modal-title {
    font-weight: 600;
    font-size: 1.25rem;
    color: var(--text-primary);
}

.modal-actions {
    display: flex;
    justify-content: flex-end;
    gap: var(--spacing-md);
    margin-top: var(--spacing-lg);
    padding-top: var(--spacing-md);
    border-top: 1px solid var(--border-light);
}

/* Tooltip */
.tooltip {
    position: relative;
    display: inline-block;
}

.tooltip-content {
    position: absolute;
    bottom: 125%;
    left: 50%;
    transform: translateX(-50%);
    background: rgba(0, 0, 0, 0.9);
    color: white;
    padding: var(--spacing-sm) var(--spacing-md);
    border-radius: var(--radius-sm);
    font-size: 0.75rem;
    white-space: nowrap;
    opacity: 0;
    visibility: hidden;
    transition: all var(--transition-fast);
    z-index: 1000;
}

.tooltip-content::after {
    content: '';
    position: absolute;
    top: 100%;
    left: 50%;
    transform: translateX(-50%);
    border: 5px solid transparent;
    border-top-color: rgba(0, 0, 0, 0.9);
}

.tooltip:hover .tooltip-content {
    opacity: 1;
    visibility: visible;
}

/* Badge/Chip */
.badge {
    display: inline-flex;
    align-items: center;
    padding: var(--spacing-xs) var(--spacing-sm);
    border-radius: var(--radius-md);
    font-size: 0.75rem;
    font-weight: 500;
    background: var(--bg-tertiary);
    color: var(--text-secondary);
}

.badge.success {
    background: rgba(16, 185, 129, 0.1);
    color: var(--success-color);
}

.badge.warning {
    background: rgba(245, 158, 11, 0.1);
    color: var(--warning-color);
}

.badge.error {
    background: rgba(239, 68, 68, 0.1);
    color: var(--error-color);
}

.badge.info {
    background: rgba(6, 182, 212, 0.1);
    color: var(--info-color);
}

/* Animations */
@keyframes recording-pulse {
    0%, 100% { 
        transform: scale(1); 
        opacity: 1; 
    }
    50% { 
        transform: scale(1.1); 
        opacity: 0.8; 
    }
}

@keyframes processing-spin {
    from { transform: rotate(0deg); }
    to { transform: rotate(360deg); }
}

@keyframes error-blink {
    0%, 50%, 100% { opacity: 1; }
    25%, 75% { opacity: 0.5; }
}

@keyframes spin {
    from { transform: rotate(0deg); }
    to { transform: rotate(360deg); }
}

@keyframes progress-indeterminate {
    0% { transform: translateX(-100%); }
    100% { transform: translateX(400%); }
}

@keyframes modalSlideIn {
    from { 
        transform: scale(0.9) translateY(20px); 
        opacity: 0; 
    }
    to { 
        transform: scale(1) translateY(0); 
        opacity: 1; 
    }
}

/* Responsive Adjustments */
@media (max-width: 768px) {
    .toast {
        min-width: 280px;
        max-width: calc(100vw - 2rem);
    }
    
    .modal {
        margin: var(--spacing-md);
        width: calc(100% - 2rem);
    }
    
    .modal-actions {
        flex-direction: column-reverse;
    }
    
    .modal-actions button {
        width: 100%;
    }
}

/* Accessibility Enhancements */
@media (prefers-reduced-motion: reduce) {
    .toast,
    .modal,
    .progress-fill,
    .status-light,
    .spinner {
        animation: none;
        transition: none;
    }
    
    .status-light.recording,
    .status-light.processing,
    .status-light.error {
        animation: none;
    }
}

/* Focus Styles */
.primary-button:focus,
.secondary-button:focus,
.settings-button:focus {
    outline: 2px solid var(--primary-color);
    outline-offset: 2px;
}

input[type="range"]:focus {
    outline: 2px solid var(--primary-color);
    outline-offset: 2px;
}

input[type="checkbox"]:focus {
    outline: 2px solid var(--primary-color);
    outline-offset: 2px;
}