/* copsoq-styles.css - Estilos para o questionário COPSOQ */

/* Estilos para o cabeçalho da página do questionário */
.copsoq-page-header {
    text-align: center;
    margin-bottom: 40px;
    padding: 20px;
    background-color: #e9ecef;
    border-radius: 8px;
    box-shadow: 0 4px 10px rgba(0,0,0,0.05);
}

.copsoq-page-header .copsoq-title {
    font-size: 2.2em; /* Tamanho base do h1, os spans filhos usam 'em' relativo a este */
    color: #343a40;
    margin: 0; /* Zera margens do h1 */
    font-weight: 700;
    line-height: 1.2; /* Garante espaçamento entre linhas dentro do h1 */
    display: flex; /* Transforma o h1 em um contêiner flexível */
    flex-direction: column; /* Organiza os spans filhos em coluna */
    align-items: center; /* Centraliza os itens horizontalmente */
}

/* Estilo para a primeira parte do título: "Questionário Psicossocial" */
.copsoq-page-header .copsoq-title .copsoq-main-title {
    display: block; /* Garante que ocupe sua própria linha */
    text-align: center; /* Centraliza o texto */
    white-space: normal; /* Permite que o texto quebre a linha normalmente */
    word-wrap: break-word; /* Permite que palavras longas quebrem */
    word-break: break-word; /* Força a quebra de linha em qualquer ponto se necessário */
    font-size: 1.2em; /* **ALTERADO:** Tamanho maior para "Questionário Psicossocial" (1.2x do tamanho base do h1) */
    line-height: 1.2; /* Herda ou define explicitamente para consistência */
    margin-bottom: 5px; /* **ADICIONADO:** Pequeno espaçamento abaixo */
    margin-top: 0;
    margin-left: 0;
    margin-right: 0;
    padding: 0; /* Zera preenchimento */
}

/* Estilo para a segunda parte do título: "Copenhagen" */
.copsoq-page-header .copsoq-title .copsoq-copenhagen {
    display: block; /* Garante que "Copenhagen" fique em sua própria linha */
    text-align: center; /* Centraliza "Copenhagen" */
    font-size: 0.9em; /* **ALTERADO:** Tamanho ligeiramente menor para "Copenhagen" (0.9x do tamanho base do h1) */
    line-height: 1.2; /* Herda ou define explicitamente para consistência */
    margin-top: 5px;    /* **ALTERADO:** Espaçamento acima */
    margin-bottom: 10px; /* **ALTERADO:** Espaçamento abaixo para separar do subtítulo */
    margin-left: auto;  /* Para manter a centralização */
    margin-right: auto; /* Para manter a centralização */
    padding: 0; /* Zera preenchimento */
}


.copsoq-page-header .copsoq-subtitle {
    font-size: 1.2em;
    color: #6c757d;
    margin-top: 25px; /* **ALTERADO:** Aumenta o espaçamento superior para afastá-lo do "Copenhagen" */
    text-align: center;
}


/* Estilo geral do container principal do questionário */
#copsoq-questionnaire-app {
    max-width: 900px;
    margin: 40px auto;
    padding: 30px;
    background-color: #f8f9fa;
    border-radius: 10px;
    box-shadow: 0 8px 20px rgba(0,0,0,0.1);
    font-family: Arial, sans-serif;
    color: #333;
}

/* Estilos para as mensagens iniciais, de carregamento e erro */
.copsoq-message {
    text-align: center;
    padding: 20px;
    margin-top: 20px;
    border-radius: 8px;
    background-color: #fff;
    box-shadow: 0 2px 5px rgba(0,0,0,0.05);
}

.copsoq-message p {
    font-size: 1.1em;
    color: #333;
    margin-bottom: 15px;
}

#version-selector {
    display: flex;
    justify-content: center;
    gap: 15px;
    flex-wrap: wrap; /* Garante que os botões quebrem a linha em telas menores */
}

/* Estilo para cada página de perguntas */
.question-page {
    display: flex;
    flex-direction: column;
    gap: 20px;
}

/* Estilo para cada item de pergunta (o bloco da pergunta individual) */
.question-item {
    background-color: #ffffff;
    padding: 25px;
    border-radius: 8px;
    box-shadow: 0 4px 10px rgba(0,0,0,0.08);
}

.question-item p {
    font-size: 1.15em;
    font-weight: bold;
    margin-bottom: 15px;
    color: #343a40;
    line-height: 1.4;
}

/* Estilo para as opções de resposta (o grupo de rádio buttons) */
.options {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.options label {
    display: flex;
    align-items: center;
    padding: 10px 15px;
    border: 1px solid #dee2e6;
    border-radius: 5px;
    cursor: pointer;
    transition: all 0.2s ease-in-out;
    background-color: #f2f2f2;
}

.options label:hover {
    background-color: #e9ecef;
    border-color: #007bff;
}

.options input[type="radio"] {
    margin-right: 10px;
    transform: scale(1.2);
    accent-color: #007bff;
}

.options input[type="radio"]:checked + span {
    font-weight: bold;
    color: #007bff;
}

/* Estilos para os botões de navegação e botões de seleção de versão */
.quiz-navigation, #version-selector {
    display: flex;
    justify-content: center;
    margin-top: 30px;
    gap: 15px;
}

