/* PHQ-9 Depression Screener Styles */

.phq9-container {
    max-width: 800px;
    margin: 0 auto;
    padding: 20px;
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
}

.phq9-section {
    background: white;
    padding: 30px;
    border-radius: 10px;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
    margin-bottom: 20px;
}

/* Disclaimer */
.phq9-disclaimer {
    background-color: #F7FAFC;
    border: 1px solid #E2E8F0;
    padding: 1rem;
    border-radius: 10px;
    margin-bottom: 2rem;
    font-size: 0.9rem;
    color: #2D3748;
}

/* Typography */
.phq9-container h2 {
    color: #2C5282;
    margin-bottom: 10px;
}

.phq9-container h3 {
    color: #2D3748;
    margin-bottom: 20px;
}

.phq9-container h4 {
    color: #4A5568;
    margin-bottom: 10px;
}

/* Buttons */
.phq9-btn {
    padding: 12px 24px;
    border: none;
    border-radius: 5px;
    font-size: 16px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    text-align: center;
    display: inline-block;
}

.phq9-btn-primary {
    background-color: #319795;
    color: white;
}

.phq9-btn-primary:hover:not(:disabled) {
    background-color: #2C5282;
    transform: translateY(-1px);
}

.phq9-btn-secondary {
    background-color: #E2E8F0;
    color: #2D3748;
}

.phq9-btn-secondary:hover:not(:disabled) {
    background-color: #CBD5E0;
}

.phq9-btn:disabled {
    opacity: 0.6;
    cursor: not-allowed;
}

/* Questions */
.phq9-question-block {
    margin-bottom: 25px;
    padding: 20px;
    background: #F7FAFC;
    border-radius: 8px;
    border: 1px solid #E2E8F0;
}

.phq9-question-text {
    font-weight: 500;
    margin-bottom: 15px;
    color: #2D3748;
    font-size: 1.05em;
}

.phq9-radio-group {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 10px;
}

.phq9-radio-label {
    display: flex;
    align-items: center;
    padding: 10px 15px;
    background: white;
    border: 2px solid #E2E8F0;
    border-radius: 5px;
    cursor: pointer;
    transition: all 0.2s ease;
}

.phq9-radio-label:hover {
    border-color: #319795;
    background: #F0FDFA;
}

.phq9-radio-label input[type="radio"] {
    margin-right: 8px;
}

.phq9-radio-label input[type="radio"]:checked + .radio-text {
    font-weight: 600;
}

.phq9-radio-label:has(input[type="radio"]:checked) {
    border-color: #319795;
    background: #E6FFFA;
}

/* Functional Impact Section */
.phq9-functional {
    background: #FEF5E7;
    border: 1px solid #FDEBD0;
    margin-top: 30px;
}

/* Results Section */
.phq9-score-display {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 20px;
    margin-bottom: 30px;
}

.phq9-metric {
    background: #F7FAFC;
    padding: 20px;
    border-radius: 10px;
    text-align: center;
    border: 1px solid #E2E8F0;
}

.metric-label {
    display: block;
    font-size: 0.9em;
    color: #718096;
    margin-bottom: 10px;
}

.metric-value {
    display: inline-block;
    font-size: 2.5em;
    font-weight: 700;
    color: #2C5282;
}

.metric-range {
    font-size: 1.2em;
    color: #718096;
}

/* Severity Boxes */
.phq9-severity-box > div {
    padding: 20px;
    border-radius: 10px;
    margin-bottom: 20px;
}

.severity-minimal {
    background-color: #C6F6D5;
    color: #22543D;
    border: 1px solid #9AE6B4;
}

.severity-mild {
    background-color: #BEE3F8;
    color: #2A4E7C;
    border: 1px solid #90CDF4;
}

.severity-moderate {
    background-color: #FEFCBF;
    color: #744210;
    border: 1px solid #FAF089;
}

.severity-moderately-severe {
    background-color: #FED7AA;
    color: #7B341E;
    border: 1px solid #FDBA74;
}

.severity-severe {
    background-color: #FEB2B2;
    color: #742A2A;
    border: 1px solid #FC8181;
}

/* Crisis Alert */
.phq9-crisis-alert {
    background-color: #FFF5F5;
    border: 2px solid #FC8181;
    padding: 20px;
    border-radius: 10px;
    margin: 20px 0;
}

.phq9-crisis-alert h4 {
    color: #C53030;
    margin-top: 0;
}

