/* MQ-0001 YA - Enneagram Personality Test Styles */

/* ========== VARIABLES ========== */
:root {
    --type-1: #607d8b;
    --type-2: #ff5722;
    --type-3: #e91e63;
    --type-4: #9b59b6;
    --type-5: #3498db;
    --type-6: #2ecc71;
    --type-7: #f1c40f;
    --type-8: #f39c12;
    --type-9: #e74c3c;
    --bg: #f5f7fa;
    --card: #ffffff;
    --text: #2d3748;
    --text-mid: #718096;
    --primary: #2d3748;
    --border: #e2e8f0;
}

/* ========== BASE STYLES ========== */
* { box-sizing: border-box; margin: 0; padding: 0; }

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Helvetica, Arial, sans-serif;
    background: var(--bg);
    color: var(--text);
    line-height: 1.6;
}

.page { display: none; }
.page.active { display: block; }

.container {
    max-width: 800px;
    margin: 0 auto;
    padding: 2rem;
}

/* ========== HERO / LANDING ========== */
.hero {
    text-align: center;
    padding: 3rem 1rem;
}

.enneagram-symbol {
    width: 200px;
    height: 200px;
    margin: 0 auto 1.5rem;
}

.enneagram-symbol svg { width: 100%; height: 100%; }

.hero h1 { font-size: 2.2rem; color: var(--primary); margin-bottom: 0.5rem; }
.subtitle { color: var(--text-mid); margin-bottom: 2rem; font-size: 1.1rem; }

/* Info Cards */
.info-cards {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 1.5rem;
    margin: 2rem 0;
}

.card {
    background: var(--card);
    padding: 1.5rem;
    border-radius: 12px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.08);
    text-align: center;
    transition: transform 0.2s;
}

.card:hover { transform: translateY(-4px); }
.card .icon { font-size: 2.5rem; display: block; margin-bottom: 0.75rem; }
.card h3 { font-size: 1.1rem; margin-bottom: 0.5rem; color: var(--primary); }
.card p { color: var(--text-mid); font-size: 0.9rem; margin: 0; }

/* ========== BUTTONS ========== */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 0.75rem 1.5rem;
    border-radius: 8px;
    font-weight: 600;
    cursor: pointer;
    border: 2px solid transparent;
    transition: all 0.2s;
    text-decoration: none;
    font-size: 1rem;
    gap: 0.5rem;
    color: inherit;
}

.btn-primary { background: var(--primary); color: white; }
.btn-primary:hover { background: #1a202c; transform: translateY(-2px); }

.btn-secondary { background: white; color: var(--text); border-color: var(--border); }
.btn-secondary:hover { background: var(--bg); }

.btn:disabled { opacity: 0.5; cursor: not-allowed; }

#start-btn { display: block; margin: 2rem auto; font-size: 1.2rem; padding: 1rem 2.5rem; }

/* About section */
.about-enneagram { margin-top: 3rem; padding-top: 2rem; border-top: 2px solid var(--border); text-align: center; }
.about-enneagram h2 { margin-bottom: 1rem; }
.about-enneagram > p { max-width: 600px; margin: 0 auto 1.5rem; }

.types-preview {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 0.5rem;
    margin-top: 1rem;
}

.type-chip {
    padding: 0.4rem 1rem;
    border-radius: 20px;
    font-size: 0.85rem;
    font-weight: 600;
    color: white;
}

/* ========== QUIZ SECTION ========== */
.quiz-container { max-width: 700px; margin: 0 auto; padding: 1.5rem; min-height: 100vh; }

.quiz-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
    margin-bottom: 2rem;
}

.progress-wrapper { flex: 1; }
.progress-bar { height: 8px; background: var(--border); border-radius: 4px; overflow: hidden; }
.progress-fill { height: 100%; background: var(--primary); border-radius: 4px; transition: width 0.3s; width: 0%; }
.progress-text { font-size: 0.875rem; color: var(--text-mid); margin-top: 0.5rem; }

.question-card { background: var(--card); border-radius: 16px; padding: 2rem; box-shadow: 0 4px 16px rgba(0,0,0,0.1); margin-bottom: 1.5rem; }

