﻿/* =========================================
   Rise Platform - Design System
   Assets/CSS/styles.css
   ========================================= */

/* ── Variables ──
   The color palette lives in CSS/tokens.css (loaded before this file, see its header for the full
   naming rules) under semantic names - --surface-card, --text-heading, --brand, and so on. Every
   dark-mode-aware page has been migrated off the old literal-named variables (--navy, --white,
   --gold, --cream, ...) onto the semantic names directly.

   The block below is NOT migration scaffolding - it's a permanent, LIGHT-ONLY compatibility layer
   kept specifically because CSS/admin.css (~1,800 lines) still uses these old names throughout and
   is deliberately out of scope for dark mode (Admin.Master hardcodes data-theme="light", so it
   never needs a dark variant of these). Do not extend this block for new code, and do not add a
   [data-theme="dark"] override for it - if admin.css is ever migrated to dark mode, replace its
   var(--navy)/var(--white)/var(--gold) call sites with the semantic names and delete this block
   entirely, the same way Phase 1-3 of the platform migration did. See CLAUDE.md "Theming & Color
   Tokens". */
:root {
  --navy: var(--text-heading);
  --white: var(--surface-card);
  --gold: var(--brand);
  --gold-light: var(--brand-hover);
  --gold-pale: var(--brand-wash);
  --cream: var(--surface-page);
  --cream-dark: var(--surface-sunken);
  --text-main: var(--text-body);
  --border-light: var(--border-strong);
  --card-shadow: var(--shadow-card);

  /* Not admin-only - also used directly by several migrated page stylesheets (borders, hover
     fills, gradient stops), so it keeps a real dark-mode pair unlike the admin-only block above. */
  --navy-light: #1a3560;
}

[data-theme="dark"] {
  --navy-light: #3a4d76;
}

/* ── Reset & Base ── */
*,
*::before,
*::after {
  box-sizing: border-box;
}

body {
  font-family: 'Tajawal', serif;
  background: var(--surface-page);
  color: var(--text-body);
  direction: rtl;
  margin: 0;
  padding: 0;
  overflow-x: hidden;
}

html {
  scroll-behavior: smooth;
}

/* ── Form Card ── */
.form-card {
  max-width: 500px;
  margin: 120px auto 50px;
  padding: 35px 30px;
  background: var(--surface-card);
  border: 1px solid var(--border);
  border-radius: 12px;
  box-shadow: var(--shadow-card);
}

.form-card h2 {
  text-align: center;
  color: var(--text-heading);
  margin-bottom: 24px;
}

.form-card p {
  text-align: center;
  color: var(--text-muted);
  margin-bottom: 24px;
  font-size: 0.95rem;
}

.form-card-wide {
  max-width: 600px;
}

/* ── Page Container ── */
.page-container {
  max-width: 1100px;
  margin: 100px auto 50px;
  padding: 0 20px;
}

/* ── Buttons ── */
.btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  border: none;
  cursor: pointer;
  font-size: 1rem;
  font-weight: 700;
  text-decoration: none;
  transition: all 0.2s;
  border-radius: 8px;
  padding: 12px 24px;
}

.btn-primary {
  background: linear-gradient(135deg, var(--brand), var(--brand-active));
  color: var(--text-on-brand);
  /* Brand-hued glow: kept as a literal rgba tied to --brand's fixed RGB (201,150,12), which is the
     same in both themes, so this shadow doesn't need a dark-mode counterpart. */
  box-shadow: 0 4px 12px rgba(201, 150, 12, 0.3);
}

.btn-primary:hover {
  transform: translateY(-2px);
  box-shadow: 0 6px 20px rgba(201, 150, 12, 0.4);
}

.btn-navy {
  background: var(--surface-inverse);
  color: var(--text-on-inverse);
}

.btn-navy:hover {
  background: var(--navy-light);
  transform: translateY(-2px);
}

.btn-danger {
  background: var(--error);
  color: var(--text-on-error);
}

.btn-danger:hover {
  background: var(--danger-hover);
  transform: translateY(-2px);
}

.btn-ghost {
  background: transparent;
  color: var(--text-heading);
  border: 1.5px solid var(--navy-light);
}

.btn-ghost:hover {
  border-color: var(--brand);
  background: rgba(201, 150, 12, 0.08);
}

.btn-block {
  width: 100%;
  justify-content: center;
}

.btn-sm {
  padding: 8px 16px;
  font-size: 0.85rem;
}

.btn-lg {
  padding: 14px 32px;
  font-size: 1.1rem;
}

.btn:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

/* ── Form Elements ── */
.form-group {
  margin-bottom: 20px;
  display: flex;
  flex-direction: column;
}

.form-group label {
  margin-bottom: 8px;
  font-weight: 700;
  color: var(--text-heading);
  font-size: 0.92rem;
}

.form-group input,
.form-group select,
.form-group textarea {
  padding: 12px 14px;
  border: 1.5px solid var(--surface-sunken);
  border-radius: 10px;
  font-size: 0.95rem;
  transition: all 0.2s;
  background: var(--surface-card);
  color: var(--text-body);
  width: 100%;
}

.form-group input:focus,
.form-group select:focus,
.form-group textarea:focus {
  outline: none;
  border-color: var(--brand);
  box-shadow: 0 0 0 3px rgba(201, 150, 12, 0.12);
}

.form-group input::placeholder,
.form-group textarea::placeholder {
  color: var(--neutral-400);
  font-size: 0.9rem;
}

.form-group textarea {
  resize: vertical;
  min-height: 80px;
}

.form-group select {
  cursor: pointer;
  appearance: none;
  /* A data-URI background-image can't read a CSS variable for its fill, so the dark-mode arrow
     needs its own rule below rather than a token swap. */
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 12 12'%3E%3Cpath fill='%235c4a2a' d='M6 8L1 3h10z'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: left 14px center;
  padding-left: 36px;
}

