/* ============================================
   APGAR Score Calculator — Warm Pink Theme
   Primary: #ec4899 / Gradient to #db2777
   ============================================ */

/* ---- Container ---- */
.apgar-calculator-container {
    max-width: 900px;
    margin: 0 auto;
    padding: 0 16px;
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, Cantarell, sans-serif;
    color: #1e293b;
    line-height: 1.6;
}

.apgar-calculator-container *,
.apgar-calculator-container *::before,
.apgar-calculator-container *::after {
    box-sizing: border-box;
}

/* ---- Hero ---- */
.apgar-hero {
    background: linear-gradient(135deg, #ec4899 0%, #db2777 100%);
    color: #fff;
    text-align: center;
    padding: 48px 32px 40px;
    border-radius: 16px;
    margin-bottom: 24px;
}

.apgar-hero h1 {
    font-size: 2rem;
    font-weight: 800;
    margin: 0 0 8px;
    letter-spacing: -0.02em;
}

.apgar-hero .hero-subtitle {
    font-size: 1.05rem;
    opacity: 0.92;
    margin: 0 0 20px;
    font-weight: 400;
}

.hero-badges {
    display: flex;
    justify-content: center;
    flex-wrap: wrap;
    gap: 10px;
}

.hero-badges .badge {
    background: rgba(255, 255, 255, 0.2);
    color: #fff;
    padding: 6px 14px;
    border-radius: 50px;
    font-size: 0.82rem;
    font-weight: 600;
    backdrop-filter: blur(4px);
    white-space: nowrap;
}

.hero-badges .badge-icon {
    margin-right: 4px;
}

/* ---- Stats Row ---- */
.stats-row {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 16px;
    margin-bottom: 24px;
}

.stat-card {
    background: #fff;
    border: 1px solid #f1e2eb;
    border-radius: 12px;
    padding: 20px 16px;
    text-align: center;
    transition: box-shadow 0.2s;
}

.stat-card:hover {
    box-shadow: 0 4px 16px rgba(236, 72, 153, 0.12);
}

.stat-number {
    display: block;
    font-size: 1.5rem;
    font-weight: 800;
    color: #db2777;
}

.stat-label {
    display: block;
    font-size: 0.82rem;
    color: #64748b;
    margin-top: 4px;
}

/* ---- Privacy Notice ---- */
.privacy-notice {
    background: #fdf2f8;
    border: 1px solid #fbcfe8;
    border-radius: 10px;
    padding: 14px 20px;
    font-size: 0.88rem;
    color: #9d174d;
    margin-bottom: 28px;
}

/* ---- Assessment Panels ---- */
.calculator-form-section {
    margin-bottom: 32px;
}

.apgar-assessment-panel {
    background: #fff;
    border: 2px solid #fbcfe8;
    border-radius: 14px;
    padding: 0;
    margin-bottom: 24px;
    overflow: hidden;
}

.panel-header {
    background: linear-gradient(135deg, #fdf2f8 0%, #fce7f3 100%);
    padding: 24px 28px 18px;
    border-bottom: 1px solid #fbcfe8;
    position: relative;
}

.panel-header h2 {
    font-size: 1.35rem;
    font-weight: 700;
    color: #9d174d;
    margin: 0 0 4px;
}

.panel-header .panel-description {
    font-size: 0.88rem;
    color: #be185d;
    margin: 0;
}

.panel-time-badge {
    position: absolute;
    top: 20px;
    right: 24px;
    background: linear-gradient(135deg, #ec4899 0%, #db2777 100%);
    color: #fff;
    font-size: 0.85rem;
    font-weight: 700;
    padding: 6px 16px;
    border-radius: 50px;
    letter-spacing: 0.02em;
}

/* ---- Criterion Card ---- */
.apgar-criterion {
    padding: 20px 28px;
    border-bottom: 1px solid #fce7f3;
}

.apgar-criterion:last-child {
    border-bottom: none;
}

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

.apgar-letter {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 44px;
    height: 44px;
    background: linear-gradient(135deg, #ec4899 0%, #db2777 100%);
    color: #fff;
    font-size: 1.3rem;
    font-weight: 800;
    border-radius: 10px;
    flex-shrink: 0;
}

.criterion-title strong {
    display: block;
    font-size: 1.05rem;
    color: #1e293b;
}

.criterion-subtitle {
    font-size: 0.82rem;
    color: #64748b;
}

/* ---- Score Options ---- */
.score-options {
    display: flex;
    flex-direction: column;
    gap: 8px;
    padding-left: 58px;
}

.score-option {
    display: flex;
    align-items: center;
    cursor: pointer;
    position: relative;
}

.score-option input[type="radio"] {
    position: absolute;
    opacity: 0;
    width: 0;
    height: 0;
}

.score-label {
    display: flex;
    align-items: center;
    gap: 10px;
    width: 100%;
    padding: 10px 14px;
    background: #fdf2f8;
    border: 2px solid transparent;
    border-radius: 8px;
    font-size: 0.92rem;
    color: #1e293b;
    transition: all 0.2s;
}

.score-option input[type="radio"]:checked + .score-label {
    background: #fce7f3;
    border-color: #ec4899;
    color: #9d174d;
    font-weight: 600;
}

.score-option:hover .score-label {
    border-color: #f9a8d4;
}

.score-option input[type="radio"]:focus-visible + .score-label {
    outline: 2px solid #ec4899;
    outline-offset: 2px;
}

.score-value-badge {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 28px;
    height: 28px;
    background: #fff;
    border: 1px solid #f9a8d4;
    border-radius: 6px;
    font-size: 0.82rem;
    font-weight: 700;
    color: #db2777;
    flex-shrink: 0;
}

.score-option input[type="radio"]:checked + .score-label .score-value-badge {
    background: #ec4899;
    border-color: #ec4899;
    color: #fff;
}

/* ---- Submit ---- */
.form-submit {
    text-align: center;
    margin-top: 8px;
}

.submit-btn {
    background: linear-gradient(135deg, #ec4899 0%, #db2777 100%);
    color: #fff;
    border: none;
    padding: 16px 48px;
    font-size: 1.1rem;
    font-weight: 700;
    border-radius: 10px;
    cursor: pointer;
    transition: transform 0.15s, box-shadow 0.2s;
}

.submit-btn:hover {
    transform: translateY(-1px);
    box-shadow: 0 6px 20px rgba(236, 72, 153, 0.35);
}

.submit-btn:active {
    transform: translateY(0);
}

/* ---- Results ---- */
.results-section {
    background: #fff;
    border: 2px solid #fbcfe8;
    border-radius: 14px;
    padding: 36px 28px;
    margin-bottom: 32px;
}

.results-section h2 {
    text-align: center;
    font-size: 1.5rem;
    font-weight: 800;
    color: #1e293b;
    margin: 0 0 28px;
}

/* Score Comparison */
.apgar-score-comparison {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 24px;
    margin-bottom: 28px;
    flex-wrap: wrap;
}

.score-panel {
    text-align: center;
    flex: 1;
    min-width: 160px;
    max-width: 220px;
}

.score-panel-label {
    font-size: 0.9rem;
    font-weight: 700;
    color: #64748b;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    margin-bottom: 12px;
}

.score-circle {
    width: 120px;
    height: 120px;
    border-radius: 50%;
    background: linear-gradient(135deg, #fdf2f8 0%, #fce7f3 100%);
    border: 4px solid #f9a8d4;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    margin: 0 auto 12px;
    transition: border-color 0.3s, background 0.3s;
}

.score-circle .score-value {
    font-size: 2.4rem;
    font-weight: 800;
    color: #db2777;
    line-height: 1;
}

.score-circle .score-max {
    font-size: 0.72rem;
    color: #9d174d;
    margin-top: 2px;
}

.score-classification {
    font-size: 0.92rem;
    font-weight: 700;
    padding: 6px 16px;
    border-radius: 50px;
    display: inline-block;
}

.score-classification.class-reassuring {
    background: #dcfce7;
    color: #166534;
}

.score-classification.class-moderate {
    background: #fef9c3;
    color: #854d0e;
}

.score-classification.class-low {
    background: #fee2e2;
    color: #991b1b;
}

/* Score circle color states */
.score-circle.circle-reassuring {
    border-color: #22c55e;
    background: linear-gradient(135deg, #f0fdf4 0%, #dcfce7 100%);
}

.score-circle.circle-reassuring .score-value {
    color: #16a34a;
}

.score-circle.circle-reassuring .score-max {
    color: #166534;
}

.score-circle.circle-moderate {
    border-color: #eab308;
    background: linear-gradient(135deg, #fefce8 0%, #fef9c3 100%);
}

.score-circle.circle-moderate .score-value {
    color: #ca8a04;
}

.score-circle.circle-moderate .score-max {
    color: #854d0e;
}

.score-circle.circle-low {
    border-color: #ef4444;
    background: linear-gradient(135deg, #fef2f2 0%, #fee2e2 100%);
}

.score-circle.circle-low .score-value {
    color: #dc2626;
}

.score-circle.circle-low .score-max {
    color: #991b1b;
}

/* Trend Indicator */
.score-trend-indicator {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 4px;
    flex-shrink: 0;
}

.trend-arrow {
    font-size: 2rem;
    line-height: 1;
}

.trend-arrow.trend-improving {
    color: #16a34a;
}

.trend-arrow.trend-stable {
    color: #64748b;
}

.trend-arrow.trend-declining {
    color: #dc2626;
}

.trend-label {
    font-size: 0.78rem;
    font-weight: 600;
    color: #64748b;
    text-transform: uppercase;
    letter-spacing: 0.04em;
}

/* Interpretation */
.apgar-interpretation {
    background: #fdf2f8;
    border: 1px solid #fbcfe8;
    border-radius: 10px;
    padding: 16px 20px;
    margin-bottom: 24px;
    font-size: 0.92rem;
    color: #9d174d;
    line-height: 1.65;
}

/* Component Breakdown */
.component-breakdown {
    margin-bottom: 24px;
}

.component-breakdown h3 {
    font-size: 1.15rem;
    font-weight: 700;
    color: #1e293b;
    margin: 0 0 14px;
}

.breakdown-table-wrapper {
    overflow-x: auto;
}

.breakdown-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.92rem;
}

.breakdown-table th {
    background: linear-gradient(135deg, #fdf2f8 0%, #fce7f3 100%);
    color: #9d174d;
    font-weight: 700;
    padding: 12px 16px;
    text-align: left;
    border-bottom: 2px solid #fbcfe8;
}

.breakdown-table th:nth-child(2),
.breakdown-table th:nth-child(3) {
    text-align: center;
}

.breakdown-table td {
    padding: 10px 16px;
    border-bottom: 1px solid #fce7f3;
    color: #1e293b;
}

.breakdown-table td:nth-child(2),
.breakdown-table td:nth-child(3) {
    text-align: center;
    font-weight: 600;
}

.breakdown-table .total-row td {
    background: #fdf2f8;
    border-top: 2px solid #fbcfe8;
    font-weight: 700;
    color: #9d174d;
}

.apgar-letter-sm {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 26px;
    height: 26px;
    background: linear-gradient(135deg, #ec4899 0%, #db2777 100%);
    color: #fff;
    font-size: 0.75rem;
    font-weight: 800;
    border-radius: 6px;
    margin-right: 8px;
    vertical-align: middle;
}

/* Result Actions */
.result-actions {
    display: flex;
    gap: 12px;
    justify-content: center;
    margin: 24px 0;
    flex-wrap: wrap;
}

.mdcv2-print-btn,
.mdcv2-share-btn {
    background: #fdf2f8;
    color: #db2777;
    border: 2px solid #fbcfe8;
    padding: 10px 24px;
    border-radius: 8px;
    font-size: 0.9rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s;
}

.mdcv2-print-btn:hover,
.mdcv2-share-btn:hover {
    background: #fce7f3;
    border-color: #f9a8d4;
}

/* History */
.mdcv2-history-section {
    border-top: 1px solid #fce7f3;
    padding-top: 20px;
    margin-top: 20px;
}

.mdcv2-history-section h3 {
    font-size: 1.05rem;
    font-weight: 700;
    color: #1e293b;
    margin: 0 0 12px;
}

.history-item {
    display: flex;
    justify-content: space-between;
    padding: 8px 12px;
    background: #fdf2f8;
    border-radius: 6px;
    margin-bottom: 6px;
    font-size: 0.85rem;
}

.history-date {
    color: #64748b;
}

.history-result {
    font-weight: 600;
    color: #9d174d;
}

.mdcv2-clear-history {
    background: none;
    border: none;
    color: #db2777;
    font-size: 0.82rem;
    cursor: pointer;
    padding: 4px 0;
    margin-top: 6px;
    text-decoration: underline;
}

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

.retake-btn {
    background: #fff;
    color: #db2777;
    border: 2px solid #ec4899;
    padding: 12px 36px;
    border-radius: 10px;
    font-size: 1rem;
    font-weight: 700;
    cursor: pointer;
    transition: all 0.2s;
}

.retake-btn:hover {
    background: #fdf2f8;
}

/* ---- Education Tabs ---- */
.education-tabs {
    background: #fff;
    border: 1px solid #f1e2eb;
    border-radius: 14px;
    margin-bottom: 28px;
    overflow: hidden;
}

.tab-nav {
    display: flex;
    flex-wrap: wrap;
    border-bottom: 2px solid #fce7f3;
    background: #fdf2f8;
}

.tab-btn {
    flex: 1;
    padding: 14px 12px;
    background: none;
    border: none;
    border-bottom: 3px solid transparent;
    font-size: 0.88rem;
    font-weight: 600;
    color: #64748b;
    cursor: pointer;
    transition: all 0.2s;
    min-width: 120px;
    text-align: center;
}

.tab-btn:hover {
    color: #db2777;
    background: rgba(236, 72, 153, 0.05);
}

.tab-btn.active {
    color: #db2777;
    border-bottom-color: #ec4899;
    background: #fff;
}

.tab-content {
    display: none;
    padding: 28px;
}

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

.tab-content h3 {
    font-size: 1.2rem;
    font-weight: 700;
    color: #1e293b;
    margin: 0 0 14px;
}

.tab-content h4 {
    font-size: 1rem;
    font-weight: 700;
    color: #9d174d;
    margin: 18px 0 8px;
}

.tab-content p {
    margin: 0 0 12px;
    color: #334155;
}

.tab-content ul {
    margin: 0 0 14px;
    padding-left: 24px;
}

.tab-content li {
    margin-bottom: 6px;
    color: #334155;
}

/* ---- FAQ ---- */
.faq-section {
    margin-bottom: 28px;
}

.faq-section h2 {
    text-align: center;
    font-size: 1.4rem;
    font-weight: 800;
    color: #1e293b;
    margin: 0 0 20px;
}

.faq-item {
    border: 1px solid #f1e2eb;
    border-radius: 10px;
    margin-bottom: 10px;
    overflow: hidden;
}

.faq-question {
    width: 100%;
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 16px 20px;
    background: #fdf2f8;
    border: none;
    font-size: 0.95rem;
    font-weight: 600;
    color: #1e293b;
    cursor: pointer;
    text-align: left;
    transition: background 0.2s;
}

.faq-question::after {
    content: '+';
    font-size: 1.3rem;
    font-weight: 700;
    color: #db2777;
    flex-shrink: 0;
    margin-left: 12px;
    transition: transform 0.2s;
}

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

.faq-item.open .faq-question::after {
    content: '\2212';
}

.faq-answer {
    display: none;
    padding: 16px 20px;
    background: #fff;
}

.faq-item.open .faq-answer {
    display: block;
}

.faq-answer p {
    margin: 0 0 10px;
    color: #334155;
    font-size: 0.92rem;
    line-height: 1.65;
}

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

/* ---- Medical Disclaimer ---- */
.medical-disclaimer {
    background: #fff7ed;
    border: 1px solid #fed7aa;
    border-radius: 10px;
    padding: 20px 24px;
    margin-bottom: 28px;
}

.medical-disclaimer h3 {
    font-size: 1rem;
    font-weight: 700;
    color: #9a3412;
    margin: 0 0 8px;
}

.medical-disclaimer p {
    font-size: 0.85rem;
    color: #9a3412;
    margin: 0;
    line-height: 1.6;
}

/* ---- Related Calculators ---- */
.related-calculators {
    margin-bottom: 28px;
}

.related-calculators h2 {
    text-align: center;
    font-size: 1.4rem;
    font-weight: 800;
    color: #1e293b;
    margin: 0 0 20px;
}

.related-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 16px;
}

.related-card {
    background: #fff;
    border: 1px solid #f1e2eb;
    border-radius: 10px;
    padding: 20px;
    text-decoration: none;
    transition: box-shadow 0.2s, border-color 0.2s;
}

.related-card:hover {
    border-color: #f9a8d4;
    box-shadow: 0 4px 16px rgba(236, 72, 153, 0.12);
}

.related-card h4 {
    font-size: 0.95rem;
    font-weight: 700;
    color: #db2777;
    margin: 0 0 6px;
}

.related-card p {
    font-size: 0.82rem;
    color: #64748b;
    margin: 0;
    line-height: 1.5;
}

/* ---- References ---- */
.references-section {
    margin-bottom: 28px;
}

.references-section h2 {
    font-size: 1.2rem;
    font-weight: 700;
    color: #1e293b;
    margin: 0 0 14px;
}

.references-section ol {
    padding-left: 24px;
    margin: 0;
}

.references-section li {
    font-size: 0.82rem;
    color: #64748b;
    margin-bottom: 8px;
    line-height: 1.55;
}

.references-section em {
    font-style: italic;
}

.references-section a {
    color: #db2777;
    text-decoration: none;
}

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

/* ============================================
   RESPONSIVE
   ============================================ */
@media (max-width: 768px) {
    .apgar-hero {
        padding: 32px 20px 28px;
    }

    .apgar-hero h1 {
        font-size: 1.5rem;
    }

    .stats-row {
        grid-template-columns: 1fr;
        gap: 10px;
    }

    .apgar-score-comparison {
        flex-direction: column;
        gap: 16px;
    }

    .score-trend-indicator {
        flex-direction: row;
        gap: 8px;
    }

    .score-options {
        padding-left: 0;
    }

    .apgar-criterion {
        padding: 16px 18px;
    }

    .panel-header {
        padding: 18px 18px 14px;
    }

    .panel-time-badge {
        position: static;
        display: inline-block;
        margin-bottom: 8px;
    }

    .results-section {
        padding: 24px 18px;
    }

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

    .tab-btn {
        border-bottom: none;
        border-left: 3px solid transparent;
    }

    .tab-btn.active {
        border-bottom: none;
        border-left-color: #ec4899;
    }

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

    .submit-btn {
        width: 100%;
        padding: 16px 24px;
    }

    .result-actions {
        flex-direction: column;
    }

    .mdcv2-print-btn,
    .mdcv2-share-btn {
        width: 100%;
    }

    .breakdown-table {
        font-size: 0.85rem;
    }

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

@media (max-width: 480px) {
    .apgar-hero h1 {
        font-size: 1.3rem;
    }

    .hero-badges .badge {
        font-size: 0.75rem;
        padding: 5px 10px;
    }

    .score-circle {
        width: 100px;
        height: 100px;
    }

    .score-circle .score-value {
        font-size: 2rem;
    }

    .apgar-letter {
        width: 36px;
        height: 36px;
        font-size: 1.1rem;
    }
}
