/* ===== COMPONENTS.CSS - COMPONENTES GERAIS DO SISTEMA ===== */

/* =========================================================================
   SEÇÃO 1: SISTEMA DE EXPAND/COLLAPSE
   ========================================================================= */

/* Headers dos Engines */
.engine-header {
    margin-bottom: 1rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.engine-header h4 {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-size: 0.9rem;
    color: #333;
    margin: 0;
    flex: 1;
}

/* Botões de Toggle */
.btn-toggle {
    background: none;
    border: none;
    color: #666;
    cursor: pointer;
    padding: 0.3rem;
    border-radius: 4px;
    transition: all 0.3s ease;
    font-size: 0.8rem;
}

.btn-toggle:hover {
    background: rgba(102, 126, 234, 0.1);
    color: #667eea;
}

.btn-toggle i {
    transition: transform 0.3s ease;
}

.btn-toggle.collapsed i {
    transform: rotate(180deg);
}

/* Conteúdo colapsável */
.engine-content,
.ai-genius-content {
    overflow: hidden;
    transition: all 0.4s ease;
    max-height: 2000px;
    opacity: 1;
}

.engine-content.collapsed,
.ai-genius-content.collapsed {
    max-height: 0;
    opacity: 0;
    margin-top: 0;
    margin-bottom: 0;
    padding-top: 0;
    padding-bottom: 0;
}

/* =========================================================================
   SEÇÃO 2: BOTÕES DO HEADER (RECORD, IMPORT, VIDEO)
   ========================================================================= */

/* === BOTÃO RECORD NOVO ESTILO OTTER === */
.btn-record-header,
.mc-btn-record {
    background: #1A56DB;
    border: none;
    color: white;
    padding: 0.5rem 1.1rem;
    border-radius: 25px;
    cursor: pointer;
    font-size: 0.875rem;
    font-weight: 600;
    display: flex;
    align-items: center;
    gap: 0.45rem;
    transition: background 0.2s, box-shadow 0.2s, transform 0.15s;
    box-shadow: 0 2px 8px rgba(26, 86, 219, 0.35);
    min-width: 105px;
    justify-content: center;
    letter-spacing: 0.01em;
}

.btn-record-header:hover,
.mc-btn-record:hover {
    background: #1446B8;
    box-shadow: 0 4px 14px rgba(26, 86, 219, 0.45);
    transform: translateY(-1px);
}

.btn-record-header:active,
.mc-btn-record:active {
    transform: translateY(0);
    box-shadow: 0 2px 6px rgba(26, 86, 219, 0.3);
}

.btn-record-header i,
.mc-btn-record i {
    font-size: 0.85rem;
}

.btn-header-action {
    background: #f8f9fa;
    border: 1px solid #e9ecef;
    color: #495057;
    padding: 0.6rem 1rem;
    border-radius: 25px;
    cursor: pointer;
    font-size: 0.9rem;
    font-weight: 500;
    display: flex;
    align-items: center;
    gap: 0.5rem;
    transition: all 0.3s ease;
    text-decoration: none;
    min-width: 100px;
    justify-content: center;
}

.btn-header-action:hover {
    background: #e9ecef;
    border-color: #dee2e6;
    transform: translateY(-1px);
    box-shadow: 0 2px 8px rgba(0,0,0,0.1);
}

.btn-header-action i {
    font-size: 0.9rem;
}

.btn-header-action.loading {
    background: #fff3cd;
    border-color: #ffeaa7;
    color: #856404;
    pointer-events: none;
}

.btn-header-action.success {
    background: #d4edda;
    border-color: #c3e6cb;
    color: #155724;
}

.btn-header-action.error {
    background: #f8d7da;
    border-color: #f5c6cb;
    color: #721c24;
}

/* =========================================================================
   SEÇÃO 3: ESTILOS DO PAINEL CENTRAL (HEADER E NAVEGAÇÃO)
   ========================================================================= */

.center-header {
    display: flex;
    gap: 1rem;
    margin-bottom: 1.5rem;
    align-items: center;
}

.center-header-custom {
    display: flex;
    gap: 0.75rem;
    align-items: center;
    justify-content: flex-end;
    width: 100%;
    padding: 1rem;
}

.btn-new-recording {
    background: linear-gradient(135deg, #ff6b6b, #ee5a52);
    border: none;
    color: white;
    padding: 0.8rem 1.5rem;
    border-radius: 12px;
    cursor: pointer;
    font-size: 1rem;
    font-weight: 600;
    display: flex;
    align-items: center;
    gap: 0.5rem;
    transition: all 0.3s ease;
    box-shadow: 0 4px 15px rgba(255, 107, 107, 0.3);
    flex-shrink: 0;
}

.btn-new-recording:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(255, 107, 107, 0.4);
}

.btn-new-recording i {
    font-size: 1.1rem;
}

/* =========================================================================
   SEÇÃO 4: BARRA DE PESQUISA E FILTROS
   ========================================================================= */

.search-bar {
    flex: 1;
    position: relative;
}

.search-bar i {
    position: absolute;
    left: 1rem;
    top: 50%;
    transform: translateY(-50%);
    color: #999;
}

.search-bar input {
    width: 100%;
    padding: 0.8rem 1rem 0.8rem 3rem;
    border: 1px solid #e0e0e0;
    border-radius: 25px;
    font-size: 0.9rem;
    background: #f8f9fa;
    transition: all 0.2s ease;
}

.search-bar input:focus {
    outline: none;
    border-color: #667eea;
    background: white;
    box-shadow: 0 0 0 3px rgba(102, 126, 234, 0.1);
}

.filters-section {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1rem;
    padding-bottom: 1rem;
    border-bottom: 1px solid #f0f0f0;
}

.filter-buttons {
    display: flex;
    gap: 0.5rem;
}

.filter-btn {
    background: #f8f9fa;
    border: 1px solid #e9ecef;
    color: #666;
    padding: 0.5rem 1rem;
    border-radius: 20px;
    cursor: pointer;
    font-size: 0.8rem;
    display: flex;
    align-items: center;
    gap: 0.3rem;
    transition: all 0.2s ease;
}

.filter-btn:hover {
    background: #e9ecef;
}

.filter-btn.active {
    background: #667eea;
    color: white;
    border-color: #667eea;
}

.sort-dropdown select {
    padding: 0.5rem;
    border: 1px solid #e0e0e0;
    border-radius: 6px;
    font-size: 0.8rem;
    background: white;
    cursor: pointer;
}

/* =========================================================================
   SEÇÃO 5: LISTA DE CONVERSAS E CARDS
   ========================================================================= */

.conversations-list {
    flex: 1;
    overflow-y: auto;
}

.conversation-card {
    background: white;
    border: 1px solid #f0f0f0;
    border-radius: 12px;
    margin-bottom: 1rem;
    overflow: hidden;
    transition: all 0.2s ease;
    cursor: pointer;
}

.conversation-card:hover {
    border-color: #667eea;
    box-shadow: 0 4px 15px rgba(0,0,0,0.1);
    transform: translateY(-1px);
}

.card-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    padding: 1rem;
    border-bottom: 1px solid #f8f9fa;
}