.question-number { font-size: 0.875rem; text-transform: uppercase; letter-spacing: 1px; color: var(--text-mid); margin-bottom: 1rem; }
.question-text { font-size: 1.3rem; color: var(--primary); margin-bottom: 2.5rem; line-height: 1.4; min-height: 60px; }

.scale-options { margin-bottom: 2rem; }
.scale-labels { display: flex; justify-content: space-between; margin-bottom: 0.75rem; }
.scale-labels span { font-size: 0.75rem; color: var(--text-mid); text-align: center; flex: 1; }
.scale-labels span:first-child { text-align: left; }
.scale-labels span:last-child { text-align: right; }

.scale-buttons { display: flex; justify-content: space-between; gap: 0.75rem; }
.scale-btn {
    width: 56px; height: 56px; border-radius: 50%; border: 2px solid var(--border);
    background: white; font-size: 1.1rem; font-weight: 700; color: var(--text-mid);
    cursor: pointer; transition: all 0.2s;
}
.scale-btn:hover { border-color: var(--primary); color: var(--primary); transform: scale(1.05); }
.scale-btn.selected { background: var(--primary); color: white; border-color: var(--primary); transform: scale(1.08); }

.question-actions { display: flex; justify-content: space-between; padding-top: 1.5rem; border-top: 1px solid var(--border); }
.quiz-footer { text-align: center; margin-top: 1rem; }
.btn-text { background: transparent; border: none; color: var(--text-mid); cursor: pointer; font-size: 0.9rem; padding: 0.5rem; }
.btn-text:hover { color: var(--primary); }

/* ========== REVIEW MODAL ========== */
.modal { display: none; position: fixed; inset: 0; background: rgba(0,0,0,0.5); z-index: 100; align-items: center; justify-content: center; padding: 1rem; }
.modal.active { display: flex; }
.modal-content { background: var(--card); border-radius: 12px; width: 100%; max-width: 700px; max-height: 90vh; overflow-y: auto; box-shadow: 0 20px 40px rgba(0,0,0,0.2); }
.modal-header { display: flex; justify-content: space-between; align-items: center; padding: 1.25rem 1.5rem; border-bottom: 1px solid var(--border); }
.modal-body { padding: 1rem 1.5rem; }
.modal-footer { padding: 1.25rem 1.5rem; border-top: 1px solid var(--border); display: flex; justify-content: flex-end; gap: 1rem; }

.btn-close { background: none; border: none; font-size: 1.5rem; cursor: pointer; color: var(--text-mid); width: 36px; height: 36px; border-radius: 6px; transition: all 0.2s; }
.btn-close:hover { background: var(--bg); color: var(--primary); }

.review-item { padding: 0.75rem 0; border-bottom: 1px solid var(--border); display: flex; justify-content: space-between; align-items: flex-start; gap: 1rem; }
.review-item:last-child { border-bottom: none; }
.review-question { flex: 1; font-size: 0.95rem; }
.review-answer { font-weight: 600; color: var(--primary); white-space: nowrap; min-width: 100px; text-align: right; font-size: 0.9rem; }

/* ========== LOADING ========== */
.loading-container { display: flex; flex-direction: column; align-items: center; justify-content: center; min-height: 100vh; }
.spinner { width: 50px; height: 50px; border: 4px solid var(--border); border-top-color: var(--primary); border-radius: 50%; animation: spin 1s linear infinite; margin-bottom: 1.5rem; }
@keyframes spin { to { transform: rotate(360deg); } }
.loading-container h2 { color: var(--primary); margin-bottom: 0.5rem; }
.loading-container p { color: var(--text-mid); }

/* ========== RESULTS ========== */
.results-container { max-width: 900px; margin: 0 auto; padding: 2rem 1.5rem; }
.results-header { text-align: center; margin-bottom: 2.5rem; }
.results-header h1 { font-size: 1.8rem; margin-bottom: 0.5rem; }
.results-subtitle { color: var(--text-mid); }

.primary-result { background: var(--card); border-radius: 16px; padding: 2.5rem; box-shadow: 0 4px 16px rgba(0,0,0,0.1); text-align: center; margin-bottom: 2rem; }

