/* mazen.carehubs.tech — Demo Scheduler Styles */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

:root {
  --primary: #0F766E;
  --primary-light: #CCFBF1;
  --primary-dark: #0D6660;
  --accent: #0EA5E9;
  --bg: #F8FAFC;
  --surface: #FFFFFF;
  --border: #E2E8F0;
  --text: #1E293B;
  --text-secondary: #64748B;
  --text-muted: #94A3B8;
  --error: #EF4444;
  --success: #22C55E;
  --radius: 12px;
  --shadow: 0 1px 3px rgba(0,0,0,.08), 0 4px 16px rgba(0,0,0,.06);
  --shadow-lg: 0 8px 32px rgba(0,0,0,.12);
}

html[dir="rtl"] { direction: rtl; }
html { scroll-behavior: smooth; }
body {
  font-family: 'Segoe UI', system-ui, -apple-system, sans-serif;
  background: var(--bg);
  color: var(--text);
  min-height: 100vh;
}

html[lang="ar"] body { font-family: 'Tajawal', 'Segoe UI', sans-serif; }

/* ── Header ── */
.sched-header {
  background: var(--surface);
  border-bottom: 1px solid var(--border);
  padding: 0 24px;
  height: 64px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  position: sticky;
  top: 0;
  z-index: 100;
  box-shadow: 0 1px 4px rgba(0,0,0,.06);
}
.sched-logo { display: flex; align-items: center; gap: 10px; text-decoration: none; }
.sched-logo-mark {
  width: 36px; height: 36px; border-radius: 8px;
  background: var(--primary); display: flex; align-items: center; justify-content: center;
  font-size: 18px; color: #fff;
}
.sched-logo-text { font-weight: 700; font-size: 17px; color: var(--text); }
.sched-logo-sub { font-size: 12px; color: var(--text-secondary); }
.lang-btn {
  background: none; border: 1px solid var(--border); border-radius: 8px;
  padding: 6px 12px; font-size: 13px; color: var(--text-secondary);
  cursor: pointer; transition: all .2s;
}
.lang-btn:hover { border-color: var(--primary); color: var(--primary); }

/* ── Main layout ── */
.sched-main {
  max-width: 860px; margin: 0 auto; padding: 32px 16px 80px;
}
.sched-hero { text-align: center; margin-bottom: 40px; }
.sched-hero h1 { font-size: 28px; font-weight: 700; color: var(--text); margin-bottom: 8px; }
.sched-hero p { color: var(--text-secondary); font-size: 15px; max-width: 480px; margin: 0 auto; }

.sched-avatar {
  width: 72px; height: 72px; border-radius: 50%;
  background: linear-gradient(135deg, var(--primary) 0%, var(--accent) 100%);
  display: flex; align-items: center; justify-content: center;
  font-size: 28px; color: #fff; margin: 0 auto 16px;
  box-shadow: 0 4px 12px rgba(15,118,110,.3);
}

/* ── Calendar ── */
.cal-wrapper { background: var(--surface); border-radius: var(--radius); box-shadow: var(--shadow); overflow: hidden; }
.cal-nav {
  display: flex; align-items: center; justify-content: space-between;
  padding: 16px 20px; border-bottom: 1px solid var(--border);
}
.cal-nav h2 { font-size: 16px; font-weight: 600; }
.cal-nav-btn {
  width: 34px; height: 34px; border-radius: 8px; border: 1px solid var(--border);
  background: none; cursor: pointer; font-size: 16px; display: flex;
  align-items: center; justify-content: center; transition: all .2s; color: var(--text);
}
.cal-nav-btn:hover { background: var(--primary-light); border-color: var(--primary); color: var(--primary); }

