/* PHQ-9 Depression Calculator Styles */
.phq9-calculator-container {
    max-width: 1000px;
    margin: 0 auto;
    padding: 20px;
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    color: #333;
    line-height: 1.7;
}

/* Crisis Banner */
.crisis-banner {
    background: linear-gradient(135deg, #fff3cd 0%, #ffe6e6 100%);
    border-left: 5px solid #dc3545;
    padding: 25px;
    margin: 20px 0;
    border-radius: 12px;
    box-shadow: 0 4px 15px rgba(220, 53, 69, 0.15);
}

.crisis-header {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 12px;
}

.crisis-icon {
    font-size: 1.8em;
}

.crisis-header h3 {
    margin: 0;
    color: #dc3545;
    font-size: 1.4em;
}

.crisis-banner p {
    margin: 0 0 15px 0;
    color: #721c24;
}

.crisis-contacts {
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
}

.crisis-link {
    background: white;
    padding: 12px 18px;
    border-radius: 8px;
    text-decoration: none;
    color: #333;
    border: 2px solid #ddd;
    transition: all 0.3s ease;
    font-size: 0.95em;
}

.crisis-link:hover {
    border-color: #dc3545;
    box-shadow: 0 3px 10px rgba(0,0,0,0.1);
    transform: translateY(-2px);
}

.crisis-link.primary {
    background: #dc3545;
    color: white;
    border-color: #dc3545;
}

.crisis-link.primary:hover {
    background: #c82333;
}

.results-crisis {
    margin-top: 30px;
    padding: 20px;
}

.results-crisis h4 {
    margin: 0 0 10px 0;
    color: #dc3545;
}

.results-crisis a {
    color: #dc3545;
    font-weight: 600;
}

/* Hero Section */
.calc-hero {
    text-align: center;
    padding: 50px 30px;
    background: linear-gradient(135deg, #5e60ce 0%, #6930c3 50%, #7400b8 100%);
    color: white;
    border-radius: 16px;
    margin-bottom: 30px;
    box-shadow: 0 8px 30px rgba(105, 48, 195, 0.3);
}

.calc-hero h2 {
    font-size: 2.4em;
    margin: 0 0 15px 0;
    font-weight: 700;
}

.calc-subtitle {
    font-size: 1.15em;
    max-width: 800px;
    margin: 0 auto 10px;
    opacity: 0.95;
}

.last-updated {
    font-size: 0.9em;
    opacity: 0.8;
    margin: 0;
}

/* Introduction Section */
.intro-section {
    background: white;
    border-radius: 12px;
    box-shadow: 0 4px 20px rgba(0,0,0,0.08);
    padding: 35px;
    margin-bottom: 30px;
}

.intro-section h3 {
    color: #5e60ce;
    margin-top: 0;
}

.intro-section ul {
    margin: 15px 0;
    padding-left: 25px;
}

.intro-section li {
    margin-bottom: 8px;
}

/* Info/Warning Boxes */
.info-box, .warning-box {
    padding: 20px 25px;
    border-radius: 10px;
    margin: 25px 0;
}

.info-box {
    background: #e8f4fd;
    border-left: 5px solid #0077cc;
}

.warning-box {
    background: #fff8e6;
    border-left: 5px solid #f0a500;
}

.info-box h4, .info-box h5,
.warning-box h4, .warning-box h5 {
    margin-top: 0;
    margin-bottom: 12px;
}

.info-box p:last-child,
.warning-box p:last-child {
    margin-bottom: 0;
}

/* Calculator Section */
.calc-section {
    background: white;
    border-radius: 16px;
    box-shadow: 0 4px 25px rgba(0,0,0,0.1);
    padding: 40px;
    margin-bottom: 30px;
}

.calc-section h3 {
    text-align: center;
    color: #333;
    margin-bottom: 10px;
}

.instruction {
    text-align: center;
    font-size: 1.1em;
    color: #555;
    margin-bottom: 30px;
}

/* Questions */
.question-container {
    max-width: 800px;
    margin: 0 auto;
}

.question {
    background: #f8f9fa;
    padding: 25px;
    border-radius: 12px;
    margin-bottom: 20px;
    border: 2px solid transparent;
    transition: all 0.3s ease;
}

.question:hover {
    border-color: #e0e0e0;
}

.question-9 {
    background: #fff8f8;
    border-color: #ffcccc;
}

.question-text {
    font-weight: 600;
    margin-bottom: 8px;
    font-size: 1.05em;
    color: #333;
}

.q-number {
    color: #5e60ce;
    margin-right: 8px;
    font-weight: 700;
}

.question-hint {
    font-size: 0.9em;
    color: #666;
    margin-bottom: 18px;
    font-style: italic;
}

.options {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
    gap: 12px;
}

.options label {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 14px 18px;
    background: white;
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.2s ease;
    border: 2px solid #e0e0e0;
    font-size: 0.95em;
}

.options label:hover {
    border-color: #5e60ce;
    background: #f8f6ff;
}

.options label:has(input:checked) {
    border-color: #5e60ce;
    background: #f0ebff;
}

.options input[type="radio"] {
    accent-color: #5e60ce;
    width: 18px;
    height: 18px;
}

.options input:checked + span {
    font-weight: 600;
    color: #5e60ce;
}

.q9-warning {
    margin-top: 18px;
    padding: 15px 18px;
    background: #ffe6e6;
    border-radius: 8px;
    color: #dc3545;
    font-size: 0.95em;
    border: 1px solid #ffcccc;
}

/* Calculate Button */
.calc-btn {
    display: block;
    width: 100%;
    max-width: 400px;
    margin: 30px auto 0;
    padding: 18px 35px;
    font-size: 1.2em;
    font-weight: 700;
    color: white;
    background: linear-gradient(135deg, #5e60ce 0%, #6930c3 100%);
    border: none;
    border-radius: 12px;
    cursor: pointer;
    transition: all 0.3s ease;
    box-shadow: 0 4px 15px rgba(105, 48, 195, 0.3);
}

.calc-btn:hover {
    transform: translateY(-3px);
    box-shadow: 0 8px 25px rgba(105, 48, 195, 0.4);
}

.calc-btn:active {
    transform: translateY(-1px);
}

/* Results Section */
.results-section {
    background: linear-gradient(135deg, #f8f9fa 0%, #ffffff 100%);
    padding: 35px;
    border-radius: 16px;
    margin-top: 30px;
    border: 2px solid #e0e0e0;
}

.results-section h3 {
    text-align: center;
    margin-bottom: 25px;
}

.score-display {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 40px;
    flex-wrap: wrap;
    margin: 30px 0;
}

.score-circle {
    width: 140px;
    height: 140px;
    border-radius: 50%;
    background: linear-gradient(135deg, #5e60ce 0%, #6930c3 100%);
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    box-shadow: 0 8px 25px rgba(105, 48, 195, 0.3);
}

#score-value {
    font-size: 3em;
    font-weight: 800;
    color: white;
}

.score-label {
    font-size: 0.9em;
    color: rgba(255,255,255,0.9);
}

.severity-badge {
    padding: 18px 35px;
    border-radius: 50px;
    font-weight: 700;
    font-size: 1.15em;
    text-align: center;
}

.severity-minimal { background: #d4edda; color: #155724; }
.severity-mild { background: #fff3cd; color: #856404; }
.severity-moderate { background: #ffe5d0; color: #8a4500; }
.severity-mod-severe { background: #f8d7da; color: #721c24; }
.severity-severe { background: #dc3545; color: white; }

.interpretation {
    padding: 25px;
    background: white;
    border-radius: 12px;
    margin: 25px 0;
    border-left: 4px solid #5e60ce;
}

.next-steps {
    padding: 25px;
    background: #e8f4fd;
    border-radius: 12px;
}

.next-steps h4 {
    margin-top: 0;
    color: #0077cc;
}

.next-steps ul {
    margin-bottom: 0;
}

.next-steps a {
    color: #0077cc;
}

/* Score Chart */
.education-section {
    background: white;
    border-radius: 12px;
    box-shadow: 0 4px 20px rgba(0,0,0,0.08);
    padding: 35px;
    margin-bottom: 30px;
}

.education-section h3 {
    color: #5e60ce;
    margin-top: 0;
    margin-bottom: 20px;
}

.score-chart {
    margin: 30px 0;
}

.chart-row {
    display: grid;
    grid-template-columns: 80px 180px 1fr auto;
    gap: 20px;
    padding: 18px 20px;
    border-radius: 10px;
    margin-bottom: 12px;
    align-items: center;
}

.chart-score {
    font-weight: 800;
    font-size: 1.2em;
}

.chart-severity {
    font-weight: 700;
}

.chart-description {
    font-size: 0.95em;
}

.chart-action {
    font-size: 0.85em;
    font-style: italic;
    max-width: 200px;
}

.chart-row.minimal { background: #d4edda; }
.chart-row.mild { background: #fff3cd; }
.chart-row.moderate { background: #ffe5d0; }
.chart-row.mod-severe { background: #f8d7da; }
.chart-row.severe { background: #f5c6cb; }

/* Educational Tabs */
.calc-education {
    background: white;
    border-radius: 12px;
    box-shadow: 0 4px 20px rgba(0,0,0,0.08);
    padding: 35px;
    margin-bottom: 30px;
}

.education-tabs {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-bottom: 30px;
    border-bottom: 2px solid #e0e0e0;
    padding-bottom: 15px;
}

.tab-btn {
    padding: 12px 20px;
    background: #f8f9fa;
    border: 2px solid #e0e0e0;
    border-radius: 8px;
    font-weight: 600;
    color: #666;
    cursor: pointer;
    transition: all 0.3s ease;
}

.tab-btn:hover {
    background: #e9ecef;
    border-color: #5e60ce;
}

.tab-btn.active {
    background: #5e60ce;
    color: white;
    border-color: #5e60ce;
}

.tab-content {
    display: none;
}

.tab-content.active {
    display: block;
}

.tab-content h4 {
    color: #5e60ce;
    margin-top: 0;
}

.tab-content h5 {
    color: #333;
    margin-top: 25px;
}

/* Stats Box */
.stat-box {
    background: #f8f6ff;
    padding: 25px;
    border-radius: 12px;
    margin: 25px 0;
}

.stat-box h5 {
    margin-top: 0;
    color: #5e60ce;
}

.stat-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
    gap: 20px;
    margin-top: 15px;
}

.stat-item {
    text-align: center;
}

.stat-number {
    display: block;
    font-size: 2.2em;
    font-weight: 800;
    color: #5e60ce;
}

.stat-label {
    font-size: 0.85em;
    color: #666;
}

/* Symptoms Grid */
.symptoms-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 20px;
    margin: 25px 0;
}

.symptom-card {
    background: #f8f9fa;
    padding: 25px;
    border-radius: 12px;
    border-left: 4px solid #5e60ce;
}

.symptom-card h5 {
    margin-top: 0;
    color: #333;
}

.symptom-card ul {
    margin: 0;
    padding-left: 20px;
}

.symptom-card li {
    margin-bottom: 6px;
}

/* Causes Grid */
.causes-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 20px;
    margin: 25px 0;
}

.cause-card {
    background: #f8f9fa;
    padding: 25px;
    border-radius: 12px;
}

.cause-card h5 {
    margin-top: 0;
    color: #5e60ce;
}

/* Treatment Section */
.treatment-section {
    margin: 30px 0;
    padding: 25px;
    background: #f8f9fa;
    border-radius: 12px;
}

.treatment-section h5 {
    margin-top: 0;
    color: #5e60ce;
    font-size: 1.2em;
}

.treatment-options {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 15px;
    margin-top: 20px;
}

.treatment-card {
    background: white;
    padding: 20px;
    border-radius: 10px;
    border: 1px solid #e0e0e0;
}

.treatment-card h6 {
    margin: 0 0 10px 0;
    color: #333;
    font-size: 1em;
}

.treatment-card p {
    margin: 0;
    font-size: 0.9em;
    color: #555;
}

/* Comparison Table */
.comparison-table {
    width: 100%;
    border-collapse: collapse;
    margin: 20px 0;
}

.comparison-table th,
.comparison-table td {
    padding: 12px 15px;
    text-align: left;
    border-bottom: 1px solid #e0e0e0;
}

.comparison-table th {
    background: #5e60ce;
    color: white;
}

.comparison-table tr:hover {
    background: #f8f9fa;
}

/* FAQ Section */
.faq-section {
    background: white;
    border-radius: 12px;
    box-shadow: 0 4px 20px rgba(0,0,0,0.08);
    padding: 35px;
    margin-bottom: 30px;
}

.faq-section h3 {
    color: #5e60ce;
    margin-top: 0;
    margin-bottom: 25px;
}

.faq-item {
    margin-bottom: 12px;
    border: 2px solid #e0e0e0;
    border-radius: 10px;
    overflow: hidden;
}

.faq-question {
    width: 100%;
    padding: 18px 22px;
    background: #f8f9fa;
    border: none;
    cursor: pointer;
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-size: 1em;
    font-weight: 600;
    text-align: left;
    transition: all 0.3s ease;
}

.faq-question:hover {
    background: #e9ecef;
}

.faq-question.active {
    background: #5e60ce;
    color: white;
}

.faq-icon {
    font-size: 1.5em;
    font-weight: 300;
    transition: transform 0.3s ease;
}

.faq-question.active .faq-icon {
    transform: rotate(45deg);
}

.faq-answer {
    display: none;
    padding: 20px 22px;
    background: white;
    border-top: 1px solid #e0e0e0;
}

.faq-answer.active {
    display: block;
}

.faq-answer ul {
    margin: 10px 0;
    padding-left: 20px;
}

.faq-answer a {
    color: #5e60ce;
}

/* Related Section */
.related-section {
    background: white;
    border-radius: 12px;
    box-shadow: 0 4px 20px rgba(0,0,0,0.08);
    padding: 35px;
    margin-bottom: 30px;
}

.related-section h3 {
    color: #5e60ce;
    margin-top: 0;
}

.related-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
    gap: 20px;
    margin-top: 25px;
}

.related-card {
    display: flex;
    flex-direction: column;
    align-items: center;
    padding: 30px 20px;
    background: #f8f9fa;
    border-radius: 12px;
    text-decoration: none;
    color: #333;
    text-align: center;
    transition: all 0.3s ease;
    border: 2px solid transparent;
}

.related-card:hover {
    border-color: #5e60ce;
    transform: translateY(-5px);
    box-shadow: 0 8px 25px rgba(0,0,0,0.1);
}

.related-icon {
    font-size: 2.5em;
    margin-bottom: 15px;
}

.related-title {
    font-weight: 700;
    margin-bottom: 8px;
    color: #5e60ce;
}

.related-desc {
    font-size: 0.9em;
    color: #666;
}

/* Sources Section */
.calc-sources {
    background: #f8f9fa;
    border-radius: 12px;
    padding: 35px;
    margin-bottom: 30px;
}

.calc-sources h3 {
    color: #5e60ce;
    margin-top: 0;
}

.calc-sources h4 {
    margin-top: 25px;
    margin-bottom: 15px;
    color: #333;
}

.calc-sources ol {
    padding-left: 25px;
}

.calc-sources li {
    margin-bottom: 12px;
    line-height: 1.6;
}

.calc-sources a {
    color: #5e60ce;
}

/* Disclaimer Section */
.calc-disclaimer {
    background: linear-gradient(135deg, #fff3cd 0%, #fff8e6 100%);
    border: 2px solid #f0a500;
    border-radius: 12px;
    padding: 35px;
    margin-bottom: 30px;
}

.calc-disclaimer h3 {
    color: #856404;
    margin-top: 0;
}

.calc-disclaimer p,
.calc-disclaimer li {
    color: #6c5a00;
}

.calc-disclaimer ul {
    padding-left: 25px;
}

/* Responsive Design */
@media (max-width: 768px) {
    .calc-hero h2 {
        font-size: 1.8em;
    }

    .calc-hero {
        padding: 35px 20px;
    }

    .calc-section,
    .intro-section,
    .education-section,
    .calc-education,
    .faq-section,
    .related-section,
    .calc-sources,
    .calc-disclaimer {
        padding: 25px 20px;
    }

    .options {
        grid-template-columns: 1fr;
    }

    .chart-row {
        grid-template-columns: 1fr;
        text-align: center;
        gap: 10px;
    }

    .chart-action {
        max-width: 100%;
    }

    .score-display {
        flex-direction: column;
        gap: 25px;
    }

    .crisis-contacts {
        flex-direction: column;
    }

    .education-tabs {
        flex-direction: column;
    }

    .tab-btn {
        width: 100%;
        text-align: center;
    }

    .stat-grid {
        grid-template-columns: 1fr;
    }

    .symptoms-grid,
    .causes-grid,
    .treatment-options {
        grid-template-columns: 1fr;
    }

    .related-grid {
        grid-template-columns: 1fr 1fr;
    }
}

@media (max-width: 480px) {
    .related-grid {
        grid-template-columns: 1fr;
    }

    .comparison-table {
        font-size: 0.85em;
    }

    .comparison-table th,
    .comparison-table td {
        padding: 8px 10px;
    }
}
