/*
 * BattlePack™ Nutrition Calculator Styles
 * Bold, typographic, sport-editorial aesthetic — matching the original exactly.
 * Color palette: #ffcd00 FAT | #ff00ff CARBS | #a800ff PRO | #00a8ff WATER
 */

@import url('https://fonts.googleapis.com/css2?family=Barlow+Condensed:wght@400;600;700;900&family=Barlow:wght@400;500;600&display=swap');

/* ── CSS Variables ──────────────────────────────────────────────────────── */
.bp-nutrition-wrap {
    --bp-fat:     #ffcd00;
    --bp-carbs:   #ff00ff;
    --bp-pro:     #a800ff;
    --bp-fiber:   #854d11;
    --bp-water:   #00a8ff;
    --bp-sports:  #0000ff;
    --bp-dark:    #1a1a1a;
    --bp-mid:     #646464;
    --bp-bg:      #ffffff;

    max-width: 480px;
    margin: 0 auto;
    background: var(--bp-bg);
    color: var(--bp-dark);
}

/* ── Page title ─────────────────────────────────────────────────────────── */
.bp-nutrition-title {
    display: none;
}

.bp-nutrition-icon-header {
    text-align: center;
    padding: 28px 0 8px;
}

.bp-nutrition-icon-header svg {
    width: 52px;
    height: 52px;
    color: var(--bp-pro);
}

/* ── Form sections ──────────────────────────────────────────────────────── */
.bp-nutrition-section-label {
    font-size: 28px;
    font-weight: 900;
    letter-spacing: 1px;
    color: var(--bp-pro);
    margin: 32px 0 6px;
}

.bp-nutrition-rule {
    border: none;
    border-top: 2px solid #e0e0e0;
    margin-bottom: 28px;
}

/* ── Form fields ────────────────────────────────────────────────────────── */
.bp-nutrition-form {
    padding: 0 20px 32px;
}

.bp-nutrition-field {
    margin-bottom: 28px;
}

.bp-nutrition-row {
    display: flex;
    gap: 24px;
    margin-bottom: 20px;
}

.bp-nutrition-row .bp-nutrition-field {
    flex: 1;
    margin-bottom: 0;
}

.bp-field-label {
    display: block;
    font-size: 19px;
    font-weight: 700;
    letter-spacing: 1px;
    text-transform: uppercase;
    color: var(--bp-dark);
    margin-bottom: 8px;
}

.bp-required {
    color: var(--bp-pro);
}

.bp-field-hint {
    font-size: 19px;
    color: var(--bp-mid);
    margin-top: 5px;
    line-height: 1.4;
}

.bp-field-hint-inline {
    font-size: 18px;
    color: var(--bp-mid);
    font-weight: 400;
}

/* ── Radio group (M/F) ──────────────────────────────────────────────────── */
.bp-radio-group {
    display: flex;
    gap: 16px;
}

.bp-radio-label {
    display: flex;
    align-items: center;
    gap: 6px;
    font-weight: 600;
    cursor: pointer;
    font-size: 19px;
}

.bp-radio-label input[type="radio"] {
    width: 18px;
    height: 18px;
    accent-color: var(--bp-pro);
    cursor: pointer;
}

/* ── Unit toggle ────────────────────────────────────────────────────────── */
.bp-unit-toggle {
    display: flex;
    align-items: center;
    gap: 10px;
}

.bp-unit-label {
    font-size: 18px;
    font-weight: 700;
    letter-spacing: 1px;
    color: var(--bp-mid);
    transition: color .2s;
}

.bp-unit-label.active {
    color: var(--bp-dark);
}

.bp-toggle-switch {
    position: relative;
    display: inline-block;
    width: 48px;
    height: 26px;
    cursor: pointer;
}

.bp-toggle-switch input { opacity: 0; width: 0; height: 0; }

.bp-toggle-slider {
    position: absolute;
    inset: 0;
    background: #ccc;
    border-radius: 26px;
    transition: .3s;
}