.quiz-button {
    padding: 12px 25px;
    border: none;
    border-radius: 5px;
    font-size: 1.05em;
    cursor: pointer;
    transition: background-color 0.2s ease, transform 0.2s ease, box-shadow 0.2s ease;
    text-transform: uppercase;
    font-weight: bold;
    letter-spacing: 0.5px;
}

/* Botão Voltar */
#prev-button {
    background-color: #6c757d;
    color: white;
}

#prev-button:hover {
    background-color: #5a6268;
    transform: translateY(-1px);
    box-shadow: 0 2px 5px rgba(0,0,0,0.2);
}

/* Botão Próximo e botões de seleção */
#next-button, #start-short-quiz, #start-medium-quiz {
    background-color: #007bff;
    color: white;
}

#next-button:hover, #start-short-quiz:hover, #start-medium-quiz:hover {
    background-color: #0056b3;
    transform: translateY(-1px);
    box-shadow: 0 2px 5px rgba(0,0,0,0.2);
}

/* Botão Enviar */
#submit-quiz {
    background-color: #28a745;
    color: white;
}

#submit-quiz:hover {
    background-color: #218838;
    transform: translateY(-1px);
    box-shadow: 0 2px 5px rgba(0,0,0,0.2);
}

/* Informações de paginação */
.pagination-info {
    text-align: center;
    margin-top: 20px;
    font-size: 0.95em;
    color: #6c757d;
}

/* Estilos para a seção de resultados */
#quiz-results {
    margin-top: 40px;
    padding: 30px;
    background-color: #e9ecef;
    border-radius: 10px;
    box-shadow: inset 0 0 10px rgba(0,0,0,0.05);
}

#quiz-results h2 {
    text-align: center;
    color: #343a40;
    margin-bottom: 25px;
    font-size: 1.8em;
    border-bottom: 2px solid #ced4da;
    padding-bottom: 15px;
}

/* Estilo para a seção do gráfico e legenda */
.chart-section {
    display: flex;
    flex-direction: column;
    align-items: center;
    margin-bottom: 20px;
    background-color: #ffffff;
    border-radius: 8px;
    box-shadow: 0 2px 5px rgba(0,0,0,0.1);
    padding: 20px;
}

#chart-legend {
    display: flex;
    justify-content: center;
    gap: 25px;
    margin-bottom: 20px;
    flex-wrap: wrap;
    font-size: 0.95em;
}

.legend-item {
    display: flex;
    align-items: center;
}

.legend-item span {
    display: inline-block;
    width: 15px;
    height: 15px;
    margin-right: 8px;
    border-radius: 3px;
    border: 1px solid #ccc; /* Subtle border for legend boxes */
}

/* Style for chart container */
#chart-container {
    width: 100%;
    min-height: 400px;
    display: flex;
    justify-content: center;
    align-items: center;
    overflow: hidden;
}


#interpretation-list {
    margin-top: 30px;
}

.interpretation-item {
    background-color: #ffffff;
    padding: 20px;
    margin-bottom: 15px;
    border-radius: 8px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.05);
    border-left: 5px solid; /* Handled by JS inline style with !important */
}

.interpretation-item h4 {
    font-size: 1.2em;
    color: #343a40;
    margin-bottom: 10px;
}

.interpretation-item p {
    font-size: 1em;
    line-height: 1.5;
    color: #555;
}

/* Color styles for interpretation text within paragraphs */
.interpretation-item p span.risk-text {
    color: #dc3545;
    font-weight: bold;
}
.interpretation-item p span.intermediate-text {
    color: #ffc107;
    font-weight: bold;
    }
.interpretation-item p span.favorable-text {
    color: #28a745;
    font-weight: bold;
}

/* Styles for result action buttons */
.result-actions {
    text-align: center;
    margin-top: 30px;
    gap: 15px;
    display: flex;
    justify-content: center;
}

/* Feedback messages (email) */
#email-message-container {
    padding: 10px;
    margin-bottom: 20px;
    border-radius: 5px;
    text-align: center;
    font-weight: bold;
}
#email-message-container.info {
    background-color: #d1ecf1;
    color: #0c5460;
    border-color: #bee5eb;
}

/* Correção para a moldura vermelha dos botões */
.quiz-button {
    border: none !important; /* Remove qualquer borda */
    outline: none !important; /* Remove qualquer outline (foco) */
}


/* Small screen optimizations */
@media (max-width: 768px) {
    .copsoq-page-header .copsoq-title {
        font-size: 1.5em; /* Reduz ainda mais o tamanho da fonte para telas muito pequenas */
    }
    .copsoq-page-header .copsoq-title .copsoq-main-title {
        white-space: normal; /* Garante que pode quebrar */
        word-wrap: break-word;
        word-break: break-word;
    }
    .copsoq-page-header .copsoq-title .copsoq-copenhagen {
        font-size: 0.9em; /* Ajusta o tamanho de Copenhagen para ser relativo e legível */
        margin-top: 2px; /* Reduz margem superior em telas pequenas */
    }
    .copsoq-page-header .copsoq-subtitle {
        font-size: 0.9em;
    }
    #version-selector {
        flex-direction: column; /* Empilha os botões verticalmente em telas pequenas */
        align-items: center; /* Centraliza os botões empilhados */
    }
}
/* Correção de cores dos botões */
#send-email-results.quiz-button {
    background-color: #2c5aa0 !important;
    color: white !important;
    border: none !important;
}

#send-email-results.quiz-button:hover {
    background-color: #1e3f73 !important;
}
/* Remover botão PDF */
#download-results-pdf {
    display: none !important;
}