.conversation-title {
    font-size: 1rem;
    font-weight: 600;
    color: #333;
    margin-bottom: 0.5rem;
}

.conversation-meta {
    display: flex;
    gap: 1rem;
    font-size: 0.7rem;
    color: #666;
}

.conversation-meta span {
    display: flex;
    align-items: center;
    gap: 0.2rem;
}

.card-actions {
    display: flex;
    gap: 0.5rem;
}

.btn-star, 
.btn-more {
    background: none;
    border: none;
    color: #999;
    padding: 0.3rem;
    border-radius: 4px;
    cursor: pointer;
    transition: all 0.2s ease;
}

.btn-star:hover, 
.btn-more:hover {
    background: #f8f9fa;
    color: #667eea;
}

.btn-star.starred {
    color: #ffc107;
}

.card-preview {
    padding: 1rem;
}

.transcript-preview {
    font-size: 0.9rem;
    line-height: 1.4;
    color: #333;
    margin-bottom: 0.5rem;
}

.translation-preview {
    color: #666;
    font-size: 0.8rem;
    font-style: italic;
}

.card-footer {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0.8rem 1rem;
    background: #f8f9fa;
    border-top: 1px solid #f0f0f0;
}

.card-stats {
    display: flex;
    gap: 1rem;
    font-size: 0.7rem;
    color: #666;
}

.card-stats span {
    display: flex;
    align-items: center;
    gap: 0.3rem;
}

