/* ==========================================================================
   Components. One block per subsection of design.md section 3.
   ========================================================================== */

/* --- 3.1 Button ---------------------------------------------------------- */

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  border: var(--stroke) solid transparent;
  border-radius: var(--radius-btn);
  font-size: 15px;
  font-weight: 500;
  line-height: 1.4;
  cursor: pointer;
  white-space: nowrap;
  background: none;
}

.btn--primary {
  background: var(--green-500);
  color: #fff;
  padding: 14px 24px;          /* nav size */
}
.btn--primary:hover { background: var(--green-600); }

.btn--secondary {
  background: var(--surface);
  color: var(--ink-700);
  border-color: var(--border);
  padding: 13px 20px;
}
.btn--secondary:hover { background: var(--muted); }

.btn--ghost {                   /* on a photograph */
  color: #fff;
  border-color: rgb(255 255 255 / 0.45);
  padding: 17px 30px;
  font-size: 16px;
}
.btn--ghost:hover { background: rgb(255 255 255 / 0.12); }

.btn--hero  { padding: 17px 30px; font-size: 16px; }
.btn--admin { padding: 13px 20px; border-radius: 9px; }

.btn--full {
  display: flex;
  inline-size: 100%;
  padding-block: 18px;
  font-size: 16px;
}

/* --- 3.2 Card ------------------------------------------------------------ */

.card {
  background: var(--surface);
  border: var(--stroke) solid var(--border);
  border-radius: var(--radius-card);
  overflow: hidden;            /* clipsContent, so image fills crop */
}

.card__body { padding: var(--card-pad); }

@media (max-width: 767px) {
  .card__body { padding: var(--card-pad-mobile); }
}

/* --- 3.3 Status indicator ------------------------------------------------
   A 7 to 8px circle then a Medium label at 13 to 14, both the same colour.
   Never red: a fully booked court is a good outcome for the club.          */

.status {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-size: 13px;
  font-weight: 500;
}
.status::before {
  content: '';
  inline-size: 8px;
  block-size: 8px;
  border-radius: 50%;
  background: currentColor;
  flex: none;
}
.status--good { color: var(--green-500); }
.status--low  { color: var(--amber-500); }
/* 3.3 lists ink/300 here, but this label carries information a customer
   needs and sits at 13 to 14, where ink/300 fails the contrast floor in
   section 7. Uses ink/500, which is what the desktop frame draws. */
.status--none { color: var(--ink-500); }

/* --- 3.4 Tag and chip ---------------------------------------------------- */

.tag {
  display: inline-flex;
  align-items: center;
  padding: 6px 12px;
  border-radius: var(--radius-sm);
  font-size: 13px;
  font-weight: 500;
}
.tag--green { background: var(--green-50); color: var(--green-600); }
.tag--blue  { background: var(--blue-50);  color: var(--blue-700); }
.tag--muted { background: var(--muted);    color: var(--ink-500); }

