/* === VARIÁVEIS GLOBAIS === */
/* Definição das cores e valores padrão do tema unificado */
:root {
    --primary-purple: #7C4DFF;
    --primary-purple-dark: #6200EA;
    --sidebar-bg: #2D2D2D;
    --sidebar-dark: #1E1E1E;
    --main-bg: #FAFAFA;
    --white: #FFFFFF;
    --text-primary: #333333;
    --text-secondary: #666666;
    --text-light: #999999;
    --border-color: #E0E0E0;
    --shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}

/* === RESET E CONFIGURAÇÕES GLOBAIS === */
/* Reset básico para garantir consistência entre navegadores */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

/* Ícone de anexo (substitui emoji) */
.icon-attach {
    width: 16px;
    height: 16px;
    margin-right: 6px;
    fill: currentColor;
    display: inline-block;
    vertical-align: middle;
}

/* Botão com ícone de anexo (Material Symbols) */
.btn-icon-attach {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    background: transparent;
    border: none;
    cursor: pointer;
    padding: 4px 8px;
}

.btn-icon-attach .material-symbols-outlined {
    font-size: 20px;
    line-height: 1;
    vertical-align: middle;
}

/* Utilitário para esconder elementos de forma assertiva */
.hidden {
    display: none !important;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, Cantarell, sans-serif;
    background-color: var(--main-bg);
    color: var(--text-primary);
    line-height: 1.5;
    overflow: hidden;
}

/* === CONTAINER PRINCIPAL === */
/* Layout principal da aplicação com sidebar e conteúdo */
.app-container {
    display: flex;
    height: 100vh;
}

/* === SIDEBAR === */
/* Barra lateral com navegação, ações e informações do usuário */
.sidebar {
    width: 280px;
    background-color: var(--sidebar-bg);
    color: var(--white);
    display: flex;
    flex-direction: column;
    border-right: 1px solid var(--sidebar-dark);
    transition: width 0.3s ease;
}

/* --- ESTADO RECOLHIDO DA SIDEBAR --- */
/* Funcionalidade para recolher a sidebar mostrando apenas ícones */
.sidebar.collapsed {
    width: 60px;
}

/* Esconde todos os elementos textuais e botões desnecessários quando recolhida */
.sidebar.collapsed .sidebar-actions,
.sidebar.collapsed .item-name,
.sidebar.collapsed .item-menu,
.sidebar.collapsed .user-name,
.sidebar.collapsed .section-title,
.sidebar.collapsed .user-actions,
.sidebar.collapsed .search-btn {
    display: none;
}

/* Centraliza os ícones dos itens recentes */
.sidebar.collapsed .recent-item {
    justify-content: center;
    padding: 8px 0;
}

/* Remove a margem do ícone para permitir a centralização perfeita */
.sidebar.collapsed .item-icon {
    margin-right: 0;
}

/* Garante que a informação do usuário (apenas o avatar) fique centralizada */
.sidebar.collapsed .user-info {
    justify-content: center;
}

/* === CABEÇALHO DA SIDEBAR === */
/* Área superior com botões de toggle e busca */
.sidebar-header {
    padding: 16px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    border-bottom: 1px solid var(--sidebar-dark);
}

.menu-toggle, .search-btn {
    background: none; 
    border: none; 
    color: var(--text-light); 
    font-size: 16px; 
    cursor: pointer; 
    padding: 8px; 
    border-radius: 4px; 
    transition: background-color 0.2s;
}
.menu-toggle:hover, .search-btn:hover { 
    background-color: var(--sidebar-dark); 
}

/* === AÇÕES DA SIDEBAR === */
/* Botões para criar novos documentos e conversas */
.sidebar-actions {
    padding: 16px; 
    display: flex; 
    flex-direction: column; 
    gap: 8px;
}

.btn-primary {
    background-color: var(--primary-purple); 
    color: var(--white); 
    border: none; 
    padding: 12px 16px; 
    border-radius: 8px; 
    font-size: 14px; 
    font-weight: 500; 
    cursor: pointer; 
    display: flex; 
    align-items: center; 
    gap: 8px; 
    transition: background-color 0.2s, transform 0.1s;
}
.btn-primary:hover { 
    background-color: var(--primary-purple-dark); 
    transform: translateY(-1px); 
}