.result-badge { display: inline-block; padding: 0.5rem 1.5rem; border-radius: 20px; font-size: 0.875rem; font-weight: 600; margin-bottom: 1rem; color: white; }
.result-type-number { font-size: 4.5rem; font-weight: 800; line-height: 1; margin-bottom: 0.5rem; display: block; }
.result-type-name { font-size: 1.75rem; font-weight: 700; margin-bottom: 0.75rem; color: var(--primary); }
.result-tagline { font-style: italic; color: var(--text-mid); margin-bottom: 1.5rem; font-size: 1.1rem; }
.result-percentage { font-size: 1.25rem; font-weight: 600; color: var(--primary); margin-bottom: 1.5rem; }
.result-description { max-width: 600px; margin: 0 auto; line-height: 1.7; }

.results-details { display: grid; grid-template-columns: 1fr 1fr; gap: 1.5rem; margin-bottom: 2rem; }
.chart-panel, .profile-panel { background: var(--card); border-radius: 12px; padding: 1.5rem; box-shadow: 0 2px 8px rgba(0,0,0,0.08); }
.chart-panel h3, .profile-panel h3 { font-size: 1.1rem; margin-bottom: 1.25rem; color: var(--primary); }

.bar-chart { display: flex; flex-direction: column; gap: 0.6rem; }
.chart-row { display: flex; align-items: center; gap: 0.75rem; }
.chart-label { width: 70px; font-size: 0.875rem; font-weight: 600; text-align: right; flex-shrink: 0; }
.chart-bar-wrapper { flex: 1; height: 22px; background: var(--bg); border-radius: 11px; overflow: hidden; }
.chart-bar { height: 100%; border-radius: 11px; transition: width 1s ease; display: flex; align-items: center; justify-content: flex-end; padding-right: 0.5rem; min-width: 30px; }
.chart-value { font-size: 0.75rem; font-weight: 700; color: white; text-shadow: 0 1px 2px rgba(0,0,0,0.2); }

.wing-info, .growth-stress { margin-bottom: 1.25rem; }
.wing-info:last-child, .growth-stress:last-child { margin-bottom: 0; }
.wing-info h4, .growth-stress h4 { font-size: 0.875rem; color: var(--text-mid); margin-bottom: 0.25rem; text-transform: uppercase; letter-spacing: 0.5px; }
.wing-type, .growth-type, .stress-type { font-weight: 700; font-size: 1.1rem; }

.type-description { background: var(--card); border-radius: 12px; padding: 2rem; box-shadow: 0 2px 8px rgba(0,0,0,0.08); margin-bottom: 2rem; }
.type-description h3 { font-size: 1.3rem; margin-bottom: 1.5rem; color: var(--primary); }
.description-section { margin-bottom: 1.5rem; }
.description-section:last-child { margin-bottom: 0; }
.description-section h4 { font-size: 1rem; margin-bottom: 0.75rem; color: var(--primary); }
.description-section ul { padding-left: 1.25rem; margin-bottom: 0.5rem; }
.description-section li { margin-bottom: 0.4rem; }

.all-types-comparison { background: var(--card); border-radius: 12px; padding: 1.5rem; box-shadow: 0 2px 8px rgba(0,0,0,0.08); margin-bottom: 2rem; overflow-x: auto; }
.all-types-comparison h3 { font-size: 1.1rem; margin-bottom: 1.25rem; color: var(--primary); }
.comparison-table { width: 100%; border-collapse: collapse; font-size: 0.875rem; }
.comparison-table th, .comparison-table td { padding: 0.75rem; text-align: left; border-bottom: 1px solid var(--border); }
.comparison-table th { font-weight: 600; color: var(--text-mid); text-transform: uppercase; font-size: 0.75rem; letter-spacing: 0.5px; background: var(--bg); }
.comparison-table tr:hover { background: var(--bg); }
.type-num-cell { font-weight: 700; width: 50px; }
.score-cell { font-weight: 700; width: 80px; }

.results-actions { display: flex; justify-content: center; gap: 1rem; margin-top: 2rem; padding-top: 2rem; border-top: 2px solid var(--border); }

