/**
 * DoctorBookly — Health tools UI (calculators + symptoms/conditions)
 */

:root {
    --ht-primary: #0d9488;
    --ht-primary-deep: #0f766e;
    --ht-bg: #f0fdfa;
    --ht-card: #ffffff;
    --ht-border: #e2e8f0;
    --ht-text: #0f172a;
    --ht-muted: #64748b;
}

.calculator-page {
    background: linear-gradient(180deg, #f8fafc 0%, #ecfdf5 55%, #f1f5f9 100%) !important;
    padding-top: 12px !important;
}

.calculator-header-icon,
.calculator-header-icon.calorie-icon,
.calculator-header-icon.medication-icon {
    background: linear-gradient(135deg, var(--ht-primary), var(--ht-primary-deep)) !important;
    animation: none !important;
}

.form-group:focus-within label,
.form-group label i {
    color: var(--ht-primary-deep) !important;
}

.input-group:focus-within,
.form-select:focus {
    border-color: var(--ht-primary) !important;
    box-shadow: 0 0 0 3px rgba(13, 148, 136, 0.12) !important;
}

.calculator-submit-btn,
.calculator-submit-btn.calorie-btn,
.calculator-submit-btn.medication-btn {
    background: linear-gradient(135deg, var(--ht-primary), var(--ht-primary-deep)) !important;
    min-height: 48px;
    font-size: 15px;
}

.calculator-submit-btn:hover {
    box-shadow: 0 6px 20px rgba(13, 148, 136, 0.28) !important;
}

.calculator-reset-btn {
    border: 1px solid var(--ht-border);
    background: #fff;
    color: var(--ht-primary-deep);
    padding: 12px 18px;
    border-radius: 10px;
    font-weight: 600;
    cursor: pointer;
    width: 100%;
    margin-top: 12px;
    min-height: 44px;
}

/* ——— Minimal breadcrumb (top only) ——— */
.health-tools-breadcrumb {
    max-width: 1200px;
    margin: 0 auto;
    padding: 12px 20px 0;
}

.health-tools-breadcrumb ol {
    list-style: none;
    margin: 0;
    padding: 0;
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 4px 6px;
    font-size: 13px;
    color: var(--ht-muted);
}

.health-tools-breadcrumb li {
    display: inline-flex;
    align-items: center;
}

.health-tools-breadcrumb__sep {
    color: #cbd5e1;
    user-select: none;
}

.health-tools-breadcrumb a {
    color: var(--ht-primary-deep);
    text-decoration: none;
    font-weight: 600;
}

.health-tools-breadcrumb a:hover {
    text-decoration: underline;
}

.health-tools-breadcrumb li:last-child span {
    color: var(--ht-text);
    font-weight: 600;
}

/* Calculator page: breadcrumb inside container rhythm */
.calculator-page > .container {
    padding-top: 4px;
}

.sc-list-page .health-tools-breadcrumb {
    max-width: 1000px;
    padding-left: 16px;
    padding-right: 16px;
}

.sc-list-page .health-tools-related {
    max-width: calc(1000px - 32px);
    margin-left: 16px;
    margin-right: 16px;
    margin-bottom: 8px;
}

/* ——— Bottom “other tools” (not top grid) ——— */
.health-tools-related {
    max-width: 1200px;
    margin: 28px auto 0;
    padding: 16px 20px;
    background: var(--ht-card);
    border: 1px solid var(--ht-border);
    border-radius: 14px;
    box-shadow: 0 2px 12px rgba(15, 23, 42, 0.04);
}

.sc-list-page .health-tools-related {
    max-width: 1000px;
    margin-left: auto;
    margin-right: auto;
}

.health-tools-related__title {
    margin: 0 0 12px;
    font-size: 13px;
    font-weight: 700;
    color: var(--ht-muted);
    text-transform: uppercase;
    letter-spacing: 0.04em;
}

.health-tools-related__scroll {
    display: flex;
    flex-wrap: nowrap;
    gap: 8px;
    overflow-x: auto;
    overflow-y: hidden;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: thin;
    padding-bottom: 4px;
}

.health-tools-related__scroll::-webkit-scrollbar {
    height: 4px;
}

.health-tools-related__scroll::-webkit-scrollbar-thumb {
    background: #cbd5e1;
    border-radius: 4px;
}

.health-tools-related__pill {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    flex: 0 0 auto;
    padding: 10px 14px;
    min-height: 44px;
    border-radius: 999px;
    border: 1px solid var(--ht-border);
    background: #f8fafc;
    color: var(--ht-text);
    text-decoration: none;
    font-size: 13px;
    font-weight: 600;
    white-space: nowrap;
    transition: border-color 0.2s, background 0.2s, box-shadow 0.2s;
}

.health-tools-related__pill i {
    color: var(--ht-primary);
    font-size: 14px;
}

.health-tools-related__pill:hover {
    border-color: rgba(13, 148, 136, 0.45);
    background: var(--ht-bg);
    box-shadow: 0 2px 8px rgba(13, 148, 136, 0.1);
}

.health-tools-related__label-short {
    display: none;
}

/* Imperial height, toasts, medication — unchanged essentials */
.height-imperial-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 10px;
}