/* Bloco para link de download do TR */
.download-box {
    /* Removido o contorno pontilhado ao redor do botão de download */
    margin: 12px 0;
    padding: 0; /* deixa o botão alinhado sem caixa ao redor */
    border: none;
    border-radius: 0;
    display: flex;
    justify-content: flex-start;
    gap: 12px;
}

/* Botão base (além do .btn-primary já existente) */
.btn {
    display: inline-block;
    text-decoration: none;
}

/* === SEÇÃO DE ITENS RECENTES === */
/* Lista de documentos e conversas recentes do usuário */
.sidebar-section {
    flex: 1; 
    padding: 16px; 
    overflow-y: auto;
}
.section-title {
    font-size: 12px; 
    font-weight: 600; 
    color: var(--text-light); 
    text-transform: uppercase; 
    letter-spacing: 0.5px; 
    margin-bottom: 12px;
}
.recent-items {
    display: flex; 
    flex-direction: column; 
    gap: 4px;
}
.recent-item {
    display: flex; 
    align-items: center; 
    padding: 8px 12px; 
    border-radius: 6px; 
    cursor: pointer; 
    transition: background-color 0.2s, opacity 0.3s, transform 0.3s; 
    position: relative;
}
.recent-item:hover { 
    background-color: var(--sidebar-dark); 
}
.item-icon {
    font-size: 14px; 
    color: var(--text-light); 
    margin-right: 12px; 
    width: 16px;
}
.pinned-icon {
    font-size: 12px;
    color: var(--primary-purple);
    margin-right: 8px;
}
.item-name {
    flex: 1; 
    font-size: 14px; 
    color: var(--white); 
    white-space: nowrap; 
    overflow: hidden; 
    text-overflow: ellipsis;
}
.item-menu {
    background: none; 
    border: none; 
    color: var(--text-secondary); 
    cursor: pointer; 
    padding: 4px; 
    border-radius: 4px; 
    transition: background-color 0.2s; 
    margin-left: auto;
}
.item-menu:hover { 
    background-color: var(--sidebar-dark); 
    color: var(--white); 
}

/* === MENU DROPDOWN === */
/* Menu de contexto para itens recentes (fixar, renomear, excluir) */
.dropdown-menu {
    position: absolute; 
    background-color: var(--white); 
    border: 1px solid var(--border-color); 
    border-radius: 6px; 
    box-shadow: 0 4px 12px rgba(0,0,0,0.15); 
    padding: 4px 0; 
    min-width: 130px; 
    z-index: 1000; 
    display: none; 
    white-space: nowrap;
}
.dropdown-menu.show { 
    display: block; 
}
.dropdown-menu button { 
    width: 100%; 
    background: none; 
    border: none; 
    padding: 8px 12px; 
    text-align: left; 
    font-size: 14px; 
    color: var(--text-primary); 
    cursor: pointer; 
    transition: background-color 0.2s; 
    display: flex; 
    align-items: center; 
    gap: 8px; 
}
.dropdown-menu button:hover { 
    background-color: var(--main-bg); 
}
.dropdown-menu button i { 
    width: 16px; 
    font-size: 12px; 
}

/* === RODAPÉ DA SIDEBAR === */
/* Informações do usuário e botões de configuração/logout */
.sidebar-footer {
    padding: 16px; 
    border-top: 1px solid var(--sidebar-dark); 
    display: flex; 
    align-items: center; 
    justify-content: space-between;
}
.user-info { 
    display: flex; 
    align-items: center; 
    gap: 8px; 
    flex: 1; 
}
.user-avatar { 
    width: 24px; 
    height: 24px; 
    background-color: var(--primary-purple); 
    border-radius: 50%; 
    display: flex; 
    align-items: center; 
    justify-content: center; 
    font-size: 10px; 
    font-weight: 600; 
    color: var(--white); 
    flex-shrink: 0; 
    text-transform: uppercase; 
}
.user-name { 
    font-size: 14px; 
    color: var(--white); 
    font-weight: 500; 
}
.user-actions { 
    display: flex; 
    align-items: center; 
    gap: 4px; 
}
.settings-btn, .logout-btn { 
    background: none; 
    border: none; 
    color: var(--text-light); 
    font-size: 14px; 
    cursor: pointer; 
    padding: 6px; 
    border-radius: 4px; 
    transition: background-color 0.2s; 
}
.settings-btn:hover, .logout-btn:hover { 
    background-color: var(--sidebar-dark); 
    color: var(--white); 
}