/* ========== RESPONSIVE ========== */
@media (max-width: 640px) {
    .container, .quiz-container, .results-container { padding: 1rem; }
    .hero h1 { font-size: 1.75rem; }
    .info-cards { grid-template-columns: 1fr; }
    .question-card { padding: 1.5rem; }
    .question-text { font-size: 1.15rem; min-height: 50px; }
    .scale-btn { width: 48px; height: 48px; font-size: 1rem; }
    .results-details { grid-template-columns: 1fr; }
    .primary-result { padding: 1.75rem; }
    .result-type-number { font-size: 3.5rem; }
    .result-type-name { font-size: 1.35rem; }
    .results-actions { flex-direction: column; }
    .results-actions .btn { width: 100%; }
    .modal-content { max-height: 95vh; border-radius: 0; }
}

/* ========== MANUAL SCORES INPUT ========== */
.manual-scores-section {
    margin-top: 3rem;
    padding-top: 2rem;
    border-top: 2px solid var(--border);
}

.manual-scores-header {
    text-align: center;
    cursor: pointer;
    padding: 1rem;
    border-radius: 12px;
    transition: background 0.2s;
    position: relative;
}

.manual-scores-header:hover {
    background: var(--bg);
}

.manual-scores-header h2 {
    font-size: 1.25rem;
    margin-bottom: 0.5rem;
    color: var(--primary);
}

.manual-scores-header p {
    color: var(--text-mid);
    font-size: 0.9rem;
    max-width: 500px;
    margin: 0 auto;
}

.toggle-icon {
    display: block;
    margin-top: 0.75rem;
    font-size: 1rem;
    color: var(--text-mid);
    transition: transform 0.2s;
}

.manual-scores-form {
    display: none;
    padding-top: 1.5rem;
}

.manual-scores-form.active {
    display: block;
}

.manual-scores-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 0.75rem;
    margin-bottom: 1.5rem;
}

.manual-score-row {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    background: var(--bg);
    padding: 0.75rem 1rem;
    border-radius: 10px;
}

.manual-score-label {
    flex: 1;
    font-size: 0.9rem;
    font-weight: 500;
    color: var(--text);
}

.manual-score-row input {
    width: 70px;
    padding: 0.5rem;
    border: 2px solid var(--border);
    border-radius: 8px;
    font-size: 1rem;
    font-weight: 600;
    text-align: center;
    color: var(--primary);
    background: white;
}

.manual-score-row input:focus {
    outline: none;
    border-color: var(--primary);
}

.manual-score-suffix {
    font-size: 0.85rem;
    color: var(--text-mid);
    font-weight: 500;
    width: 20px;
}

.manual-scores-actions {
    display: flex;
    justify-content: center;
    gap: 1rem;
    margin-bottom: 1rem;
}

.manual-scores-hint {
    text-align: center;
    font-size: 0.85rem;
    margin: 0;
    min-height: 1.2rem;
}

/* ========== TYPE CARDS ON HOMEPAGE ========== */
.type-cards-wrapper {
    margin-top: 3rem;
    padding-top: 2rem;
    border-top: 2px solid var(--border);
    text-align: center;
}

.type-cards-wrapper h2 {
    font-size: 1.5rem;
    margin-bottom: 0.5rem;
    color: var(--primary);
}

.type-cards-intro {
    color: var(--text-mid);
    font-size: 0.95rem;
    margin-bottom: 1.5rem;
}

.type-cards-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 1rem;
    text-align: left;
}

.type-card {
    background: var(--card);
    border-radius: 12px;
    padding: 1.25rem;
    box-shadow: 0 2px 8px rgba(0,0,0,0.08);
    cursor: pointer;
    transition: transform 0.2s, box-shadow 0.2s;
    position: relative;
}

.type-card:hover {
    transform: translateY(-4px);
    box-shadow: 0 8px 24px rgba(0,0,0,0.12);
}

.type-card-number {
    font-size: 2.5rem;
    font-weight: 800;
    line-height: 1;
    margin-bottom: 0.5rem;
}

.type-card-name {
    font-size: 1.1rem;
    font-weight: 700;
    color: var(--primary);
    margin-bottom: 0.25rem;
}

