/*
 * BattlePack™ Meal Tracker Styles
 */

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

.bp-tracker-wrap {
    --bp-fat:   #ffcd00;
    --bp-carbs: #ff00ff;
    --bp-pro:   #a800ff;
    --bp-teal:  #00ffc8;
    --bp-dark:  #1a1a1a;
    --bp-mid:   #646464;
    --bp-border:#e2e4e7;
    font-family: 'Barlow', sans-serif;
    max-width: 520px;
    margin: 0 auto;
}

/* ── Header ─────────────────────────────────────────────────────────────── */
.bp-tracker-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 16px;
}

.bp-tracker-date {
    font-family: 'Barlow Condensed', sans-serif;
    font-size: 22px;
    font-weight: 900;
    letter-spacing: 1px;
    margin: 0;
    color: var(--bp-dark);
}

.bp-tracker-today-link {
    font-size: 13px;
    color: var(--bp-pro);
    text-decoration: none;
    font-weight: 600;
}

/* ── Daily totals bars ──────────────────────────────────────────────────── */
.bp-tracker-totals {
    background: #f8f9fa;
    border: 1px solid var(--bp-border);
    border-radius: 10px;
    padding: 14px 16px;
    margin-bottom: 20px;
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.bp-macro-bar-wrap {}

.bp-macro-bar-header {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 5px;
}

.bp-macro-bar-label {
    font-family: 'Barlow Condensed', sans-serif;
    font-size: 13px;
    font-weight: 800;
    letter-spacing: 1px;
    width: 46px;
}

.bp-macro-bar-vals {
    font-size: 13px;
    font-weight: 600;
    color: var(--bp-dark);
    flex: 1;
}

.bp-macro-bar-vals.bp-over-target { color: #d63638; }
.bp-bar-divider { color: var(--bp-mid); margin: 0 2px; }

.bp-macro-bar-pct {
    font-size: 12px;
    font-weight: 700;
    color: var(--bp-mid);
    width: 36px;
    text-align: right;
}

.bp-macro-bar-track {
    height: 6px;
    background: #e2e4e7;
    border-radius: 3px;
    overflow: hidden;
}

.bp-macro-bar-fill {
    height: 100%;
    border-radius: 3px;
    transition: width .4s ease;
    min-width: 2px;
}

.bp-macro-bar-fill.bp-over { opacity: .7; }

/* ── Meal cards ─────────────────────────────────────────────────────────── */
.bp-meals-list { margin-bottom: 20px; }

.bp-no-meals {
    text-align: center;
    padding: 24px;
    color: var(--bp-mid);
    font-size: 14px;
    background: #f8f9fa;
    border-radius: 8px;
    border: 1px dashed var(--bp-border);
}

.bp-meal-card {
    background: #fff;
    border: 1px solid var(--bp-border);
    border-radius: 10px;
    padding: 14px;
    margin-bottom: 10px;
    transition: border-color .2s;
}

.bp-meal-card:hover { border-color: #c0c5ca; }

.bp-meal-card-header {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    margin-bottom: 8px;
    gap: 8px;
}

.bp-meal-card-title {
    display: flex;
    align-items: center;
    gap: 6px;
    flex: 1;
    flex-wrap: wrap;
}

.bp-meal-icon { font-size: 15px; }

.bp-meal-name {
    font-weight: 700;
    font-size: 14px;
    color: var(--bp-dark);
}

.bp-meal-slot {
    font-size: 11px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: .5px;
    color: var(--bp-mid);
    background: #f0f2f4;
    padding: 2px 7px;
    border-radius: 10px;
}

.bp-meal-card-actions {
    display: flex;
    gap: 4px;
}

.bp-meal-edit-btn,
.bp-meal-delete-btn {
    background: none;
    border: none;
    cursor: pointer;
    font-size: 14px;
    padding: 4px;
    opacity: .5;
    transition: opacity .15s;
    line-height: 1;
}

.bp-meal-edit-btn:hover   { opacity: 1; }
.bp-meal-delete-btn:hover { opacity: 1; color: #d63638; }

.bp-meal-photo {
    width: 100%;
    max-height: 200px;
    object-fit: cover;
    border-radius: 6px;
    margin-bottom: 8px;
}

.bp-food-items {
    list-style: none;
    padding: 0;
    margin: 0 0 8px;
    font-size: 12px;
    color: var(--bp-mid);
    line-height: 1.6;
}

.bp-food-items li::before { content: '• '; }

.bp-meal-macros {
    display: flex;
    gap: 12px;
    font-size: 13px;
    font-weight: 700;
    flex-wrap: wrap;
}

.bp-meal-cal { color: var(--bp-dark); }

.bp-meal-notes {
    font-size: 12px;
    color: var(--bp-mid);
    font-style: italic;
    margin: 6px 0 0;
}

/* ── Add meal panel ─────────────────────────────────────────────────────── */
.bp-add-meal-panel {
    background: #fff;
    border: 1px solid var(--bp-border);
    border-radius: 10px;
    padding: 18px;
}

.bp-panel-title {
    font-family: 'Barlow Condensed', sans-serif;
    font-size: 18px;
    font-weight: 900;
    letter-spacing: 1px;
    margin: 0 0 14px;
    color: var(--bp-dark);
    padding-bottom: 10px;
    border-bottom: 2px solid var(--bp-teal);
    display: inline-block;
}

/* ── Method toggle ──────────────────────────────────────────────────────── */
.bp-method-toggle {
    display: flex;
    gap: 8px;
    margin-bottom: 16px;
}

.bp-method-btn {
    flex: 1;
    padding: 10px;
    border: 1.5px solid var(--bp-border);
    border-radius: 8px;
    background: #f8f9fa;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    transition: all .15s;
    color: var(--bp-mid);
}

.bp-method-btn.active {
    background: var(--bp-pro);
    border-color: var(--bp-pro);
    color: #fff;
}

.bp-entry-panel { display: none; }
.bp-entry-panel.active { display: block; }

/* ── Photo upload area ──────────────────────────────────────────────────── */
.bp-photo-upload-area {
    position: relative;
    width: 100%;
    min-height: 160px;
    border: 2px dashed var(--bp-border);
    border-radius: 10px;
    cursor: pointer;
    transition: border-color .2s;
    overflow: hidden;
    margin-bottom: 12px;
    background: #f8f9fa;
}

.bp-photo-upload-area:hover { border-color: var(--bp-pro); }
.bp-photo-upload-area.bp-has-photo { border-style: solid; }

.bp-photo-input-hidden {
    position: absolute;
    inset: 0;
    opacity: 0;
    cursor: pointer;
    width: 100%;
    height: 100%;
    z-index: 2;
}

.bp-photo-placeholder {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 28px 16px;
    gap: 8px;
    text-align: center;
}

.bp-photo-icon { font-size: 36px; }

.bp-photo-label {
    font-size: 14px;
    font-weight: 600;
    color: var(--bp-dark);
}

.bp-photo-tip {
    font-size: 11px;
    color: var(--bp-mid);
}

.bp-photo-preview {
    width: 100%;
    max-height: 260px;
    object-fit: cover;
    display: block;
}

/* ── Analyze button ─────────────────────────────────────────────────────── */
.bp-btn-analyze {
    display: block;
    width: 100%;
    padding: 13px;
    background: var(--bp-teal);
    color: #0a0f0f;
    font-family: 'Barlow Condensed', sans-serif;
    font-size: 17px;
    font-weight: 900;
    letter-spacing: 2px;
    border: none;
    border-radius: 8px;
    cursor: pointer;
    transition: background .2s;
    margin-bottom: 16px;
}

.bp-btn-analyze:disabled {
    opacity: .4;
    cursor: not-allowed;
}

.bp-btn-analyze:not(:disabled):hover { background: #00e5b4; }

/* ── Analysis result ────────────────────────────────────────────────────── */
.bp-analysis-result {
    background: #f8f9fa;
    border: 1px solid var(--bp-border);
    border-radius: 8px;
    padding: 14px;
    margin-bottom: 12px;
}

.bp-analysis-header {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 10px;
}

.bp-analysis-title {
    font-weight: 700;
    font-size: 15px;
    color: var(--bp-dark);
    flex: 1;
}

.bp-confidence-badge {
    font-size: 11px;
    font-weight: 700;
    padding: 3px 8px;
    border-radius: 10px;
    text-transform: uppercase;
    letter-spacing: .5px;
}

.bp-confidence-badge.high   { background: #d1e7dd; color: #0a3622; }
.bp-confidence-badge.medium { background: #fff3cd; color: #664d03; }
.bp-confidence-badge.low    { background: #f8d7da; color: #58151c; }

.bp-food-items-list {
    font-size: 12px;
    color: var(--bp-mid);
    line-height: 1.7;
    margin-bottom: 8px;
}

.bp-analysis-notes {
    font-size: 11px;
    color: #d63638;
    font-style: italic;
    margin-bottom: 10px;
}

.bp-confirm-title {
    font-family: 'Barlow Condensed', sans-serif;
    font-size: 14px;
    font-weight: 800;
    letter-spacing: 1px;
    margin: 12px 0 4px;
    color: var(--bp-dark);
}

.bp-confirm-hint {
    font-size: 11px;
    color: var(--bp-mid);
    margin-bottom: 10px;
}

/* ── Macro inputs ───────────────────────────────────────────────────────── */
.bp-macro-inputs {
    display: grid;
    grid-template-columns: 1fr 1fr 1fr 1fr;
    gap: 10px;
    margin-bottom: 12px;
}

.bp-macro-input-group {
    display: flex;
    flex-direction: column;
    gap: 4px;
    align-items: center;
}

.bp-macro-input-label {
    font-family: 'Barlow Condensed', sans-serif;
    font-size: 12px;
    font-weight: 800;
    letter-spacing: 1px;
    text-transform: uppercase;
}

.bp-macro-input {
    width: 100%;
    text-align: center;
    padding: 8px 4px;
    border: 1.5px solid var(--bp-border);
    border-radius: 6px;
    font-size: 16px;
    font-weight: 700;
    color: var(--bp-dark);
    outline: none;
    -moz-appearance: textfield;
    box-sizing: border-box;
}

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

.bp-macro-input:focus { border-color: var(--bp-pro); }
.bp-macro-unit { font-size: 11px; color: var(--bp-mid); font-weight: 600; }

/* ── Field rows ─────────────────────────────────────────────────────────── */
.bp-field-row {
    margin-bottom: 10px;
}

.bp-optional {
    font-size: 11px;
    color: var(--bp-mid);
    font-weight: 400;
    text-transform: none;
    letter-spacing: 0;
}

.bp-text-input {
    width: 100%;
    padding: 9px 12px;
    border: 1.5px solid var(--bp-border);
    border-radius: 6px;
    font-size: 14px;
    outline: none;
    box-sizing: border-box;
}

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

/* ── Log button ─────────────────────────────────────────────────────────── */
.bp-btn-log {
    display: block;
    width: 100%;
    padding: 13px;
    background: var(--bp-pro);
    color: #fff;
    font-family: 'Barlow Condensed', sans-serif;
    font-size: 17px;
    font-weight: 900;
    letter-spacing: 2px;
    border: none;
    border-radius: 8px;
    cursor: pointer;
    transition: background .2s;
    margin-top: 14px;
}

.bp-btn-log:hover { background: #8f00d9; }
.bp-btn-log:disabled { opacity: .5; cursor: not-allowed; }

/* ── Feedback ───────────────────────────────────────────────────────────── */
.bp-tracker-feedback {
    text-align: center;
    padding: 8px 0;
    font-size: 14px;
    font-weight: 600;
    color: #00a32a;
    min-height: 28px;
}

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