/* === ÁREA DE CONTEÚDO PRINCIPAL === */
/* Container principal que abriga as diferentes views da aplicação */
.main-content {
    flex: 1; 
    display: flex; 
    flex-direction: column; 
    position: relative; 
    background-color: var(--main-bg);
}

/* === TELA INICIAL (HOME) === */
/* View principal com seleção de tipos de documentos */
.home-view { 
    display: flex; 
    flex-direction: column; 
    height: 100%; 
}
.main-header { 
    padding: 20px 32px; 
    background-color: var(--white); 
    border-bottom: 1px solid var(--border-color); 
}
.app-title { 
    display: flex; 
    align-items: center; 
    gap: 12px; 
}
.app-icon { 
    font-size: 24px; 
    color: var(--primary-purple); 
}
.app-title h1 { 
    font-size: 20px; 
    font-weight: 600; 
    color: var(--text-primary); 
}
.content-center { 
    flex: 1; 
    display: flex; 
    flex-direction: column; 
    align-items: center; 
    justify-content: center; 
    padding: 32px; 
    max-width: 800px; 
    margin: 0 auto; 
    width: 100%; 
}
.main-question { 
    font-size: 28px; 
    font-weight: 400; 
    color: var(--text-primary); 
    text-align: center; 
    margin-bottom: 40px; 
}
.document-options { 
    display: flex; 
    flex-wrap: wrap; 
    justify-content: center; 
    gap: 10px; 
}
.doc-option { 
    background-color: var(--white); 
    border: 1px solid #ccc; 
    border-radius: 20px; 
    padding: 6px 14px; 
    font-size: 14px; 
    cursor: pointer; 
    transition: all 0.2s; 
}
.doc-option:hover { 
    background-color: #f5f5f5; 
}

/* === TELA DE PESQUISA === */
/* View para buscar conversas e documentos existentes */
.search-view { 
    padding: 40px 32px; 
    width: 100%; 
    max-width: 800px; 
    margin: 0 auto; 
    align-items: center; 
    flex-direction: column; 
}
.search-title { 
    font-size: 28px; 
    font-weight: 600; 
    margin-bottom: 24px; 
}
.search-input-container { 
    position: relative; 
    width: 100%; 
    margin-bottom: 24px; 
}
#searchInput { 
    width: 100%; 
    height: 56px; 
    padding: 0 60px 0 24px; 
    font-size: 16px; 
    border-radius: 28px; 
    border: 1px solid var(--border-color); 
    box-shadow: var(--shadow); 
    transition: box-shadow 0.2s, border-color 0.2s; 
}
#searchInput:focus { 
    outline: none; 
    border-color: var(--primary-purple); 
    box-shadow: 0 0 0 3px rgba(124, 77, 255, 0.2); 
}
.search-input-button { 
    position: absolute; 
    right: 8px; 
    top: 50%; 
    transform: translateY(-50%); 
    width: 40px; 
    height: 40px; 
    border-radius: 50%; 
    border: none; 
    background-color: var(--primary-purple); 
    color: var(--white); 
    font-size: 16px; 
    cursor: pointer; 
    display: flex; 
    align-items: center; 
    justify-content: center; 
}
.search-results-list { 
    width: 100%; 
}
.search-result-item { 
    display: flex; 
    align-items: center; 
    padding: 16px; 
    border-bottom: 1px solid var(--border-color); 
    cursor: pointer; 
    transition: background-color 0.2s; 
}
.search-result-item:hover { 
    background-color: #f0f0f0; 
}
.search-result-item .item-icon { 
    font-size: 16px; 
    color: var(--text-secondary); 
    margin-right: 16px; 
}
.search-result-item .item-name { 
    font-size: 15px; 
    color: var(--text-primary); 
}

