/* =====================================================================
   بحرنا — شريط الخيارات + صفحات الحساب والفعاليات والطقس والدورات
   يبني على متغيرات style.css ولا يعرّف ألواناً جديدة خارج الهوية.
   ===================================================================== */

/* ---------------------------- شريط الخيارات ---------------------------- */
.appbar {
  position: fixed; inset-inline: 0; bottom: 0; z-index: 60;
  display: flex; align-items: center; gap: 0.5rem;
  padding: 0.45rem 0.6rem calc(0.45rem + env(safe-area-inset-bottom, 0px));
  background: rgba(3, 25, 35, 0.94);
  border-top: 1px solid var(--line);
  backdrop-filter: blur(14px);
}
.appbar__scroll {
  flex: 1; display: flex; align-items: stretch; gap: 0.15rem;
  overflow-x: auto; scrollbar-width: none; -ms-overflow-style: none;
  scroll-behavior: smooth;
}
.appbar__scroll::-webkit-scrollbar { display: none; }
.appbar__item {
  flex: 0 0 auto; display: grid; justify-items: center; gap: 0.24rem;
  min-width: 68px; padding: 0.42rem 0.55rem;
  border-radius: 14px; border: 1px solid transparent;
  color: var(--text-dim); text-decoration: none;
  font-size: 0.72rem; font-weight: 600; line-height: 1.2; text-align: center;
  transition: color 0.2s var(--ease-out), background 0.2s var(--ease-out), border-color 0.2s var(--ease-out);
}
.appbar__item:hover { color: var(--cyan); }
.appbar__item.is-active {
  color: var(--cyan);
  background: linear-gradient(160deg, rgba(0, 167, 181, 0.22), rgba(0, 167, 181, 0.07));
  border-color: rgba(111, 231, 242, 0.35);
}
.appbar__item span { white-space: nowrap; }
.appbar__ic { width: 22px; height: 22px; color: currentColor; flex: 0 0 auto; }
.appbar__chip {
  flex: 0 0 auto; display: inline-flex; align-items: center; gap: 0.4rem;
  padding: 0.5rem 0.85rem; border-radius: 999px;
  border: 1px solid var(--line-gold); color: var(--gold);
  background: rgba(216, 181, 109, 0.08);
  font-size: 0.78rem; font-weight: 700; text-decoration: none; white-space: nowrap;
}
.appbar__chip:hover { background: rgba(216, 181, 109, 0.16); }
.appbar__chip .appbar__ic { width: 18px; height: 18px; }
body.has-appbar { padding-bottom: 84px; }
body.has-appbar .footer { margin-bottom: 0; }
@media (max-width: 520px) {
  .appbar__item { min-width: 60px; font-size: 0.66rem; padding: 0.38rem 0.4rem; }
  .appbar__chip span { display: none; }
  .appbar__chip { padding: 0.5rem; }
}