.phq9-crisis-alert ul {
    list-style: none;
    padding: 0;
}

.phq9-crisis-alert li {
    margin: 10px 0;
    padding-left: 20px;
}

/* Chart Container */
.phq9-chart-container {
    background: #F7FAFC;
    padding: 20px;
    border-radius: 10px;
    margin: 20px 0;
    height: 400px;
}

#phq9-chart {
    max-height: 350px;
}

/* Details Section */
.phq9-details {
    margin: 20px 0;
    background: #F7FAFC;
    padding: 20px;
    border-radius: 10px;
}

.phq9-details summary {
    cursor: pointer;
    font-weight: 600;
    color: #2C5282;
    padding: 10px;
    background: white;
    border-radius: 5px;
}

.phq9-details summary:hover {
    background: #E6FFFA;
}

/* Tables */
.phq9-table,
.phq9-responses-table,
.phq9-history-table {
    width: 100%;
    border-collapse: collapse;
    margin-top: 20px;
}

.phq9-table th,
.phq9-table td,
.phq9-responses-table th,
.phq9-responses-table td,
.phq9-history-table th,
.phq9-history-table td {
    padding: 12px;
    text-align: left;
    border-bottom: 1px solid #E2E8F0;
}

.phq9-table th,
.phq9-responses-table th,
.phq9-history-table th {
    background: #F7FAFC;
    font-weight: 600;
    color: #2D3748;
}

.phq9-table tr.severity-minimal td {
    background-color: rgba(198, 246, 213, 0.3);
}

.phq9-table tr.severity-mild td {
    background-color: rgba(190, 227, 248, 0.3);
}

.phq9-table tr.severity-moderate td {
    background-color: rgba(254, 252, 191, 0.3);
}

.phq9-table tr.severity-moderately-severe td {
    background-color: rgba(254, 215, 170, 0.3);
}

.phq9-table tr.severity-severe td {
    background-color: rgba(254, 178, 178, 0.3);
}

.highlight-row {
    background-color: #FFF5F5 !important;
}

.highlight-row td {
    color: #C53030;
    font-weight: 500;
}

/* Resources */
.phq9-resources {
    margin-top: 30px;
}

.phq9-info-box {
    background: #EDF2F7;
    padding: 20px;
    border-radius: 10px;
    margin-top: 20px;
}

.phq9-info-box h4 {
    margin-top: 0;
    color: #2C5282;
}

.phq9-info-box ul {
    margin: 10px 0;
    padding-left: 25px;
}

.phq9-info-box li {
    margin: 5px 0;
}

/* Actions */
.phq9-actions {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 15px;
    margin-top: 30px;
}

/* Severity Badges */
.severity-badge,
.phq9-severity-badge {
    display: inline-block;
    padding: 4px 12px;
    border-radius: 15px;
    font-size: 0.85em;
    font-weight: 600;
}

.severity-badge.severity-minimal,
.phq9-severity-badge.severity-minimal {
    background: #C6F6D5;
    color: #22543D;
}

.severity-badge.severity-mild,
.phq9-severity-badge.severity-mild {
    background: #BEE3F8;
    color: #2A4E7C;
}

.severity-badge.severity-moderate,
.phq9-severity-badge.severity-moderate {
    background: #FEFCBF;
    color: #744210;
}

.severity-badge.severity-moderately-severe,
.phq9-severity-badge.severity-moderately-severe {
    background: #FED7AA;
    color: #7B341E;
}

.severity-badge.severity-severe,
.phq9-severity-badge.severity-severe {
    background: #FEB2B2;
    color: #742A2A;
}

/* Responsive Design */
@media (max-width: 768px) {
    .phq9-container {
        padding: 10px;
    }
    
    .phq9-section {
        padding: 20px;
    }
    
    .phq9-radio-group {
        grid-template-columns: 1fr;
    }
    
    .phq9-score-display {
        grid-template-columns: 1fr;
    }
    
    .phq9-actions {
        grid-template-columns: 1fr;
    }
    
    .phq9-table {
        font-size: 0.9em;
    }
}

/* Print Styles */
@media print {
    .phq9-btn,
    .phq9-actions,
    .phq9-details summary {
        display: none;
    }
    
    .phq9-details[open] > *:not(summary) {
        display: block !important;
    }
    
    .phq9-container {
        max-width: 100%;
    }
    
    .phq9-chart-container {
        page-break-inside: avoid;
    }
}