.type-card-tagline {
    font-size: 0.8rem;
    font-style: italic;
    color: var(--text-mid);
    margin-bottom: 0.75rem;
}

.type-card-description {
    font-size: 0.85rem;
    color: var(--text);
    line-height: 1.5;
    margin-bottom: 1rem;
}

.type-card-cta {
    font-size: 0.85rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

@media (max-width: 768px) {
    .type-cards-grid { grid-template-columns: repeat(2, 1fr); }
}

@media (max-width: 480px) {
    .type-cards-grid { grid-template-columns: 1fr; }
}

/* ========== NEW ANALYSIS PANELS ========== */
.analysis-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 1.5rem;
    margin-bottom: 1.5rem;
}

.analysis-full {
    background: var(--card);
    border-radius: 12px;
    padding: 1.5rem;
    box-shadow: 0 2px 8px rgba(0,0,0,0.08);
    margin-bottom: 1.5rem;
}

.analysis-panel {
    background: var(--card);
    border-radius: 12px;
    padding: 1.5rem;
    box-shadow: 0 2px 8px rgba(0,0,0,0.08);
}

.analysis-panel h3, .analysis-full h3 {
    font-size: 1.1rem;
    margin-bottom: 0.75rem;
    color: var(--primary);
}

.triad-intro {
    font-size: 0.9rem;
    color: var(--text-mid);
    margin: 0 0 1rem;
    line-height: 1.5;
}

/* Analysis detail sections */
.detail-section { margin-bottom: 1.25rem; }
.detail-section:last-child { margin-bottom: 0; }
.detail-section h4 { font-size: 0.95rem; margin-bottom: 0.5rem; color: var(--primary); }
.detail-section p { margin: 0; }
.detail-section ul { padding-left: 1.25rem; margin: 0.25rem 0; }
.detail-section li { margin-bottom: 0.35rem; font-size: 0.9rem; }

/* Health banner */
.health-banner { margin-bottom: 1.5rem; }
.health-banner p { margin: 0; }

/* Confidence indicator */
.confidence-indicator {
    font-size: 0.9rem;
    color: var(--text-mid);
    margin-top: 1.25rem;
    padding-top: 1rem;
    border-top: 1px solid var(--border);
}

/* Tritype */
.tritype-display { align-items: center; }

.tritype-box {
    cursor: pointer;
    padding: 0.75rem;
    border-radius: 12px;
    transition: transform 0.2s, box-shadow 0.2s, background 0.2s;
    position: relative;
}

.tritype-box:hover {
    transform: translateY(-4px);
    box-shadow: 0 8px 24px rgba(0,0,0,0.12);
    background: var(--bg);
}

.tritype-box.tritype-primary {
    cursor: default;
}

.tritype-box.tritype-primary:hover {
    transform: none;
    box-shadow: none;
    background: transparent;
}

.tritype-circle {
    position: relative;
    transition: transform 0.2s;
}

.tritype-box:hover .tritype-circle {
    transform: scale(1.05);
}

/* Modal large variant */
.modal-content.modal-large {
    max-width: 800px;
}

/* Center analysis */
.center-dominant { margin: 1rem 0; }
.center-bars { display: flex; flex-direction: column; gap: 0.5rem; margin-top: 1rem; }

/* Inline tritype profiles (for print) */
.tritype-inline-profile {
    page-break-inside: avoid;
    margin-bottom: 1.5rem;
}

/* Responsive analysis panels */
@media (max-width: 768px) {
    .analysis-row { grid-template-columns: 1fr; }
    .tritype-display { gap: 1rem; }
    .modal-content.modal-large { max-width: 95vw; }
}

@media print {
    /* MQ-0001 YA - Print only results page */
    #landing-page, #quiz-section, #loading-section { display: none !important; }
    #results-section { display: block !important; }
    
    .results-actions, .quiz-footer, .quiz-header, .btn-text { display: none !important; }
    body { background: white; }
    .results-container { max-width: 100%; padding: 0; }
    .primary-result, .chart-panel, .profile-panel, .type-description,
    .analysis-panel, .analysis-full { box-shadow: none; border: 1px solid var(--border); }
    .modal { display: none !important; }
}
