/* --- ESTILOS GERAIS --- */
@import url('https://fonts.googleapis.com/css2?family=Roboto:wght@400;500;700&display=swap');

#guia-exames-app {
    font-family: 'Roboto', sans-serif;
    color: #333;
    display: flex;
    flex-direction: column; /* ALTERADO: Agora a direção é vertical */
    gap: 20px;
    width: 100%;
    font-size: 16px;
}

/* --- (NOVO) LINHA SUPERIOR DE CONTROLES --- */
.gex-top-controls-container {
    display: flex;
    gap: 20px;
    width: 100%;
}

/* Ajuste para que os painéis dentro do novo contêiner dividam o espaço */
.gex-top-controls-container .controls-panel {
    flex: 1; /* Faz com que cada painel ocupe metade do espaço */
    min-width: 300px; /* Garante uma largura mínima */
}


/* --- PAINEL DE CONTROLES (Estilos existentes, sem alteração) --- */
.controls-panel {
    background: #fff;
    border-radius: 8px;
    padding: 20px;
    box-shadow: 0 2px 10px rgba(0,0,0,0.05);
    border: 1px solid #e0e0e0;
    transition: padding 0.3s ease;
    display: flex;
    flex-direction: column;
    max-height: 80vh;
}

.panel-header {
    display: flex;
    align-items: center;
    cursor: pointer;
    user-select: none;
    margin-bottom: 15px;
}
.panel-header h3 {
    margin: 0;
    font-size: 17px;
    font-weight: bold;
    color: #1565c0;
}
.panel-header::before {
    content: '▼ ';
    font-size: 14px;
    color: #1565c0;
    margin-right: 8px;
    transition: transform 0.3s ease;
}

.controls-panel.collapsed {
    padding: 12px 15px;
    height: fit-content;
    max-height: 50px;
}
.controls-panel.collapsed > .panel-content {
    display: none;
}
.controls-panel.collapsed .panel-header::before {
    transform: rotate(-90deg);
}
.controls-panel.collapsed .panel-header {
    margin-bottom: 0;
}

.panel-content {
    display: flex;
    flex-direction: column;
    min-height: 0;
}

.search-box {
    margin-bottom: 15px;
}
.search-box input {
    width: 100%;
    padding: 10px;
    border: 1px solid #ccc;
    border-radius: 5px;
    font-size: 16px;
    box-sizing: border-box;
}