/* === TELA DE CHAT === */
/* Interface de conversação para criação de documentos e chat com IA */
.chat-view { 
    display: flex; 
    flex-direction: column; 
    height: 100vh; 
    width: 100%; 
    background-color: var(--white); 
}
.chat-header { 
    padding: 16px 32px; 
    border-bottom: 1px solid var(--border-color); 
    flex-shrink: 0; 
}
.chat-header h2 { 
    font-size: 18px; 
    font-weight: 600; 
}
.chat-messages-container { 
    flex-grow: 1; 
    overflow-y: auto; 
    padding: 24px 32px; 
    display: flex; 
    flex-direction: column; 
    gap: 20px; 
}
.chat-message { 
    display: flex; 
    flex-direction: column; 
    max-width: 80%; 
}
.message-bubble { 
    padding: 12px 16px; 
    border-radius: 18px; 
    line-height: 1.6; 
    font-size: 15px; 
    word-wrap: break-word; 
}
.ai-message { 
    align-self: flex-start; 
    align-items: flex-start; 
}
.ai-message .message-bubble { 
    background-color: #f0f2f5; 
    color: var(--text-primary); 
    border-top-left-radius: 4px; 
}
.user-message { 
    align-self: flex-end; 
    align-items: flex-end; 
}
.user-message .message-bubble { 
    background-color: var(--primary-purple); 
    color: var(--white); 
    border-top-right-radius: 4px; 
}

/* === MARKDOWN STYLING WITHIN MESSAGE BUBBLES === */
/* Styling for Markdown elements rendered in chat messages */
.message-bubble strong {
    font-weight: 600;
    color: inherit;
}

.message-bubble em {
    font-style: italic;
    color: inherit;
}

.message-bubble ul, .message-bubble ol {
    margin: 8px 0;
    padding-left: 20px;
}

.message-bubble li {
    margin: 4px 0;
    line-height: 1.5;
}

.message-bubble p {
    margin: 8px 0;
}

.message-bubble p:first-child {
    margin-top: 0;
}

.message-bubble p:last-child {
    margin-bottom: 0;
}

.message-bubble h1, .message-bubble h2, .message-bubble h3, 
.message-bubble h4, .message-bubble h5, .message-bubble h6 {
    margin: 12px 0 8px 0;
    font-weight: 600;
    color: inherit;
}

.message-bubble h1:first-child, .message-bubble h2:first-child, 
.message-bubble h3:first-child, .message-bubble h4:first-child,
.message-bubble h5:first-child, .message-bubble h6:first-child {
    margin-top: 0;
}

/* === FORMATTED TEXT AND BADGES (HOTFIX) === */
/* Enhanced formatting for lists and requirement badges */
.message-bubble pre, .message-bubble .formatted {
    white-space: pre-wrap;
    line-height: 1.45;
}

.message-bubble ol, .message-bubble ul {
    margin: 8px 0 8px 20px;
    padding: 0;
}

.message-bubble ol li, .message-bubble ul li {
    margin-bottom: 4px;
}

.badge-od {
    display: inline-block;
    font-size: 12px;
    padding: 0 6px;
    border-radius: 10px;
    margin-left: 6px;
    border: 1px solid #ddd;
}

.badge-obr {
    background: #fff6f6;
    border-color: #ffcdd2;
}

.badge-des {
    background: #f6fff8;
    border-color: #c8e6c9;
}