[data-theme="dark"] .form-group select {
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 12 12'%3E%3Cpath fill='%239aa3b2' d='M6 8L1 3h10z'/%3E%3C/svg%3E");
}

.form-group select[dir='rtl'] {
  background-position: right 14px center;
  padding-left: 14px;
  padding-right: 36px;
}

/* ── Password Toggle ── */
.password-container {
  display: flex;
  align-items: center;
  position: relative;
}

.password-container input {
  flex: 1;
  padding-left: 60px;
}

.password-container input[dir='rtl'] {
  padding-left: 14px;
  padding-right: 60px;
}

.toggle-pwd {
  position: absolute;
  right: 14px;
  cursor: pointer;

  color: var(--brand-ink);
  user-select: none;
  font-weight: 600;
  font-size: 0.85rem;
  background: rgba(201, 150, 12, 0.08);
  padding: 4px 10px;
  border-radius: 6px;
  transition: all 0.2s;
}

.toggle-pwd:hover {
  background: rgba(201, 150, 12, 0.18);
}

[dir='rtl'] .toggle-pwd {
  right: auto;
  left: 14px;
}

/* ─ Phone Group ── */
.phone-group {
  display: flex;
  gap: 10px;
  flex-direction: row-reverse;
}

.phone-group select {
  flex: 0 0 150px;
  min-width: 0;
}

.phone-group input {
  flex: 1 1 0;
  min-width: 0;
}

/* ── Full Name Group ── */
.full-name-group {
  display: flex;
  gap: 10px;
  flex-direction: row-reverse;
}

.full-name-group input {
  flex: 1 1 0;
  min-width: 0;
}

/* ── Alerts ── */
.alert {
  padding: 12px 16px;
  border-radius: 8px;
  text-align: center;
  margin-bottom: 16px;
  font-size: 0.95rem;
  display: block;
}

.alert-error {
  background: var(--error-wash);
  color: var(--error);
  border: 1px solid var(--error-wash-border);
}

.alert-success {
  background: var(--success-wash);
  color: var(--success);
  border: 1px solid var(--success-wash-border);
}

/* ── Back Link ── */
.back-link {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  background: var(--surface-inverse);
  color: var(--text-on-inverse);
  text-decoration: none;
  padding: 10px 16px;
  border-radius: 999px;
  font-size: 0.9rem;
  font-weight: 700;
  transition: transform 0.15s, background 0.15s;
}

.back-link:hover {
  background: var(--navy-light);
  transform: translateY(-1px);
}

/* ── Link Effect ── */
.btn-link-effect {
  transition: all 0.2s ease;
  padding: 8px 12px;
  border-radius: 6px;
  text-decoration: none;
  font-weight: 700;
  color: var(--text-heading);
}

.btn-link-effect:hover {
  background: var(--ink-wash);
  transform: translateY(-1px);
}

/* ── Badges ── */
.badge {
  display: inline-block;
  padding: 4px 12px;
  border-radius: 50px;
  font-size: 0.75rem;
  font-weight: 600;
}

.badge-success {
  background: var(--success-wash-border);
  color: var(--success);
}

.badge-gold {
  background: var(--brand-wash);
  color: var(--brand-ink);
}

.badge-muted {
  background: var(--ink-wash-weak);
  color: var(--text-muted);
}

.badge-navy {
  background: var(--ink-wash);
  color: var(--text-heading);
}

.badge-available {
  background: var(--success-wash);
  color: var(--success);
}

.badge-unavailable {
  background: var(--error-wash);
  color: var(--error);
}

/* ── Subject Tags ── */
.subject-tag {
  display: inline-block;
  padding: 4px 10px;
  background: var(--surface-subtle);
  color: var(--text-muted);
  border: 1px solid var(--border-strong);
  border-radius: 12px;
  font-size: 0.75rem;
}

/* ── Avatars ── */
.avatar {
  width: 44px;
  height: 44px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  color: var(--text-heading);
  flex-shrink: 0;
}

.avatar-sm {
  width: 30px;
  height: 30px;
  font-size: 0.85rem;
}

.avatar-lg {
  width: 70px;
  height: 70px;
  font-size: 1.6rem;
}

.avatar-xl {
  width: 120px;
  height: 120px;
  font-size: 2rem;
}

.avatar-gold {
  background: var(--brand-hover);
}

.avatar-cream {
  background: var(--surface-sunken);
}

.avatar-navy {
  background: var(--surface-inverse);
  color: var(--brand-hover);
}

.avatar-fallback {
  width: 70px;
  height: 70px;
  border-radius: 50%;
  background: var(--brand);
  color: var(--text-on-brand);
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  font-family: 'Noto Naskh Arabic', serif;
}

/* ── Section Layout ── */
.section-header {
  text-align: center;
  margin-bottom: 60px;
}

.section-tag {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  /* Brand-hued wash/border: kept as literal rgba tied to --brand's fixed RGB, unchanged across
     themes, so no dark-mode counterpart is needed. */
  background: rgba(201, 150, 12, 0.1);
  border: 1px solid rgba(201, 150, 12, 0.3);
  color: var(--brand-ink);
  padding: 5px 16px;
  border-radius: 50px;
  font-size: 0.82rem;
  font-weight: 600;
  margin-bottom: 1rem;
  letter-spacing: 0.5px;
}

.section-title {
  font-size: clamp(1.8rem, 3vw, 2.6rem);
  font-weight: 700;
  color: var(--text-heading);
  line-height: 1.3;
  margin-bottom: 1rem;
}

.section-sub {
  font-size: 1.05rem;
  color: var(--text-muted);
  line-height: 1.8;
  max-width: 560px;
  margin: 0 auto;
}

