/* ============================================================
   K Performance — Body Analysis Widget v3
   Large text, full labels, readable
   ============================================================ */
@import url('https://fonts.googleapis.com/css2?family=Orbitron:wght@400;500;600;700&display=swap');


:root {
    --ba-cyan: #00f7ff;
    --ba-cyan-dim: rgba(0,247,255,0.15);
    --ba-gold: #D4AF37;
    --ba-gold-dim: rgba(212,175,55,0.18);
    --ba-bg: #050508;
    --ba-card: #0a0a10;
    --ba-border: rgba(0,247,255,0.12);
    --ba-text: #FAFAFA;
    --ba-gray: #999aaa;
    --ba-font: 'Orbitron', 'Montserrat', sans-serif;
}

/* Layout */
.ba-widget {
    width: 100%;
    display: grid;
    grid-template-columns: 320px 1fr;
    gap: 16px;
    font-family: var(--ba-font);
    min-height: calc(100vh - 150px);
}

/* ---- LEFT COLUMN ---- */
.ba-left {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

/* Gender toggle */
.ba-gender-toggle {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 4px;
    background: var(--ba-card);
    border: 1px solid var(--ba-border);
    border-radius: 12px;
    padding: 4px;
}
.ba-gender-btn {
    padding: 12px 0;
    border: none;
    border-radius: 10px;
    background: transparent;
    color: var(--ba-gray);
    font-family: var(--ba-font);
    font-size: 13px;
    font-weight: 700;
    letter-spacing: 3px;
    cursor: pointer;
    transition: all 0.25s;
    text-transform: uppercase;
}
.ba-gender-btn.active {
    background: var(--ba-cyan-dim);
    color: var(--ba-cyan);
    box-shadow: 0 0 16px rgba(0,247,255,0.18);
}
.ba-gender-btn:hover:not(.active) { color: var(--ba-text); background: rgba(255,255,255,0.03); }

/* Card */
.ba-card {
    background: var(--ba-card);
    border: 1px solid var(--ba-border);
    border-radius: 12px;
    padding: 16px 18px;
}
.ba-card-title {
    font-size: 12px;
    font-weight: 700;
    letter-spacing: 3px;
    text-transform: uppercase;
    color: var(--ba-cyan);
    margin-bottom: 16px;
}

/* Input row */
.ba-input-row {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 12px;
}
.ba-input-row:last-child { margin-bottom: 0; }
.ba-input-label {
    width: 80px;
    font-size: 11px;
    font-weight: 600;
    letter-spacing: 0.5px;
    color: var(--ba-gray);
    flex-shrink: 0;
    font-family: 'Montserrat', sans-serif;
}
.ba-input-slider {
    flex: 1;
    -webkit-appearance: none;
    appearance: none;
    height: 5px;
    background: rgba(0,247,255,0.12);
    border-radius: 3px;
    outline: none;
    transition: background 0.2s;
}
.ba-input-slider:hover { background: rgba(0,247,255,0.25); }
.ba-input-slider::-webkit-slider-thumb {
    -webkit-appearance: none;
    width: 18px; height: 18px;
    background: var(--ba-cyan);
    border-radius: 50%;
    cursor: pointer;
    box-shadow: 0 0 10px rgba(0,247,255,0.5);
    transition: transform 0.15s;
}
.ba-input-slider::-webkit-slider-thumb:hover { transform: scale(1.3); }
.ba-input-slider::-moz-range-thumb {
    width: 18px; height: 18px;
    background: var(--ba-cyan);
    border-radius: 50%;
    cursor: pointer;
    border: none;
}
.ba-input-field {
    width: 56px;
    padding: 6px 6px;
    background: rgba(0,247,255,0.06);
    border: 1px solid rgba(0,247,255,0.18);
    border-radius: 8px;
    color: var(--ba-text);
    font-family: var(--ba-font);
    font-size: 13px;
    text-align: center;
    font-weight: 700;
    -moz-appearance: textfield;
    transition: border-color 0.2s, box-shadow 0.2s;
}
.ba-input-field::-webkit-inner-spin-button,
.ba-input-field::-webkit-outer-spin-button { -webkit-appearance: none; }
.ba-input-field:focus {
    outline: none;
    border-color: var(--ba-cyan);
    box-shadow: 0 0 12px rgba(0,247,255,0.25);
}
.ba-input-unit {
    font-size: 10px;
    color: var(--ba-gray);
    width: 18px;
    font-weight: 600;
}

/* Criteria box */
.ba-criteria {
    background: var(--ba-card);
    border: 1px solid var(--ba-gold-dim);
    border-radius: 12px;
    padding: 14px 16px;
    text-align: center;
    margin-top: auto;
}
.ba-criteria-label {
    font-size: 9px;
    color: var(--ba-gray);
    letter-spacing: 2px;
    text-transform: uppercase;
    margin-bottom: 6px;
}
.ba-criteria-value {
    font-size: 12px;
    color: var(--ba-gold);
    font-weight: 700;
    letter-spacing: 1px;
    line-height: 1.5;
}

/* ---- RIGHT COLUMN — BODY PANEL ---- */
.ba-body-panel {
    position: relative;
    background: radial-gradient(ellipse at 50% 40%, rgba(0,247,255,0.04) 0%, var(--ba-bg) 70%);
    border: 1px solid var(--ba-border);
    border-radius: 14px;
    overflow: hidden;
    min-height: calc(100vh - 150px);
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
}

/* Corner brackets */
.ba-body-panel::before, .ba-body-panel::after, .ba-corner-bl, .ba-corner-br {
    content: ''; position: absolute; width: 24px; height: 24px;
    border-color: var(--ba-cyan); border-style: solid; border-width: 0;
    opacity: 0.4; pointer-events: none;
}
.ba-body-panel::before { top: 10px; left: 10px; border-top-width: 2px; border-left-width: 2px; }
.ba-body-panel::after { top: 10px; right: 10px; border-top-width: 2px; border-right-width: 2px; }
.ba-corner-bl { bottom: 10px; left: 10px; border-bottom-width: 2px; border-left-width: 2px; }
.ba-corner-br { bottom: 10px; right: 10px; border-bottom-width: 2px; border-right-width: 2px; }

/* Grid + scan */
.ba-grid-lines {
    position: absolute; inset: 0; pointer-events: none;
    background: repeating-linear-gradient(0deg, transparent, transparent 49px, rgba(0,247,255,0.025) 49px, rgba(0,247,255,0.025) 50px);
}
.ba-scan-line {
    position: absolute; left: 0; right: 0; height: 2px;
    background: linear-gradient(90deg, transparent 0%, var(--ba-cyan) 30%, var(--ba-cyan) 70%, transparent 100%);
    opacity: 0.22; animation: ba-scan 3s linear infinite; pointer-events: none;
    clip-path: inset(0 0 0 0 round 14px);
}
@keyframes ba-scan { 0% { top: 0; } 100% { top: 100%; } }

/* Result badge */
.ba-result-badge {
    position: absolute; top: 18px; left: 50%; transform: translateX(-50%);
    padding: 8px 24px; border: 1px solid var(--ba-gold); border-radius: 24px;
    background: rgba(212,175,55,0.08); box-shadow: 0 0 20px rgba(212,175,55,0.12);
    font-size: 14px; font-weight: 700; letter-spacing: 3px;
    color: var(--ba-gold); text-transform: uppercase; z-index: 5; white-space: nowrap;
}

/* SVG body */
.ba-svg-wrap { position: relative; z-index: 2; width: 320px; height: 540px; }
.ba-svg-wrap svg { width: 100%; height: 100%; }

/* HUD metrics */
.ba-hud { position: absolute; z-index: 5; }
.ba-hud-tl { top: 55px; left: 20px; text-align: left; }
.ba-hud-tr { top: 55px; right: 20px; text-align: right; }
.ba-hud-bl { bottom: 80px; left: 20px; text-align: left; }
.ba-hud-br { bottom: 80px; right: 20px; text-align: right; }
.ba-hud-label {
    font-size: 10px; letter-spacing: 3px; color: var(--ba-gray);
    text-transform: uppercase; margin-bottom: 4px; font-weight: 600;
}
.ba-hud-value {
    font-size: 32px; font-weight: 700; color: var(--ba-cyan);
    text-shadow: 0 0 14px rgba(0,247,255,0.3); line-height: 1;
}
.ba-hud-est {
    font-size: 9px; color: var(--ba-gray); letter-spacing: 1.5px; margin-top: 4px; font-weight: 500;
}

/* Measurement labels */
.ba-measure-label {
    position: absolute; z-index: 4; font-size: 12px; font-weight: 700;
    color: var(--ba-gold); letter-spacing: 1.5px; white-space: nowrap; pointer-events: none;
}
.ba-measure-label::before {
    content: ''; position: absolute; top: 50%; width: 22px; height: 1px;
    background: var(--ba-gold); opacity: 0.5;
}
.ba-ml-right { right: calc(50% + 165px); }
.ba-ml-right::before { right: -26px; }

/* ---- CATEGORY STRIP ---- */
.ba-cat-strip {
    position: absolute; bottom: 10px; left: 8px; right: 8px;
    display: flex; gap: 4px; justify-content: center; flex-wrap: wrap; z-index: 5;
}
.ba-cat-chip {
    position: relative; padding: 5px 10px;
    border: 1px solid rgba(255,255,255,0.08); border-radius: 16px;
    font-family: var(--ba-font); font-size: 10px; letter-spacing: 1.5px;
    color: var(--ba-gray); background: rgba(0,0,0,0.6);
    cursor: pointer; transition: all 0.25s; text-transform: uppercase;
    white-space: nowrap; font-weight: 600;
}
.ba-cat-chip:hover {
    color: var(--ba-text); border-color: rgba(0,247,255,0.3);
    background: rgba(0,247,255,0.06); transform: translateY(-3px);
}
.ba-cat-chip.active {
    border-color: var(--ba-gold); color: var(--ba-gold);
    background: rgba(212,175,55,0.10); box-shadow: 0 0 14px rgba(212,175,55,0.18);
}

/* Tooltip */
/* Tooltip — overlay a képernyő közepén, JS által vezérelve */
.ba-tooltip-overlay {
    display: none;
    position: fixed;
    top: 0; left: 0; right: 0; bottom: 0;
    z-index: 9998;
    background: rgba(0,0,0,0.5);
}
.ba-tooltip-overlay.open { display: flex; align-items: center; justify-content: center; }
.ba-tooltip-box {
    width: 320px;
    padding: 22px 26px;
    background: rgba(5,5,10,0.98);
    border: 1px solid var(--ba-cyan);
    border-radius: 16px;
    backdrop-filter: blur(18px);
    box-shadow: 0 0 50px rgba(0,247,255,0.15), 0 16px 48px rgba(0,0,0,0.85);
    animation: ba-tooltip-in 0.2s ease;
}
@keyframes ba-tooltip-in { from { transform: scale(0.9); opacity: 0; } to { transform: scale(1); opacity: 1; } }
/* Hide inline tooltips — we use the overlay now */
.ba-cat-chip .ba-tooltip { display: none !important; }
.ba-tooltip-title { font-size: 11px; font-weight: 700; color: var(--ba-cyan); letter-spacing: 2px; margin-bottom: 6px; }
.ba-tooltip-desc { font-size: 11px; color: var(--ba-text); line-height: 1.6; font-family: 'Montserrat', sans-serif; opacity: 0.85; }
.ba-tooltip-criteria { font-size: 9px; color: var(--ba-gold); margin-top: 8px; padding-top: 8px; border-top: 1px solid rgba(255,255,255,0.06); letter-spacing: 1px; font-weight: 600; }

/* ---- DISCLAIMER ---- */
.ba-disclaimer-btn {
    position: absolute; top: 18px; right: 18px; padding: 6px 16px;
    border: 1px solid rgba(255,200,50,0.25); border-radius: 16px;
    background: rgba(0,0,0,0.6); color: var(--ba-gold);
    font-family: var(--ba-font); font-size: 9px; font-weight: 600;
    letter-spacing: 1.5px; cursor: pointer; z-index: 10; transition: all 0.2s;
}
.ba-disclaimer-btn:hover { background: rgba(212,175,55,0.12); transform: translateY(-1px); }
.ba-disclaimer-panel {
    display: none; position: absolute; top: 48px; right: 14px; width: 320px;
    background: rgba(5,5,8,0.97); border: 1px solid var(--ba-border);
    border-radius: 14px; padding: 18px; z-index: 20;
    backdrop-filter: blur(14px); box-shadow: 0 12px 44px rgba(0,0,0,0.7);
}
.ba-disclaimer-panel.open { display: block; }
.ba-disc-title { font-size: 10px; letter-spacing: 3px; color: var(--ba-cyan); text-transform: uppercase; margin-bottom: 10px; font-weight: 700; }
.ba-disc-table { width: 100%; border-collapse: collapse; margin-bottom: 14px; }
.ba-disc-table th, .ba-disc-table td { font-size: 10px; padding: 6px 8px; text-align: left; border-bottom: 1px solid rgba(255,255,255,0.04); color: var(--ba-gray); font-family: 'Montserrat', sans-serif; }
.ba-disc-table th { color: var(--ba-text); font-weight: 700; letter-spacing: 1px; }
.ba-disc-note { font-size: 10px; color: var(--ba-gray); line-height: 1.7; margin-bottom: 12px; padding: 8px 12px; border-left: 2px solid var(--ba-gold); background: rgba(212,175,55,0.04); border-radius: 0 6px 6px 0; font-family: 'Montserrat', sans-serif; }
.ba-disc-cta { display: block; text-align: center; padding: 8px; border: 1px solid var(--ba-gold-dim); border-radius: 8px; color: var(--ba-gold); font-size: 10px; font-weight: 700; letter-spacing: 1.5px; text-decoration: none; transition: all 0.2s; }
.ba-disc-cta:hover { background: rgba(212,175,55,0.12); transform: translateY(-1px); }

/* ---- RESPONSIVE ---- */

/* Tablet */
@media (max-width: 900px) {
    .ba-widget {
        grid-template-columns: 1fr;
        gap: 12px;
        min-height: auto;
    }
    .ba-left {
        display: grid;
        grid-template-columns: 1fr 1fr;
        gap: 8px;
    }
    .ba-gender-toggle { grid-column: 1 / -1; }
    .ba-criteria { grid-column: 1 / -1; }
    .ba-body-panel { min-height: 480px; }
    .ba-hud-value { font-size: 20px; }
    .ba-result-badge { font-size: 11px; padding: 6px 16px; }
    .ba-svg-wrap { width: 240px; height: 440px; }
    .ba-disclaimer-panel { width: 260px; right: 8px; }
}

/* Telefon */
@media (max-width: 480px) {
    .ba-widget { gap: 8px; }
    .ba-left {
        grid-template-columns: 1fr;
        gap: 6px;
    }
    .ba-card { padding: 10px 12px; }
    .ba-card-title { font-size: 10px; margin-bottom: 10px; letter-spacing: 2px; }
    .ba-input-row { gap: 6px; margin-bottom: 8px; }
    .ba-input-label { width: 60px; font-size: 10px; }
    .ba-input-field { width: 48px; font-size: 12px; padding: 4px; }
    .ba-input-slider { height: 4px; }
    .ba-gender-btn { padding: 8px 0; font-size: 11px; }

    .ba-body-panel { min-height: 400px; }
    .ba-svg-wrap { width: 180px; height: 340px; }

    .ba-hud-value { font-size: 16px; }
    .ba-hud-label { font-size: 7px; letter-spacing: 1.5px; }
    .ba-hud-est { font-size: 7px; }
    .ba-hud-tl { top: 40px; left: 10px; }
    .ba-hud-tr { top: 40px; right: 10px; }
    .ba-hud-bl { bottom: 55px; left: 10px; }
    .ba-hud-br { bottom: 55px; right: 10px; }

    .ba-result-badge { font-size: 9px; padding: 4px 12px; letter-spacing: 2px; top: 12px; }
    .ba-disclaimer-btn { font-size: 7px; padding: 4px 10px; top: 12px; right: 10px; }
    .ba-disclaimer-panel { width: 220px; right: 5px; top: 36px; padding: 12px; }
    .ba-disc-table th, .ba-disc-table td { font-size: 8px; padding: 3px 5px; }

    .ba-cat-strip { bottom: 6px; left: 4px; right: 4px; gap: 3px; }
    .ba-cat-chip { padding: 3px 6px; font-size: 7px; letter-spacing: 0.8px; border-radius: 10px; }

    .ba-criteria { padding: 8px 10px; }
    .ba-criteria-value { font-size: 10px; }
}

/* Kis telefon */
@media (max-width: 360px) {
    .ba-svg-wrap { width: 150px; height: 290px; }
    .ba-hud-value { font-size: 14px; }
    .ba-cat-chip { padding: 2px 5px; font-size: 6px; }
    .ba-body-panel { min-height: 350px; }
}

/* Tooltip overlay — mindig responsive */
.ba-tooltip-overlay .ba-tooltip-box {
    max-width: calc(100vw - 40px);
}
@media (max-width: 480px) {
    .ba-tooltip-overlay .ba-tooltip-box {
        width: calc(100vw - 32px);
        padding: 16px 18px;
    }
    .ba-tooltip-title { font-size: 10px !important; }
    .ba-tooltip-desc { font-size: 10px !important; }
    .ba-tooltip-criteria { font-size: 8px !important; }
}