/* === BLOCO DE PREVIEW DO DOCUMENTO === */
/* Componente para exibir preview de documentos gerados pela IA */
/* Block grows with content, no internal scrolling */
.document-preview-block { 
    position: relative;
    width: 100%; 
    max-width: 800px; 
    background-color: var(--sidebar-bg); 
    border: 1px solid var(--sidebar-dark); 
    border-radius: 8px; 
    margin-top: 8px; 
    /* No overflow hidden - let content grow naturally */
}
.preview-header { 
    display: flex; 
    justify-content: space-between; 
    align-items: center; 
    padding: 10px 16px; 
    background-color: var(--sidebar-dark); 
    border-radius: 8px 8px 0 0;
}
.preview-title { 
    font-size: 14px; 
    font-weight: 500; 
    color: var(--white); 
}
.download-doc-btn { 
    background-color: var(--primary-purple); 
    color: var(--white); 
    border: none; 
    padding: 6px 12px; 
    border-radius: 6px; 
    font-size: 13px; 
    font-weight: 500; 
    cursor: pointer; 
    transition: background-color 0.2s, opacity 0.2s; 
}
.download-doc-btn:hover:not(:disabled) { 
    background-color: var(--primary-purple-dark); 
}
.download-doc-btn:disabled { 
    background-color: #555; 
    cursor: not-allowed; 
    opacity: 0.7; 
}
.preview-content { 
    padding: 16px; 
    /* No max-height or overflow - content grows naturally */
    /* Page handles scrolling, not this container */
    color: #e0e0e0; 
    font-family: 'Menlo', 'Monaco', 'Courier New', monospace; 
    font-size: 14px; 
    white-space: pre-wrap; 
    line-height: 1.7; 
}

/* === ÁREA DE INPUT DO CHAT === */
/* Componente de entrada de texto para conversas com a IA */
.chat-input-area { 
    padding: 16px 32px; 
    border-top: 1px solid var(--border-color); 
    background-color: var(--main-bg); 
    flex-shrink: 0; 
}
.chat-input-wrapper { 
    display: flex; 
    align-items: center; 
    background-color: var(--white); 
    border: 1px solid #ccc; 
    border-radius: 24px; 
    padding: 6px; 
    max-width: 800px; 
    margin: 0 auto; 
}
.chat-input-wrapper:focus-within { 
    border-color: var(--primary-purple); 
    box-shadow: 0 0 0 3px rgba(124, 77, 255, 0.2); 
}
#userInput { 
    flex-grow: 1; 
    border: none; 
    padding: 10px; 
    resize: none; 
    font-family: inherit; 
    font-size: 15px; 
    background-color: transparent; 
    max-height: 120px; 
}
#userInput:focus { 
    outline: none; 
}
.attach-btn, .send-btn { 
    background: none; 
    border: none; 
    cursor: pointer; 
    color: var(--text-secondary); 
    font-size: 18px; 
    padding: 8px 12px; 
    border-radius: 50%; 
    width: 40px; 
    height: 40px; 
}
.send-btn { 
    background-color: var(--primary-purple); 
    color: white; 
}

/* === INDICADOR DE DIGITAÇÃO === */
/* Animação para mostrar quando a IA está "pensando" ou processando */
.typing-indicator span { 
    display: inline-block; 
    width: 8px; 
    height: 8px; 
    border-radius: 50%; 
    background-color: var(--text-secondary); 
    margin: 0 2px; 
    animation: bounce 1.4s infinite ease-in-out both; 
}
.typing-indicator span:nth-child(1) { 
    animation-delay: -0.32s; 
}
.typing-indicator span:nth-child(2) { 
    animation-delay: -0.16s; 
}
@keyframes bounce { 
    0%, 80%, 100% { 
        transform: scale(0); 
    } 
    40% { 
        transform: scale(1.0); 
    } 
}