.bp-toggle-slider::before {
    content: '';
    position: absolute;
    width: 20px;
    height: 20px;
    left: 3px;
    bottom: 3px;
    background: white;
    border-radius: 50%;
    transition: .3s;
}

.bp-toggle-switch input:checked + .bp-toggle-slider {
    background: var(--bp-water);
}

.bp-toggle-switch input:checked + .bp-toggle-slider::before {
    transform: translateX(22px);
}

/* ── Number inputs ──────────────────────────────────────────────────────── */
.bp-input-with-unit {
    display: flex;
    border: 1.5px solid #d0d3d7;
    border-radius: 6px;
    overflow: hidden;
}

.bp-number-input {
    flex: 1;
    border: none;
    padding: 12px 14px;
    font-size: 18px;
    font-weight: 600;
    color: var(--bp-dark);
    outline: none;
    background: #fff;
    -moz-appearance: textfield;
}

.bp-number-input::-webkit-outer-spin-button,
.bp-number-input::-webkit-inner-spin-button { -webkit-appearance: none; }

.bp-number-input--small {
    width: 100%;
    border: 1.5px solid #d0d3d7;
    border-radius: 6px;
    font-size: 16px;
}

.bp-unit-badge {
    display: flex;
    align-items: center;
    padding: 0 16px;
    background: #f0f2f4;
    font-size: 18px;
    font-weight: 700;
    letter-spacing: 1px;
    color: var(--bp-mid);
    border-left: 1.5px solid #d0d3d7;
}

/* ── Select ─────────────────────────────────────────────────────────────── */
.bp-select {
    width: 100%;
    padding: 12px 14px;
    border: 1.5px solid #d0d3d7;
    border-radius: 6px;
    font-size: 14px;
    font-weight: 500;
    color: var(--bp-dark);
    background-color: #fff;
    cursor: pointer;
    outline: none;
    box-sizing: border-box;
}

/* High-specificity override to defeat theme interference */
.bp-nutrition-wrap select.bp-select,
.bp-nutrition-wrap .bp-select {
    display: block !important;
    width: 100% !important;
    min-width: 0 !important;
    max-width: 100% !important;
    padding: 12px 14px !important;
    font-size: 14px !important;
    color: #2c3236 !important;
    background-color: #fff !important;
    border: 1.5px solid #d0d3d7 !important;
    border-radius: 6px !important;
    box-sizing: border-box !important;
    overflow: visible !important;
    text-overflow: clip !important;
    white-space: nowrap !important;
    -webkit-appearance: menulist !important;
    -moz-appearance: menulist !important;
    appearance: auto !important;
    opacity: 1 !important;
    visibility: visible !important;
}

.bp-select:focus {
    border-color: var(--bp-pro);
}

/* ── Adjustments ────────────────────────────────────────────────────────── */
.bp-adjustments-section {
    margin-bottom: 24px;
    border: 1.5px solid #e2e4e7;
    border-radius: 8px;
    overflow: hidden;
}

