/* ============================================
   RON AMAR BARBERSHOP — Custom Styles
   ============================================ */

/* Hero overlay gradient */
.hero-overlay {
  background: linear-gradient(to bottom,
    rgba(10,10,10,0.5) 0%,
    rgba(10,10,10,0.3) 40%,
    rgba(10,10,10,0.7) 70%,
    rgba(10,10,10,0.95) 100%
  );
}

/* Custom scrollbar */
.custom-scrollbar::-webkit-scrollbar { width: 4px; }
.custom-scrollbar::-webkit-scrollbar-track { background: transparent; }
.custom-scrollbar::-webkit-scrollbar-thumb { background: rgba(197, 160, 89, 0.3); border-radius: 4px; }
.custom-scrollbar::-webkit-scrollbar-thumb:hover { background: rgba(197, 160, 89, 0.6); }

/* Smooth scroll */
html { scroll-behavior: smooth; }

/* Modal animations */
.modal-enter {
  animation: modalSlideUp 0.35s cubic-bezier(0.16, 1, 0.3, 1) forwards;
}
.modal-exit {
  transform: translateY(20px);
  opacity: 0;
  transition: all 0.3s ease;
}
.modal-exit.active {
  transform: translateY(0);
  opacity: 1;
}

@keyframes modalSlideUp {
  from { transform: translateY(40px); opacity: 0; }
  to { transform: translateY(0); opacity: 1; }
}

/* Booking step transitions */
.booking-step {
  animation: fadeIn 0.3s ease;
}
@keyframes fadeIn {
  from { opacity: 0; transform: translateY(10px); }
  to { opacity: 1; transform: translateY(0); }
}

/* Time slot buttons */
.time-slot {
  padding: 10px;
  text-align: center;
  border-radius: 12px;
  border: 1px solid rgba(255,255,255,0.1);
  background: #0A0A0A;
  color: white;
  cursor: pointer;
  font-weight: 500;
  font-size: 14px;
  transition: all 0.2s;
}
.time-slot:hover {
  border-color: rgba(197, 160, 89, 0.5);
  background: rgba(197, 160, 89, 0.05);
}
.time-slot.selected {
  border-color: #C5A059;
  background: rgba(197, 160, 89, 0.15);
  color: #C5A059;
  font-weight: 700;
}
.time-slot.disabled {
  opacity: 0.3;
  cursor: not-allowed;
  pointer-events: none;
}

/* Radio button selected state */
input[type="radio"]:checked + div + span,
input[type="radio"]:checked ~ span {
  color: #C5A059;
}

/* Navbar scroll effect */
.navbar-scrolled {
  box-shadow: 0 4px 30px rgba(0,0,0,0.3);
}

/* Appointment card in dashboard */
.appointment-card {
  background: #1A1A1A;
  border: 1px solid rgba(255,255,255,0.05);
  border-radius: 16px;
  padding: 16px 20px;
  display: flex;
  align-items: center;
  gap: 16px;
  transition: all 0.2s;
}
.appointment-card:hover {
  border-color: rgba(197, 160, 89, 0.3);
}
.appointment-card .time-badge {
  background: linear-gradient(135deg, #C5A059, #A38040);
  color: white;
  font-weight: 700;
  font-size: 14px;
  padding: 8px 14px;
  border-radius: 10px;
  min-width: 60px;
  text-align: center;
}
.appointment-card .details {
  flex: 1;
}
.appointment-card .details .name {
  color: white;
  font-weight: 600;
  font-size: 15px;
}
.appointment-card .details .info {
  color: rgba(255,255,255,0.4);
  font-size: 12px;
  margin-top: 2px;
}
.appointment-card .delete-btn {
  background: rgba(239, 68, 68, 0.1);
  border: 1px solid rgba(239, 68, 68, 0.2);
  color: #ef4444;
  border-radius: 10px;
  width: 36px;
  height: 36px;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: all 0.2s;
}
.appointment-card .delete-btn:hover {
  background: rgba(239, 68, 68, 0.2);
}

/* Loading spinner */
.spinner {
  width: 24px; height: 24px;
  border: 3px solid rgba(197,160,89,0.2);
  border-top-color: #C5A059;
  border-radius: 50%;
  animation: spin 0.6s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }

/* Empty state */
.empty-state {
  text-align: center;
  padding: 48px 24px;
  color: rgba(255,255,255,0.3);
}
.empty-state i {
  font-size: 48px;
  margin-bottom: 16px;
  display: block;
}

/* Date group header */
.date-group-header {
  font-size: 13px;
  font-weight: 600;
  color: #C5A059;
  letter-spacing: 1px;
  text-transform: uppercase;
  padding: 8px 0;
  border-bottom: 1px solid rgba(255,255,255,0.05);
  margin-bottom: 12px;
  margin-top: 24px;
}
.date-group-header:first-child { margin-top: 0; }

/* Responsive fixes */
@media (max-width: 640px) {
  #booking-modal-content {
    max-height: 100vh;
    border-radius: 0;
    height: 100%;
  }
}