/* ------------------------------ صفحة الدخول ---------------------------- */
.auth-wrap {
  min-height: 72vh; display: grid; place-items: center;
  padding: clamp(1.5rem, 5vw, 3rem) clamp(1rem, 4vw, 2rem) 3rem;
}
.auth-card {
  width: min(440px, 100%); background: var(--surface);
  border: 1px solid var(--line); border-radius: calc(var(--radius) + 6px);
  padding: clamp(1.4rem, 4vw, 2.2rem); box-shadow: var(--shadow);
}
.auth-card h1 { font-family: var(--font-display); font-size: 1.6rem; margin: 0 0 0.3rem; color: var(--inktext); }
.auth-card .auth-sub { color: var(--text-dim); font-size: 0.92rem; margin: 0 0 1.4rem; }
.auth-tabs { display: flex; gap: 0.4rem; margin-bottom: 1.3rem; }
.auth-tabs button {
  flex: 1; font: inherit; font-weight: 700; cursor: pointer;
  padding: 0.6rem 0.5rem; border-radius: 12px;
  border: 1px solid var(--line); background: transparent; color: var(--text-dim);
}
.auth-tabs button.is-active { color: var(--ink); background: var(--cyan); border-color: var(--cyan); }
.auth-field { display: grid; gap: 0.35rem; margin-bottom: 0.9rem; }
.auth-field label { font-size: 0.85rem; font-weight: 600; color: var(--text-dim); }
.auth-field input {
  font: inherit; padding: 0.7rem 0.9rem; border-radius: 12px;
  border: 1px solid var(--line); background: rgba(3, 25, 35, 0.6); color: var(--text);
}
.auth-field input:focus { outline: 2px solid var(--teal); outline-offset: 1px; }
.auth-submit {
  width: 100%; font: inherit; font-weight: 800; cursor: pointer; margin-top: 0.5rem;
  padding: 0.8rem 1rem; border-radius: 999px; border: none; color: var(--on-gold);
  background: linear-gradient(135deg, var(--gold) 0%, var(--gold-deep) 100%);
}
.auth-submit[disabled] { opacity: 0.6; cursor: default; }
.auth-msg { margin-top: 1rem; padding: 0.7rem 0.9rem; border-radius: 12px; font-size: 0.88rem; display: none; }
.auth-msg.is-err { display: block; color: #ffb9a6; background: rgba(255, 107, 74, 0.12); border: 1px solid rgba(255, 107, 74, 0.4); }
.auth-msg.is-ok { display: block; color: var(--cyan); background: rgba(0, 167, 181, 0.12); border: 1px solid var(--line); }
.auth-alt { margin-top: 1.1rem; text-align: center; font-size: 0.85rem; color: var(--text-dim); }
.auth-alt button { font: inherit; background: none; border: none; color: var(--cyan); cursor: pointer; text-decoration: underline; padding: 0; }

/* ------------------------------ صفحة الحساب ---------------------------- */
/* الترويسة مثبّتة أعلى الصفحة، فالمحتوى يبدأ تحتها لا خلفها */
.acc-main { padding-top: 104px; }
@media (max-width: 700px) { .acc-main { padding-top: 92px; } }

.acc-head {
  display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between;
  gap: 1rem; margin-bottom: 1.4rem;
}
.acc-who { display: flex; align-items: center; gap: 0.8rem; }
.acc-avatar {
  width: 52px; height: 52px; border-radius: 50%; display: grid; place-items: center;
  background: linear-gradient(160deg, var(--teal), var(--surface-2));
  color: var(--inktext); font-weight: 800; font-size: 1.2rem; flex: 0 0 auto;
}
.acc-who h1 { font-family: var(--font-display); font-size: 1.35rem; margin: 0; color: var(--inktext); }
.acc-who p { margin: 0.15rem 0 0; color: var(--text-dim); font-size: 0.85rem; }
.acc-tabs { display: flex; gap: 0.4rem; overflow-x: auto; padding-bottom: 0.4rem; margin-bottom: 1.4rem; scrollbar-width: none; }
.acc-tabs::-webkit-scrollbar { display: none; }
.acc-tab {
  flex: 0 0 auto; font: inherit; font-weight: 700; font-size: 0.88rem; cursor: pointer;
  padding: 0.55rem 1.1rem; border-radius: 999px;
  border: 1px solid var(--line); background: transparent; color: var(--text-dim);
}
.acc-tab.is-active { color: var(--ink); background: var(--cyan); border-color: var(--cyan); }
.acc-panel[hidden] { display: none; }

.bh-list { display: grid; gap: 0.9rem; }
.bh-item {
  background: var(--surface); border: 1px solid var(--line);
  border-radius: var(--radius); padding: 1.1rem 1.2rem;
}
.bh-item__top { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 0.6rem; }
.bh-item__title { font-family: var(--font-display); font-size: 1.05rem; color: var(--inktext); margin: 0; }
.bh-item__meta { display: flex; flex-wrap: wrap; gap: 0.5rem 1.2rem; margin-top: 0.7rem; color: var(--text-dim); font-size: 0.87rem; }
.bh-item__meta span { display: inline-flex; align-items: center; gap: 0.35rem; }
.bh-item__meta strong { color: var(--text); font-weight: 700; }
.bh-item__note { margin: 0.8rem 0 0; padding-top: 0.8rem; border-top: 1px solid var(--line); color: var(--text-dim); font-size: 0.87rem; }
.bh-badge {
  font-size: 0.76rem; font-weight: 700; padding: 0.28rem 0.75rem;
  border-radius: 999px; border: 1px solid var(--line); white-space: nowrap;
}
.bh-msg { display: grid; gap: 0.3rem; }
.bh-msg.is-unread { border-inline-start: 3px solid var(--gold); }
.bh-msg time { color: var(--text-dim); font-size: 0.78rem; }

.bh-empty {
  text-align: center; padding: 3rem 1.2rem; color: var(--text-dim);
  background: var(--surface); border: 1px dashed var(--line); border-radius: var(--radius);
}
.bh-empty svg { width: 42px; height: 42px; color: var(--teal); opacity: 0.7; margin-bottom: 0.8rem; }
.bh-empty h3 { font-family: var(--font-display); color: var(--inktext); margin: 0 0 0.4rem; font-size: 1.05rem; }
.bh-empty p { margin: 0 auto; max-width: 44ch; font-size: 0.9rem; line-height: 1.7; }
.bh-loading { text-align: center; padding: 2.5rem; color: var(--text-dim); }

/* ------------------------------ صفحة الطقس ---------------------------- */
.wx-grid { display: grid; gap: 1rem; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); }
.wx-card {
  background: var(--surface); border: 1px solid var(--line);
  border-radius: var(--radius); padding: 1.2rem 1.3rem;
}
.wx-card__head { display: flex; align-items: baseline; justify-content: space-between; gap: 0.6rem; }
.wx-card__city { font-family: var(--font-display); font-size: 1.15rem; color: var(--inktext); margin: 0; }
.wx-card__region { color: var(--gold); font-size: 0.78rem; font-weight: 600; }
.wx-temp { font-family: var(--font-num); font-size: 2.4rem; font-weight: 800; color: var(--cyan); line-height: 1.1; margin: 0.6rem 0 0.2rem; }
.wx-rows { list-style: none; margin: 0.9rem 0 0; padding: 0; display: grid; gap: 0.5rem; }
.wx-rows li { display: flex; align-items: center; justify-content: space-between; gap: 0.6rem; font-size: 0.87rem; color: var(--text-dim); border-bottom: 1px solid var(--line); padding-bottom: 0.5rem; }
.wx-rows li:last-child { border-bottom: none; padding-bottom: 0; }
.wx-rows strong { font-family: var(--font-num); color: var(--text); font-weight: 700; }
.wx-verdict { margin-top: 0.9rem; padding: 0.55rem 0.8rem; border-radius: 12px; font-size: 0.84rem; font-weight: 700; text-align: center; }
.wx-verdict.is-good { color: var(--cyan); background: rgba(0, 167, 181, 0.14); border: 1px solid var(--line); }
.wx-verdict.is-fair { color: var(--gold); background: rgba(216, 181, 109, 0.12); border: 1px solid var(--line-gold); }
.wx-verdict.is-bad { color: #ffb9a6; background: rgba(255, 107, 74, 0.12); border: 1px solid rgba(255, 107, 74, 0.4); }
.wx-source { margin-top: 1.6rem; color: var(--text-dim); font-size: 0.82rem; text-align: center; }

/* ---------------------- الدورات التدريبية والفعاليات ------------------- */
.bh-cards { display: grid; gap: 1.1rem; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); }
.bh-card {
  background: var(--surface); border: 1px solid var(--line);
  border-radius: var(--radius); padding: 1.3rem; display: flex; flex-direction: column; gap: 0.7rem;
}
.bh-card h3 { font-family: var(--font-display); font-size: 1.12rem; color: var(--inktext); margin: 0; }
.bh-card__desc { color: var(--text-dim); font-size: 0.9rem; line-height: 1.75; margin: 0; flex: 1; }
.bh-card__facts { display: grid; gap: 0.45rem; font-size: 0.86rem; color: var(--text-dim); }
.bh-card__facts span { display: flex; justify-content: space-between; gap: 0.6rem; }
.bh-card__facts strong { font-family: var(--font-num); color: var(--text); }
.bh-card__cta {
  align-self: flex-start; font-weight: 700; font-size: 0.86rem; text-decoration: none;
  padding: 0.5rem 1.1rem; border-radius: 999px; color: var(--on-gold);
  background: linear-gradient(135deg, var(--gold) 0%, var(--gold-deep) 100%);
}
.bh-tags { display: flex; flex-wrap: wrap; gap: 0.35rem; }
.bh-tags span {
  font-size: 0.75rem; padding: 0.22rem 0.65rem; border-radius: 999px;
  border: 1px solid var(--line); color: var(--cyan); background: rgba(0, 167, 181, 0.1);
}
