/*
 * BattlePack™ ABP Styles
 * Matches the original — bold type, purple D1, orange FX, white raw score.
 */

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

/* ── Wrap ───────────────────────────────────────────────────────────────── */
.bp-abp-wrap {
    --bp-raw:   #2c3236;
    --bp-fx:    var(--bp-accent,  #fc9e0e);
    --bp-d1:    var(--bp-secondary, #a800ff);
    --bp-teal:  var(--bp-primary, #00ffc8);
    --bp-dark:  var(--bp-dark,    #2c3236);
    --bp-mid:   var(--bp-mid,     #495258);
    max-width: 600px;
    margin: 0 auto;
    background: #fff;
    color: var(--bp-dark);
}

/* ── Header ─────────────────────────────────────────────────────────────── */
.bp-abp-header {
    padding: 16px 20px 8px;
    text-align: center;
}

.bp-abp-name-block {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
}

.bp-abp-avatar {
    width: 37px !important;
    height: 37px !important;
    border-radius: 50%;
    object-fit: cover;
    flex-shrink: 0;
}

.bp-abp-name {
    font-size: 20px;
    font-weight: 900;
    margin: 0;
    letter-spacing: .5px;
}

/* ── Position + Combat Rating block ─────────────────────────────────────── */
.bp-abp-cr-block {
    text-align: center;
    padding: 20px 20px 16px;
}

.bp-abp-position-display {
    margin-bottom: 16px;
}

.bp-abp-position-text {
    font-size: 72px;
    font-weight: 900;
    letter-spacing: 2px;
    color: #2c3236;
    line-height: 1;
    display: block;
}

.bp-abp-position-empty { color: #ccc; }

/* ── Combat Rating ──────────────────────────────────────────────────────── */
.bp-cr-scores {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 12px;
    font-size: 48px;
    font-weight: 900;
    line-height: 1;
    margin-bottom: 8px;
}

.bp-cr-raw  { color: #2c3236; }
.bp-cr-fx   { color: #fc9e0e; }
.bp-cr-d1   { color: #a800ff; }
.bp-cr-sep  { color: #ccc; font-weight: 300; font-size: 36px; }

.bp-cr-placeholder        { font-size: 22px; font-weight: 800; letter-spacing: 1px; color: #2c3236; opacity: 0.25; }
.bp-cr-placeholder-fx     { color: #fc9e0e; opacity: 0.4; }
.bp-cr-placeholder-d1     { color: #a800ff; opacity: 0.4; }

.bp-cr-fx-label {
    font-size: 12px;
    color: #fc9e0e;
    margin: 4px 0 0;
}

/* ── Tab navigation — matches ATC style ─────────────────────────────────── */
.bp-abp-tabs {
    display: flex;
    gap: 4px;
    flex-wrap: nowrap;
    overflow-x: auto;
    overflow-y: visible;
    background: transparent;
    border-top: none;
    justify-content: safe center;
    scrollbar-width: none;
    -ms-overflow-style: none;
    -webkit-overflow-scrolling: touch;
    padding: 16px 0 0;
}

.bp-abp-tabs::-webkit-scrollbar { display: none; }

.bp-tab-btn {
    padding: 8px 18px;
    border: none;
    border-bottom: none;
    margin-bottom: 0;
    background: #495258;
    color: #abb8c3;
    font-size: 15px;
    font-weight: 700;
    cursor: pointer;
    border-radius: 12px 12px 0 0;
    transition: background 0.15s, color 0.15s;
    letter-spacing: 0.3px;
    white-space: nowrap;
    flex-shrink: 0;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 4px;
    min-width: 44px;
}

.bp-tab-btn:hover {
    background: #5c666d;
    color: #fff;
}

.bp-tab-btn.active {
    background: #a800ff;
    color: #fff;
}

.bp-tab-icon {
    width: 22px;
    height: 22px;
    object-fit: contain;
    opacity: 0.7;
    transition: opacity 0.15s;
    display: block;
}

.bp-tab-btn.active .bp-tab-icon,
.bp-tab-btn:hover  .bp-tab-icon { opacity: 1; }

.bp-tab-label {
    font-size: 18px;
    font-weight: 700;
    letter-spacing: 0.8px;
    text-transform: uppercase;
}

/* ── Panels ─────────────────────────────────────────────────────────────── */
.bp-abp-panels {
    padding: 20px;
}

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

/* ── Metric grid (B, C, STP, R tabs) ───────────────────────────────────── */
.bp-metric-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 16px;
    margin-bottom: 20px;
}

.bp-metric-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 6px;
    text-align: center;
}

.bp-metric-icon {
    width: 56px;
    height: 56px;
    object-fit: contain;
}

.bp-metric-value {
    font-size: 26px;
    font-weight: 900;
    color: var(--bp-dark);
    line-height: 1;
}

.bp-metric-label {
    display: none;
}

/* ── STP summary ────────────────────────────────────────────────────────── */
.bp-stp-summary {
    text-align: center;
    font-size: 14px;
    color: var(--bp-mid);
    margin-bottom: 16px;
    padding: 10px;
    background: #f8f9fa;
    border-radius: 6px;
}

.bp-stp-summary strong { color: var(--bp-d1); }

/* ── Intangibles grid ───────────────────────────────────────────────────── */
.bp-intangibles-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 16px;
    margin-bottom: 20px;
}

.bp-intangible-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 5px;
    text-align: center;
}

.bp-intangible-icon {
    width: 52px;
    height: 52px;
    object-fit: contain;
}

.bp-intangible-score {
    font-size: 28px;
    font-weight: 900;
    color: var(--bp-dark);
    line-height: 1;
}

.bp-intangible-label {
    display: none;
}

.bp-intangible-bar-track {
    width: 100%;
    height: 4px;
    background: #e2e4e7;
    border-radius: 2px;
    overflow: hidden;
}

.bp-intangible-bar-fill {
    height: 100%;
    background: var(--bp-teal);
    border-radius: 2px;
    transition: width .4s ease;
}

/* ── METLE list ─────────────────────────────────────────────────────────── */
.bp-metle-header { margin-bottom: 12px; }

.bp-metle-title {
    font-size: 32px;
    font-weight: 900;
    margin: 0;
    color: var(--bp-dark);
}

.bp-metle-subtitle {
    font-size: 12px;
    color: var(--bp-mid);
    margin: 0;
}

.bp-metle-list {
    display: flex;
    flex-direction: column;
    gap: 10px;
    margin-bottom: 16px;
}

.bp-metle-row {
    display: flex;
    align-items: center;
    gap: 10px;
}

.bp-metle-label {
    font-size: 13px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: .5px;
    color: var(--bp-mid);
    width: 180px;
    flex-shrink: 0;
}

.bp-metle-scores {
    display: flex;
    align-items: center;
    gap: 6px;
    width: 80px;
    flex-shrink: 0;
}

.bp-metle-sep  { color: #ccc; font-size: 14px; }

.bp-metle-bar-track {
    flex: 1;
    height: 8px;
    background: #f0f2f4;
    border-radius: 4px;
    overflow: hidden;
    position: relative;
}

.bp-metle-bar-fill {
    position: absolute;
    top: 0;
    left: 0;
    height: 100%;
    border-radius: 4px;
}

.bp-metle-raw-bar { background: var(--bp-teal); z-index: 2; }
.bp-metle-d1-bar  { background: var(--bp-d1); opacity: .25; z-index: 1; }

/* ── Focus tab ──────────────────────────────────────────────────────────── */
.bp-focus-header { margin-bottom: 16px; }

.bp-focus-title {
    font-size: 28px;
    font-weight: 900;
    color: var(--bp-dark);
    margin: 0;
}

.bp-focus-category { margin-bottom: 20px; }

.bp-focus-cat-label {
    font-size: 14px;
    font-weight: 800;
    text-transform: uppercase;
    letter-spacing: 1px;
    color: var(--bp-mid);
    margin: 0 0 8px;
    padding-bottom: 4px;
    border-bottom: 1px solid #e2e4e7;
}

.bp-focus-lessons { display: flex; flex-direction: column; gap: 8px; }

.bp-focus-lesson-card {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 10px 12px;
    background: #f8f9fa;
    border: 1px solid #e2e4e7;
    border-radius: 8px;
    text-decoration: none;
    color: var(--bp-dark);
    transition: all .15s;
}

.bp-focus-lesson-card:hover {
    background: #fff;
    border-color: var(--bp-teal);
    box-shadow: 0 2px 8px rgba(0,255,200,.15);
}

.bp-focus-lesson-thumb img {
    width: 48px;
    height: 48px;
    object-fit: cover;
    border-radius: 4px;
}

.bp-focus-lesson-info {
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.bp-focus-lesson-title {
    font-size: 13px;
    font-weight: 700;
    color: var(--bp-dark);
    line-height: 1.3;
}

.bp-focus-lesson-course {
    font-size: 11px;
    color: var(--bp-mid);
}

.bp-focus-lesson-duration {
    font-size: 11px;
    color: var(--bp-teal);
    font-weight: 600;
}

.bp-focus-lesson-arrow {
    color: var(--bp-teal);
    font-size: 18px;
    font-weight: 700;
}

/* ── About text ─────────────────────────────────────────────────────────── */
.bp-tab-about {
    font-size: 13px;
    color: var(--bp-mid);
    line-height: 1.6;
    text-align: center;
    padding: 12px 4px 0;
    border-top: 1px solid #f0f0f0;
    margin-top: 16px;
}

.bp-tab-notice {
    text-align: center;
    color: var(--bp-mid);
    font-size: 14px;
    padding: 32px 16px;
    background: #f8f9fa;
    border-radius: 8px;
}

/* ── ABP Lab ──────────────────────────────────────────────────────────────── */
.bp-abp-lab-wrap { max-width: 900px; margin: 0 auto; padding: 0 0 40px; }

/* Search */
.bp-lab-search-wrap { position: relative; margin-bottom: 20px; }
.bp-lab-search-input {
    width: 100%;
    padding: 14px 18px;
    font-size: 18px;
    font-weight: 500;
    border: 2px solid #d0d3d7;
    border-radius: 8px;
    box-sizing: border-box;
    outline: none;
}
.bp-lab-search-input:focus { border-color: #7c3aed; }

.bp-lab-search-results {
    position: absolute;
    top: 100%;
    left: 0; right: 0;
    background: #fff;
    border: 1.5px solid #d0d3d7;
    border-top: none;
    border-radius: 0 0 8px 8px;
    z-index: 100;
    max-height: 260px;
    overflow-y: auto;
    box-shadow: 0 4px 16px rgba(0,0,0,.12);
}
.bp-lab-result-item {
    padding: 12px 16px;
    cursor: pointer;
    border-bottom: 1px solid #f0f0f0;
    font-size: 14px;
    line-height: 1.4;
}
.bp-lab-result-item:hover { background: #f5f0ff; }
.bp-lab-result-item:last-child { border-bottom: none; }
.bp-lab-result-empty { padding: 12px 16px; color: #888; font-size: 14px; }
.bp-lab-pos-badge {
    display: inline-block;
    background: #7c3aed;
    color: #fff;
    padding: 1px 7px;
    border-radius: 4px;
    font-size: 11px;
    font-weight: 700;
    letter-spacing: 0.5px;
    vertical-align: middle;
}

/* Athlete header */
.bp-lab-athlete-header {
    display: flex;
    align-items: center;
    gap: 12px;
    background: #2c3236;
    color: #fff;
    padding: 14px 18px;
    border-radius: 8px;
    margin-bottom: 20px;
    flex-wrap: wrap;
}
.bp-lab-athlete-name { font-size: 18px; font-weight: 800; letter-spacing: 0.5px; flex: 1; }
.bp-lab-athlete-pos  { font-size: 13px; font-weight: 700; color: #00ffc8; letter-spacing: 1px; }
.bp-lab-clear-btn {
    background: transparent;
    border: 1px solid #64747d;
    color: #abb8c3;
    padding: 6px 12px;
    border-radius: 4px;
    font-size: 12px;
    cursor: pointer;
}
.bp-lab-clear-btn:hover { border-color: #fff; color: #fff; }

/* History */
.bp-lab-history { margin-bottom: 24px; }
.bp-lab-history h3 { font-size: 13px; font-weight: 700; letter-spacing: 1px; text-transform: uppercase; color: #64747d; margin: 0 0 10px; }
.bp-lab-history-table { width: 100%; border-collapse: collapse; font-size: 13px; }
.bp-lab-history-table th { background: #2c3236; color: #abb8c3; padding: 7px 10px; text-align: left; font-weight: 700; letter-spacing: 0.5px; font-size: 12px; }
.bp-lab-history-table td { padding: 7px 10px; border-bottom: 1px solid #e2e4e7; }
.bp-lab-history-table tr:last-child td { border-bottom: none; }

/* Form */
.bp-abp-lab-form { background: #fff; border: 1px solid #e2e4e7; border-radius: 8px; padding: 24px; }
.bp-lab-section { margin-bottom: 24px; }
.bp-lab-section-title { font-size: 12px; font-weight: 800; letter-spacing: 1.5px; text-transform: uppercase; color: #2c3236; margin: 0 0 14px; padding-bottom: 8px; border-bottom: 2px solid #e2e4e7; }
.bp-lab-hint { font-weight: 400; color: #64747d; text-transform: none; letter-spacing: 0; }
.bp-lab-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(160px, 1fr)); gap: 14px; }
.bp-lab-field { display: flex; flex-direction: column; gap: 5px; }
.bp-lab-field label { font-size: 10px; font-weight: 700; letter-spacing: 1px; text-transform: uppercase; color: #64747d; }
.bp-lab-input {
    padding: 9px 11px;
    border: 1.5px solid #d0d3d7;
    border-radius: 6px;
    font-size: 15px;
    font-weight: 500;
    color: #2c3236;
    background: #fff;
    width: 100%;
    box-sizing: border-box;
}
.bp-lab-input:focus { border-color: #7c3aed; outline: none; }
.bp-lab-checkbox { display: flex; align-items: center; gap: 8px; font-size: 13px; font-weight: 500; cursor: pointer; }
.bp-lab-textarea { width: 100%; padding: 10px 12px; border: 1.5px solid #d0d3d7; border-radius: 6px; font-size: 14px; resize: vertical; box-sizing: border-box; }

.bp-lab-actions { margin-top: 20px; padding-top: 18px; border-top: 1px solid #e2e4e7; }
.bp-lab-submit-btn { background: #7c3aed; color: #fff; border: none; padding: 13px 28px; font-size: 13px; font-weight: 800; letter-spacing: 1.5px; text-transform: uppercase; border-radius: 6px; cursor: pointer; }
.bp-lab-submit-btn:hover { background: #6d28d9; }
.bp-lab-submit-btn:disabled { opacity: 0.6; cursor: not-allowed; }

.bp-lab-form-msg { padding: 11px 14px; border-radius: 6px; font-size: 14px; font-weight: 600; margin-bottom: 14px; }
.bp-lab-msg-success { background: #d1fae5; color: #065f46; border: 1px solid #6ee7b7; }
.bp-lab-msg-error   { background: #fee2e2; color: #991b1b; border: 1px solid #fca5a5; }

@media (max-width: 600px) {
    .bp-lab-grid { grid-template-columns: 1fr 1fr; }
}