/* ── Responsive ── */
@media (max-width: 768px) {
  .form-card {
    padding: 25px 20px;
    margin: 100px auto 40px;
  }

  .full-name-group {
    flex-direction: column;
  }

  .phone-group {
    flex-direction: column;
  }

  .phone-group select {
    flex: 1;
  }

  .page-container {
    padding: 0 12px;
  }
}

/* ── Utility ── */
.text-center {
  text-align: center;
}

.text-muted {
  color: var(--text-muted);
}

.mt-1 {
  margin-top: 8px;
}

.mt-2 {
  margin-top: 16px;
}

.mt-3 {
  margin-top: 24px;
}

.mb-1 {
  margin-bottom: 8px;
}

.mb-2 {
  margin-bottom: 16px;
}

.flex {
  display: flex;
}

.flex-between {
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.gap-1 {
  gap: 8px;
}

.gap-2 {
  gap: 16px;
}

/* ── Interactive Elements ── */
a,
button,
input[type="submit"],
input[type="button"],
input[type="checkbox"],
input[type="radio"],
label[for],
.clickable,
[onclick] {
  cursor: pointer;
}



textarea,
input,
select {
  font-family: 'Tajawal';
}

/* =========================================
   Shared week grid
   One .week-grid definition - originally BookSession.aspx's client-rendered slot picker
   (Scripts/book-session.js) - now used everywhere a day x hour grid of cells appears:
   Profile.aspx's/MySessions.aspx's weekly schedule views and MySessions' student grid (both via
   Helper/ScheduleGridHelper.cs / Helper/WeekGridHelper.cs), and the recurring-availability
   checkbox editor (Helper/AvailabilityGridHelper.cs, Settings.aspx + Profile.aspx's edit modal).
   One definition so none of these can visually drift apart.

   No horizontal or vertical scrollbar anywhere by design: columns shrink fluidly
   (minmax(0, 1fr)) and day names abbreviate to a single letter below 640px instead of clipping or
   scrolling; --wg-slot-h shrinks the same way so a full week of rows always fits its container.
   ========================================= */

.schedule-nav {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 16px;
  margin-bottom: 12px;
}

.schedule-nav-btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 6px 16px;
  border: 1.5px solid var(--border);
  border-radius: 20px;
  background: var(--surface-card);
  color: var(--text-heading);
  font-size: 0.82rem;
  font-weight: 600;
  cursor: pointer;
  transition: all .2s;
}

.schedule-nav-btn:hover:not(:disabled) {
  border-color: var(--brand);
  color: var(--brand-ink);
}

.schedule-nav-btn:disabled {
  opacity: .35;
  cursor: not-allowed;
}

.wg-week-panel { display: none; }
.wg-week-panel.active { display: block; }

.schedule-week-label {
  font-size: 0.85rem;
  font-weight: 700;
  color: var(--text-heading);
  min-width: 140px;
  text-align: center;
}

.schedule-tz-note {
  font-size: 0.75rem;
  color: var(--neutral-600);
  margin-bottom: 8px;
}

/* Profile.aspx's schedule grid has no dedicated legend teaching "this grid is clickable" the way
   BookSession's own picker does - this one line carries that, shown only when the viewer can
   actually book (Helper/ScheduleGridHelper.cs's allowBooking). */
.schedule-book-hint {
  font-size: 0.75rem;
  color: var(--neutral-600);
  text-align: center;
  margin-top: 8px;
}

.slots-legend {
  display: flex;
  gap: 16px;
  flex-wrap: wrap;
  margin: 4px 0 14px;
  font-size: 0.8rem;
  color: var(--neutral-600);
}

.slots-legend.center {
  justify-content: center;
  margin-top: 10px;
}

.slot-legend-item {
  display: inline-flex;
  align-items: center;
  gap: 6px;
}

.slot-swatch {
  display: inline-block;
  width: 12px;
  height: 12px;
  border-radius: 3px;
  border: 2px solid;
}

.slot-swatch-available { border-color: var(--success); }
.slot-swatch-partial { border-color: var(--warn); background: var(--warn-wash); }
.slot-swatch-full { border-color: var(--error); background: var(--error-wash); }
/* Blocked by a DIFFERENT product's booking (BookSession only) - see .wg-slot-blocked below. */
.slot-swatch-blocked { border-color: var(--navy-light); background: var(--slate-wash); }
/* Student's own "this hour is booked" swatch - matches .wg-slot-booked's color. */
.slot-swatch-booked { border-color: var(--brand); background: var(--brand-wash); }
.slot-swatch-recorded { border-color: var(--slot-recorded); background: var(--slate-wash); }
.slot-swatch-none { border-color: var(--border-strong); background: var(--neutral-100); }
/* Same hatched pattern as .wg-slot-maintenance below, scaled down - the legend chip needs to read
   as the same thing as the grid cell, not a plain red square that happens to sit next to it. */
.slot-swatch-maintenance {
  border-color: var(--maintenance);
  background: var(--maintenance-wash);
  background-image: repeating-linear-gradient(
    45deg,
    transparent,
    transparent 2px,
    var(--maintenance) 2px,
    var(--maintenance) 3px
  );
  background-blend-mode: multiply;
}

/* No overflow-x here by design (see the "no scrollbar" note above) - .week-grid's fluid columns
   are what keep this from ever needing one. The class stays as the loading/empty-state wrapper
   Scripts/book-session.js and the server renderers below target by id/selector. */
.week-grid-container { display: block; }

.week-grid {
  --wg-slot-h: 44px;
  display: grid;
  grid-template-columns: minmax(34px, 58px) repeat(7, minmax(0, 1fr));
  gap: 4px;
}

/* Schedule + availability-editor views: a full week of rows needs to fit at a glance, so they use
   a shorter slot height than BookSession's own 44px picker. */
.week-grid.compact {
  --wg-slot-h: 32px;
}

.wg-cell {
  display: flex;
  align-items: center;
  justify-content: center;
  min-width: 0;
}

.wg-corner { background: transparent; }