.height-imperial-row input {
    width: 100%;
    padding: 14px 16px;
    border: 2px solid var(--ht-border);
    border-radius: 10px;
    font-size: 16px;
    background: #f8fafc;
    box-sizing: border-box;
}

.field-hint {
    font-size: 12px;
    color: var(--ht-muted);
    margin: 4px 0 0;
}

.health-tool-toast {
    position: fixed;
    bottom: 24px;
    left: 50%;
    transform: translateX(-50%) translateY(80px);
    z-index: 10050;
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 14px 20px;
    max-width: min(420px, calc(100vw - 32px));
    border-radius: 12px;
    background: var(--ht-text);
    color: #fff;
    font-size: 14px;
    font-weight: 600;
    box-shadow: 0 12px 40px rgba(15, 23, 42, 0.25);
    opacity: 0;
    pointer-events: none;
    transition: transform 0.35s ease, opacity 0.35s ease;
}

.health-tool-toast.is-visible {
    transform: translateX(-50%) translateY(0);
    opacity: 1;
}

.health-tool-toast--success {
    background: linear-gradient(135deg, #059669, #047857);
}

.health-tool-toast--error {
    background: linear-gradient(135deg, #dc2626, #b91c1c);
}

.med-notify-banner {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 10px;
    padding: 12px 14px;
    margin-bottom: 16px;
    border-radius: 10px;
    background: #fffbeb;
    border: 1px solid #fde68a;
    font-size: 13px;
    color: #92400e;
}

.med-notify-banner button {
    margin-left: auto;
    padding: 8px 14px;
    border: none;
    border-radius: 8px;
    background: var(--ht-primary-deep);
    color: #fff;
    font-weight: 700;
    font-size: 12px;
    cursor: pointer;
    min-height: 36px;
}

.calculator-header {
    margin-top: 8px !important;
}

.calculator-container {
    margin-bottom: 24px !important;
}

/* Mobile */
@media (max-width: 640px) {
    .health-tools-breadcrumb {
        padding: 10px 16px 0;
        font-size: 12px;
    }

    .calculator-page {
        padding: 8px 0 24px !important;
    }

    .calculator-header {
        padding: 16px !important;
        margin-bottom: 16px !important;
        gap: 12px !important;
    }

    .calculator-header h1 {
        font-size: 1.35rem !important;
    }

    .calculator-subtitle {
        font-size: 13px !important;
    }

    .health-tools-related {
        margin-top: 20px;
        padding: 14px 16px;
        border-radius: 12px;
    }

    .health-tools-related__label-full {
        display: none;
    }

    .health-tools-related__label-short {
        display: inline;
    }

    .health-tools-related__pill {
        padding: 10px 12px;
        font-size: 12px;
    }

    .calculator-form-card,
    .calculator-results-card,
    .medication-list-card {
        padding: 16px !important;
    }

    .calorie-results-grid,
    .goal-boxes {
        grid-template-columns: 1fr !important;
    }
}

@media (min-width: 641px) {
    .health-tools-related__scroll {
        flex-wrap: wrap;
    }
}

@media (prefers-reduced-motion: reduce) {
    .health-tool-toast,
    .health-tools-related__pill {
        transition: none !important;
    }
}
