/* A2Z Barbershop — Customer App — Components */

/* ── Dashboard: greeting header ── */
.dash-header {
  background: var(--surface);
  padding: 18px 18px 14px;
  border-bottom: 1px solid var(--border-lt);
  display: flex; justify-content: space-between; align-items: center;
}
.dash-greet { color: var(--text-sec); font-size: 12px; margin-bottom: 3px; }
.dash-name  { color: var(--text); font-size: 20px; font-weight: 500; }
.dash-pts-box {
  background: var(--card); border: 1px solid var(--border);
  border-radius: var(--radius-md); padding: 8px 14px; text-align: center; min-width: 56px;
}
.dash-pts-num { color: var(--text); font-size: 22px; font-weight: 500; }
.dash-pts-lbl { color: var(--text-mute); font-size: 10px; letter-spacing: 0.8px; text-transform: uppercase; }

/* ── Dashboard: booking card ── */
.bk-card {
  background: var(--card); border: 1px solid var(--border);
  border-radius: var(--radius-lg); padding: 16px 18px;
  margin: 0 16px 4px; position: relative; overflow: hidden;
}
.bk-card::before {
  content: ''; position: absolute; left: 0; top: 0; bottom: 0;
  width: 3px; background: var(--green); border-radius: 3px 0 0 3px;
}
.bk-card.accent::before { background: var(--accent); }
.bk-svc  { color: var(--text); font-size: 15px; font-weight: 500; margin-bottom: 6px; }
.bk-meta { display: flex; gap: 14px; margin-bottom: 12px; }
.bk-meta span { color: var(--text-sec); font-size: 12px; }

/* ── Dashboard: no upcoming ── */
.no-upcoming {
  margin: 0 16px 4px;
  border: 1.5px dashed var(--border);
  border-radius: var(--radius-lg); padding: 24px;
  text-align: center; color: var(--text-sec); font-size: 13px;
}