.wg-day-head {
  flex-direction: column;
  padding: 6px 2px;
  border-radius: 8px;
  background: var(--surface-subtle);
}

.wg-day-name { font-size: 0.72rem; color: var(--text-muted); }
.wg-day-abbr { display: none; font-size: 0.72rem; color: var(--text-muted); }
.wg-day-num { font-size: 0.95rem; font-weight: 700; color: var(--text-heading); }

/* Neutral --info accent, not --brand - gold is already claimed by the "booked" seat-state color in
   this same grid (see .wg-slot-booked below), so "today" needs a hue that can't be confused with
   any seat-state color. */
.wg-day-head.today {
  background: var(--info-wash);
  box-shadow: inset 0 -3px 0 var(--info);
}

.wg-hour-head { font-size: 0.78rem; color: var(--text-muted); font-weight: 600; }
.wg-dual-tz { font-size: 0.7rem; color: var(--neutral-500); }

.wg-slot {
  position: relative;
  height: var(--wg-slot-h);
  border-radius: 8px;
  border: 2px solid transparent;
  font-size: 0.8rem;
  font-weight: 700;
  transition: all 0.15s;
}

.wg-slot.clickable:focus-visible { outline: 2px solid var(--brand); outline-offset: 2px; }
.wg-slot-available { background: var(--success-wash); border-color: var(--success); cursor: pointer; }
.wg-slot-available:hover { background: var(--success-wash-border); }
.wg-slot-partial { background: var(--warn-wash); border-color: var(--warn); color: var(--warn-wash-text); cursor: pointer; }
.wg-slot-partial:hover { background: var(--brand-wash); }
.wg-slot-full { background: var(--error-wash); border-color: var(--error); color: var(--error); opacity: 0.7; cursor: not-allowed; }

/* Blocked by a DIFFERENT product's booking (BookSession only) - a distinct state from "this
   product's own session is full" (.wg-slot-full, red), so it gets its own slate-blue color rather
   than reading as a red "Full" variant. Same tone as BookSession's .pc-badge/var(--navy-light). */
.wg-slot-blocked { background: var(--slate-wash); border-color: var(--navy-light); color: var(--slate-wash-text); flex-direction: column; gap: 1px; padding: 2px 4px; opacity: 1; line-height: 1.15; cursor: not-allowed; }
/* .wg-slot-label: the product-name line shown on occupied cells in the aggregate grids (Profile's/
   MySessions' instructor schedule, MySessions' student grid) - not BookSession's own per-product
   picker, where every cell already belongs to the one product being booked. Shares .wg-blocked-
   product's exact treatment (small, bold, ellipsized) since it's the same "small product-name tag
   on a slot" idea; no explicit color, so it inherits whichever state class it's nested in. */
