/* =================================================================
   JORNADA SAÚDE - QUESTIONÁRIO DE BEM-ESTAR GERAL
   Sistema completo: Questionário + Relatório
   ================================================================= */

/* RESET E CONFIGURAÇÕES GLOBAIS */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, Cantarell, sans-serif;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    min-height: 100vh;
    padding: 2rem;
    line-height: 1.6;
}

#app-container {
    max-width: 900px;
    margin: 0 auto;
    background: white;
    border-radius: 20px;
    overflow: hidden;
    box-shadow: 0 20px 60px rgba(0,0,0,0.3);
}

/* HEADER */
.mev-header {
    background: linear-gradient(135deg, #5eead4 0%, #60a5fa 100%);
    padding: 3rem 2rem;
    text-align: center;
    color: white;
}

.mev-header h1 {
    font-size: 2.5rem;
    margin-bottom: 0.5rem;
    font-weight: 700;
}

.mev-header .subtitle {
    font-size: 1.1rem;
    opacity: 0.95;
    margin-bottom: 0.5rem;
}

.mev-header .description {
    font-size: 0.95rem;
    opacity: 0.9;
}

/* BARRA DE PROGRESSO */
.progress-container {
    padding: 1.5rem 2rem;
    background: #f8fafc;
    border-bottom: 1px solid #e2e8f0;
}

.progress-bar {
    width: 100%;
    height: 12px;
    background: #e2e8f0;
    border-radius: 10px;
    overflow: hidden;
    margin-bottom: 0.75rem;
}

.progress-fill {
    height: 100%;
    background: linear-gradient(90deg, #10b981 0%, #059669 100%);
    border-radius: 10px;
    transition: width 0.4s ease;
    width: 0%;
}

.progress-text {
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-size: 0.9rem;
    color: #64748b;
    font-weight: 600;
}

.progress-percentage {
    color: #059669;
}

/* SEÇÕES DO FORMULÁRIO */
#sections-container {
    padding: 2rem;
}

.form-section {
    display: none;
}

.form-section.active {
    display: block;
    animation: fadeIn 0.4s ease;
}

@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.section-title {
    font-size: 1.8rem;
    color: #1e293b;
    margin-bottom: 0.5rem;
}

.section-description {
    color: #64748b;
    margin-bottom: 2rem;
}

.form-group {
    margin-bottom: 2rem;
}

.form-label {
    display: block;
    font-weight: 600;
    color: #1e293b;
    margin-bottom: 0.75rem;
    font-size: 1.05rem;
}

.form-input, .form-select {
    width: 100%;
    padding: 0.75rem 1rem;
    border: 2px solid #e2e8f0;
    border-radius: 8px;
    font-size: 1rem;
    transition: border-color 0.2s ease;
}

.form-input:focus, .form-select:focus {
    outline: none;
    border-color: #5eead4;
}

/* SLIDER EMPÁTICO */
.empathetic-slider-container {
    position: relative;
    margin-top: 1rem;
}

.empathetic-slider {
    width: 100%;
    height: 12px;
    border-radius: 10px;
    outline: none;
    -webkit-appearance: none;
    cursor: pointer;
}

.empathetic-slider::-webkit-slider-thumb {
    -webkit-appearance: none;
    width: 24px;
    height: 24px;
    border-radius: 50%;
    background: white;
    cursor: pointer;
    box-shadow: 0 2px 8px rgba(0,0,0,0.3);
}

.empathetic-slider::-moz-range-thumb {
    width: 24px;
    height: 24px;
    border-radius: 50%;
    background: white;
    cursor: pointer;
    box-shadow: 0 2px 8px rgba(0,0,0,0.3);
    border: none;
}

.slider-value-display {
    position: absolute;
    top: -35px;
    background: rgba(0,0,0,0.8);
    color: white;
    padding: 0.25rem 0.75rem;
    border-radius: 6px;
    font-size: 0.9rem;
    font-weight: 700;
    pointer-events: none;
    transition: opacity 0.2s;
}

.status-badge {
    display: inline-block;
    margin-top: 0.5rem;
    padding: 0.35rem 1rem;
    border-radius: 20px;
    font-size: 0.85rem;
    font-weight: 600;
}

.status-low {
    background: #fee2e2;
    color: #991b1b;
}

.status-medium {
    background: #fef3c7;
    color: #78350f;
}

.status-good {
    background: #d1fae5;
    color: #065f46;
}

.status-excellent {
    background: #dbeafe;
    color: #1e3a8a;
}

/* BOTÕES DE NAVEGAÇÃO */
.navigation-buttons {
    display: flex;
    gap: 1rem;
    padding: 2rem;
    background: #f8fafc;
    border-top: 1px solid #e2e8f0;
}

.btn {
    padding: 0.875rem 2rem;
    font-size: 1rem;
    font-weight: 600;
    border: none;
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.2s ease;
}

.btn-primary {
    background: linear-gradient(135deg, #5eead4 0%, #60a5fa 100%);
    color: white;
    flex: 1;
}

.btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(94, 234, 212, 0.4);
}

.btn-secondary {
    background: #e2e8f0;
    color: #475569;
}

.btn-secondary:hover {
    background: #cbd5e1;
}

.btn-success {
    background: linear-gradient(135deg, #10b981 0%, #059669 100%);
    color: white;
    flex: 1;
}

.btn-success:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(16, 185, 129, 0.4);
}

/* LOADING OVERLAY */
#loading-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.8);
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    z-index: 9999;
}