/* ── Calendar GUI ─────────────────────── */
.calendar-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 12px;
}
.calendar-header .month-label {
  font-weight: 700;
  color: white;
  font-size: 15px;
}
.calendar-header button {
  background: rgba(255,255,255,0.05);
  border: 1px solid rgba(255,255,255,0.1);
  color: #C5A059;
  width: 32px; height: 32px;
  border-radius: 8px;
  cursor: pointer;
  font-size: 14px;
  display: flex; align-items: center; justify-content: center;
  transition: all 0.2s;
}
.calendar-header button:hover { background: rgba(197,160,89,0.15); }
.calendar-days-header {
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  gap: 2px;
  margin-bottom: 6px;
}
.calendar-days-header span {
  text-align: center;
  font-size: 11px;
  color: rgba(255,255,255,0.3);
  font-weight: 600;
  padding: 4px 0;
}
.calendar-grid {
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  gap: 3px;
}
.calendar-day {
  aspect-ratio: 1;
  display: flex; align-items: center; justify-content: center;
  border-radius: 10px;
  font-size: 14px;
  font-weight: 500;
  color: white;
  cursor: pointer;
  transition: all 0.15s;
  border: 1px solid transparent;
}
.calendar-day:hover:not(.disabled):not(.empty) {
  background: rgba(197,160,89,0.1);
  border-color: rgba(197,160,89,0.3);
}
.calendar-day.selected {
  background: #C5A059 !important;
  color: #0A0A0A !important;
  font-weight: 700;
  border-color: #C5A059;
}
.calendar-day.today {
  border-color: rgba(0,240,255,0.4);
  color: #00f0ff;
}
.calendar-day.disabled {
  color: rgba(255,255,255,0.15);
  cursor: not-allowed;
}
.calendar-day.empty {
  cursor: default;
}
.calendar-day.shabbat {
  color: rgba(239,68,68,0.4);
  cursor: not-allowed;
}

/* ============================================
   DASHBOARD STYLES
   ============================================ */

/* Desktop tab buttons */
.dash-tab-btn {
  padding: 14px 18px;
  font-size: 14px;
  font-weight: 600;
  color: rgba(255,255,255,0.5);
  border-bottom: 2px solid transparent;
  display: flex;
  align-items: center;
  gap: 8px;
  background: transparent;
  cursor: pointer;
  transition: all 0.2s;
  white-space: nowrap;
}
.dash-tab-btn:hover {
  color: white;
  background: rgba(197,160,89,0.05);
}
.dash-tab-btn.active {
  color: #C5A059;
  border-bottom-color: #C5A059;
}
.dash-tab-btn i {
  font-size: 14px;
}

/* Mobile bottom-nav tabs */
.dash-mobile-tab {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 3px;
  padding: 6px 4px;
  background: transparent;
  border: none;
  color: rgba(255,255,255,0.4);
  font-size: 10px;
  font-weight: 600;
  cursor: pointer;
  transition: color 0.2s;
  border-radius: 8px;
}
.dash-mobile-tab i {
  font-size: 18px;
}
.dash-mobile-tab.active {
  color: #C5A059;
}
.dash-mobile-tab:hover {
  color: white;
}
.dash-mobile-tab.active:hover {
  color: #C5A059;
}

/* Tab content fade-in */
.dash-tab-content {
  animation: fadeIn 0.25s ease;
}