.chip {
  display: inline-flex;
  align-items: center;
  position: relative;
  padding: 5px 10px;
  border: 0;
  border-radius: 6px;
  font-size: 12px;
  font-weight: 500;
}
.chip--paid   { background: var(--green-50);      color: var(--green-600); }
.chip--unpaid { background: var(--chip-unpaid-bg); color: var(--amber-500); cursor: pointer; }
.chip--unpaid:hover { background: #f9e7cb; }

/* Section 7 wants 44x44 tap targets. The chip stays visually 27px tall and
   grows only its hit area, so the layout is untouched. */
.chip--unpaid::after {
  content: '';
  position: absolute;
  inset: -9px -6px;
}

/* --- 3.5 Input -----------------------------------------------------------
   Two fields in the whole booking flow: name and phone. No email, no
   password, no account.                                                    */

.field {
  inline-size: 100%;
  padding: 15px 16px;
  background: var(--field-fill);
  border: var(--stroke) solid var(--border);
  border-radius: var(--radius-btn);
  font-family: inherit;
  font-size: 15px;
  color: var(--ink-900);
}
.field::placeholder { color: var(--ink-300); opacity: 1; }
.field:focus { border-color: var(--green-500); outline: none; }

/* --- 3.6 Day cell -------------------------------------------------------- */

.day {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 3px;
  padding-block: 14px;
  border: var(--stroke) solid var(--border);
  border-radius: var(--radius-md);
  background: var(--muted);
  cursor: pointer;
  min-block-size: 95px;
  justify-content: center;
}
.day__dow   { font-size: 13px; font-weight: 500; color: var(--ink-300); }
.day__num   { font-size: 20px; font-weight: 700; color: var(--ink-900); }
.day__month { font-size: 11px; font-weight: 500; color: var(--ink-300); }

.day[aria-pressed='true'] {
  background: var(--green-500);
  border-color: transparent;
}
.day[aria-pressed='true'] .day__dow,
.day[aria-pressed='true'] .day__month { color: var(--day-selected-label); }
.day[aria-pressed='true'] .day__num   { color: #fff; }

.day:not([aria-pressed='true']):hover { border-color: var(--slot-free-border); }

/* --- 3.7 Slot button -----------------------------------------------------
   The price sits on the free slot itself. On a five-court venue with two
   price tiers this removes the most common phone call.                     */

.slot {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 3px;
  padding-block: 14px;
  border: var(--stroke) solid transparent;
  border-radius: var(--radius-btn);
  cursor: pointer;
  min-block-size: 72px;
  justify-content: center;
}
.slot__time { font-size: 17px; font-weight: 500; }
.slot__sub  { font-size: 12px; font-weight: 500; }

.slot--free {
  background: var(--surface);
  border-color: var(--slot-free-border);
}
.slot--free .slot__time { color: var(--ink-900); }
.slot--free .slot__sub  { color: var(--green-600); }
.slot--free:hover { background: var(--green-50); }

.slot--booked {
  background: var(--muted);
  cursor: not-allowed;
}
.slot--booked .slot__time,
.slot--booked .slot__sub { color: var(--ink-300); }

.slot[aria-pressed='true'] {
  background: var(--blue-700);
  border-color: transparent;
}
.slot[aria-pressed='true'] .slot__time { color: #fff; }
.slot[aria-pressed='true'] .slot__sub  { color: var(--slot-selected-sub); }

/* --- 3.8 Schedule cell, admin -------------------------------------------- */

.cell {
  display: flex;
  align-items: center;
  padding: 11px 12px;
  border: var(--stroke) solid transparent;
  border-radius: var(--radius-sm);
  font-size: 13px;
  font-weight: 500;
  min-block-size: 40px;
}
.cell--free {
  background: var(--sched-free-fill);
  border-color: var(--sched-free-border);
  color: var(--green-600);
}
.cell--booked { background: var(--blue-50); color: var(--blue-700); }
.cell--closed { background: var(--muted);   color: var(--ink-300); }

/* --- Brand lockup -------------------------------------------------------- */

/* The wordmark subtitle ("NIZWA SPORTS CLUB") is dropped at the client's
   request and the crest is enlarged to carry the lockup on its own. */

.brand { display: flex; align-items: center; gap: 14px; }

.brand__slot {
  inline-size: 60px;
  block-size: 60px;
  border-radius: var(--radius-md);
  background: var(--blue-50);
  display: grid;
  place-items: center;
  flex: none;
  overflow: hidden;
}
.brand__slot img { inline-size: 82%; block-size: 82%; object-fit: contain; }

.brand__name {
  font-size: 19px;
  font-weight: 700;
  letter-spacing: 0.02em;
  color: var(--blue-700);
  white-space: nowrap;   /* it wrapped to two lines in the tablet band */
}
:root[lang='ar'] .brand__name { letter-spacing: 0; }

/* --- Nav ----------------------------------------------------------------- */

.nav {
  block-size: 84px;
  background: var(--surface);
  border-block-end: var(--stroke) solid var(--border);
  display: flex;
  align-items: center;
  position: sticky;
  inset-block-start: 0;
  z-index: 20;
}
.nav__inner {
  inline-size: 100%;
  max-inline-size: 1440px;
  margin-inline: auto;
  padding-inline: var(--gutter-desktop);
  display: flex;
  align-items: center;
  gap: 24px;
}
.nav__links {
  display: flex;
  gap: 34px;
  margin-inline: auto;
  font-size: 15px;
  color: var(--ink-700);
}
.nav__links a:hover { color: var(--green-600); }
.nav__actions { display: flex; align-items: center; gap: 14px; }
.nav__phone { font-size: 15px; color: var(--ink-900); }

/* Menu button, mobile only */
.nav__menu {
  display: none;
  flex-direction: column;
  gap: 5px;
  padding: 12px 0;
  border: 0;
  background: none;
  cursor: pointer;
}
.nav__menu span {
  inline-size: 20px;
  block-size: 2px;
  border-radius: 1px;
  background: var(--ink-700);
}

@media (max-width: 1180px) {
  .nav__links { display: none; }
  .nav__actions { margin-inline-start: auto; }
}
@media (max-width: 767px) {
  .nav { block-size: 66px; }
  .nav__inner { padding-inline: var(--gutter-mobile); gap: 12px; }
  .nav__phone, .nav__actions .btn { display: none; }
  .nav__menu { display: flex; }
  .brand__slot { inline-size: 44px; block-size: 44px; border-radius: var(--radius-sm); }
  .brand__name { font-size: 15px; }
}

/* --- Language toggle ----------------------------------------------------- */

.lang {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 9px 13px;
  background: var(--surface);
  color: var(--ink-700);
  border: var(--stroke) solid var(--border);
  border-radius: var(--radius-btn);
  font-size: 13px;
  font-weight: 500;
  cursor: pointer;
  min-block-size: 44px;
}
.lang:hover { background: var(--muted); border-color: var(--slot-free-border); }
.lang--dark {
  background: var(--admin-user-fill);
  border-color: transparent;
  color: #fff;
}
.lang--dark:hover { background: #22374d; }

/* --- Informational note (blue/50) ---------------------------------------- */

.note {
  background: var(--blue-50);
  border-radius: var(--radius-md);
  padding: 18px 20px;
  font-size: 14px;
  line-height: 1.5;
  color: var(--blue-700);
}
