/* =========================================================
   باشگاه‌یاب — Design tokens
   Palette: metallic blue #2F80ED · metallic red #C62828
            brushed silver #C0C0C0 · white · light grey #F5F7FA
   No gold. No dark-navy backgrounds. Bright, open, premium.
   ========================================================= */

:root{
  --blue: #2F80ED;
  --blue-deep: #1D5FC2;
  --blue-soft: #EAF2FE;
  --red: #C62828;
  --red-deep: #9E1F1F;
  --red-soft: #FBEAEA;
  --silver: #C0C0C0;
  --silver-deep: #9AA0A8;
  --bg: #F5F7FA;
  --surface: #FFFFFF;
  --surface-glass: rgba(255,255,255,0.62);
  --ink: #131722;
  --ink-soft: #5B6472;
  --ink-faint: #94A0AF;
  --line: rgba(19,23,34,0.08);

  --r-lg: 24px;
  --r-md: 20px;
  --r-sm: 14px;
  --r-pill: 999px;

  --shadow-soft: 0 10px 30px rgba(31,45,80,0.08), 0 2px 8px rgba(31,45,80,0.05);
  --shadow-card: 0 16px 40px rgba(20,30,60,0.10), 0 4px 10px rgba(20,30,60,0.05);
  --shadow-pop: 0 20px 50px rgba(20,30,60,0.16);

  --font-display: 'Vazirmatn', 'Segoe UI', Tahoma, sans-serif;
  --font-body: 'Vazirmatn', 'Segoe UI', Tahoma, sans-serif;

  --nav-h: 76px;
  --topbar-h: 68px;
}

*{ box-sizing:border-box; }
html{ scroll-behavior:smooth; }

body{
  margin:0;
  background: var(--bg);
  background-image:
    radial-gradient(1200px 500px at 90% -10%, rgba(47,128,237,0.10), transparent 60%),
    radial-gradient(900px 400px at -10% 20%, rgba(198,40,40,0.06), transparent 55%);
  background-attachment: fixed;
  color: var(--ink);
  font-family: var(--font-body);
  -webkit-font-smoothing: antialiased;
  padding-bottom: calc(var(--nav-h) + 14px);
  min-height:100vh;
}

h1,h2,h3{ font-family: var(--font-display); margin:0; letter-spacing:-0.01em; }
p{ margin:0; }
button{ font-family:inherit; }
img{ max-width:100%; display:block; }