/* ── Dashboard: book button ── */
.dash-book-btn {
  width: calc(100% - 32px); margin: 12px 16px 0;
  background: var(--text); color: var(--bg);
  border: none; border-radius: var(--radius-md);
  padding: 14px; font-size: 14px; font-weight: 500;
  cursor: pointer; transition: background var(--ease);
}
.dash-book-btn:hover { background: #e0e0e0; }

/* ── Loyalty dots card ── */
.loy-card {
  background: var(--card); border: 1px solid var(--border);
  border-radius: var(--radius-lg); padding: 16px 18px;
  margin: 0 16px;
}
.loy-top {
  display: flex; justify-content: space-between; align-items: flex-start;
  margin-bottom: 14px;
}
.loy-title { color: var(--text); font-size: 14px; font-weight: 500; }
.loy-sub   { color: var(--text-sec); font-size: 11px; margin-top: 3px; }
.loy-dots  { display: flex; gap: 5px; justify-content: center; margin-bottom: 14px; flex-wrap: wrap; }
.loy-dot {
  width: 26px; height: 26px; border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  font-size: 10px; font-weight: 500;
}
.loy-dot-on   { background: var(--text); color: var(--bg); }
.loy-dot-off  { background: #333; border: 1px solid var(--border); color: var(--text-mute); }
.loy-dot-star { background: var(--accent-bg); border: 1px solid var(--accent-bd); color: var(--accent); }
.loy-prog-track { background: #333; border-radius: 4px; height: 5px; margin-bottom: 8px; }
.loy-prog-fill  { background: var(--text); height: 100%; border-radius: 4px; transition: width 0.6s ease; }
.loy-prog-lbls  { display: flex; justify-content: space-between; }
.loy-prog-lbls span { color: var(--text-mute); font-size: 11px; }
.loy-prog-lbls .mid { color: var(--text-sec); }

/* ── Services grid ── */
.services-grid {
  display: grid; grid-template-columns: repeat(2, 1fr);
  gap: 10px; padding: 0 16px 16px;
}
.service-card {
  background: var(--card); border: 1px solid var(--border);
  border-radius: var(--radius-md); padding: 13px;
  cursor: pointer; transition: border-color var(--ease);
}
.service-card:hover, .service-card.selected { border-color: var(--text-sec); }
.service-card.selected { border-color: var(--accent); }
.service-card-image {
  width: 34px; height: 34px; background: #333;
  border-radius: var(--radius-sm); margin-bottom: 9px;
  display: flex; align-items: center; justify-content: center; font-size: 16px;
  overflow: hidden;
}
.service-card-image img { width: 100%; height: 100%; object-fit: cover; }
.service-card-name  { color: var(--text); font-size: 13px; font-weight: 500; margin-bottom: 2px; }
.service-card-desc  { color: var(--text-sec); font-size: 11px; margin-bottom: 8px; line-height: 1.4; }
.service-card-footer { display: flex; align-items: center; justify-content: space-between; margin-top: 6px; }
.service-card-price    { font-size: 14px; font-weight: 600; color: var(--text); }
.service-card-duration { font-size: 11px; color: var(--text-mute); }
.service-card .svc-btn {
  width: 100%; background: #333; border: 1px solid var(--border);
  border-radius: var(--radius-sm); padding: 7px;
  color: var(--text-sec); font-size: 11px; cursor: pointer; margin-top: 10px;
}
.service-card .svc-btn:hover { color: var(--text); border-color: var(--text-sec); }

/* ── History list ── */
.history-list { padding: 16px; display: flex; flex-direction: column; gap: 10px; }
.history-item {
  background: var(--card); border: 1px solid var(--border);
  border-radius: var(--radius-md); padding: 13px 15px;
  display: flex; align-items: center; gap: 12px;
}
.history-icon {
  width: 36px; height: 36px; background: #333; border-radius: var(--radius-sm);
  display: flex; align-items: center; justify-content: center;
  font-size: 16px; flex-shrink: 0;
}
.history-info  { flex: 1; min-width: 0; }
.history-service { color: var(--text); font-size: 13px; font-weight: 500; }
.history-date    { color: var(--text-sec); font-size: 11px; margin-top: 2px; }
.history-price   { color: var(--text); font-size: 13px; font-weight: 500; flex-shrink: 0; }
.history-item-right { display: flex; flex-direction: column; align-items: flex-end; gap: 6px; }

/* ── Booking Steps ── */
.booking-steps {
  display: flex; align-items: center; justify-content: center;
  padding: 14px 16px; gap: 0; background: var(--surface);
  border-bottom: 1px solid var(--border-lt);
}
.step-item {
  display: flex; flex-direction: column; align-items: center;
  gap: 5px; flex: 1; position: relative;
}
.step-item:not(:last-child)::after {
  content: ''; position: absolute; top: 15px; left: 55%; right: -45%;
  height: 1.5px; background: var(--border);
}
.step-item.completed:not(:last-child)::after { background: var(--text-sec); }
.step-circle {
  width: 30px; height: 30px; border-radius: var(--radius-full);
  background: var(--card); border: 1.5px solid var(--border);
  display: flex; align-items: center; justify-content: center;
  font-size: 12px; font-weight: 600; color: var(--text-mute); z-index: 1;
  transition: all var(--ease);
}
.step-item.active    .step-circle { background: var(--text); border-color: var(--text); color: var(--bg); }
.step-item.completed .step-circle { background: var(--green-bg); border-color: var(--green-bd); color: var(--green); }
.step-label { font-size: 9px; font-weight: 600; color: var(--text-mute); text-align: center; letter-spacing: 0.3px; text-transform: uppercase; }
.step-item.active .step-label { color: var(--text); }

/* ── Calendar ── */
.calendar-wrapper { padding: 0 16px 16px; }
.calendar-nav {
  display: flex; align-items: center; justify-content: space-between;
  padding: 14px 0;
}
.calendar-month { font-size: 16px; font-weight: 600; color: var(--text); }
.calendar-nav-btn {
  width: 36px; height: 36px; border-radius: var(--radius-full);
  background: var(--card); border: 1px solid var(--border);
  color: var(--text); display: flex; align-items: center; justify-content: center;
  font-size: 17px; min-width: 36px;
}
.calendar-grid { display: grid; grid-template-columns: repeat(7, 1fr); gap: 3px; }
.calendar-dow {
  text-align: center; font-size: 10px; font-weight: 600;
  color: var(--text-mute); padding: 6px 0; text-transform: uppercase; letter-spacing: 0.5px;
}
.calendar-day {
  aspect-ratio: 1; border-radius: var(--radius-sm);
  display: flex; align-items: center; justify-content: center;
  font-size: 13px; font-weight: 500; cursor: pointer;
  transition: background var(--ease), color var(--ease);
  min-height: 34px; position: relative; color: var(--text);
}
.calendar-day.empty { pointer-events: none; }
.calendar-day.past  { color: var(--text-mute); pointer-events: none; }
.calendar-day.today { font-weight: 700; }
.calendar-day.today::after {
  content: ''; position: absolute; bottom: 3px;
  width: 4px; height: 4px; border-radius: 50%; background: var(--accent);
}
.calendar-day:not(.past):not(.empty):hover { background: var(--card); }
.calendar-day.selected { background: var(--text); color: var(--bg); font-weight: 700; }
.calendar-day.selected::after { background: var(--bg); }

/* ── Time Slots ── */
.slots-grid {
  display: grid; grid-template-columns: repeat(3, 1fr);
  gap: 8px; padding: 0 16px 16px;
}
.slot-btn {
  height: 44px; border-radius: var(--radius-sm);
  border: 1px solid var(--border); background: var(--card);
  font-size: 13px; font-weight: 500; color: var(--text);
  transition: all var(--ease);
}
.slot-btn:hover:not(:disabled) { border-color: var(--text-sec); }
.slot-btn.selected { background: var(--text); border-color: var(--text); color: var(--bg); }
.slot-btn:disabled { opacity: 0.3; cursor: not-allowed; }

/* ── Confirm card ── */
.confirm-card {
  margin: 16px; border-radius: var(--radius-lg);
  border: 1px solid var(--border); overflow: hidden; background: var(--card);
}
.confirm-card-header {
  background: var(--surface); border-bottom: 1px solid var(--border);
  padding: 20px; text-align: center;
}
.confirm-card-header .confirm-logo { font-size: 22px; font-weight: 800; color: var(--accent); margin-bottom: 4px; }
.confirm-card-header h2 { font-size: 17px; font-weight: 600; color: var(--text); }
.confirm-card-body { padding: 20px; }
.confirm-row {
  display: flex; justify-content: space-between; align-items: center;
  padding: 12px 0; border-bottom: 1px solid var(--border-lt);
}
.confirm-row:last-child { border-bottom: none; }
.confirm-label { font-size: 12px; color: var(--text-sec); font-weight: 500; }
.confirm-value { font-size: 14px; font-weight: 600; color: var(--text); text-align: end; }

/* ── Success screen ── */
.success-screen {
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  padding: 48px 24px; text-align: center; gap: 16px; min-height: 60vh;
}
.success-icon { font-size: 72px; animation: pop 0.4s cubic-bezier(0.34,1.56,0.64,1); }
@keyframes pop { from { transform: scale(0); opacity:0; } to { transform: scale(1); opacity:1; } }
.confetti { position: fixed; inset: 0; pointer-events: none; z-index: 9998; overflow: hidden; }
.confetti-piece {
  position: absolute; width: 8px; height: 8px;
  animation: confetti-fall 2.5s ease-in forwards;
}
@keyframes confetti-fall {
  0%   { transform: translateY(-20px) rotate(0deg); opacity:1; }
  100% { transform: translateY(110vh) rotate(720deg); opacity:0; }
}

/* ── Loyalty page ── */
.loyalty-card {
  margin: 0 16px;
  background: var(--card); border: 1px solid var(--border);
  border-radius: var(--radius-lg); padding: 20px;
}
.loyalty-card .lc-label  { font-size: 12px; color: var(--text-sec); font-weight: 500; }
.loyalty-card .lc-points { font-size: 48px; font-weight: 700; color: var(--text); line-height: 1.1; }
.loyalty-card .lc-sub    { font-size: 12px; color: var(--text-sec); }
.loyalty-progress { margin-top: 18px; }
.loyalty-progress-bar  { height: 5px; border-radius: 4px; background: #333; overflow: hidden; }
.loyalty-progress-fill { height: 100%; background: var(--text); border-radius: 4px; transition: width 0.6s ease; }
.loyalty-progress-text { display: flex; justify-content: space-between; font-size: 11px; margin-top: 6px; color: var(--text-mute); }

/* ── PWA install popup ── */
.pwa-popup {
  position: fixed; bottom: 0; left: 50%;
  transform: translateX(-50%) translateY(100%);
  width: 100%; max-width: var(--max-w);
  background: var(--surface); border-top: 1px solid var(--border);
  border-radius: var(--radius-xl) var(--radius-xl) 0 0;
  box-shadow: var(--shadow-lg); padding: 20px 20px 32px;
  z-index: 9000; transition: transform 0.35s cubic-bezier(0.34,1.2,0.64,1);
}
.pwa-popup.show { transform: translateX(-50%) translateY(0); }
.pwa-popup-handle { width: 36px; height: 3px; border-radius: 2px; background: var(--border); margin: 0 auto 18px; }
.pwa-popup-logo { font-size: 36px; font-weight: 900; color: var(--accent); text-align: center; margin-bottom: 6px; }
.pwa-popup h2 { font-size: 18px; font-weight: 700; text-align: center; margin-bottom: 4px; color: var(--text); }
.pwa-popup p  { font-size: 13px; color: var(--text-sec); text-align: center; margin-bottom: 18px; }
.pwa-pills { display: flex; justify-content: center; gap: 8px; margin-bottom: 20px; flex-wrap: wrap; }
.pwa-pill {
  background: var(--card); border: 1px solid var(--border);
  border-radius: var(--radius-full); padding: 5px 12px;
  font-size: 12px; font-weight: 600; color: var(--text);
  display: flex; align-items: center; gap: 5px;
}
.pwa-overlay {
  position: fixed; inset: 0; background: rgba(0,0,0,0.7);
  z-index: 8999; opacity: 0; pointer-events: none; transition: opacity 0.3s;
}
.pwa-overlay.show { opacity: 1; pointer-events: all; }

/* ── Step section labels ── */
.step-section { padding: 16px 16px 8px; }
.step-section h2 { font-size: 19px; font-weight: 700; color: var(--text); }
.step-section p  { font-size: 13px; color: var(--text-sec); margin-top: 3px; }

/* ── Action bar (booking bottom bar) ── */
.action-bar {
  position: sticky; bottom: var(--nav-h);
  background: var(--surface); border-top: 1px solid var(--border-lt);
  padding: 12px 16px;
  padding-bottom: calc(12px + env(safe-area-inset-bottom, 0));
  z-index: 50;
}

/* ── Upcoming card (dashboard) ── */
.upcoming-card {
  background: var(--card); border: 1px solid var(--border);
  border-radius: var(--radius-lg); padding: 16px 18px;
  margin: 0 16px; position: relative; overflow: hidden;
}
.upcoming-card::before {
  content: ''; position: absolute; left: 0; top: 0; bottom: 0;
  width: 3px; background: var(--green); border-radius: 3px 0 0 3px;
}
.upcoming-card .uc-label   { font-size: 10px; color: var(--text-mute); letter-spacing: 1px; text-transform: uppercase; margin-bottom: 6px; }
.upcoming-card .uc-service { font-size: 16px; font-weight: 500; color: var(--text); margin-bottom: 6px; }
.upcoming-card .uc-time    { color: var(--text-sec); font-size: 12px; margin-bottom: 10px; }
.upcoming-card .uc-status  {}

/* ── Contact Section ── */
.contact-section {
  display: flex;
  flex-direction: column;
  gap: 10px;
  padding: 0 16px;
  margin-bottom: 8px;
}

.contact-btn {
  display: flex;
  align-items: center;
  gap: 14px;
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 14px 18px;
  text-decoration: none;
  color: var(--text);
  transition: background 0.18s, border-color 0.18s, transform 0.12s;
  position: relative;
  overflow: hidden;
}
.contact-btn:active { transform: scale(0.98); }

/* left accent stripe per button type */
.contact-btn::before {
  content: '';
  position: absolute; left: 0; top: 0; bottom: 0;
  width: 3px; border-radius: 3px 0 0 3px;
}
.contact-btn-call::before     { background: #4299e1; }
.contact-btn-whatsapp::before { background: #25D366; }
.contact-btn-maps::before     { background: var(--accent); }

.contact-btn-icon {
  width: 40px; height: 40px; border-radius: 10px;
  display: flex; align-items: center; justify-content: center;
  flex-shrink: 0;
}
.contact-btn-icon svg { width: 20px; height: 20px; }

.contact-btn-call     .contact-btn-icon { background: rgba(66,153,225,0.12); color: #4299e1; }
.contact-btn-whatsapp .contact-btn-icon { background: rgba(37,211,102,0.12); color: #25D366; }
.contact-btn-maps     .contact-btn-icon { background: rgba(201,168,76,0.12);  color: var(--accent); }

.contact-btn-label {
  font-size: 15px;
  font-weight: 500;
  color: var(--text);
  flex: 1;
}
.contact-btn-sub {
  font-size: 11px;
  color: var(--text-mute);
  display: block;
  margin-top: 2px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  max-width: 180px;
}

/* RTL adjustments */
[dir="rtl"] .contact-btn::before {
  left: auto; right: 0;
  border-radius: 0 3px 3px 0;
}
[dir="rtl"] .contact-btn {
  flex-direction: row-reverse;
  text-align: right;
}

/* ── Admin Settings Card ── */
.settings-card {
  background: var(--surface-2, #1a1a1a);
  border-radius: 16px;
  margin: 16px;
  overflow: hidden;
}
.settings-group {
  padding: 16px 16px 8px;
  border-bottom: 1px solid var(--border, #2a2a2a);
}
.settings-group:last-of-type { border-bottom: none; }
.settings-group-title {
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 0.8px;
  text-transform: uppercase;
  color: var(--text-mute, #888);
  margin-bottom: 12px;
}
.form-hint {
  font-size: 11px;
  color: var(--text-mute, #888);
  margin-top: 4px;
}

/* ── About Section ── */
.about-section {
  margin: 8px 16px 0;
  padding: 16px;
  border-top: 1px solid var(--border);
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 10px;
  text-align: center;
}
.about-text {
  font-size: 12px;
  color: var(--text-mute);
  line-height: 1.5;
}
.about-wa {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  background: rgba(37,211,102,0.1);
  color: #25D366;
  border: 1px solid rgba(37,211,102,0.25);
  border-radius: 20px;
  padding: 6px 14px;
  font-size: 13px;
  font-weight: 500;
  text-decoration: none;
  transition: background 0.18s;
}
.about-wa:active { background: rgba(37,211,102,0.2); }
