/* Real-Time Transcription Styles */

/* Кнопки в основной области */
.upload-buttons {
    display: flex;
    gap: 15px;
    justify-content: center;
    align-items: center;
    flex-wrap: wrap;
}

.upload-buttons .btn {
    margin: 0;
}

/* Кнопка Real-Time */
.btn-realtime {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    border: none;
    border-radius: 8px;
    padding: 12px 20px;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    display: inline-flex;
    align-items: center;
    gap: 8px;
    margin-left: 10px;
}

.btn-realtime:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(102, 126, 234, 0.4);
}

.btn-realtime.active {
    background: linear-gradient(135deg, #ff6b6b 0%, #ee5a24 100%);
    animation: pulse 2s infinite;
}

@keyframes pulse {
    0% {
        box-shadow: 0 0 0 0 rgba(255, 107, 107, 0.7);
    }
    70% {
        box-shadow: 0 0 0 10px rgba(255, 107, 107, 0);
    }
    100% {
        box-shadow: 0 0 0 0 rgba(255, 107, 107, 0);
    }
}

/* Панель Real-Time */
.realtime-panel {
    position: fixed;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 600px;
    max-width: 90vw;
    max-height: 80vh;
    background: white;
    border-radius: 16px;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
    z-index: 1000;
    overflow: hidden;
    display: flex;
    flex-direction: column;
}

.realtime-panel.hidden {
    display: none;
}

/* Заголовок панели */
.realtime-header {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    padding: 20px;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.realtime-header h3 {
    margin: 0;
    font-size: 18px;
    font-weight: 600;
    display: flex;
    align-items: center;
    gap: 10px;
}

.btn-close {
    background: rgba(255, 255, 255, 0.2);
    border: none;
    border-radius: 50%;
    width: 32px;
    height: 32px;
    color: white;
    cursor: pointer;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    justify-content: center;
}

.btn-close:hover {
    background: rgba(255, 255, 255, 0.3);
    transform: scale(1.1);
}

/* Статус и индикаторы */
.realtime-status {
    padding: 20px;
    background: #f8f9fa;
    border-bottom: 1px solid #e9ecef;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

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

.status-dot {
    width: 12px;
    height: 12px;
    border-radius: 50%;
    background: #6c757d;
    transition: all 0.3s ease;
}

.status-dot.status-connecting {
    background: #ffc107;
    animation: blink 1s infinite;
}

.status-dot.status-connected {
    background: #28a745;
}

.status-dot.status-recording {
    background: #dc3545;
    animation: pulse 1.5s infinite;
}

.status-dot.status-error {
    background: #dc3545;
}

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

/* Прогресс 10-секундного цикла */
.cycle-progress {
    display: flex;
    flex-direction: column;
    gap: 4px;
    min-width: 200px;
}

.cycle-info {
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-size: 12px;
    color: #6c757d;
}

.progress-bar {
    width: 100%;
    height: 6px;
    background: #e9ecef;
    border-radius: 3px;
    overflow: hidden;
}

.progress-fill {
    height: 100%;
    background: linear-gradient(90deg, #007bff, #28a745);
    transition: width 0.3s ease;
    border-radius: 3px;
}

/* Индикатор громкости */
.volume-indicator {
    display: flex;
    align-items: center;
    gap: 10px;
}

.volume-bar {
    width: 100px;
    height: 6px;
    background: #e9ecef;
    border-radius: 3px;
    overflow: hidden;
}

.volume-level {
    height: 100%;
    background: linear-gradient(90deg, #28a745 0%, #ffc107 50%, #dc3545 100%);
    width: 0%;
    transition: width 0.1s ease;
}

/* Кнопки управления */
.realtime-controls {
    padding: 20px;
    display: flex;
    gap: 12px;
    justify-content: center;
    border-bottom: 1px solid #e9ecef;
}

.realtime-controls .btn {
    padding: 12px 20px;
    border: none;
    border-radius: 8px;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    display: inline-flex;
    align-items: center;
    gap: 8px;
    min-width: 120px;
    justify-content: center;
}

.btn-start {
    background: #28a745;
    color: white;
}

.btn-start:hover:not(:disabled) {
    background: #218838;
    transform: translateY(-2px);
}

.btn-start:disabled {
    background: #6c757d;
    cursor: not-allowed;
}

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

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

.btn-config {
    background: #6c757d;
    color: white;
}

.btn-config:hover {
    background: #5a6268;
    transform: translateY(-2px);
}

/* Область транскрипции */
.realtime-transcription {
    flex: 1;
    padding: 20px;
    display: flex;
    flex-direction: column;
    min-height: 200px;
}

.transcription-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 12px;
}

.transcription-header h4 {
    margin: 0;
    font-size: 16px;
    color: #495057;
}

.transcription-actions {
    display: flex;
    gap: 8px;
    align-items: center;
}

.btn-copy {
    background: #28a745;
    border: none;
    border-radius: 6px;
    width: 28px;
    height: 28px;
    color: white;
    cursor: pointer;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 12px;
}

.btn-copy:hover {
    background: #218838;
    transform: scale(1.1);
}

.btn-copy.btn-success {
    background: #20c997;
    transform: scale(1.1);
}

.btn-clear {
    background: #6c757d;
    border: none;
    border-radius: 6px;
    width: 28px;
    height: 28px;
    color: white;
    cursor: pointer;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    justify-content: center;
}

.btn-clear:hover {
    background: #5a6268;
    transform: scale(1.1);
}

.transcription-area {
    flex: 1;
    background: #f8f9fa;
    border: 2px solid #e9ecef;
    border-radius: 8px;
    padding: 16px;
    font-family: 'SF Pro Text', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    font-size: 16px;
    line-height: 1.6;
    color: #495057;
    overflow-y: auto;
    min-height: 300px;
    max-height: 500px;
    white-space: pre-wrap;
    word-wrap: break-word;
}

.transcription-area:empty::before {
    content: attr(placeholder);
    color: #6c757d;
    font-style: italic;
}

/* Панель настроек */
.realtime-config-panel {
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    background: white;
    border-top: 1px solid #e9ecef;
    padding: 20px;
    max-height: 300px;
    overflow-y: auto;
}

.realtime-config-panel.hidden {
    display: none;
}

.realtime-config-panel h4 {
    margin: 0 0 16px 0;
    font-size: 16px;
    color: #495057;
}

.config-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 16px;
    margin-bottom: 20px;
}

.config-item {
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.config-item label {
    font-size: 14px;
    font-weight: 600;
    color: #495057;
    display: flex;
    align-items: center;
    gap: 8px;
}

.config-item select,
.config-item input[type="checkbox"] {
    padding: 8px 12px;
    border: 2px solid #e9ecef;
    border-radius: 6px;
    font-size: 14px;
    transition: border-color 0.3s ease;
}

.config-item select:focus {
    outline: none;
    border-color: #667eea;
}

.config-item input[type="checkbox"] {
    width: auto;
    margin: 0;
}

.config-actions {
    display: flex;
    gap: 12px;
    justify-content: flex-end;
}

.config-actions .btn {
    padding: 10px 20px;
    border: none;
    border-radius: 6px;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
}

.btn-primary {
    background: #667eea;
    color: white;
}

.btn-primary:hover {
    background: #5a67d8;
    transform: translateY(-1px);
}

.btn-secondary {
    background: #6c757d;
    color: white;
}

.btn-secondary:hover {
    background: #5a6268;
    transform: translateY(-1px);
}

/* Уведомления об ошибках */
.realtime-error {
    background: #f8d7da;
    color: #721c24;
    border: 1px solid #f5c6cb;
    border-radius: 8px;
    padding: 12px 16px;
    margin: 16px 20px;
    display: flex;
    align-items: center;
    gap: 10px;
    animation: slideDown 0.3s ease;
}

/* Уведомления об успехе */
.realtime-success {
    background: #d4edda;
    color: #155724;
    border: 1px solid #c3e6cb;
    border-radius: 8px;
    padding: 12px 16px;
    margin: 16px 20px;
    display: flex;
    align-items: center;
    gap: 10px;
    animation: slideDown 0.3s ease;
}

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

.realtime-error .btn-close {
    background: transparent;
    color: #721c24;
    margin-left: auto;
}

.realtime-error .btn-close:hover {
    background: rgba(114, 28, 36, 0.1);
}

.realtime-success .btn-close {
    background: transparent;
    color: #155724;
    margin-left: auto;
}

.realtime-success .btn-close:hover {
    background: rgba(21, 87, 36, 0.1);
}

/* Адаптивность */
@media (max-width: 768px) {
    .realtime-panel {
        width: 95vw;
        height: 90vh;
        top: 5vh;
        left: 2.5vw;
        transform: none;
    }
    
    .config-grid {
        grid-template-columns: 1fr;
    }
    
    .realtime-controls {
        flex-direction: column;
        align-items: center;
    }
    
    .realtime-controls .btn {
        width: 100%;
        max-width: 200px;
    }
}

/* Темная тема */
@media (prefers-color-scheme: dark) {
    .realtime-panel {
        background: #2d3748;
        color: #e2e8f0;
    }
    
    .realtime-status {
        background: #4a5568;
        border-color: #2d3748;
    }
    
    .transcription-area {
        background: #4a5568;
        border-color: #2d3748;
        color: #e2e8f0;
    }
    
    .transcription-area:empty::before {
        color: #a0aec0;
    }
    
    .realtime-config-panel {
        background: #2d3748;
        border-color: #4a5568;
    }
    
    .config-item select {
        background: #4a5568;
        color: #e2e8f0;
        border-color: #2d3748;
    }
}

/* Скрытие элементов */
.hidden {
    display: none !important;
}

/* Анимации загрузки */
.loading-spinner {
    width: 20px;
    height: 20px;
    border: 2px solid #f3f3f3;
    border-top: 2px solid #667eea;
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

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