/* === MODAL === */
/* Sistema de modais para edição de perfil e outras funcionalidades */
.modal-overlay { 
    position: fixed; 
    top: 0; 
    left: 0; 
    width: 100%; 
    height: 100%; 
    background-color: rgba(0,0,0,0.5); 
    display: flex; 
    align-items: center; 
    justify-content: center; 
    z-index: 1000; 
    opacity: 0; 
    visibility: hidden; 
    transition: all 0.3s ease; 
}
.modal-overlay.show { 
    opacity: 1; 
    visibility: visible; 
}
.modal-content { 
    background-color: var(--white); 
    border-radius: 12px; 
    padding: 24px; 
    width: 90%; 
    max-width: 400px; 
    transform: scale(0.9); 
    transition: transform 0.3s ease; 
}
.modal-overlay.show .modal-content { 
    transform: scale(1); 
}
.modal-header { 
    display: flex; 
    align-items: center; 
    justify-content: space-between; 
    margin-bottom: 20px; 
}
.modal-title { 
    font-size: 18px; 
    font-weight: 600; 
}
.modal-close { 
    background: none; 
    border: none; 
    font-size: 20px; 
    cursor: pointer; 
}
.form-group { 
    display: flex; 
    flex-direction: column; 
    gap: 6px; 
    margin-bottom: 16px; 
}
.form-label { 
    font-size: 14px; 
    font-weight: 500; 
}
.form-input { 
    padding: 10px 12px; 
    border: 1px solid var(--border-color); 
    border-radius: 6px; 
    font-size: 14px; 
}
.modal-actions { 
    display: flex; 
    gap: 12px; 
    justify-content: flex-end; 
    margin-top: 20px; 
}
.btn-secondary { 
    background-color: var(--main-bg); 
    color: var(--text-secondary); 
    border: 1px solid var(--border-color); 
    padding: 8px 16px; 
    border-radius: 6px; 
    cursor: pointer; 
}
.btn-primary-modal { 
    background-color: var(--primary-purple); 
    color: var(--white); 
    border: none; 
    padding: 8px 16px; 
    border-radius: 6px; 
    cursor: pointer; 
}

/* === INTERFACE DE REQUISITOS === */
/* Estilos para a nova funcionalidade de sugestão de requisitos dinâmicos */
.requirements-interface-block {
    position: static;
    display: block;
    width: 100%;
    clear: both;
    background-color: var(--white);
    border: 2px solid var(--primary-purple);
    border-radius: 12px;
    padding: 20px;
    margin: 8px 0 12px 0;
    box-shadow: var(--shadow);
}

.requirements-header h4 {
    color: var(--primary-purple);
    font-size: 18px;
    font-weight: 600;
    margin-bottom: 8px;
}

.requirements-header p {
    color: var(--text-secondary);
    font-size: 14px;
    margin-bottom: 16px;
}

/* Requirements container removed - requirements now render inline as chat messages */
/*.requirements-container {
    padding: 16px;
    margin: 16px 0;
    background-color: #f9f9f9;
    border-radius: 8px;
    border: 1px solid var(--border-color);
}*/

.requirements-list {
    margin-bottom: 20px;
}

.requirement-item {
    display: flex;
    align-items: flex-start;
    gap: 10px;
    padding: 12px;
    margin-bottom: 8px;
    background-color: #f8f9fa;
    border-radius: 8px;
    border: 1px solid var(--border-color);
    transition: background-color 0.2s ease;
}

.requirement-item:hover {
    background-color: #f0f0f0;
}

.requirement-item input[type="checkbox"] {
    margin-top: 2px;
    transform: scale(1.2);
}

.requirement-item label {
    flex: 1;
    font-size: 14px;
    line-height: 1.4;
    cursor: pointer;
    color: var(--text-primary);
}

.edit-req-btn {
    background: none;
    border: none;
    cursor: pointer;
    font-size: 16px;
    opacity: 0.6;
    transition: opacity 0.2s ease;
}

.edit-req-btn:hover {
    opacity: 1;
}

.requirements-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    margin-bottom: 15px;
}

.action-btn {
    padding: 10px 16px;
    border: none;
    border-radius: 8px;
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s ease;
    display: flex;
    align-items: center;
    gap: 6px;
}

.accept-btn {
    background-color: #4CAF50;
    color: white;
}

.accept-btn:hover {
    background-color: #45a049;
    transform: translateY(-1px);
}

.modify-btn {
    background-color: var(--primary-purple);
    color: white;
}

.modify-btn:hover {
    background-color: var(--primary-purple-dark);
    transform: translateY(-1px);
}

.add-btn {
    background-color: #2196F3;
    color: white;
}

.add-btn:hover {
    background-color: #1976D2;
    transform: translateY(-1px);
}

.skip-btn {
    background-color: var(--text-secondary);
    color: white;
}

.skip-btn:hover {
    background-color: #555;
    transform: translateY(-1px);
}

.add-requirement-form {
    background-color: #f8f9fa;
    padding: 16px;
    border-radius: 8px;
    border: 1px solid var(--border-color);
    margin-top: 15px;
}