.wg-blocked-product, .wg-slot-label { font-size: 0.62rem; font-weight: 700; max-width: 100%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.wg-blocked-seats { font-size: 0.68rem; font-weight: 600; opacity: 0.8; }
.wg-slot-none { background: var(--neutral-100); color: var(--border-strong); cursor: default; }
.wg-slot.selected { border-color: var(--brand); background: var(--brand); color: var(--text-on-solid); box-shadow: 0 0 0 3px rgba(201,150,12,0.2); }
.wg-slot.selected .wg-seats { color: var(--text-on-solid); }
.wg-seats { font-size: 0.78rem; }

/* Student's own booking (MySessions.aspx week view) - a wash, not a solid fill, so it sits in the
   same visual language as the seat-state colors above. Stacked (like .wg-slot-blocked) so the
   product-name label can sit above the existing state icon. */
.wg-slot-booked { background: var(--brand-wash); border-color: var(--brand); color: var(--brand-ink); cursor: pointer; flex-direction: column; gap: 1px; padding: 2px 4px; line-height: 1.15; }
.wg-slot-booked:hover { background: var(--brand-hover); transform: scale(1.03); z-index: 1; position: relative; }

/* A past session with a recording attached - deliberately NOT red (wg-slot-full) or gray
   (wg-slot-locked below): a past session must not read as "full" or "locked". */
.wg-slot-recorded { background: var(--slate-wash); border-color: var(--slot-recorded); color: var(--slate-wash-text); cursor: pointer; flex-direction: column; gap: 1px; padding: 2px 4px; line-height: 1.15; }
.wg-slot-recorded:hover { background: var(--slot-recorded-hover); color: var(--text-on-solid); transform: scale(1.03); z-index: 1; position: relative; }

/* Booked, but the join link hasn't opened yet — SessionJoinService gates it until 15 minutes before start. */
.wg-slot-locked { background: var(--neutral-100); border-color: var(--locked); color: var(--locked); cursor: not-allowed; }

/* An hour that's already elapsed today - dimmed regardless of what state it would otherwise be. */
.wg-slot-past { opacity: 0.4; }

/* Platform-reserved maintenance window — not bookable, not editable. Red hatched pattern, kept at
   full opacity (unlike other disabled-looking states) since the hatch itself already reads as
   "blocked" - fading it on top just made the whole cell look broken/half-rendered. */
.wg-slot-maintenance {
  background: var(--maintenance-wash);
  background-image: repeating-linear-gradient(
    45deg,
    transparent,
    transparent 3px,
    var(--maintenance) 3px,
    var(--maintenance) 6px
  );
  background-blend-mode: multiply;
  border-color: var(--maintenance);
  color: var(--maintenance-wash-text);
  cursor: not-allowed;
}

/* Wrench icon standing in for the "صيانة" text label, which ellipsized at the compact grid's
   slot width - see Helper/ScheduleGridHelper.cs, Helper/AvailabilityGridHelper.cs, and
   Scripts/book-session.js's renderCellHtml Maintenance branch. */
.wg-maint-icon { font-size: 0.7rem; }

/* Raise a slot that contains an info icon so the icon (position: absolute) paints above
   adjacent cells in the grid rather than being clipped behind them. */
.wg-slot.has-info { z-index: 3; }

/* Info icon on occupied (partial/full) slot cells — positioned top-left, shows a CSS tooltip
   on hover with group session details (price, seats). Only rendered server-side by
   WeekGridHelper.RenderCell when WeekGridCell.InfoTooltip is set (Profile.aspx's student view). */
.wg-slot-info {
  position: absolute;
  top: 1px;
  left: 1px;
  width: 14px;
  height: 14px;
  border-radius: 50%;
  background: rgba(0,0,0,0.35);
  color: #fff;
  font-size: 0.55rem;
  font-weight: 700;
  font-style: italic;
  line-height: 14px;
  text-align: center;
  cursor: help;
  z-index: 2;
  opacity: 0.7;
  transition: opacity 0.15s;
}
.wg-slot-info:hover { opacity: 1; }

/* CSS tooltip driven by data-tip — shown on hover over the info icon. */
.wg-slot-info::after {
  content: attr(data-tip);
  position: absolute;
  top: calc(100% + 5px);
  left: 0;
  background: var(--surface-inverse);
  color: var(--text-on-inverse);
  font-size: 0.68rem;
  font-weight: 600;
  font-style: normal;
  white-space: pre-line;
  padding: 4px 8px;
  border-radius: 6px;
  box-shadow: 0 2px 8px rgba(0,0,0,0.18);
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.15s;
  z-index: 10;
  min-width: 120px;
}
.wg-slot-info:hover::after { opacity: 1; }

@media (max-width: 640px) {
  .schedule-nav { gap: 8px; }
  .schedule-nav-btn { padding: 5px 10px; font-size: 0.75rem; }

  .week-grid { --wg-slot-h: 30px; gap: 3px; }
  .wg-day-name { display: none; }
  .wg-day-abbr { display: inline; }
  .wg-hour-head { font-size: 0.66rem; }

  /* At narrow widths the "H:00 (H:00)" dual-timezone suffix forces the hour label to wrap onto a
     second line, which desyncs that row's height from the rest of the grid - hide it below the
     breakpoint rather than widen the hour column back out. */
  .wg-dual-tz { display: none; }
}

@media (max-width: 380px) {
  .week-grid { --wg-slot-h: 26px; gap: 2px; }
  .wg-hour-head { font-size: 0.6rem; }
}

/* =========================================
   Shared recurring-availability EDIT grid (checkbox cells)
   Rendered by Rise.Helper.AvailabilityGridHelper via Helper/WeekGridHelper.cs, for Settings.aspx
   and Profile.aspx's edit modal. Reuses the same .wg-slot cell shape as the read-only grids above
   (a plain .wg-slot with an .avail-cell modifier) instead of a third, separately-styled table.
   ========================================= */

.avail-cell {
  position: relative;
  background: var(--surface-card);
  border-color: var(--border);
  cursor: pointer;
}

.avail-cell.selected {
  background: var(--brand);
  border-color: var(--brand);
}

.avail-cell input.avail-check {
  position: absolute;
  inset: 0;
  opacity: 0;
  margin: 0;
  width: 100%;
  height: 100%;
  cursor: pointer;
}

/* =========================================
   Shared avatar-crop modal (Scripts/avatar-crop.js)
   Used by Settings.aspx and Profile.aspx.
   ========================================= */

.crop-modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.6);
  z-index: 10000;
  display: flex;
  align-items: center;
  justify-content: center;
  direction: rtl;
}

.crop-modal {
  background: var(--surface-card);
  border-radius: 16px;
  width: 420px;
  max-width: 94vw;
  max-height: 90vh;
  overflow: hidden;
  box-shadow: 0 12px 48px rgba(0, 0, 0, 0.25);
  display: flex;
  flex-direction: column;
}

.crop-modal-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 16px 20px;
  border-bottom: 1px solid var(--border);
}

.crop-modal-title {
  font-size: 1.05rem;
  font-weight: 700;
  color: var(--text-heading);
}

.crop-close-btn {
  background: none;
  border: none;
  font-size: 1.6rem;
  color: var(--neutral-500);
  cursor: pointer;
  line-height: 1;
  padding: 0 4px;
}

.crop-close-btn:hover {
  color: var(--danger);
}

.crop-modal-body {
  padding: 20px;
  text-align: center;
  flex: 1;
  overflow: auto;
}

.crop-modal-body .cr-boundary {
  margin: 0 auto;
}

.crop-zoom-controls {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  margin-top: 16px;
  direction: ltr;
}

.zoom-btn {
  width: 34px;
  height: 34px;
  border-radius: 50%;
  border: 1px solid var(--border-strong);
  background: var(--neutral-100);
  font-size: 1.2rem;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--text-body);
  transition: all 0.15s;
}

.zoom-btn:hover {
  background: var(--neutral-200);
  border-color: var(--neutral-500);
}

.zoom-slider-wrapper {
  flex: 1;
  max-width: 160px;
}

.zoom-slider {
  width: 100%;
  cursor: pointer;
  height: 4px;
  accent-color: var(--brand);
}

.zoom-label {
  font-size: 0.8rem;
  color: var(--neutral-600);
  min-width: 40px;
  text-align: center;
  font-weight: 600;
}

.crop-modal-footer {
  display: flex;
  gap: 10px;
  padding: 14px 20px;
  border-top: 1px solid var(--border);
  direction: ltr;
}

.crop-btn-cancel {
  flex: 1;
  padding: 10px;
  border: 1px solid var(--border-strong);
  border-radius: 8px;
  background: var(--surface-card);
  color: var(--neutral-600);
  font-size: 0.9rem;
  font-weight: 600;
  cursor: pointer;
  transition: background 0.15s;
}

.crop-btn-cancel:hover {
  background: var(--neutral-100);
}