.loading-spinner {
    width: 60px;
    height: 60px;
    border: 6px solid #e2e8f0;
    border-top-color: #5eead4;
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

@keyframes spin {
    to {
        transform: rotate(360deg);
    }
}

#loading-overlay p {
    color: white;
    margin-top: 1rem;
    font-size: 1.1rem;
}

/* ============================================
   ESTILOS DO RELATÓRIO
   ============================================ */

.report-card {
    margin: 2rem;
    padding: 2rem;
    background: #f8fafc;
    border-radius: 12px;
    border: 1px solid #e2e8f0;
}

.report-card h2 {
    color: #1e293b;
    font-size: 1.5rem;
    margin-bottom: 1.5rem;
    padding-bottom: 0.5rem;
    border-bottom: 3px solid #5eead4;
}

/* INFORMAÇÕES BÁSICAS */
.info-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 1rem;
}

.info-item {
    background: white;
    padding: 1rem;
    border-radius: 8px;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
}

.info-label {
    font-size: 0.875rem;
    color: #64748b;
    margin-bottom: 0.25rem;
}

.info-value {
    font-size: 1.5rem;
    font-weight: 700;
    color: #0f172a;
}

.imc-card {
    background: linear-gradient(135deg, #fef3c7 0%, #fde68a 100%);
    border: none;
}

.imc-display {
    text-align: center;
    padding: 1rem;
}

.imc-value {
    font-size: 3rem;
    font-weight: 800;
    color: #92400e;
}

.imc-category {
    font-size: 1.25rem;
    color: #78350f;
    font-weight: 600;
}

/* ÁRVORE DO BEM-ESTAR */
.tree-container {
    position: relative;
    width: 100%;
    max-width: 500px;
    margin: 1.5rem auto;
    padding: 0.5rem;
    min-height: 400px;
}

.tree-image {
    width: 100%;
    height: auto;
    display: block;
}

/* PONTOS CLICÁVEIS */
.leaf-point {
    position: absolute;
    width: 28px;
    height: 28px;
    border-radius: 50%;
    cursor: pointer;
    transform: translate(-50%, -50%);
    z-index: 15;
    transition: all 0.3s ease;
    box-shadow: 0 4px 12px rgba(0,0,0,0.3);
    animation: pointAppear 0.6s ease-out;
}

@keyframes pointAppear {
    from {
        opacity: 0;
        transform: translate(-50%, -50%) scale(0);
    }
    to {
        opacity: 1;
        transform: translate(-50%, -50%) scale(1);
    }
}

.leaf-point:hover {
    transform: translate(-50%, -50%) scale(1.2);
    z-index: 20;
}

.point-pulse {
    width: 100%;
    height: 100%;
    border-radius: 50%;
    animation: pulse 2s ease-in-out infinite;
}

@keyframes pulse {
    0%, 100% {
        box-shadow: 0 0 0 0 rgba(255, 255, 255, 0.7);
    }
    50% {
        box-shadow: 0 0 0 8px rgba(255, 255, 255, 0);
    }
}

.point-high {
    background: linear-gradient(135deg, #10b981 0%, #059669 100%);
}

.point-medium {
    background: linear-gradient(135deg, #f59e0b 0%, #d97706 100%);
}

.point-low {
    background: linear-gradient(135deg, #ef4444 0%, #dc2626 100%);
}

.root-point {
    width: 42px;
    height: 42px;
    background: linear-gradient(135deg, #14b8a6 0%, #06b6d4 100%);
    box-shadow: 0 6px 20px rgba(20, 184, 166, 0.5);
}

.root-badge {
    position: absolute;
    bottom: -24px;
    left: 50%;
    transform: translateX(-50%);
    background: white;
    padding: 0.2rem 0.6rem;
    border-radius: 12px;
    font-size: 0.65rem;
    font-weight: 700;
    color: #0d9488;
    white-space: nowrap;
    box-shadow: 0 2px 8px rgba(0,0,0,0.15);
    pointer-events: none;
}

/* TOOLTIP */
.point-tooltip {
    position: absolute;
    top: 100%;
    left: 50%;
    transform: translateX(-50%);
    margin-top: 8px;
    background: rgba(0, 0, 0, 0.9);
    color: white;
    padding: 0.5rem 0.8rem;
    border-radius: 8px;
    white-space: nowrap;
    opacity: 0;
    visibility: hidden;
    pointer-events: none;
    transition: opacity 0.2s ease, visibility 0s 0.5s;
    z-index: 100;
    box-shadow: 0 4px 12px rgba(0,0,0,0.3);
}

.point-tooltip::before {
    content: '';
    position: absolute;
    bottom: 100%;
    left: 50%;
    transform: translateX(-50%);
    border: 6px solid transparent;
    border-bottom-color: rgba(0, 0, 0, 0.9);
}

.leaf-point:hover .point-tooltip {
    opacity: 1;
    visibility: visible;
    transition: opacity 0.2s ease, visibility 0s 0s;
}

.tooltip-label {
    font-size: 0.75rem;
    font-weight: 600;
    margin-bottom: 0.15rem;
    text-align: center;
}

.tooltip-score {
    font-size: 1rem;
    font-weight: 800;
    text-align: center;
}

/* POPUP MODAL */
.leaf-popup {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.6);
    z-index: 1000;
    align-items: center;
    justify-content: center;
    backdrop-filter: blur(4px);
}

.leaf-popup.active {
    display: flex;
}

.popup-content {
    background: white;
    border-radius: 20px;
    padding: 2rem;
    max-width: 400px;
    width: 90%;
    text-align: center;
    box-shadow: 0 20px 60px rgba(0,0,0,0.3);
    position: relative;
    animation: popupSlideIn 0.4s ease-out;
}

@keyframes popupSlideIn {
    from {
        transform: translateY(-50px) scale(0.9);
        opacity: 0;
    }
    to {
        transform: translateY(0) scale(1);
        opacity: 1;
    }
}

.popup-close {
    position: absolute;
    top: 1rem;
    right: 1rem;
    background: #f1f5f9;
    border: none;
    width: 35px;
    height: 35px;
    border-radius: 50%;
    font-size: 1.2rem;
    cursor: pointer;
    transition: all 0.2s ease;
}

.popup-close:hover {
    background: #e2e8f0;
    transform: rotate(90deg);
}

.popup-icon {
    font-size: 4rem;
    margin-bottom: 1rem;
}

.popup-title {
    font-size: 1.5rem;
    color: #1e293b;
    margin-bottom: 1rem;
    font-weight: 700;
    text-transform: uppercase;
}

.popup-score {
    font-size: 3rem;
    font-weight: 900;
    margin: 1rem 0;
}

.popup-score.score-high { color: #059669; }
.popup-score.score-medium { color: #d97706; }
.popup-score.score-low { color: #dc2626; }

.popup-nivel {
    display: inline-block;
    padding: 0.5rem 1.5rem;
    border-radius: 25px;
    font-size: 1rem;
    font-weight: 600;
    margin-top: 1rem;
}

.popup-nivel.nivel-high {
    background: linear-gradient(135deg, #d1fae5 0%, #a7f3d0 100%);
    color: #065f46;
}

.popup-nivel.nivel-medium {
    background: linear-gradient(135deg, #fef3c7 0%, #fde68a 100%);
    color: #78350f;
}

.popup-nivel.nivel-low {
    background: linear-gradient(135deg, #fee2e2 0%, #fecaca 100%);
    color: #991b1b;
}

/* DIMENSÕES COM BARRAS */
.dimension-item {
    padding: 1rem;
    margin-bottom: 1rem;
    background: white;
    border-radius: 8px;
    border-left: 4px solid #5eead4;
    box-shadow: 0 2px 4px rgba(0,0,0,0.05);
}

.dimension-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 0.5rem;
}

.dimension-name {
    font-weight: 600;
    color: #1e293b;
    font-size: 1.1rem;
}

.dimension-score {
    font-size: 1.3rem;
    font-weight: 800;
    color: #1e293b;
}

.dimension-bar-container {
    width: 100%;
    height: 12px;
    background: #e5e7eb;
    border-radius: 10px;
    overflow: hidden;
}

.dimension-bar {
    height: 100%;
    border-radius: 10px;
    transition: width 1s ease-out;
    animation: barGrow 1.2s ease-out;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
}

@keyframes barGrow {
    from {
        width: 0 !important;
    }
}

/* RECOMENDAÇÕES */
.recommendation-item {
    background: linear-gradient(135deg, #ede9fe 0%, #ddd6fe 100%);
    padding: 1.5rem;
    border-radius: 12px;
    margin-bottom: 1rem;
    border-left: 5px solid #8b5cf6;
}

.recommendation-item h3 {
    color: #5b21b6;
    margin-bottom: 0.75rem;
    font-size: 1.25rem;
}

.recommendation-item p {
    color: #4c1d95;
    line-height: 1.7;
}

/* RESPONSIVO MOBILE */
@media (max-width: 768px) {
    body {
        padding: 1rem;
    }

    #app-container {
        border-radius: 12px;
    }

    .mev-header {
        padding: 2rem 1rem;
    }

    .mev-header h1 {
        font-size: 1.8rem;
    }

    .progress-container {
        padding: 1rem;
    }

    #sections-container {
        padding: 1.5rem 1rem;
    }

    .section-title {
        font-size: 1.5rem;
    }

    .navigation-buttons {
        flex-direction: column;
        padding: 1rem;
    }

    .btn {
        width: 100%;
    }

    .report-card {
        margin: 1rem;
        padding: 1.2rem;
    }

    .tree-container {
        padding: 0.5rem;
        min-height: 350px;
    }

    .leaf-point {
        width: 26px;
        height: 26px;
    }

    .root-point {
        width: 36px;
        height: 36px;
    }

    .popup-content {
        width: 95%;
        padding: 1.5rem;
    }

    .popup-title {
        font-size: 1.1rem;
    }

    .popup-score {
        font-size: 2.2rem;
    }
}