.add-requirement-form textarea {
    width: 100%;
    padding: 12px;
    border: 1px solid var(--border-color);
    border-radius: 6px;
    font-size: 14px;
    font-family: inherit;
    resize: vertical;
    margin-bottom: 12px;
}

.add-requirement-form button {
    padding: 8px 16px;
    border: none;
    border-radius: 6px;
    font-size: 14px;
    cursor: pointer;
    margin-right: 10px;
    transition: background-color 0.2s ease;
}

.add-requirement-form button:first-of-type {
    background-color: var(--primary-purple);
    color: white;
}

.add-requirement-form button:first-of-type:hover {
    background-color: var(--primary-purple-dark);
}

.add-requirement-form button:last-of-type {
    background-color: var(--text-secondary);
    color: white;
}

.add-requirement-form button:last-of-type:hover {
    background-color: #555;
}

/* Responsividade para a interface de requisitos */
@media (max-width: 768px) {
    .requirements-actions {
        flex-direction: column;
    }
    
    .action-btn {
        width: 100%;
        justify-content: center;
    }
    
    .requirement-item {
        flex-direction: column;
        gap: 8px;
    }

    .requirement-item label {
        margin-left: 20px;
    }
}

/* indicador de fase removido no HTML/JS; nenhuma exibição */

/* === ETP PREVIEW BLOCKS === */
/* Styling for ETP preview code blocks with download button */
/* The preview block grows with content, no internal scrolling */
.etp-preview-block {
    position: relative;
    background-color: #0f172a;
    border: 1px solid #1e293b;
    border-radius: 12px;
    padding: 16px;
    margin: 16px 0;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.15);
    /* No max-height or overflow - block grows with content */
    /* Page scrolling handles long content */
}

.etp-preview-block code {
    display: block;
    white-space: pre-wrap;
    word-wrap: break-word;
    font-family: 'Courier New', Courier, monospace;
    font-size: 12px;
    line-height: 1.6;
    color: #e2e8f0;
}

/* Style headings in preview */
.etp-preview-block code .title,
.etp-preview-block code h1,
.etp-preview-block code h2,
.etp-preview-block code h3 {
    color: #60a5fa;
    font-weight: 700;
}

/* Floating download button positioned at top-right of preview block */
/* Stays visible while preview is on screen (sticky effect) */
.etp-download-btn {
    position: absolute;
    bottom: 16px;
    right: 16px;
    z-index: 10;

    display: inline-flex;
    align-items: center;
    justify-content: center;

    width: 42px;
    height: 42px;
    border-radius: 999px;
    border: none;

    background: #2563eb;  /* primary */
    color: white;
    cursor: pointer;
    box-shadow: 0 4px 12px rgba(0,0,0,0.15);
    transition: transform 0.12s ease, box-shadow 0.12s ease, opacity 0.12s ease;
    opacity: 0.95;
}

.etp-download-btn:hover {
    transform: translateY(-1px);
    box-shadow: 0 6px 16px rgba(0,0,0,0.2);
    opacity: 1;
}

.etp-download-btn .material-symbols-outlined {
    font-size: 22px;
    line-height: 1;
}

/* Ensure code blocks inside chat messages have proper positioning */
.message-bubble pre.etp-preview-block {
    position: relative;
    max-width: 100%;
}

.req-confirmation {
    display: flex;
    flex-direction: column;
    gap: 12px;
    margin-top: 12px;
}

.req-confirmation__message {
    font-weight: 600;
}

.req-confirmation__list {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.req-confirmation__item {
    border: 1px solid var(--border-color);
    border-radius: 10px;
    padding: 12px;
    background: var(--surface-secondary);
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.req-confirmation__excerpt {
    margin: 0;
    color: var(--text-secondary);
}

.req-confirmation__button {
    align-self: flex-start;
}

.req-confirmation__empty {
    color: var(--text-secondary);
    font-style: italic;
}

/* === PLACEHOLDER MESSAGE WITH SPINNER === */
.msg-placeholder {
    display: flex;
    align-items: center;
    gap: 10px;
    color: #64748b;
    font-style: italic;
}

.placeholder-spinner {
    width: 16px;
    height: 16px;
    border: 2px solid #e2e8f0;
    border-top-color: var(--primary-purple);
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
}

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