.icon{ width:20px; height:20px; color:currentColor; flex-shrink:0; }
.icon--chev{ width:14px; height:14px; }
.icon--star{ width:15px; height:15px; color:#F4A623; }

:focus-visible{
  outline: 2.5px solid var(--blue);
  outline-offset: 2px;
  border-radius: 8px;
}

/* =========================== Top bar =========================== */
.topbar{
  position: sticky; top:0; z-index: 40;
  height: var(--topbar-h);
  background: rgba(245,247,250,0.78);
  backdrop-filter: blur(18px) saturate(160%);
  -webkit-backdrop-filter: blur(18px) saturate(160%);
  border-bottom: 1px solid var(--line);
}
.topbar__inner{
  max-width: 520px; margin:0 auto; height:100%;
  display:flex; align-items:center; justify-content:space-between;
  padding: 0 16px;
}
.brand{ display:flex; align-items:center; gap:8px; }
.brand__logo{ border-radius: 10px; box-shadow: var(--shadow-soft); }
.brand__name{ font-family: var(--font-display); font-weight:800; font-size:17px; }

.location-pill{
  display:flex; align-items:center; gap:6px;
  background: var(--surface-glass);
  border:1px solid var(--line);
  color: var(--ink-soft);
  padding:7px 12px; border-radius: var(--r-pill);
  font-size:12.5px; font-weight:600;
  cursor:pointer;
}
.location-pill .icon{ width:15px; height:15px; color: var(--blue); }

.avatar-btn{
  border:none; background:none; padding:0; cursor:pointer;
  border-radius:50%;
  box-shadow: 0 0 0 2px var(--surface), 0 0 0 3.5px var(--blue);
}
.avatar-btn img{ border-radius:50%; }

/* =========================== Layout shell =========================== */
main{ max-width:520px; margin:0 auto; padding: 0 16px; }

/* =========================== Hero =========================== */
.hero{ padding-top:16px; }
.hero__banner{
  position:relative; border-radius: var(--r-lg); overflow:hidden;
  box-shadow: var(--shadow-card);
  aspect-ratio: 5/3;
}
.hero__banner-img{ width:100%; height:100%; object-fit:cover; }
.hero__banner-overlay{
  position:absolute; inset:0; display:flex; flex-direction:column;
  justify-content:flex-end; gap:6px; padding:18px;
  background: linear-gradient(180deg, rgba(10,14,24,0.02) 0%, rgba(10,14,24,0.55) 100%);
}
.chip{
  align-self:flex-start;
  font-size:11px; font-weight:700; padding:5px 11px; border-radius: var(--r-pill);
}
.chip--live{
  background: rgba(255,255,255,0.92); color: var(--blue-deep);
  display:flex; align-items:center; gap:6px;
}
.chip--live::before{
  content:''; width:7px; height:7px; border-radius:50%;
  background: linear-gradient(135deg, #34D399, #10B981);
}
.hero__title{ color:#fff; font-size:22px; font-weight:800; line-height:1.4; }
.hero__subtitle{ color: rgba(255,255,255,0.88); font-size:13px; font-weight:500; }

.search-bar{
  margin-top:14px;
  display:flex; align-items:center; gap:10px;
  background: var(--surface);
  border:1px solid var(--line);
  border-radius: var(--r-pill);
  padding: 13px 16px;
  box-shadow: var(--shadow-soft);
}
.search-bar .icon{ color: var(--ink-faint); }
.search-bar input{
  flex:1; border:none; outline:none; background:none;
  font-size:14.5px; color:var(--ink); font-family:inherit;
}
.search-bar input::placeholder{ color: var(--ink-faint); }
.search-bar__filter{
  border:none; background: var(--blue-soft); color: var(--blue-deep);
  width:34px; height:34px; border-radius:50%;
  display:flex; align-items:center; justify-content:center;
  cursor:pointer; flex-shrink:0;
}

.cta-near{
  margin-top:12px; width:100%;
  display:flex; align-items:center; justify-content:center; gap:8px;
  border:none; cursor:pointer;
  background: linear-gradient(120deg, var(--blue) 0%, #4C8FF0 55%, var(--red) 130%);
  color:#fff; font-weight:700; font-size:14.5px;
  padding:15px; border-radius: var(--r-md);
  box-shadow: 0 14px 30px rgba(47,128,237,0.28);
  transition: transform .15s ease, box-shadow .15s ease;
}
.cta-near:active{ transform: scale(0.98); box-shadow: 0 8px 18px rgba(47,128,237,0.24); }

/* =========================== Categories =========================== */
.categories{ margin-top:22px; }
.categories__scroller{
  display:flex; gap:12px; overflow-x:auto; padding: 2px 2px 8px;
  scrollbar-width:none;
}
.categories__scroller::-webkit-scrollbar{ display:none; }

.category-chip{
  flex: 0 0 auto;
  display:flex; flex-direction:column; align-items:center; gap:8px;
  width:78px; padding:14px 8px;
  background: var(--surface-glass);
  border:1px solid var(--line);
  border-radius: var(--r-md);
  cursor:pointer;
  backdrop-filter: blur(10px);
  transition: border-color .15s ease, box-shadow .15s ease, transform .15s ease;
}
.category-chip:hover{ transform: translateY(-2px); box-shadow: var(--shadow-soft); }
.category-chip.is-active{
  border-color: transparent;
  background: linear-gradient(160deg, var(--blue-soft), #fff 60%);
  box-shadow: 0 0 0 1.5px var(--blue), var(--shadow-soft);
}
.category-chip__icon{
  width:42px; height:42px; border-radius:14px;
  display:flex; align-items:center; justify-content:center;
  background: linear-gradient(150deg, #EAF2FE, #F5F7FA);
  color: var(--blue-deep);
}
.category-chip__icon svg{ width:22px; height:22px; }
.category-chip__label{ font-size:11.5px; font-weight:700; color: var(--ink-soft); text-align:center; }
.category-chip.is-active .category-chip__label{ color: var(--blue-deep); }

/* =========================== Gym sections =========================== */
.gym-section{ margin-top:28px; }
.gym-section__head{
  display:flex; align-items:baseline; justify-content:space-between;
  margin-bottom:12px;
}
.gym-section__head h2{ font-size:16.5px; font-weight:800; }
.see-all{
  border:none; background:none; color: var(--blue-deep);
  font-size:12.5px; font-weight:700; cursor:pointer; padding:4px;
}

.gym-scroller{
  display:flex; gap:14px; overflow-x:auto; padding: 2px 2px 10px;
  scroll-snap-type: x proximity;
  scrollbar-width:none;
}
.gym-scroller::-webkit-scrollbar{ display:none; }
.gym-scroller .gym-card{ flex: 0 0 240px; scroll-snap-align:start; }

.gym-grid{
  display:grid; grid-template-columns: 1fr 1fr; gap:14px;
}
@media (max-width:420px){
  .gym-grid{ grid-template-columns: 1fr; }
}

/* =========================== Gym card =========================== */
.gym-card{
  background: var(--surface);
  border-radius: var(--r-lg);
  overflow:hidden;
  box-shadow: var(--shadow-card);
  border: 1px solid rgba(19,23,34,0.04);
  transition: transform .18s ease, box-shadow .18s ease;
}
.gym-card:hover{ transform: translateY(-3px); box-shadow: var(--shadow-pop); }

.gym-card__media{ position:relative; aspect-ratio: 4/3; overflow:hidden; }
.gym-card__img{ width:100%; height:100%; object-fit:cover; }

/* signature element: metallic duotone foil ribbon */
.gym-card__ribbon{
  position:absolute; top:14px; left:-34px;
  width:150px; padding:5px 0; text-align:center;
  transform: rotate(-45deg);
  font-size:10.5px; font-weight:800; letter-spacing:.02em;
  color:#fff;
  background: linear-gradient(90deg, var(--blue) 0%, #7C8FE0 45%, var(--red) 100%);
  box-shadow: 0 4px 10px rgba(0,0,0,0.18);
}
.gym-card__ribbon:empty{ display:none; }

.gym-card__fav{
  position:absolute; top:10px; right:10px;
  width:32px; height:32px; border-radius:50%; border:none;
  background: rgba(255,255,255,0.85); backdrop-filter: blur(6px);
  display:flex; align-items:center; justify-content:center;
  color: var(--ink-soft); cursor:pointer;
  box-shadow: var(--shadow-soft);
}
.gym-card__fav .icon{ width:17px; height:17px; }
.gym-card__fav.is-fav{ color: var(--red); }
.gym-card__fav.is-fav .icon{ fill: var(--red); }

.gym-card__status{
  position:absolute; bottom:10px; right:10px;
  font-size:10.5px; font-weight:700; padding:4px 10px; border-radius: var(--r-pill);
  backdrop-filter: blur(6px);
}
.gym-card__status.is-open{ background: rgba(16,185,129,0.16); color:#0B7A56; }
.gym-card__status.is-closed{ background: rgba(198,40,40,0.14); color: var(--red-deep); }

.gym-card__body{ padding:13px 14px 15px; }
.gym-card__toprow{ display:flex; align-items:flex-start; justify-content:space-between; gap:8px; }
.gym-card__name{ font-size:14.5px; font-weight:800; line-height:1.4; }
.gym-card__rating{
  flex-shrink:0; display:flex; align-items:center; gap:3px;
  background: #FFF7E8; padding:3px 7px; border-radius: var(--r-pill);
}
.gym-card__rating-num{ font-size:11.5px; font-weight:800; color:#7A5A12; }

.gym-card__meta{ margin-top:5px; font-size:12px; color: var(--ink-soft); }

.gym-card__tags{ display:flex; flex-wrap:wrap; gap:6px; margin-top:9px; }
.tag{
  font-size:10.5px; font-weight:600; color: var(--ink-soft);
  background: var(--bg); border:1px solid var(--line);
  padding:3px 8px; border-radius: var(--r-pill);
  display:flex; align-items:center; gap:4px;
}

.gym-card__bottomrow{
  margin-top:11px; padding-top:11px; border-top:1px dashed var(--line);
  display:flex; align-items:baseline; gap:6px;
}
.gym-card__price{ font-size:15px; font-weight:800; color: var(--blue-deep); }
.gym-card__price-unit{ font-size:11px; color: var(--ink-faint); }

/* =========================== Empty state =========================== */
.empty-state{
  text-align:center; color: var(--ink-faint); font-size:13.5px;
  padding: 40px 10px;
}

/* =========================== Profile view =========================== */
.profile-view{ margin-top:28px; }
.profile-card{
  display:flex; align-items:center; gap:14px;
  background: var(--surface); border-radius: var(--r-lg);
  padding:18px; box-shadow: var(--shadow-card);
}
.profile-card img{ border-radius:50%; box-shadow: 0 0 0 3px var(--blue-soft); }
.profile-card h3{ font-size:16px; font-weight:800; }
.profile-card p{ font-size:12.5px; color: var(--ink-soft); margin-top:3px; }

.profile-list{
  list-style:none; margin:14px 0 0; padding:0;
  background: var(--surface); border-radius: var(--r-lg);
  box-shadow: var(--shadow-card); overflow:hidden;
}
.profile-list li{
  display:flex; align-items:center; justify-content:space-between;
  padding:14px 18px; font-size:13.5px; color: var(--ink-soft);
  border-bottom:1px solid var(--line);
}
.profile-list li:last-child{ border-bottom:none; }
.profile-list strong{ color: var(--ink); font-size:14.5px; }

/* =========================== Bottom nav =========================== */
.bottom-nav{
  position:fixed; bottom:0; left:0; right:0; z-index:50;
  height: var(--nav-h);
  max-width:520px; margin:0 auto;
  display:flex; align-items:center; justify-content:space-around;
  background: rgba(255,255,255,0.82);
  backdrop-filter: blur(20px) saturate(160%);
  -webkit-backdrop-filter: blur(20px) saturate(160%);
  border-top: 1px solid var(--line);
  border-radius: 22px 22px 0 0;
  box-shadow: 0 -8px 30px rgba(20,30,60,0.08);
  padding-bottom: env(safe-area-inset-bottom);
}
.bottom-nav__item{
  position:relative;
  border:none; background:none; cursor:pointer;
  display:flex; flex-direction:column; align-items:center; gap:4px;
  color: var(--ink-faint);
  font-size:10.5px; font-weight:600;
  padding:8px 14px;
}
.bottom-nav__item .icon{ width:22px; height:22px; }
.bottom-nav__item.is-active{ color: var(--blue); }
.bottom-nav__item.is-active .icon{ filter: drop-shadow(0 3px 8px rgba(47,128,237,0.35)); }
.bottom-nav__badge{
  position:absolute; top:2px; left:18px;
  background: var(--red); color:#fff; font-size:9px; font-weight:800;
  min-width:15px; height:15px; border-radius:50%;
  display:flex; align-items:center; justify-content:center;
  box-shadow: 0 2px 6px rgba(198,40,40,0.4);
}

/* =========================== State banners (loading / error) =========================== */
.state-banner{
  margin: 4px 16px 18px;
  padding: 14px 16px;
  border-radius: var(--r-sm);
  background: var(--surface);
  box-shadow: var(--shadow-soft);
  display:flex; align-items:center; gap:10px;
  font-size:13.5px; color: var(--ink-soft);
}
.state-banner--error{
  color: var(--red-deep);
  background: var(--red-soft);
  justify-content:space-between;
}
.state-banner__spinner{
  width:16px; height:16px; flex-shrink:0;
  border-radius:50%;
  border: 2.5px solid var(--blue-soft);
  border-top-color: var(--blue);
  animation: spin 0.8s linear infinite;
}
@keyframes spin{ to{ transform: rotate(360deg); } }
.state-banner__retry{
  border:none; cursor:pointer;
  background: var(--red);
  color:#fff; font-weight:700; font-size:12.5px;
  padding:7px 14px; border-radius: var(--r-pill);
  flex-shrink:0;
}

/* =========================== Profile: admin link =========================== */
.admin-link{
  display:block;
  margin: 18px 4px 0;
  text-align:center;
  font-size:13px; font-weight:700;
  color: var(--ink-faint);
  text-decoration:none;
  padding:10px;
}
.admin-link:hover{ color: var(--blue); }

/* =========================== Misc =========================== */
@media (min-width: 560px){
  .topbar__inner, main, .bottom-nav{ max-width: 560px; }
}