.selected-diseases {
    margin-bottom: 15px;
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

.disease-tag {
    background-color: #e3f2fd;
    color: #0d47a1;
    padding: 5px 10px;
    border-radius: 15px;
    font-size: 14px;
    font-weight: 500;
    display: flex;
    align-items: center;
    gap: 8px;
    cursor: default;
}

.disease-tag span.remove-tag {
    cursor: pointer;
    font-weight: bold;
    color: #b71c1c;
    font-size: 16px;
}

.scrollable-content {
    overflow-y: auto;
    flex-grow: 1;
}

.category-title {
    font-weight: bold;
    color: #333;
    cursor: pointer;
    padding: 10px;
    background-color: #f5f5f5;
    border-radius: 5px;
    margin-top: 10px;
    user-select: none;
    font-size: 15px;
}
.scrollable-content .category-title:first-child {
    margin-top: 0;
}
.category-title::before {
    content: '▶ ';
    font-size: 12px;
}
.category-title.open::before {
    content: '▼ ';
}

.category-items {
    padding-left: 15px;
    list-style: none;
    display: none;
}

.category-items.open {
    display: block;
}

.category-items li {
    padding: 8px 5px;
    cursor: pointer;
    transition: background-color 0.2s;
    border-radius: 4px;
    font-size: 15px;
}

.category-items li:hover {
    background-color: #eef;
}
.category-items li.selected-exam {
    background-color: #e3f2fd;
    color: #0d47a1;
    font-weight: bold;
}


/* --- COLUNA DA DIREITA (RESULTADOS) --- */
.results-panel { 
    background: #fff; 
    border-radius: 8px; 
    padding: 20px; 
    box-shadow: 0 2px 10px rgba(0,0,0,0.05); 
    display: flex; 
    flex-direction: column; 
    border: 1px solid #e0e0e0; 
}
.results-header { display: flex; justify-content: space-between; align-items: center; border-bottom: 2px solid #eee; padding-bottom: 10px; margin-bottom: 20px; }
.results-header h2 { margin: 0; color: #333; font-size: 21px; }
.action-buttons button { background-color: #1976d2; color: white; border: none; padding: 8px 15px; border-radius: 5px; cursor: pointer; margin-left: 10px; font-weight: 500; transition: background-color 0.2s; font-size: 14px; }
.action-buttons button:hover { background-color: #1565c0; }
.action-buttons button:disabled { background-color: #ccc; cursor: not-allowed; }
.exam-category { margin-bottom: 25px; }
.exam-category h3 { color: #0d47a1; border-bottom: 1px solid #e0e0e0; padding-bottom: 5px; font-size: 17px; }
.exam-list { list-style: none; padding: 0; }
.exam-item { padding: 10px; border-bottom: 1px solid #f5f5f5; display: flex; align-items: center; justify-content: space-between; font-size: 15px; gap: 10px; }
.exam-info { position: relative; flex-grow: 1; }
.info-icon { display: inline-block; width: 18px; height: 18px; background-color: #bbdefb; color: #0d47a1; border-radius: 50%; text-align: center; font-size: 12px; font-weight: bold; line-height: 18px; cursor: help; margin-left: 8px; user-select: none; }
.info-icon .tooltip { visibility: hidden; width: 250px; background-color: #333; color: #fff; text-align: left; border-radius: 6px; padding: 8px; position: absolute; z-index: 100; left: 110%; top: -5px; opacity: 0; transition: opacity 0.3s; font-size: 12px; font-weight: normal; pointer-events: none; }
.info-icon:hover .tooltip { visibility: visible; opacity: 1; }
.exam-source { font-size: 12px; color: #757575; font-style: italic; text-align: right; max-width: 40%; flex-shrink: 0; }
.placeholder { text-align: center; color: #999; margin: auto; font-size: 17px; }
#gex-print-modal { position: fixed; top: 0; left: 0; width: 100%; height: 100%; background-color: rgba(0, 0, 0, 0.6); display: flex; justify-content: center; align-items: center; z-index: 1000; }
#gex-print-modal .modal-content { background-color: white; padding: 30px; border-radius: 8px; text-align: center; box-shadow: 0 5px 15px rgba(0,0,0,0.3); width: 90%; max-width: 400px; }
#gex-print-modal h3 { margin-top: 0; color: #333; }
#gex-print-modal button { display: block; width: 100%; padding: 12px; margin-top: 15px; border: none; border-radius: 5px; font-size: 16px; cursor: pointer; background-color: #1976d2; color: white; transition: background-color 0.2s; }
#gex-print-modal button:hover { background-color: #1565c0; }
#gex-print-modal .cancel-btn { background-color: #f44336; }
#gex-print-modal .cancel-btn:hover { background-color: #d32f2f; }

/* --- ESTILOS PARA "ADICIONAR OUTRO" --- */
.add-other-container { margin-top: 15px; padding-top: 15px; border-top: 1px dashed #ccc; }
.add-other-toggle { color: #1565c0; cursor: pointer; font-weight: 500; font-size: 14px; }
.add-other-box { display: none; margin-top: 10px; display: flex; gap: 10px; }
.add-other-box input { flex-grow: 1; padding: 8px; border: 1px solid #ccc; border-radius: 4px; }
.add-other-box button { padding: 8px 12px; border: none; background-color: #28a745; color: white; border-radius: 4px; cursor: pointer; }
.add-other-box button:hover { background-color: #218838; }


/* --- NOVOS ESTILOS ADICIONADOS --- */

/* BOTÃO DE REMOVER EXAME INDIVIDUAL */
.remove-exam-btn {
    background-color: #f44336;
    color: white;
    border: none;
    border-radius: 50%;
    width: 22px;
    height: 22px;
    font-size: 16px;
    font-weight: bold;
    line-height: 20px;
    text-align: center;
    cursor: pointer;
    padding: 0;
    flex-shrink: 0; /* Impede que o botão encolha */
    transition: background-color 0.2s, transform 0.2s;
}

.remove-exam-btn:hover {
    background-color: #d32f2f;
    transform: scale(1.1);
}

/* BOTÃO DE LIMPAR TUDO */
#gex-clear-btn {
    background-color: #f44336;
}
#gex-clear-btn:hover {
    background-color: #d32f2f;
}

/* ESTILOS PARA ADIÇÃO DE EXAMES MANUAIS */
.manual-exam-list-container {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-top: 10px;
    /* Adicionado para garantir que não fique vazio quando não houver itens */
    margin-bottom: 5px; 
}

.manual-exam-tag {
    background-color: #e8f5e9; /* Cor verde clara */
    color: #1b5e20; /* Cor verde escura */
    padding: 5px 10px;
    border-radius: 15px;
    font-size: 14px;
    font-weight: 500;
    display: flex;
    align-items: center;
    gap: 8px;
}

.manual-exam-tag span.remove-tag {
    cursor: pointer;
    font-weight: bold;
    color: #b71c1c;
    font-size: 16px;
}

/* --- AJUSTE PARA O TÍTULO LONGO --- */
#gex-individual-header h3 {
    white-space: nowrap; /* Impede que o texto quebre em duas linhas */
}