/* ═══════════════════════════════════════════════════
   FHR Workout Software Pro — style.css v2.0
   © Seremailragno Edizioni — https://www.seremailragno.com
   Struttura identica a Gear Climb Analyzer Pro
═══════════════════════════════════════════════════ */
@import url('https://fonts.googleapis.com/css2?family=Barlow+Condensed:wght@400;600;700;900&family=Barlow:wght@400;500;600&display=swap');

/* ── Reset & base ─────────────────────────────── */
#gym-app, #gym-app * { box-sizing: border-box; }
#gym-app {
    font-family: 'Barlow', sans-serif;
    max-width: 860px;
    margin: 32px auto 48px;
    background: #0d0f14;
    border-radius: 16px;
    overflow: hidden;
    box-shadow: 0 20px 60px rgba(0,0,0,.6);
    border: 1px solid #1e2230;
    color: #dde1f0;
}

/* ── Header ───────────────────────────────────── */
.gym-header {
    background: linear-gradient(135deg, #111318 0%, #181c26 60%, #1a1208 100%);
    border-bottom: 3px solid #e85500;
}
.gym-header-inner {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 18px 28px;
    gap: 16px;
}
.gym-brand { display: flex; align-items: center; gap: 14px; }
.gym-brand-icon { font-size: 2.2rem; filter: drop-shadow(0 0 10px rgba(232,85,0,.6)); }
.gym-brand-title {
    display: block;
    font-family: 'Barlow Condensed', sans-serif;
    font-size: 1.5rem;
    font-weight: 900;
    letter-spacing: .04em;
    color: #fff;
    text-transform: uppercase;
    line-height: 1.1;
}
.gym-brand-title em { font-style: normal; color: #e85500; }
.gym-brand-sub {
    display: block;
    font-size: .78rem;
    color: #7880a0;
    letter-spacing: .08em;
    text-transform: uppercase;
    margin-top: 2px;
}
.gym-header-logo { height: 42px; width: auto; object-fit: contain; opacity: .9; transition: opacity .2s; }
.gym-header-logo:hover { opacity: 1; }

/* ── Main tabs ────────────────────────────────── */
.gym-tabs {
    display: flex;
    background: #0a0c10;
    border-bottom: 1px solid #1e2230;
    overflow-x: auto;
}
.gym-tab {
    flex: 1;
    min-width: 120px;
    padding: 14px 16px;
    background: transparent;
    border: none;
    border-bottom: 3px solid transparent;
    color: #606880;
    font-family: 'Barlow Condensed', sans-serif;
    font-size: .93rem;
    font-weight: 700;
    letter-spacing: .06em;
    text-transform: uppercase;
    cursor: pointer;
    transition: color .2s, border-color .2s, background .2s;
    white-space: nowrap;
}
.gym-tab:hover { color: #c8cde0; background: #10131a; }
.gym-tab.active { color: #e85500; border-bottom-color: #e85500; background: #0d0f14; }

/* ── Panels ───────────────────────────────────── */
.gym-panel { display: none; padding: 28px; }
.gym-panel.active { display: block; }
.gym-intro {
    font-size: .9rem;
    color: #7880a0;
    margin: 0 0 22px;
    line-height: 1.6;
    border-left: 3px solid #e85500;
    padding-left: 12px;
}
.gym-intro strong { color: #dde1f0; }

/* ── Grid & fields ────────────────────────────── */
.gym-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
    gap: 16px;
    margin-bottom: 24px;
}
.gym-field { display: flex; flex-direction: column; gap: 6px; }
.gym-field label {
    font-family: 'Barlow Condensed', sans-serif;
    font-size: .82rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: .07em;
    color: #9098b8;
}
.gym-hint { font-weight: 400; text-transform: none; color: #555d78; font-size: .78rem; }
.gym-field input[type="number"],
.gym-field select {
    background: #13151f;
    border: 1px solid #252840;
    border-radius: 8px;
    color: #dde1f0;
    font-family: 'Barlow', sans-serif;
    font-size: .95rem;
    padding: 9px 12px;
    width: 100%;
    outline: none;
    transition: border-color .2s, box-shadow .2s;
    -moz-appearance: textfield;
}
.gym-field input[type="number"]::-webkit-outer-spin-button,
.gym-field input[type="number"]::-webkit-inner-spin-button { -webkit-appearance: none; }
.gym-field input:focus, .gym-field select:focus {
    border-color: #e85500;
    box-shadow: 0 0 0 3px rgba(232,85,0,.15);
}
.gym-field-accent input, .gym-field-accent select {
    border-color: #3a2010;
    background: #180f06;
    color: #ffb870;
}
.gym-field-accent label { color: #e85500; }
.gym-field-accent input:focus, .gym-field-accent select:focus {
    border-color: #e85500;
    box-shadow: 0 0 0 3px rgba(232,85,0,.2);
}

/* ── Buttons ──────────────────────────────────── */
.gym-btn-row { display: flex; gap: 12px; flex-wrap: wrap; margin-bottom: 4px; }
.gym-btn {
    display: inline-block;
    background: linear-gradient(135deg, #e85500 0%, #c04000 100%);
    color: #fff;
    border: none;
    border-radius: 10px;
    padding: 13px 28px;
    font-family: 'Barlow Condensed', sans-serif;
    font-size: 1rem;
    font-weight: 700;
    letter-spacing: .08em;
    text-transform: uppercase;
    cursor: pointer;
    transition: transform .15s, box-shadow .15s, filter .15s;
    box-shadow: 0 4px 18px rgba(232,85,0,.35);
}
.gym-btn:hover { transform: translateY(-2px); box-shadow: 0 8px 28px rgba(232,85,0,.5); filter: brightness(1.08); }
.gym-btn:active { transform: translateY(0); }
.gym-btn-secondary {
    background: transparent;
    border: 1px solid #e85500;
    color: #e85500;
    box-shadow: none;
}
.gym-btn-secondary:hover { background: rgba(232,85,0,.1); box-shadow: none; }

/* ── Result ───────────────────────────────────── */
.gym-result {
    margin-top: 22px;
    background: #0a0c10;
    border: 1px solid #1e2230;
    border-radius: 12px;
    padding: 22px 24px;
    animation: gymFade .3s ease;
}
@keyframes gymFade { from { opacity:0; transform:translateY(6px); } to { opacity:1; transform:none; } }

/* Stat cards */
.gym-stats {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(140px, 1fr));
    gap: 12px;
    margin-bottom: 16px;
}
.gym-stat {
    background: #13151f;
    border: 1px solid #1e2230;
    border-radius: 10px;
    padding: 14px 12px;
    text-align: center;
}
.gym-stat-val {
    font-family: 'Barlow Condensed', sans-serif;
    font-size: 1.6rem;
    font-weight: 900;
    line-height: 1;
    color: #e85500;
    display: block;
}
.gym-stat-lbl { font-size: .7rem; text-transform: uppercase; letter-spacing: .08em; color: #606880; display: block; margin-top: 4px; }
.gym-stat.ok  .gym-stat-val { color: #22cc88; }
.gym-stat.warn .gym-stat-val { color: #f0a020; }
.gym-stat.bad  .gym-stat-val { color: #e83040; }
.gym-stat.info .gym-stat-val { color: #4499ff; }

.gym-result-note {
    font-size: .82rem;
    color: #5a6278;
    margin-top: 12px;
    line-height: 1.55;
}
.gym-result-note strong { color: #9098b8; }

/* ── Scheda tables ────────────────────────────── */
#sc-result { margin-top: 22px; animation: gymFade .3s ease; }
.gym-scheda-header {
    text-align: center;
    padding: 20px;
    background: #0a0c10;
    border: 1px solid #1e2230;
    border-radius: 12px 12px 0 0;
    border-bottom: none;
}
.gym-scheda-title {
    font-family: 'Barlow Condensed', sans-serif;
    font-size: 1.1rem;
    font-weight: 900;
    color: #7880a0;
    text-transform: uppercase;
    letter-spacing: .1em;
    margin-bottom: 6px;
}
.gym-scheda-sub { font-size: .8rem; color: #3a4060; }

.gym-table-section {
    background: #0a0c10;
    border: 1px solid #1e2230;
    border-radius: 0;
    margin-bottom: 0;
    border-top: none;
}
.gym-table-section:last-child { border-radius: 0 0 12px 12px; }

.gym-table-title {
    font-family: 'Barlow Condensed', sans-serif;
    font-size: 1rem;
    font-weight: 900;
    text-transform: uppercase;
    letter-spacing: .1em;
    color: #e85500;
    padding: 14px 20px 10px;
    border-top: 1px solid #1e2230;
    display: flex;
    align-items: center;
    gap: 8px;
}
.gym-table-title::before {
    content: '';
    display: inline-block;
    width: 3px;
    height: 16px;
    background: #e85500;
    border-radius: 2px;
}
.gym-table-desc { font-size: .75rem; color: #4a5068; padding: 0 20px 10px; font-weight: 400; font-family: 'Barlow', sans-serif; text-transform: none; letter-spacing: 0; }

.gym-table-wrap { overflow-x: auto; padding: 0 20px 20px; }
.gym-table {
    width: 100%;
    border-collapse: collapse;
    font-size: .88rem;
}
.gym-table th {
    background: #13151f;
    padding: 9px 10px;
    text-align: center;
    font-family: 'Barlow Condensed', sans-serif;
    font-size: .75rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: .07em;
    color: #606880;
    border-bottom: 1px solid #1e2230;
}
.gym-table td {
    padding: 9px 10px;
    text-align: center;
    border-bottom: 1px solid #0e1018;
    color: #b0b8d0;
}
.gym-table tr:last-child td { border-bottom: none; }
.gym-table tr:hover td { background: #12141e; }
.gym-table .hl { color: #e85500; font-weight: 700; font-size: 1rem; }
.gym-table .hl-kg { color: #ffb870; font-weight: 700; }

/* ── Macro bars ───────────────────────────────── */
.gym-macro-bar-wrap { margin-top: 16px; }
.gym-macro-row { display: flex; align-items: center; gap: 12px; margin-bottom: 10px; }
.gym-macro-label { font-size: .78rem; font-family: 'Barlow Condensed', sans-serif; font-weight: 700; text-transform: uppercase; letter-spacing: .06em; color: #9098b8; min-width: 80px; }
.gym-macro-bar-bg { flex: 1; background: #13151f; border-radius: 4px; height: 10px; overflow: hidden; }
.gym-macro-bar { height: 100%; border-radius: 4px; transition: width .5s ease; }
.gym-macro-val { font-size: .82rem; color: #dde1f0; min-width: 90px; text-align: right; font-family: 'Barlow Condensed', sans-serif; font-weight: 600; }

/* ── Recupero bars ────────────────────────────── */
.gym-rec-block { margin-bottom: 16px; }
.gym-rec-title { font-family: 'Barlow Condensed', sans-serif; font-size: .85rem; font-weight: 700; text-transform: uppercase; letter-spacing: .07em; color: #9098b8; margin-bottom: 6px; }
.gym-rec-pill {
    display: inline-block;
    background: rgba(232,85,0,.12);
    border: 1px solid #e85500;
    color: #e85500;
    border-radius: 6px;
    padding: 6px 14px;
    font-family: 'Barlow Condensed', sans-serif;
    font-size: 1.1rem;
    font-weight: 700;
    letter-spacing: .06em;
    margin-right: 8px;
    margin-bottom: 6px;
}
.gym-rec-note { font-size: .8rem; color: #5a6278; margin-top: 4px; line-height: 1.5; }

/* ── Wilks level bar ──────────────────────────── */
.gym-wilks-bar { margin-top: 14px; }
.gym-wilks-track { position: relative; background: #13151f; border-radius: 6px; height: 14px; margin: 8px 0; overflow: hidden; }
.gym-wilks-fill { height: 100%; border-radius: 6px; background: linear-gradient(90deg,#2244aa,#44aaff,#22cc88,#f0a020,#e85500,#cc2020); transition: width .6s ease; }
.gym-wilks-marker { position: absolute; top: -3px; width: 4px; height: 20px; background: #fff; border-radius: 2px; transform: translateX(-50%); box-shadow: 0 0 6px rgba(255,255,255,.5); }
.gym-wilks-labels { display: flex; justify-content: space-between; font-size: .68rem; color: #3a4060; font-family: 'Barlow Condensed', sans-serif; text-transform: uppercase; letter-spacing: .05em; margin-top: 4px; }

/* ── BMI bar ──────────────────────────────────── */
.gym-bmi-bar { margin-top: 14px; }
.gym-bmi-track { position: relative; background: #13151f; border-radius: 6px; height: 14px; overflow: hidden; }
.gym-bmi-fill { height: 100%; border-radius: 6px; background: linear-gradient(90deg,#4499ff 0%,#22cc88 30%,#f0a020 60%,#e85500 80%,#cc2020 100%); }
.gym-bmi-marker { position: absolute; top: -3px; width: 4px; height: 20px; background: #fff; border-radius: 2px; transform: translateX(-50%); box-shadow: 0 0 6px rgba(255,255,255,.4); }

/* ── Sub-tabs ─────────────────────────────────── */
.gym-subtabs { display: flex; gap: 6px; margin-bottom: 24px; flex-wrap: wrap; }
.gym-subtab {
    padding: 8px 16px;
    background: #13151f;
    border: 1px solid #1e2230;
    border-radius: 8px;
    color: #606880;
    font-family: 'Barlow Condensed', sans-serif;
    font-size: .86rem;
    font-weight: 700;
    letter-spacing: .05em;
    text-transform: uppercase;
    cursor: pointer;
    transition: all .2s;
}
.gym-subtab:hover { color: #dde1f0; border-color: #3a3e58; }
.gym-subtab.active { background: rgba(232,85,0,.12); border-color: #e85500; color: #e85500; }
.gym-subpanel { display: none; }
.gym-subpanel.active { display: block; }

/* ── Footer ───────────────────────────────────── */
.gym-footer {
    display: flex;
    align-items: center;
    gap: 20px;
    padding: 20px 28px;
    border-top: 1px solid #1e2230;
    background: #0a0c10;
    flex-wrap: wrap;
}
.gym-footer-logo { height: 34px; width: auto; object-fit: contain; opacity: .75; transition: opacity .2s; }
.gym-footer-logo:hover { opacity: 1; }
.gym-footer-text { font-size: .78rem; color: #4a5068; line-height: 1.6; }
.gym-footer-text strong { color: #7880a0; }
.gym-footer-text a { color: #e85500; text-decoration: none; }
.gym-footer-text a:hover { text-decoration: underline; }
.gym-disclaimer { font-size: .72rem; color: #363848; }

/* ── Print ────────────────────────────────────── */
@media print {
    #gym-app { box-shadow: none; border: none; }
    .gym-header, .gym-tabs, .gym-btn-row, .gym-footer { display: none !important; }
    .gym-panel { display: block !important; padding: 0; }
    #t-scheda { display: block !important; }
    #t-1rm, #t-tdee, #t-extra { display: none !important; }
    .gym-table { font-size: 11px; }
    .gym-table th, .gym-table td { border: 1px solid #ccc !important; color: #000 !important; }
    .gym-table .hl { color: #c00 !important; }
    .gym-table-title { color: #c00 !important; }
    #gym-app { background: #fff !important; color: #000 !important; }
}

/* ── Responsive ───────────────────────────────── */
@media (max-width: 600px) {
    .gym-header-inner { flex-direction: column; align-items: flex-start; gap: 12px; }
    .gym-header-logo { height: 30px; }
    .gym-panel { padding: 18px; }
    .gym-grid { grid-template-columns: 1fr; }
    .gym-brand-title { font-size: 1.2rem; }
    .gym-tab { font-size: .78rem; padding: 12px 10px; min-width: 80px; }
    .gym-stats { grid-template-columns: repeat(2, 1fr); }
    .gym-footer { flex-direction: column; align-items: flex-start; }
}