.cal-grid {
  display: grid; grid-template-columns: repeat(7, 1fr);
  border-left: 1px solid var(--border);
}
.cal-dow {
  padding: 10px 4px; text-align: center; font-size: 11px; font-weight: 600;
  color: var(--text-muted); text-transform: uppercase; letter-spacing: .04em;
  border-right: 1px solid var(--border); border-bottom: 1px solid var(--border);
}
.cal-day {
  padding: 8px 4px; min-height: 52px; text-align: center;
  border-right: 1px solid var(--border); border-bottom: 1px solid var(--border);
  position: relative; cursor: default; transition: background .15s;
}
.cal-day.empty { background: #FAFAFA; }
.cal-day.past { opacity: .4; }
.cal-day.today .cal-day-num {
  background: var(--primary); color: #fff; border-radius: 50%;
  width: 26px; height: 26px; display: inline-flex; align-items: center;
  justify-content: center; font-size: 13px;
}
.cal-day-num { font-size: 13px; font-weight: 500; line-height: 26px; }
.cal-day.has-slots {
  cursor: pointer; background: var(--surface);
}
.cal-day.has-slots:hover { background: var(--primary-light); }
.cal-day.selected { background: var(--primary) !important; }
.cal-day.selected .cal-day-num { color: #fff; font-weight: 700; }
.cal-slot-dot {
  width: 6px; height: 6px; border-radius: 50%; background: var(--primary);
  margin: 3px auto 0; display: block;
}
.cal-day.selected .cal-slot-dot { background: rgba(255,255,255,.8); }
.cal-loading { padding: 40px; text-align: center; color: var(--text-muted); font-size: 14px; }

/* ── Slots panel ── */
.slots-panel {
  margin-top: 24px; background: var(--surface);
  border-radius: var(--radius); box-shadow: var(--shadow);
  overflow: hidden; display: none;
}
.slots-panel.visible { display: block; animation: slideDown .2s ease; }
@keyframes slideDown { from { opacity: 0; transform: translateY(-8px); } to { opacity: 1; transform: translateY(0); } }

.slots-header {
  padding: 16px 20px; border-bottom: 1px solid var(--border);
  display: flex; align-items: center; justify-content: space-between;
}
.slots-header h3 { font-size: 15px; font-weight: 600; }
.slots-close {
  width: 28px; height: 28px; border-radius: 6px; border: none;
  background: var(--bg); cursor: pointer; font-size: 16px; color: var(--text-secondary);
  display: flex; align-items: center; justify-content: center;
}
.slots-close:hover { background: var(--border); }
.slots-grid {
  padding: 16px 20px;
  display: grid; grid-template-columns: repeat(auto-fill, minmax(120px, 1fr)); gap: 10px;
}
.slot-chip {
  padding: 10px 8px; border-radius: 8px; border: 1.5px solid var(--border);
  background: var(--surface); cursor: pointer; text-align: center;
  font-size: 14px; font-weight: 500; color: var(--text); transition: all .15s;
}
.slot-chip:hover { border-color: var(--primary); background: var(--primary-light); color: var(--primary); }
.slot-chip.selected { border-color: var(--primary); background: var(--primary); color: #fff; }
.slots-empty { padding: 20px; text-align: center; color: var(--text-muted); font-size: 14px; }

/* ── Booking form ── */
.booking-form-wrap {
  margin-top: 24px; background: var(--surface);
  border-radius: var(--radius); box-shadow: var(--shadow);
  overflow: hidden; display: none;
}
.booking-form-wrap.visible { display: block; animation: slideDown .2s ease; }
.booking-form-header {
  padding: 16px 20px; border-bottom: 1px solid var(--border);
  background: linear-gradient(135deg, var(--primary-light) 0%, #E0F2FE 100%);
}
.booking-form-header h3 { font-size: 15px; font-weight: 600; color: var(--primary); }
.booking-form-header p { font-size: 13px; color: var(--text-secondary); margin-top: 2px; }
.booking-form { padding: 20px; display: flex; flex-direction: column; gap: 14px; }
.form-row { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
@media (max-width: 520px) { .form-row { grid-template-columns: 1fr; } }
.form-group { display: flex; flex-direction: column; gap: 6px; }
.form-label { font-size: 13px; font-weight: 500; color: var(--text); }
.form-label span { color: var(--error); margin-inline-start: 2px; }
.form-input, .form-select {
  padding: 10px 12px; border: 1.5px solid var(--border); border-radius: 8px;
  font-size: 14px; color: var(--text); background: var(--surface);
  transition: border-color .15s; outline: none; width: 100%;
}
.form-input:focus, .form-select:focus { border-color: var(--primary); }
.form-input::placeholder { color: var(--text-muted); }
.form-error { font-size: 12px; color: var(--error); display: none; }
.booking-submit {
  padding: 12px; border-radius: 8px; border: none;
  background: var(--primary); color: #fff; font-size: 15px; font-weight: 600;
  cursor: pointer; transition: background .2s; margin-top: 4px;
}
.booking-submit:hover { background: var(--primary-dark); }
.booking-submit:disabled { opacity: .6; cursor: not-allowed; }

/* ── Confirmation ── */
.confirmation { display: none; }
.confirmation.visible { display: block; }
.confirm-card {
  background: var(--surface); border-radius: var(--radius); box-shadow: var(--shadow);
  padding: 40px 32px; text-align: center; margin-top: 24px;
  animation: slideDown .3s ease;
}
.confirm-icon { font-size: 56px; margin-bottom: 16px; }
.confirm-card h2 { font-size: 22px; font-weight: 700; color: var(--text); margin-bottom: 8px; }
.confirm-card p { color: var(--text-secondary); font-size: 15px; line-height: 1.6; }
.confirm-time {
  margin: 20px 0; padding: 16px; border-radius: 10px;
  background: var(--primary-light); color: var(--primary);
  font-size: 17px; font-weight: 600;
}
.gcal-btn {
  display: inline-flex; align-items: center; gap: 8px;
  padding: 11px 22px; border-radius: 8px; border: 1.5px solid var(--primary);
  color: var(--primary); background: none; font-size: 14px; font-weight: 500;
  cursor: pointer; text-decoration: none; transition: all .2s; margin-top: 8px;
}
.gcal-btn:hover { background: var(--primary-light); }
.cancel-note { font-size: 12px; color: var(--text-muted); margin-top: 20px; }
.cancel-note a { color: var(--primary); }

/* ── Cancel page ── */
.cancel-card {
  background: var(--surface); border-radius: var(--radius); box-shadow: var(--shadow);
  padding: 48px 32px; text-align: center; margin-top: 40px;
  max-width: 480px; margin-left: auto; margin-right: auto;
}
.cancel-card h2 { font-size: 20px; font-weight: 700; margin-bottom: 12px; }
.cancel-card p { color: var(--text-secondary); font-size: 15px; line-height: 1.6; }
.cancel-btn {
  margin-top: 20px; padding: 12px 28px; border-radius: 8px; border: none;
  background: var(--error); color: #fff; font-size: 15px; font-weight: 600;
  cursor: pointer; transition: background .2s;
}
.cancel-btn:hover { background: #DC2626; }
.cancel-btn:disabled { opacity: .5; cursor: not-allowed; }
.back-btn {
  display: inline-block; margin-top: 12px; color: var(--primary); font-size: 14px;
  text-decoration: none; cursor: pointer;
}

/* ── General error ── */
.page-error { padding: 60px 24px; text-align: center; }
.page-error h2 { font-size: 20px; font-weight: 700; margin-bottom: 8px; }
.page-error p { color: var(--text-secondary); }

/* ── No slots banner ── */
.no-slots-banner {
  margin-top: 24px; padding: 20px; border-radius: var(--radius);
  background: var(--surface); border: 1px dashed var(--border);
  text-align: center; color: var(--text-secondary); font-size: 14px;
  display: none;
}
.no-slots-banner.visible { display: block; }

@media (max-width: 640px) {
  .sched-main { padding: 20px 12px 60px; }
  .sched-hero h1 { font-size: 22px; }
  .cal-grid { font-size: 12px; }
  .confirm-card { padding: 28px 16px; }
}