.card-buttons {
    display: flex;
    gap: 0.3rem;
}

.btn-play, 
.btn-edit, 
.btn-download, 
.btn-share {
    background: none;
    border: none;
    color: #666;
    padding: 0.4rem;
    border-radius: 4px;
    cursor: pointer;
    transition: all 0.2s ease;
    font-size: 0.8rem;
}

.btn-play:hover { background: #e8f5e8; color: #4caf50; }
.btn-edit:hover { background: #fff3e0; color: #ff9800; }
.btn-download:hover { background: #e3f2fd; color: #2196f3; }
.btn-share:hover { background: #f3e5f5; color: #9c27b0; }

/* =========================================================================
   SEÇÃO 6: ESTADOS ESPECIAIS (EMPTY, LOADING)
   ========================================================================= */

.empty-state {
    text-align: center;
    padding: 3rem 1rem;
    color: #666;
}

.empty-icon {
    font-size: 3rem;
    color: #ddd;
    margin-bottom: 1rem;
}

.empty-state h3 {
    margin-bottom: 0.5rem;
    color: #333;
}

.empty-state p {
    margin-bottom: 1.5rem;
    line-height: 1.5;
}

.btn-start-first {
    background: linear-gradient(135deg, #667eea, #764ba2);
    border: none;
    color: white;
    padding: 0.8rem 1.5rem;
    border-radius: 10px;
    cursor: pointer;
    font-size: 0.9rem;
    font-weight: 500;
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    transition: all 0.3s ease;
}

.btn-start-first:hover {
    transform: translateY(-2px);
    box-shadow: 0 5px 15px rgba(102, 126, 234, 0.3);
}

.loading-conversations {
    text-align: center;
    padding: 2rem;
    color: #666;
}

.loading-spinner {
    width: 30px;
    height: 30px;
    border: 3px solid #f0f0f0;
    border-top: 3px solid #667eea;
    border-radius: 50%;
    animation: spin 1s linear infinite;
    margin: 0 auto 1rem;
}

/* =========================================================================
   SEÇÃO 7: ESTILOS DO PAINEL DIREITO (INFORMAÇÕES E STATS)
   ========================================================================= */

.conversation-info,
.stats-section,
.shortcuts-section,
.tips-section,
.system-status {
    margin-bottom: 2rem;
    padding-bottom: 1.5rem;
    border-bottom: 1px solid #f0f0f0;
}

.conversation-info:last-child,
.stats-section:last-child,
.shortcuts-section:last-child,
.tips-section:last-child,
.system-status:last-child {
    border-bottom: none;
}

.conversation-info h3,
.stats-section h3,
.shortcuts-section h3,
.tips-section h3,
.system-status h3 {
    font-size: 0.9rem;
    font-weight: 600;
    color: #666;
    margin-bottom: 1rem;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.info-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 0.8rem;
    font-size: 0.8rem;
}

.info-item label {
    font-weight: 500;
    color: #666;
}

.info-item span {
    color: #333;
    font-weight: 400;
}

.stat-card {
    background: #f8f9fa;
    border-radius: 8px;
    padding: 1rem;
    margin-bottom: 0.8rem;
    display: flex;
    align-items: center;
    gap: 0.8rem;
    transition: all 0.2s ease;
}

.stat-card:hover {
    background: #e9ecef;
    transform: translateY(-1px);
}

.stat-icon {
    width: 35px;
    height: 35px;
    border-radius: 50%;
    background: #667eea;
    color: white;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.stat-icon i {
    font-size: 0.9rem;
}

.stat-content {
    flex: 1;
}

.stat-number {
    font-size: 1.1rem;
    font-weight: 600;
    color: #333;
    line-height: 1.2;
}

.stat-label {
    font-size: 0.7rem;
    color: #666;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

/* =========================================================================
   SEÇÃO 8: ATALHOS DE TECLADO E DICAS
   ========================================================================= */

.shortcut-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 0.8rem;
    font-size: 0.8rem;
}

.shortcut-keys {
    display: flex;
    gap: 0.2rem;
    align-items: center;
}

.shortcut-keys kbd {
    background: #f1f3f4;
    border: 1px solid #dadce0;
    border-radius: 3px;
    padding: 0.2rem 0.4rem;
    font-size: 0.7rem;
    font-family: inherit;
    color: #3c4043;
    box-shadow: 0 1px 1px rgba(0,0,0,0.1);
}

.shortcut-desc {
    color: #666;
    flex: 1;
    text-align: right;
}

.tip-item {
    display: flex;
    gap: 0.8rem;
    margin-bottom: 1rem;
    font-size: 0.8rem;
    line-height: 1.4;
}

.tip-icon {
    width: 25px;
    height: 25px;
    border-radius: 50%;
    background: #4caf50;
    color: white;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    font-size: 0.7rem;
}

.tip-content {
    flex: 1;
    color: #666;
}

.tip-content strong {
    color: #333;
}

/* =========================================================================
   SEÇÃO 9: STATUS DO SISTEMA
   ========================================================================= */

.status-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 0.8rem;
    font-size: 0.8rem;
}

.status-indicator {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.status-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
}

.status-dot.online {
    background: #4caf50;
    animation: pulse 2s infinite;
}

.status-dot.warning {
    background: #ff9800;
}

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

.status-dot.offline {
    background: #f44336;
}

.status-dot.connecting {
    background: #ff9800;
}

.status-value {
    color: #666;
    font-weight: 500;
}

.api-status {
    color: #666;
}

.status-ok {
    color: #4caf50;
    font-weight: 500;
}

.status-error {
    color: #f44336;
    font-weight: 500;
}

.status-warning {
    color: #ff9800;
    font-weight: 500;
}

/* =========================================================================
   SEÇÃO 10: INPUTS E CONTROLES CUSTOMIZADOS
   ========================================================================= */

.input-group {
    margin-bottom: 1rem;
}

.input-group label {
    display: block;
    font-size: 0.8rem;
    font-weight: 500;
    color: #666;
    margin-bottom: 0.3rem;
}

.microphone-select,
.audio-select,
.language-select,
.model-select {
    width: 100%;
    padding: 0.5rem;
    border: 1px solid #ddd;
    border-radius: 6px;
    font-size: 0.8rem;
    background: white;
    cursor: pointer;
    transition: border-color 0.2s ease;
}

.microphone-select:focus,
.audio-select:focus,
.language-select:focus,
.model-select:focus {
    outline: none;
    border-color: #667eea;
    box-shadow: 0 0 0 2px rgba(102, 126, 234, 0.1);
}

.checkbox-group {
    margin-bottom: 0.8rem;
}

.checkbox-label {
    display: flex;
    align-items: center;
    font-size: 0.8rem;
    color: #666;
    cursor: pointer;
    user-select: none;
}

.checkbox-label input[type="checkbox"] {
    display: none;
}

.checkmark {
    width: 16px;
    height: 16px;
    border: 2px solid #ddd;
    border-radius: 3px;
    margin-right: 0.5rem;
    position: relative;
    transition: all 0.2s ease;
}

.checkbox-label input[type="checkbox"]:checked + .checkmark {
    background: #667eea;
    border-color: #667eea;
}

.checkbox-label input[type="checkbox"]:checked + .checkmark::after {
    content: '';
    position: absolute;
    left: 4px;
    top: 1px;
    width: 4px;
    height: 8px;
    border: solid white;
    border-width: 0 2px 2px 0;
    transform: rotate(45deg);
}

/* =========================================================================
   SEÇÃO 11: TESTE DE MICROFONE
   ========================================================================= */

.mic-test {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    margin-top: 0.5rem;
}

.btn-test-mic {
    background: #667eea;
    border: none;
    color: white;
    padding: 0.4rem 0.8rem;
    border-radius: 6px;
    cursor: pointer;
    font-size: 0.7rem;
    font-weight: 500;
    display: flex;
    align-items: center;
    gap: 0.3rem;
    transition: all 0.2s ease;
}

.btn-test-mic:hover {
    background: #5a6fd8;
    transform: translateY(-1px);
}

.mic-level {
    flex: 1;
    height: 4px;
    background: #f0f0f0;
    border-radius: 2px;
    overflow: hidden;
}

.mic-level-bar {
    height: 100%;
    background: linear-gradient(90deg, #4caf50, #ffeb3b, #ff5722);
    width: 0%;
    transition: width 0.1s ease;
    border-radius: 2px;
}

/* =========================================================================
   SEÇÃO 12: ANIMAÇÕES GLOBAIS
   ========================================================================= */

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

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