.crop-btn-confirm {
  flex: 1;
  padding: 10px;
  border: none;
  border-radius: 8px;
  background: var(--brand);
  color: var(--text-on-solid);
  font-size: 0.9rem;
  font-weight: 700;
  cursor: pointer;
  transition: background 0.15s;
}

.crop-btn-confirm:hover {
  background: var(--brand-active);
}

.crop-btn-confirm:disabled {
  background: var(--neutral-400);
  cursor: not-allowed;
}

.upload-progress-modal {
  background: var(--surface-card);
  border-radius: 16px;
  padding: 40px 36px;
  width: 360px;
  max-width: 88vw;
  text-align: center;
  box-shadow: 0 12px 48px rgba(0, 0, 0, 0.25);
}

.upload-progress-icon {
  color: var(--brand);
  margin-bottom: 12px;
}

.upload-progress-title {
  font-size: 1rem;
  font-weight: 700;
  color: var(--text-heading);
  margin-bottom: 20px;
}

.upload-progress-bar-track {
  height: 10px;
  background: var(--neutral-200);
  border-radius: 10px;
  overflow: hidden;
  margin-bottom: 8px;
}

.upload-progress-bar-fill {
  height: 100%;
  background: linear-gradient(90deg, var(--brand), var(--brand-hover));
  border-radius: 10px;
  transition: width 0.3s ease;
}

.upload-progress-text {
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--neutral-600);
}

/* =========================================
   Generic small edit modal (Profile.aspx per-section pencil editors)
   Same hand-rolled overlay pattern as .crop-modal-overlay / Admin's #confirmModal - no modal
   library in this codebase.
   ========================================= */

.modal-overlay {
  position: fixed;
  inset: 0;
  background: var(--overlay-scrim);
  z-index: 10000;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 16px;
}

.modal-box {
  background: var(--surface-card);
  border-radius: 14px;
  width: 440px;
  max-width: 100%;
  box-shadow: 0 12px 48px rgba(0, 0, 0, 0.25);
  overflow: hidden;
}

.modal-box-wide {
  width: 620px;
}

/* Caps overall modal height. The availability grid inside no longer has its own scrollbox (it
   fits fluidly via --wg-slot-h - see CSS/styles.css's "Shared week grid" block), so this can
   safely own the scroll itself now; the old ambiguous-containing-block hazard that kept this at
   `overflow: visible` was specific to that grid's now-removed sticky table header. */
.modal-box-wide .modal-box-body {
  max-height: 70vh;
  overflow-y: auto;
}

.modal-box-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 16px 20px;
  border-bottom: 1px solid var(--surface-sunken);
}

.modal-box-header h3 {
  margin: 0;
  font-size: 1.05rem;
  color: var(--text-heading);
}

.modal-close-btn {
  background: none;
  border: none;
  font-size: 1.5rem;
  color: var(--neutral-500);
  cursor: pointer;
  line-height: 1;
  padding: 0 4px;
}

.modal-close-btn:hover {
  color: var(--danger);
}

.modal-box-body {
  padding: 20px;
}

.modal-box-body textarea,
.modal-box-body input[type="text"],
.modal-box-body input[type="url"],
.modal-input {
  width: 100%;
  box-sizing: border-box;
  padding: 10px 12px;
  border: 1px solid var(--border);
  border-radius: 8px;
  font-family: 'Tajawal';
  font-size: 0.9rem;
  resize: vertical;
}

.modal-box-hint {
  margin-top: 8px;
  font-size: 0.8rem;
  color: var(--neutral-500);
}

.modal-box-hint.warn {
  color: var(--brand-active);
}

.modal-box-footer {
  display: flex;
  justify-content: flex-end;
  gap: 10px;
  padding: 14px 20px;
  border-top: 1px solid var(--surface-sunken);
}

.modal-btn-cancel {
  padding: 9px 20px;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: var(--surface-card);
  color: var(--neutral-600);
  font-size: 0.88rem;
  font-weight: 600;
  cursor: pointer;
  transition: background 0.15s;
}

.modal-btn-cancel:hover {
  background: var(--surface-sunken);
}

.modal-btn-save {
  padding: 9px 22px;
  border: none;
  border-radius: 8px;
  background: linear-gradient(135deg, var(--brand), var(--brand-active));
  color: var(--text-on-solid);
  font-size: 0.88rem;
  font-weight: 700;
  cursor: pointer;
  transition: opacity 0.15s;
}

.modal-btn-save:hover {
  opacity: .88;
}

/* Small pencil trigger next to a profile section title */
.section-edit-btn {
  margin-inline-start: auto;
  background: none;
  border: none;
  color: var(--neutral-500);
  font-size: 0.85rem;
  cursor: pointer;
  padding: 2px 6px;
  border-radius: 4px;
  transition: color 0.15s, background 0.15s;
}

.section-edit-btn:hover {
  color: var(--brand-ink);
  background: var(--surface-sunken);
}

/* =========================================
   Shared avatar-edit widget (Scripts/avatar-crop.js)
   Base sizing here is Settings' original 130px; Profile.aspx's .profile-header overrides size/
   border to match its own header design (see CSS/profile.css).
   ========================================= */

.avatar-circle {
  position: relative;
  width: 130px;
  height: 130px;
  border-radius: 50%;
  overflow: hidden;
  background: var(--surface-sunken);
  border: 4px solid var(--surface-sunken);
  cursor: pointer;
  margin: 10px auto;
  display: flex;
  align-items: center;
  justify-content: center;
}

.avatar-img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.avatar-fallback {
  font-size: 2.5rem;
  font-weight: 700;
  color: var(--text-heading);
  text-transform: uppercase;
}

.avatar-spinner {
  position: absolute;
  inset: 0;
  background: var(--spinner-veil);
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
  z-index: 2;
}

.avatar-spinner i {
  color: var(--text-heading);
}