.bp-adjustments-label {
    font-size: 19px;
    font-weight: 700;
    letter-spacing: 1px;
    text-transform: uppercase;
    padding: 12px 16px;
    background: #f8f9fa;
    cursor: pointer;
    list-style: none;
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.bp-adjustments-label::after {
    content: '▼';
    font-size: 10px;
    color: var(--bp-mid);
}

.bp-adjustments-section[open] .bp-adjustments-label::after {
    content: '▲';
}

.bp-adjustments-section > *:not(summary) {
    padding: 12px 16px;
}

.bp-adjustments-row {
    display: flex;
    gap: 12px;
    padding: 0 16px 12px !important;
}

.bp-adjustments-row .bp-nutrition-field {
    flex: 1;
    margin: 0;
}

/* ── Calculate button ───────────────────────────────────────────────────── */
.bp-btn-calculate {
    display: block;
    width: 100%;
    padding: 16px;
    background: var(--bp-pro);
    color: #fff;
    font-size: 20px;
    font-weight: 900;
    letter-spacing: 2px;
    text-transform: uppercase;
    border: none;
    border-radius: 8px;
    cursor: pointer;
    transition: background .2s, transform .1s;
    margin-bottom: 12px;
}

.bp-btn-calculate:hover {
    background: #8f00d9;
    transform: translateY(-1px);
}

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

.bp-disclaimer {
    font-size: 18px;
    color: var(--bp-mid);
    text-align: center;
    line-height: 1.5;
    margin-top: 8px;
}

/* ── Results sections ───────────────────────────────────────────────────── */
.bp-nutrition-results {
    padding: 0 16px;
}

.bp-hidden { display: none !important; }

.bp-results-section {
    text-align: center;
    padding: 32px 0;
    border-bottom: 1px solid #f0f0f0;
}

.bp-results-section:last-child {
    border-bottom: none;
}

/* ── Section display titles (DAILY MACROS. / EAT. / DRINK. / WATCH.) ───── */
.bp-results-display-title {
    font-size: clamp(52px, 16vw, 72px);
    font-weight: 900;
    line-height: 0.95;
    color: var(--bp-dark);
    margin: 0 0 12px;
    letter-spacing: -1px;
}

/* ── Summary lines ──────────────────────────────────────────────────────── */
.bp-macros-summary,
.bp-eat-summary,
.bp-drink-subtitle {
    font-size: 17px;
    font-weight: 500;
    margin: 0 0 16px;
    line-height: 1.5;
}

/* ── Color classes ──────────────────────────────────────────────────────── */
.bp-fat-color   { color: var(--bp-fat);    }
.bp-carbs-color { color: var(--bp-carbs);  }
.bp-pro-color   { color: var(--bp-pro);    }
.bp-fiber-color { color: var(--bp-fiber);  }
.bp-water-color { color: var(--bp-water);  }
.bp-sports-color{ color: var(--bp-sports); }

/* ── Donut charts ───────────────────────────────────────────────────────── */
.bp-donut-chart {
    width: 100%;
    height: 260px;
    margin: 0 auto 8px;
}

/* ── Macro stats (big numbers) ──────────────────────────────────────────── */
.bp-macro-stat {
    margin: 20px 0;
}

.bp-stat-value {
    display: block;
    font-size: clamp(44px, 14vw, 64px);
    font-weight: 900;
    line-height: 1;
    letter-spacing: -1px;
}

.bp-stat-label {
    display: block;
    font-size: 16px;
    font-weight: 600;
    letter-spacing: 1.5px;
    text-transform: uppercase;
    color: var(--bp-dark);
    margin-top: 4px;
}

/* ── Hints ──────────────────────────────────────────────────────────────── */
.bp-results-hint {
    font-size: 16px;
    color: var(--bp-mid);
    line-height: 1.6;
    margin-top: 16px;
    padding: 0 4px;
}

/* ── Carbs education ────────────────────────────────────────────────────── */
.bp-carbs-education {
    font-size: 17px;
    line-height: 1.7;
    color: var(--bp-dark);
    max-width: 400px;
    margin: 0 auto;
    text-align: center;
}

/* ── Save row ───────────────────────────────────────────────────────────── */
.bp-save-row {
    text-align: center;
    padding: 28px 16px 40px;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 10px;
}

.bp-btn-save-macros {
    padding: 16px 40px;
    background: var(--bp-water);
    color: #fff;
    font-size: 18px;
    font-weight: 900;
    letter-spacing: 2px;
    border: none;
    border-radius: 8px;
    cursor: pointer;
    transition: background .2s;
}

.bp-btn-save-macros:hover { background: #0090e0; }

.bp-save-feedback {
    font-size: 18px;
    font-weight: 600;
    color: #00a32a;
}

/* ── My Macros read-only wrap ───────────────────────────────────────────── */
.bp-my-macros-wrap .bp-results-section:first-child {
    padding-top: 8px;
}

/* ── Login notice ───────────────────────────────────────────────────────── */
.bp-nutrition-login,
.bp-no-macros {
    text-align: center;
    padding: 40px 20px;
    color: var(--bp-mid);
    font-size: 16px;
}