/* Stat cards */
.stat-card {
  background: #1A1A1A;
  border: 1px solid rgba(255,255,255,0.05);
  border-radius: 14px;
  padding: 14px 12px;
  text-align: center;
}
.stat-value {
  font-size: 26px;
  font-weight: 800;
  line-height: 1.1;
}
.stat-label {
  font-size: 11px;
  color: rgba(255,255,255,0.5);
  margin-top: 4px;
  font-weight: 500;
}
@media (min-width: 640px) {
  .stat-value { font-size: 32px; }
  .stat-label { font-size: 12px; }
}

/* Icon button */
.dash-icon-btn {
  width: 38px;
  height: 38px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: #1A1A1A;
  border: 1px solid rgba(255,255,255,0.1);
  border-radius: 10px;
  color: rgba(255,255,255,0.7);
  cursor: pointer;
  transition: all 0.2s;
}
.dash-icon-btn:hover {
  border-color: rgba(197,160,89,0.4);
  color: #C5A059;
}

/* Enhanced appointment card */
.appt-row {
  background: #1A1A1A;
  border: 1px solid rgba(255,255,255,0.05);
  border-radius: 16px;
  padding: 14px 16px;
  display: grid;
  grid-template-columns: auto 1fr;
  gap: 14px;
  align-items: center;
  transition: all 0.2s;
}
.appt-row.completed {
  opacity: 0.55;
  border-color: rgba(34,197,94,0.2);
}
.appt-row.cancelled {
  opacity: 0.4;
  border-color: rgba(239,68,68,0.2);
}
.appt-row:hover {
  border-color: rgba(197,160,89,0.3);
}
.appt-row .time-badge {
  background: linear-gradient(135deg, #C5A059, #A38040);
  color: white;
  font-weight: 700;
  font-size: 14px;
  padding: 10px 14px;
  border-radius: 12px;
  min-width: 64px;
  text-align: center;
}
.appt-row .info {
  min-width: 0;
}
.appt-row .name {
  color: white;
  font-weight: 600;
  font-size: 15px;
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}
.appt-row .meta {
  color: rgba(255,255,255,0.45);
  font-size: 12px;
  margin-top: 3px;
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}
.appt-row .meta span { white-space: nowrap; }
.appt-row .meta a { color: #C5A059; text-decoration: none; }
.appt-row .actions {
  grid-column: 1 / -1;
  display: flex;
  gap: 8px;
  padding-top: 10px;
  margin-top: 10px;
  border-top: 1px solid rgba(255,255,255,0.05);
}
.appt-action-btn {
  flex: 1;
  padding: 8px;
  border-radius: 10px;
  font-size: 12px;
  font-weight: 600;
  border: 1px solid;
  background: transparent;
  cursor: pointer;
  transition: all 0.15s;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 5px;
}
.appt-action-btn.complete { color: #22c55e; border-color: rgba(34,197,94,0.3); }
.appt-action-btn.complete:hover { background: rgba(34,197,94,0.1); }
.appt-action-btn.cancel { color: #ef4444; border-color: rgba(239,68,68,0.3); }
.appt-action-btn.cancel:hover { background: rgba(239,68,68,0.1); }
.appt-action-btn.call { color: #C5A059; border-color: rgba(197,160,89,0.3); text-decoration: none; }
.appt-action-btn.call:hover { background: rgba(197,160,89,0.1); }

/* Status pill */
.status-pill {
  display: inline-block;
  padding: 2px 8px;
  border-radius: 999px;
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.3px;
}
.status-pill.confirmed { background: rgba(59,130,246,0.15); color: #60a5fa; }
.status-pill.completed { background: rgba(34,197,94,0.15); color: #4ade80; }
.status-pill.cancelled { background: rgba(239,68,68,0.15); color: #f87171; }

/* Hours row */
.hours-row {
  background: #1A1A1A;
  border: 1px solid rgba(255,255,255,0.05);
  border-radius: 14px;
  padding: 14px 16px;
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 12px;
  align-items: center;
}
.hours-row.closed { opacity: 0.55; }
.hours-row .day-label {
  font-weight: 600;
  color: white;
  font-size: 15px;
}
.hours-row .time-inputs {
  display: flex;
  align-items: center;
  gap: 6px;
}
.hours-row input[type="time"] {
  background: #0A0A0A;
  border: 1px solid rgba(255,255,255,0.1);
  color: white;
  padding: 6px 8px;
  border-radius: 8px;
  font-size: 13px;
  width: 90px;
  font-family: inherit;
  color-scheme: dark;
}
.hours-row input[type="time"]:focus {
  outline: none;
  border-color: #C5A059;
}
.hours-row .toggle-switch {
  position: relative;
  width: 44px;
  height: 24px;
  background: rgba(255,255,255,0.1);
  border-radius: 999px;
  cursor: pointer;
  transition: background 0.2s;
  flex-shrink: 0;
}
.hours-row .toggle-switch::after {
  content: '';
  position: absolute;
  top: 2px;
  right: 2px;
  width: 20px;
  height: 20px;
  background: white;
  border-radius: 50%;
  transition: all 0.2s;
}
.hours-row.open .toggle-switch {
  background: #C5A059;
}
.hours-row.open .toggle-switch::after {
  right: 22px;
}

/* Price row */
.price-row {
  background: #1A1A1A;
  border: 1px solid rgba(255,255,255,0.05);
  border-radius: 14px;
  padding: 14px 16px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
}
.price-row .name {
  font-weight: 600;
  color: white;
  font-size: 15px;
}
.price-row .price {
  color: #C5A059;
  font-weight: 700;
  font-size: 16px;
}
.price-row .actions {
  display: flex;
  gap: 6px;
}
.price-row .actions button {
  width: 34px;
  height: 34px;
  border-radius: 9px;
  border: 1px solid rgba(255,255,255,0.1);
  background: rgba(255,255,255,0.03);
  color: rgba(255,255,255,0.7);
  cursor: pointer;
  transition: all 0.15s;
  display: flex;
  align-items: center;
  justify-content: center;
}
.price-row .actions button:hover {
  border-color: rgba(197,160,89,0.4);
  color: #C5A059;
}
.price-row .actions button.del:hover {
  border-color: rgba(239,68,68,0.4);
  color: #ef4444;
}

/* Mobile-friendly date input */
input[type="date"] { color-scheme: dark; }

/* Smaller mobile calendar in dashboard */
#new-appt-calendar .calendar-day { font-size: 13px; }

/* ── Mobile Dashboard Improvements ─────── */
@media (max-width: 640px) {
  /* Dashboard fills screen properly */
  #dashboard-overlay {
    padding-bottom: 0;
  }
  
  /* Bottom nav safe area */
  .dash-mobile-tab {
    padding: 8px 4px 12px;
    gap: 2px;
  }
  .dash-mobile-tab i {
    font-size: 20px;
  }
  .dash-mobile-tab span {
    font-size: 9px;
    letter-spacing: 0.3px;
  }
  
  /* Tab content padding for bottom nav */
  .dash-tab-content {
    padding-bottom: 20px !important;
  }
  
  /* Appointment cards - stack better on mobile */
  .appt-row {
    grid-template-columns: 1fr;
    gap: 8px;
    padding: 12px;
  }
  .appt-row .time-badge {
    justify-self: start;
    padding: 6px 14px;
    font-size: 13px;
    display: inline-flex;
    align-items: center;
    gap: 6px;
  }
  .appt-row .name { font-size: 14px; }
  .appt-row .meta { font-size: 11px; }
  .appt-row .actions {
    grid-column: 1;
    flex-wrap: wrap;
  }
  .appt-action-btn {
    padding: 10px 8px;
    font-size: 11px;
    min-height: 40px;
  }
  
  /* Stats cards */
  .stat-card {
    padding: 10px 8px;
  }
  .stat-value {
    font-size: 22px;
  }
  .stat-label {
    font-size: 10px;
  }
  
  /* Hours - stack on mobile */
  .hours-row {
    grid-template-columns: 1fr;
    gap: 10px;
    padding: 12px;
  }
  .hours-row .time-inputs {
    flex-wrap: wrap;
    gap: 8px;
  }
  .hours-row input[type="time"] {
    width: 100px;
    padding: 8px 10px;
    font-size: 14px;
  }
  .hours-row .day-label { font-size: 14px; }
  .hours-row .toggle-switch {
    width: 48px;
    height: 26px;
  }
  .hours-row .toggle-switch::after {
    width: 22px;
    height: 22px;
  }
  .hours-row.open .toggle-switch::after {
    right: 24px;
  }
  
  /* Price rows */
  .price-row {
    flex-wrap: wrap;
    padding: 12px;
    gap: 8px;
  }
  .price-row .name { font-size: 14px; flex: 1 1 100%; }
  .price-row .price { font-size: 15px; }
  .price-row .actions button {
    width: 38px;
    height: 38px;
  }
  
  /* Headings smaller */
  .dash-tab-content h3 {
    font-size: 1.25rem !important;
  }
  
  /* Calendar in new appointment */
  #new-appt-calendar .calendar-day {
    font-size: 12px;
  }
  #new-appt-calendar .calendar-header .month-label {
    font-size: 13px;
  }
  
  /* Profile stat cards grid */
  #tab-profile .grid {
    grid-template-columns: repeat(3, 1fr) !important;
    gap: 6px !important;
  }
  
  /* Login form */
  #dash-login > div {
    margin-top: 16px !important;
    padding: 20px !important;
  }
  
  /* Modal for price edit - full width on mobile */
  #price-modal > div {
    margin: 16px;
    max-width: 100%;
  }
  
  /* Date navigation bar */
  #tab-appointments .flex.items-center.gap-2 button {
    min-width: 36px;
    min-height: 36px;
  }
}

/* iOS safe area for bottom nav */
@supports (padding-bottom: env(safe-area-inset-bottom)) {
  .md\:hidden.fixed.bottom-0 {
    padding-bottom: calc(8px + env(safe-area-inset-bottom));
  }
}

/* Smoother touch interactions */
.dash-mobile-tab,
.appt-action-btn,
.dash-icon-btn,
.price-row .actions button,
.hours-row .toggle-switch {
  -webkit-tap-highlight-color: transparent;
  touch-action: manipulation;
}

/* ── PWA Install Banner ─────────────── */
#pwa-install-banner {
  position: fixed;
  bottom: 20px;
  left: 50%;
  transform: translateX(-50%) translateY(120px);
  z-index: 9999;
  background: linear-gradient(135deg, #1A1A1A, #222);
  border: 1px solid rgba(197,160,89,0.4);
  border-radius: 16px;
  padding: 14px 18px;
  display: flex;
  align-items: center;
  gap: 14px;
  box-shadow: 0 10px 40px rgba(0,0,0,0.6), 0 0 20px rgba(197,160,89,0.15);
  width: calc(100% - 32px);
  max-width: 400px;
  transition: transform 0.5s cubic-bezier(0.16, 1, 0.3, 1);
  backdrop-filter: blur(12px);
}
#pwa-install-banner.show {
  transform: translateX(-50%) translateY(0);
}
#pwa-install-banner .pwa-icon {
  width: 44px;
  height: 44px;
  border-radius: 12px;
  object-fit: cover;
  flex-shrink: 0;
}
#pwa-install-banner .pwa-text {
  flex: 1;
  min-width: 0;
}
#pwa-install-banner .pwa-title {
  font-weight: 700;
  color: white;
  font-size: 14px;
}
#pwa-install-banner .pwa-subtitle {
  color: rgba(255,255,255,0.5);
  font-size: 11px;
  margin-top: 2px;
}
#pwa-install-banner .pwa-install-btn {
  background: #C5A059;
  color: white;
  border: none;
  padding: 8px 16px;
  border-radius: 10px;
  font-weight: 700;
  font-size: 13px;
  cursor: pointer;
  white-space: nowrap;
  transition: background 0.2s;
  font-family: inherit;
}
#pwa-install-banner .pwa-install-btn:hover {
  background: #A38040;
}
#pwa-install-banner .pwa-close {
  position: absolute;
  top: -8px;
  left: -8px;
  width: 24px;
  height: 24px;
  border-radius: 50%;
  background: #333;
  border: 1px solid rgba(255,255,255,0.1);
  color: rgba(255,255,255,0.6);
  font-size: 12px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.2s;
}
#pwa-install-banner .pwa-close:hover {
  background: #555;
  color: white;
}