.avatar-error {
  display: inline-block;
  margin-top: 8px;
  padding: 8px 12px;
  border-radius: 6px;
  background: var(--error-wash) !important;
  border: 1px solid var(--error-wash-border) !important;
  color: var(--danger) !important;
  font-size: 0.85rem;
  font-weight: 700 !important;
  text-align: center;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.12);
}

.avatar-overlay {
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  background: var(--photo-caption-veil);
  color: var(--text-on-solid);
  text-align: center;
  padding: 6px 0;
  font-size: 0.85rem;
  opacity: 0;
  transition: opacity 0.2s;
}

.avatar-circle:hover .avatar-overlay {
  opacity: 1;
}

/* =========================================
   Shared session-row list (Rise.Helper.SessionRowHelper)
   Used by Profile.aspx's compact upcoming-sessions preview and MySessions.aspx's full list.
   ========================================= */

.bookings-list {
  font-size: 0.85rem;
  display: flex;
  flex-direction: column;
}

.booking-row {
  padding: 10px 0;
  border-bottom: 1px solid var(--surface-sunken);
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 10px;
}

.booking-row:last-child {
  border-bottom: none;
}

.booking-row.cancelled {
  color: var(--error);
}

.booking-row-main {
  display: flex;
  flex-direction: column;
  gap: 2px;
  flex: 1;
  min-width: 0;
}

.booking-row-main > span:first-child {
  font-weight: 600;
  color: var(--text-heading);
}

.booking-row-party {
  color: var(--text-muted);
  font-size: 0.85rem;
}

.booking-row-subject {
  color: var(--neutral-500);
  font-size: 0.78rem;
}

.status-badge {
  background: var(--error-wash-border);
  color: var(--danger);
  padding: 0 6px;
  border-radius: 3px;
  font-size: 0.7rem;
  font-weight: 600;
}

.zoom-link {
  color: var(--brand-ink);
  font-size: 1.05rem;
}

/* Meeting exists but the join link hasn't opened yet */
.zoom-link-locked {
  color: var(--locked);
  cursor: not-allowed;
  font-size: 0.8rem;
}

/* Admin-entered Zoom host key, shown next to an instructor's own session row - never to a student */
.host-key {
  color: var(--text-muted);
  font-family: monospace;
  font-size: 0.85rem;
  margin-inline-start: 6px;
}

/* Recording status on a past booking row (see Rise.Helper.SessionRowHelper). A real link once the
   instructor attaches a recording via the MySessions modal; otherwise a muted note telling the
   viewer it hasn't been uploaded yet - deliberately text, not a dead icon. */
.session-recording {
  color: var(--brand-ink);
  font-size: 0.85rem;
  font-weight: 600;
  text-decoration: none;
  white-space: nowrap;
}

a.session-recording:hover {
  color: var(--brand-active);
}

.session-recording-none {
  color: var(--text-muted);
  font-weight: 400;
  cursor: default;
}

/* "قيّم المعلم" - only ever rendered for a student viewing their own past/cancelled row (see
   Rise.Helper.SessionRowHelper.reviewLink); never for the instructor's own list. */
.review-link {
  color: var(--brand-ink);
  font-size: 0.85rem;
  font-weight: 600;
  text-decoration: none;
  white-space: nowrap;
}

.review-link:hover {
  color: var(--brand-active);
}

/* "إلغاء الحصة" - rendered for both roles on any active, not-yet-past, non-compact row (see
   Rise.Helper.SessionRowHelper). Links out to CancelSession.aspx, which is what actually decides
   whether cancelling is still possible. */
.cancel-link {
  color: var(--danger);
  font-size: 1.05rem;
  margin-inline-start: 6px;
  text-decoration: none;
}

.cancel-link:hover {
  color: var(--danger-hover);
}

/* "شارك الحصة" - rendered only for a student's own non-compact row on a still-joinable group
   session (see Rise.Helper.SessionRowHelper / Rise.Services.GroupShareService.IsShareable). A plain
   button, not a link - Scripts\share-link.js's delegated click handler reads data-share-url. */
.share-link {
  color: var(--brand-ink);
  font-size: 1.05rem;
  margin-inline-start: 6px;
  background: none;
  border: none;
  padding: 0;
  cursor: pointer;
}

.share-link:hover {
  color: var(--brand-active);
}

/* Instructor-only icon for adding/editing a session recording URL - rendered by SessionRowHelper
   on past, non-cancelled rows when instructorView is true. */
.recording-link {
  color: var(--text-muted);
  font-size: 1.05rem;
  cursor: pointer;
  text-decoration: none;
}

.recording-link.has-recording {
  color: var(--brand-ink);
}

.recording-link:hover {
  color: var(--brand-active);
}

/* BookSession.aspx's post-booking share box - offered right below the join link when
   GroupShareService.IsShareable is true for the just-created booking. */
.share-box {
  margin-top: 16px;
  padding: 14px;
  background: var(--surface-tint);
  border-radius: 8px;
}

.share-box p {
  margin: 0 0 10px;
  color: var(--text-muted);
  font-size: 0.9rem;
}

.share-box-row {
  display: flex;
  gap: 8px;
}

.share-url {
  flex: 1;
  min-width: 0;
  padding: 8px 10px;
  border: 1px solid var(--border-strong);
  border-radius: 6px;
  background: var(--surface-card);
  font-size: 0.85rem;
  color: var(--text-heading);
}

.btn-copy {
  padding: 8px 14px;
  border: none;
  border-radius: 6px;
  background: var(--brand);
  color: var(--text-on-solid);
  font-size: 0.85rem;
  font-weight: 600;
  cursor: pointer;
  white-space: nowrap;
}

.btn-copy:hover {
  background: var(--brand-active);
}

/* Toast shown by Scripts\share-link.js after a successful copy - ported from CSS\Admin.css's
   .copy-toast/@keyframes copyToastFade (that one's scoped to the Admin area). */
