/* ============================================
   EPDS Calculator - Soft Teal Theme
   Primary: #0d9488  Gradient to: #0f766e
   ============================================ */

/* Container */
.epds-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;
}

/* ============================================
   HERO SECTION
   ============================================ */
.epds-hero {
    text-align: center;
    padding: 50px 30px;
    background: linear-gradient(135deg, #0d9488 0%, #0f766e 100%);
    color: white;
    border-radius: 16px;
    margin-bottom: 30px;
    box-shadow: 0 8px 30px rgba(13, 148, 136, 0.3);
}

.epds-hero h1 {
    font-size: 2.4em;
    margin: 0 0 15px 0;
    font-weight: 700;
    color: white;
}

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

.hero-badges {
    display: flex;
    justify-content: center;
    flex-wrap: wrap;
    gap: 12px;
    margin-top: 20px;
}

.hero-badges .badge {
    background: rgba(255, 255, 255, 0.2);
    border: 1px solid rgba(255, 255, 255, 0.4);
    padding: 8px 18px;
    border-radius: 50px;
    font-size: 0.9em;
    font-weight: 600;
    backdrop-filter: blur(4px);
}

/* ============================================
   STATS SECTION
   ============================================ */
.epds-stats {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 20px;
    margin-bottom: 30px;
}

.stat-card {
    background: white;
    border-radius: 12px;
    padding: 25px 20px;
    text-align: center;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.08);
    border-top: 4px solid #0d9488;
    transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.stat-card:hover {
    transform: translateY(-3px);
    box-shadow: 0 8px 25px rgba(0, 0, 0, 0.12);
}

.stat-card .stat-number {
    display: block;
    font-size: 2em;
    font-weight: 800;
    color: #0d9488;
    margin-bottom: 5px;
}

.stat-card .stat-label {
    display: block;
    font-size: 0.9em;
    color: #666;
    font-weight: 500;
}

/* ============================================
   PRIVACY NOTICE
   ============================================ */
.epds-privacy-notice {
    background: #f0fdfa;
    border: 1px solid #99f6e4;
    border-left: 4px solid #0d9488;
    padding: 16px 22px;
    border-radius: 8px;
    margin-bottom: 30px;
    font-size: 0.95em;
    color: #134e4a;
}

/* ============================================
   FORM SECTION
   ============================================ */
.epds-form-section {
    background: white;
    border-radius: 16px;
    box-shadow: 0 4px 25px rgba(0, 0, 0, 0.1);
    padding: 40px;
    margin-bottom: 30px;
}

.epds-form-section h2 {
    text-align: center;
    color: #0f766e;
    margin: 0 0 10px 0;
    font-size: 1.6em;
}

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

/* Progress Bar (injected by JS via shared) */
.mdcv2-progress-wrapper {
    background: #f0fdfa;
    border-radius: 10px;
    padding: 15px 20px;
    margin-bottom: 25px;
}

.mdcv2-progress-text {
    font-size: 0.9em;
    color: #0f766e;
    font-weight: 600;
    margin-bottom: 8px;
}

.mdcv2-progress-bar {
    height: 8px;
    background: #e0f2fe;
    border-radius: 4px;
    overflow: hidden;
}

.mdcv2-progress-fill {
    height: 100%;
    background: linear-gradient(90deg, #0d9488, #0f766e);
    border-radius: 4px;
    transition: width 0.4s ease;
}

/* Questions */
.epds-question {
    background: #f8fffe;
    padding: 25px;
    border-radius: 12px;
    margin-bottom: 18px;
    border: 2px solid transparent;
    transition: all 0.3s ease;
}

.epds-question:hover {
    border-color: #ccfbf1;
}

.epds-question.answered {
    border-color: #99f6e4;
    background: #f0fdfa;
}

.question-text {
    font-weight: 600;
    margin: 0 0 15px 0;
    font-size: 1.05em;
    color: #333;
    line-height: 1.5;
}

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

/* Question 10 - Safety Question Styling */
.epds-question-10 {
    background: #fff8f8;
    border-color: #fecaca;
}

.epds-question-10:hover {
    border-color: #fca5a5;
}

/* Radio Options */
.epds-question .options {
    display: grid;
    grid-template-columns: 1fr;
    gap: 10px;
}

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

.epds-question .options label:hover {
    border-color: #0d9488;
    background: #f0fdfa;
}

.epds-question .options label:has(input:checked) {
    border-color: #0d9488;
    background: #f0fdfa;
}

.epds-question .options input[type="radio"] {
    accent-color: #0d9488;
    width: 18px;
    height: 18px;
    flex-shrink: 0;
}

.epds-question .options input:checked + span {
    font-weight: 600;
    color: #0f766e;
}

/* Q10 Crisis Warning (inline, shown on selection) */
.q10-crisis-warning {
    margin-top: 18px;
    padding: 18px 20px;
    background: #fef2f2;
    border: 2px solid #ef4444;
    border-radius: 10px;
    color: #991b1b;
    font-size: 0.95em;
    line-height: 1.6;
}

.q10-crisis-links {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    margin-top: 12px;
}

.q10-crisis-links a {
    display: inline-block;
    background: #ef4444;
    color: white;
    padding: 8px 16px;
    border-radius: 6px;
    text-decoration: none;
    font-weight: 600;
    font-size: 0.9em;
    transition: background 0.2s ease;
}

.q10-crisis-links a:hover {
    background: #dc2626;
}

/* Submit Button */
.epds-submit-btn {
    display: block;
    width: 100%;
    max-width: 420px;
    margin: 30px auto 0;
    padding: 18px 35px;
    font-size: 1.2em;
    font-weight: 700;
    color: white;
    background: linear-gradient(135deg, #0d9488 0%, #0f766e 100%);
    border: none;
    border-radius: 12px;
    cursor: pointer;
    transition: all 0.3s ease;
    box-shadow: 0 4px 15px rgba(13, 148, 136, 0.3);
}

.epds-submit-btn:hover {
    transform: translateY(-3px);
    box-shadow: 0 8px 25px rgba(13, 148, 136, 0.4);
}

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

.epds-submit-btn:disabled {
    opacity: 0.6;
    cursor: not-allowed;
    transform: none;
}

/* ============================================
   RESULTS SECTION
   ============================================ */
.epds-results-section {
    background: linear-gradient(135deg, #f8fffe 0%, #ffffff 100%);
    padding: 40px;
    border-radius: 16px;
    margin-bottom: 30px;
    border: 2px solid #ccfbf1;
    box-shadow: 0 4px 25px rgba(0, 0, 0, 0.08);
}

.epds-results-section h3 {
    text-align: center;
    color: #0f766e;
    margin-bottom: 25px;
}

/* Crisis Box (shown FIRST if Q10 > 0) */
.epds-crisis-box {
    background: #fef2f2;
    border: 3px solid #ef4444;
    border-radius: 12px;
    padding: 30px;
    margin-bottom: 30px;
    box-shadow: 0 4px 20px rgba(239, 68, 68, 0.15);
}

.epds-crisis-box h3 {
    color: #991b1b;
    margin: 0 0 15px 0;
    text-align: left;
}

.epds-crisis-box p {
    color: #7f1d1d;
    margin: 0 0 15px 0;
}

.crisis-contacts {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
    gap: 12px;
    margin: 20px 0;
}

.crisis-contact {
    display: block;
    background: white;
    padding: 18px 20px;
    border-radius: 10px;
    text-decoration: none;
    color: #333;
    border: 2px solid #fecaca;
    transition: all 0.3s ease;
    text-align: center;
}

.crisis-contact:hover {
    border-color: #ef4444;
    box-shadow: 0 4px 15px rgba(239, 68, 68, 0.15);
    transform: translateY(-2px);
}

.crisis-contact.primary {
    background: #ef4444;
    color: white;
    border-color: #ef4444;
}

.crisis-contact.primary:hover {
    background: #dc2626;
}

.crisis-contact strong {
    display: block;
    font-size: 1.1em;
    margin-bottom: 4px;
}

.crisis-contact small {
    font-size: 0.85em;
    opacity: 0.85;
}

.crisis-note {
    font-weight: 600;
    margin-top: 15px;
    font-size: 0.95em;
}

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

.epds-score-circle {
    width: 140px;
    height: 140px;
    border-radius: 50%;
    background: linear-gradient(135deg, #0d9488 0%, #0f766e 100%);
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    box-shadow: 0 8px 25px rgba(13, 148, 136, 0.3);
}

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

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

.epds-severity-badge {
    padding: 18px 35px;
    border-radius: 50px;
    font-weight: 700;
    font-size: 1.1em;
    text-align: center;
    max-width: 400px;
}

/* Severity Classes */
.severity-green {
    background: #d1fae5;
    color: #065f46;
}

.severity-yellow {
    background: #fef3c7;
    color: #92400e;
}

.severity-orange {
    background: #ffedd5;
    color: #9a3412;
}

.severity-red {
    background: #fee2e2;
    color: #991b1b;
}

/* Score Bar Visual */
.epds-score-bar {
    position: relative;
    display: flex;
    height: 30px;
    border-radius: 15px;
    overflow: visible;
    margin: 25px 0 5px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}

.bar-segment {
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.75em;
    font-weight: 700;
    color: white;
}

.bar-segment:first-child {
    border-radius: 15px 0 0 15px;
}

.bar-segment:last-child {
    border-radius: 0 15px 15px 0;
}

.bar-segment span {
    opacity: 0.9;
}

.bar-green {
    background: #10b981;
}

.bar-yellow {
    background: #f59e0b;
}

.bar-orange {
    background: #f97316;
}

.bar-red {
    background: #ef4444;
}

.score-marker {
    position: absolute;
    top: -8px;
    width: 4px;
    height: 46px;
    background: #1e293b;
    border-radius: 2px;
    transition: left 0.6s ease;
    z-index: 2;
    box-shadow: 0 0 6px rgba(0, 0, 0, 0.3);
}

.score-marker::after {
    content: '';
    position: absolute;
    top: -6px;
    left: -4px;
    width: 12px;
    height: 12px;
    background: #1e293b;
    border-radius: 50%;
}

.epds-bar-labels {
    display: flex;
    justify-content: space-between;
    font-size: 0.75em;
    color: #666;
    margin-bottom: 25px;
    padding: 0 5px;
}

/* Interpretation */
.epds-interpretation {
    padding: 25px;
    background: white;
    border-radius: 12px;
    margin: 25px 0;
    border-left: 4px solid #0d9488;
}

.epds-interpretation h4 {
    margin: 0 0 12px 0;
    color: #0f766e;
}

.epds-interpretation p {
    margin: 0 0 10px 0;
}

.epds-interpretation p:last-child {
    margin-bottom: 0;
}

/* Provider Section */
.epds-provider-section {
    padding: 25px;
    background: #f0fdfa;
    border-radius: 12px;
    margin: 25px 0;
    border: 1px solid #99f6e4;
}

.epds-provider-section h4 {
    margin: 0 0 12px 0;
    color: #0f766e;
}

.epds-provider-section ul {
    margin: 0;
    padding-left: 22px;
}

.epds-provider-section li {
    margin-bottom: 6px;
}

/* Action Buttons */
.epds-action-buttons {
    display: flex;
    justify-content: center;
    gap: 15px;
    flex-wrap: wrap;
    margin: 25px 0;
}

.epds-btn-secondary {
    padding: 12px 25px;
    background: white;
    color: #0d9488;
    border: 2px solid #0d9488;
    border-radius: 8px;
    font-weight: 600;
    font-size: 0.95em;
    cursor: pointer;
    transition: all 0.3s ease;
}

.epds-btn-secondary:hover {
    background: #0d9488;
    color: white;
}

.epds-btn-text {
    background: none;
    border: none;
    color: #666;
    font-size: 0.85em;
    cursor: pointer;
    text-decoration: underline;
    padding: 5px;
}

.epds-btn-text:hover {
    color: #0d9488;
}

/* History Section */
.mdcv2-history-section {
    margin-top: 25px;
    padding: 20px;
    background: #f8fffe;
    border-radius: 10px;
    border: 1px solid #e0f2fe;
}

.mdcv2-history-section h4 {
    margin: 0 0 15px 0;
    color: #0f766e;
}

.history-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 10px 15px;
    background: white;
    border-radius: 6px;
    margin-bottom: 8px;
    border: 1px solid #e5e7eb;
}

.history-date {
    font-size: 0.85em;
    color: #666;
}

.history-result {
    font-weight: 600;
    color: #0f766e;
}

/* Retake Button */
.epds-retake-wrapper {
    text-align: center;
    margin-top: 25px;
}

.epds-retake-btn {
    padding: 14px 35px;
    background: linear-gradient(135deg, #0d9488 0%, #0f766e 100%);
    color: white;
    border: none;
    border-radius: 10px;
    font-weight: 600;
    font-size: 1.05em;
    cursor: pointer;
    transition: all 0.3s ease;
    box-shadow: 0 4px 15px rgba(13, 148, 136, 0.3);
}

.epds-retake-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(13, 148, 136, 0.4);
}

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

.epds-tab-nav {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-bottom: 30px;
    border-bottom: 2px solid #e5e7eb;
    padding-bottom: 15px;
}

.epds-tab-btn {
    padding: 12px 20px;
    background: #f8fffe;
    border: 2px solid #e5e7eb;
    border-radius: 8px;
    font-weight: 600;
    color: #666;
    cursor: pointer;
    transition: all 0.3s ease;
    font-size: 0.95em;
}

.epds-tab-btn:hover {
    background: #f0fdfa;
    border-color: #0d9488;
    color: #0f766e;
}

.epds-tab-btn.active {
    background: #0d9488;
    color: white;
    border-color: #0d9488;
}

.epds-tab-content {
    display: none;
}

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

.epds-tab-content h3 {
    color: #0f766e;
    margin-top: 0;
}

.epds-tab-content h4 {
    color: #134e4a;
    margin-top: 25px;
    margin-bottom: 12px;
}

.epds-tab-content ul {
    padding-left: 22px;
}

.epds-tab-content li {
    margin-bottom: 8px;
}

/* Info Box */
.epds-info-box {
    background: #f0fdfa;
    border-left: 4px solid #0d9488;
    padding: 20px 25px;
    border-radius: 0 10px 10px 0;
    margin: 25px 0;
}

.epds-info-box h4 {
    margin-top: 0;
    color: #0f766e;
}

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

/* Warning Box */
.epds-warning-box {
    background: #fff7ed;
    border-left: 4px solid #f97316;
    padding: 20px 25px;
    border-radius: 0 10px 10px 0;
    margin: 20px 0;
}

.epds-warning-box ul {
    margin: 0 0 10px 0;
}

.epds-warning-box li {
    font-style: italic;
    color: #9a3412;
}

.epds-warning-box p {
    margin: 10px 0 0 0;
    color: #7c2d12;
}

/* Risk Factor Grid */
.epds-risk-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 18px;
    margin: 25px 0;
}

.risk-card {
    background: #f8fffe;
    padding: 22px;
    border-radius: 12px;
    border: 1px solid #e0f2fe;
}

.risk-card h4 {
    margin: 0 0 12px 0;
    color: #0f766e;
    font-size: 1em;
}

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

.risk-card li {
    margin-bottom: 5px;
    font-size: 0.93em;
}

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

.treatment-card {
    background: #f8fffe;
    padding: 22px;
    border-radius: 12px;
    border: 1px solid #e0f2fe;
}

.treatment-card h4 {
    margin: 0 0 12px 0;
    color: #0f766e;
    font-size: 1.05em;
}

.treatment-card p {
    margin: 0 0 10px 0;
    font-size: 0.95em;
}

.treatment-card p:last-child {
    margin-bottom: 0;
}

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

.treatment-card li {
    margin-bottom: 5px;
    font-size: 0.93em;
}

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

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

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

.epds-faq-section .faq-question {
    width: 100%;
    padding: 18px 22px;
    background: #f8fffe;
    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;
    color: #333;
}

.epds-faq-section .faq-question:hover {
    background: #f0fdfa;
}

.epds-faq-section .faq-question.active {
    background: #0d9488;
    color: white;
}

.epds-faq-section .faq-icon {
    font-size: 1.5em;
    font-weight: 300;
    transition: transform 0.3s ease;
    flex-shrink: 0;
    margin-left: 12px;
}

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

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

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

.epds-faq-section .faq-answer p {
    margin: 0 0 10px 0;
}

.epds-faq-section .faq-answer p:last-child {
    margin-bottom: 0;
}

/* ============================================
   DISCLAIMER
   ============================================ */
.epds-disclaimer {
    background: linear-gradient(135deg, #fff7ed 0%, #fffbeb 100%);
    border: 2px solid #f59e0b;
    border-radius: 12px;
    padding: 35px;
    margin-bottom: 30px;
}

.epds-disclaimer h3 {
    color: #92400e;
    margin-top: 0;
}

.epds-disclaimer p,
.epds-disclaimer li {
    color: #78350f;
}

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

.epds-disclaimer li {
    margin-bottom: 8px;
}

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

.epds-related h3 {
    color: #0f766e;
    margin-top: 0;
    margin-bottom: 20px;
}

.epds-related .related-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(210px, 1fr));
    gap: 18px;
}

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

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

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

.epds-related .related-title {
    font-weight: 700;
    margin-bottom: 8px;
    color: #0f766e;
}

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

/* ============================================
   REFERENCES
   ============================================ */
.epds-references {
    background: #f8fffe;
    border-radius: 12px;
    padding: 35px;
    margin-bottom: 30px;
}

.epds-references h3 {
    color: #0f766e;
    margin-top: 0;
}

.epds-references ol {
    padding-left: 25px;
}

.epds-references li {
    margin-bottom: 15px;
    line-height: 1.6;
}

.epds-references a {
    color: #0d9488;
}

.epds-references a:hover {
    text-decoration: underline;
}

/* ============================================
   ATTRIBUTION
   ============================================ */
.epds-attribution {
    text-align: center;
    padding: 20px;
    font-size: 0.9em;
    color: #666;
    border-top: 1px solid #e5e7eb;
}

.epds-attribution p {
    margin: 0;
}

/* ============================================
   RESPONSIVE DESIGN
   ============================================ */
@media (max-width: 768px) {
    .epds-hero h1 {
        font-size: 1.8em;
    }

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

    .hero-badges {
        flex-direction: column;
        align-items: center;
    }

    .epds-stats {
        grid-template-columns: 1fr;
        gap: 12px;
    }

    .epds-form-section,
    .epds-results-section,
    .epds-education,
    .epds-faq-section,
    .epds-related,
    .epds-references,
    .epds-disclaimer {
        padding: 25px 18px;
    }

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

    .crisis-contacts {
        grid-template-columns: 1fr;
    }

    .epds-tab-nav {
        flex-direction: column;
    }

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

    .epds-risk-grid,
    .treatment-grid {
        grid-template-columns: 1fr;
    }

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

    .epds-action-buttons {
        flex-direction: column;
        align-items: center;
    }

    .epds-btn-secondary {
        width: 100%;
        max-width: 300px;
    }

    .q10-crisis-links {
        flex-direction: column;
    }

    .epds-bar-labels {
        font-size: 0.65em;
    }

    .bar-segment span {
        font-size: 0.7em;
    }
}

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

    .epds-hero h1 {
        font-size: 1.5em;
    }

    .stat-card .stat-number {
        font-size: 1.6em;
    }
}