.copy-toast {
  position: fixed;
  padding: 6px 14px;
  background: var(--toast-bg);
  color: var(--toast-text);
  font-size: 13px;
  border-radius: 6px;
  pointer-events: none;
  z-index: 99999;
  animation: copyToastFade 1.2s ease forwards;
}

@keyframes copyToastFade {
  0% { opacity: 1; transform: translateY(0); }
  80% { opacity: 1; transform: translateY(0); }
  100% { opacity: 0; transform: translateY(-10px); }
}

/* =========================================
   Shared list pager (Scripts\table-pager.js's RisePager + Rise.Helper.PagerHelper)
   Used on every long list across the app (Admin.aspx tables/cards, MySessions, Disputes,
   Profile reviews, Earnings). Mirrors the shape of the older per-page pagers this replaces
   (dashboardCore.js's .dash-pager-*, still used standalone by the two dashboards) so paging
   reads the same everywhere.
   ========================================= */

.rp-pager {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 16px;
  flex-wrap: wrap;
  margin-top: 14px;
}

.rp-pager.rp-pager-empty {
  display: none;
}

.rp-pager-info {
  color: var(--text-muted);
  font-size: 0.85rem;
  font-weight: 600;
}

.rp-pager-nav-group {
  display: flex;
  align-items: center;
  gap: 4px;
  flex-wrap: wrap;
}

.rp-pager-btn {
  min-width: 30px;
  height: 30px;
  padding: 0 8px;
  border-radius: 6px;
  border: 1px solid var(--border);
  background: var(--surface-card);
  color: var(--text-muted);
  font-size: 0.82rem;
  font-weight: 600;
  cursor: pointer;
  font-variant-numeric: tabular-nums;
}

.rp-pager-btn:hover:not(:disabled) {
  border-color: var(--brand);
  color: var(--text-heading);
}

.rp-pager-btn.active {
  background: var(--surface-inverse);
  border-color: var(--surface-inverse);
  color: var(--text-on-inverse);
  cursor: default;
}

.rp-pager-btn:disabled {
  opacity: 0.4;
  cursor: default;
}

.rp-pager-dots {
  color: var(--text-muted);
  padding: 0 4px;
  font-size: 0.82rem;
}

/* Items paged out of the current page, or excluded by an active filter - two separate classes
   (table-pager.js's comment explains why) but the same visual result. */
.rp-off,
.rp-hidden {
  display: none !important;
}

/* Click-to-sort column headers (data-rp-sort regions only). */
th.rp-sortable {
  cursor: pointer;
  user-select: none;
  position: relative;
  padding-inline-end: 18px;
}

th.rp-sortable:hover {
  color: var(--brand-ink);
}

th.rp-sortable::after {
  content: '\2195';
  position: absolute;
  inset-inline-end: 4px;
  opacity: 0.35;
  font-size: 0.85em;
}

th.rp-sortable.rp-sort-asc::after {
  content: '\2191';
  opacity: 1;
  color: var(--brand-ink);
}

th.rp-sortable.rp-sort-desc::after {
  content: '\2193';
  opacity: 1;
  color: var(--brand-ink);
}

/* Notice for lists whose source query has a server-side cap (Rise.Helper.PagerHelper.TruncationNotice) -
   client paging can't reveal rows the query never fetched, so this says so rather than let a
   full last page silently imply "that's everything". */
.rp-truncated {
  color: var(--text-muted);
  font-size: 0.82rem;
  text-align: center;
  margin-top: 10px;
  padding: 8px;
  background: var(--surface-sunken);
  border-radius: 6px;
}

/* =========================================
   Floating WhatsApp contact button (Home.Master, litWhatsAppFab)
   Rendered on every Home.Master page, right after the shared <footer>. Pinned with a physical
   `right` rather than `inset-inline-end` on purpose: the site is dir="rtl", so the logical
   inline-end edge is the visual LEFT (see Admin.css's .btn-refresh) - this button is meant to sit
   on the visual right regardless of reading direction. Deliberately stays position:fixed at all
   times (no scroll-driven docking) so it floats on top of the shared <footer> once scrolled into
   view, like a normal always-on-top FAB - z-index 9998 matches .btn-refresh: above the fixed nav
   (1000) and the footer/page content, below modal overlays (9999/10000) and .copy-toast (99999)
   so it never floats over a dialog. BookSession.aspx is the one exception: its own fixed
   .bs-sticky-bar sits flush against the viewport bottom, so book-session.css lifts this button
   above that bar specifically (see its comment) - it isn't meant to overlap that bar the way it
   overlaps the shared footer.
   ========================================= */
.rise-wa-fab {
  position: fixed;
  right: 24px;
  bottom: 24px;
  z-index: 9998;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 56px;
  height: 56px;
  border-radius: 50%;
  background: var(--whatsapp);
  color: var(--text-on-whatsapp);
  font-size: 1.6rem;
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.28);
  text-decoration: none;
  transition: transform 0.15s ease, box-shadow 0.15s ease, background 0.15s ease;
}

.rise-wa-fab:hover,
.rise-wa-fab:focus-visible {
  background: var(--whatsapp-hover);
  box-shadow: 0 6px 20px rgba(0, 0, 0, 0.34);
  transform: translateY(-2px) scale(1.05);
}

.rise-wa-fab:focus-visible {
  outline: 2px solid var(--whatsapp);
  outline-offset: 3px;
}

@media (prefers-reduced-motion: reduce) {
  .rise-wa-fab {
    transition: none;
  }

  .rise-wa-fab:hover,
  .rise-wa-fab:focus-visible {
    transform: none;
  }
}

@media (max-width: 768px) {
  .rise-wa-fab {
    right: 16px;
    bottom: 16px;
    width: 50px;
    height: 50px;
    font-size: 1.4rem;
  }
}

