/* ==========================================================================
   HairQueue PRO — Modern Native iOS / iPadOS Design System
   Ultra-modern, sleek, responsive styling matching contemporary mobile apps
   ========================================================================== */

@import url('./product-mocks.css');

:root {
  --app-bg: #F8FAFC;
  --app-surface: #FFFFFF;
  --app-text: #0F172A;
  --app-text-muted: #64748B;
  --app-text-dim: #94A3B8;
  --app-border: #E2E8F0;
  --app-border-light: #F1F5F9;
  --app-primary: #2563EB;
  --app-primary-hover: #1D4ED8;
  --app-primary-soft: #EFF6FF;
  --app-success: #16A34A;
  --app-success-soft: #DCFCE7;
  --app-warning: #D97706;
  --app-warning-soft: #FEF3C7;
  --app-radius-sm: 8px;
  --app-radius-md: 12px;
  --app-radius-lg: 16px;
  --app-radius-full: 9999px;
  --app-shadow-sm: 0 1px 2px rgba(15, 23, 42, 0.05);
  --app-shadow-md: 0 4px 12px -2px rgba(15, 23, 42, 0.08);
  --app-shadow-lg: 0 12px 28px -4px rgba(15, 23, 42, 0.12);
  --app-font: -apple-system, BlinkMacSystemFont, "SF Pro Text", "SF Pro Display", "Inter", Roboto, Helvetica, Arial, sans-serif;
}

html, body, #app {
  width: 100%;
  height: 100%;
  margin: 0;
  padding: 0;
  overflow: hidden;
  background: var(--app-bg);
  font-family: var(--app-font);
  color: var(--app-text);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

* {
  box-sizing: border-box;
}

/* Base Layout Wrapper */
.app-device-wrapper {
  width: 100%;
  height: 100%;
  display: flex;
  background: var(--app-bg);
  position: relative;
  overflow: hidden;
}

/* --------------------------------------------------------------------------
   Desktop & Tablet Management Sidebar
   -------------------------------------------------------------------------- */
.desktop-sidebar {
  width: 230px;
  background: var(--app-surface);
  border-right: 1px solid var(--app-border);
  display: flex;
  flex-direction: column;
  padding: 20px 14px;
  flex-shrink: 0;
  z-index: 20;
}

.desktop-sidebar .brand-row {
  display: flex;
  align-items: center;
  padding: 4px 8px 18px;
  border-bottom: 1px solid var(--app-border-light);
  margin-bottom: 16px;
}

.desktop-sidebar .brand-logo {
  height: 24px;
  width: auto;
  display: block;
}

.studio-pill {
  display: flex;
  align-items: center;
  gap: 10px;
  background: var(--app-bg);
  border: 1px solid var(--app-border);
  border-radius: var(--app-radius-md);
  padding: 10px 12px;
  font-size: 13px;
  font-weight: 600;
  color: var(--app-text);
  margin-bottom: 18px;
  cursor: pointer;
  transition: all 0.15s ease;
}
.studio-pill:hover {
  background: #EDF2F7;
  border-color: #CBD5E1;
}

.nav-links {
  display: flex;
  flex-direction: column;
  gap: 6px;
  flex: 1;
}

.nav-btn {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px 14px;
  border-radius: var(--app-radius-md);
  border: none;
  background: transparent;
  color: var(--app-text-muted);
  font-size: 14px;
  font-weight: 500;
  cursor: pointer;
  text-align: left;
  transition: all 0.15s ease;
}
.nav-btn:hover {
  background: var(--app-border-light);
  color: var(--app-text);
}
.nav-btn.active {
  background: var(--app-primary-soft);
  color: var(--app-primary);
  font-weight: 600;
}
.nav-btn svg {
  width: 19px;
  height: 19px;
  stroke-width: 2;
  flex-shrink: 0;
}

.sidebar-foot {
  margin-top: auto;
  padding-top: 14px;
  border-top: 1px solid var(--app-border-light);
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.wal-badge {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 11px;
  font-weight: 600;
  color: var(--app-success);
  background: var(--app-success-soft);
  padding: 6px 10px;
  border-radius: var(--app-radius-sm);
}

/* --------------------------------------------------------------------------
   Main Surface Area
   -------------------------------------------------------------------------- */
.app-main-surface {
  flex: 1;
  display: flex;
  flex-direction: column;
  min-width: 0;
  height: 100%;
  overflow: hidden;
  position: relative;
  background: var(--app-bg);
}

@media (max-width: 768px) {
  .desktop-sidebar {
    display: none !important;
  }
}

/* --------------------------------------------------------------------------
   Modern Navigation Topbar & Modern Buttons
   -------------------------------------------------------------------------- */
.modern-topbar {
  height: 56px;
  padding: 0 16px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  background: var(--app-surface);
  border-bottom: 1px solid var(--app-border);
  flex-shrink: 0;
  position: relative;
  z-index: 15;
}

.modern-topbar-title {
  font-size: 17px;
  font-weight: 700;
  letter-spacing: -0.01em;
  color: var(--app-text);
  margin: 0;
}

.modern-actions-group {
  display: flex;
  align-items: center;
  gap: 8px;
}

/* Modern Circular Action Button (Replaces Vintage Square Button) */
.btn-icon-modern {
  width: 36px;
  height: 36px;
  border-radius: var(--app-radius-full);
  background: #F1F5F9;
  border: none;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  color: var(--app-text);
  cursor: pointer;
  transition: all 0.15s cubic-bezier(0.16, 1, 0.3, 1);
  padding: 0;
}
.btn-icon-modern:hover {
  background: #E2E8F0;
  transform: scale(1.04);
}
.btn-icon-modern:active {
  transform: scale(0.96);
  background: #CBD5E1;
}
.btn-icon-modern.primary {
  background: var(--app-primary);
  color: #FFFFFF;
}
.btn-icon-modern.primary:hover {
  background: var(--app-primary-hover);
}
.btn-icon-modern svg {
  width: 18px;
  height: 18px;
  stroke-width: 2.2;
}

/* Modern Action Pills */
.btn-pill-action {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  padding: 6px 14px;
  border-radius: var(--app-radius-full);
  font-size: 12.5px;
  font-weight: 600;
  cursor: pointer;
  border: none;
  transition: all 0.15s ease;
  white-space: nowrap;
}
.btn-pill-action.primary {
  background: var(--app-primary);
  color: #FFFFFF;
  box-shadow: 0 2px 8px rgba(37, 99, 235, 0.25);
}
.btn-pill-action.primary:hover {
  background: var(--app-primary-hover);
}
.btn-pill-action.secondary {
  background: #F1F5F9;
  color: var(--app-text);
}
.btn-pill-action.secondary:hover {
  background: #E2E8F0;
}

/* --------------------------------------------------------------------------
   Modern Segmented Control (Day / Week / Month / List)
   -------------------------------------------------------------------------- */
.modern-segments {
  display: flex;
  background: #E2E8F0;
  border-radius: var(--app-radius-md);
  padding: 3px;
  gap: 3px;
  margin-bottom: 12px;
}
.modern-segment-btn {
  flex: 1;
  border: none;
  background: transparent;
  padding: 7px 0;
  border-radius: 9px;
  font-size: 13px;
  font-weight: 500;
  color: var(--app-text-muted);
  cursor: pointer;
  transition: all 0.15s cubic-bezier(0.16, 1, 0.3, 1);
  text-align: center;
}
.modern-segment-btn.active {
  background: #FFFFFF;
  color: var(--app-text);
  font-weight: 600;
  box-shadow: 0 2px 6px rgba(15, 23, 42, 0.08);
}

/* Date Navigator Row */
.modern-date-nav {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 4px 4px 10px;
}
.modern-date-label {
  font-size: 16px;
  font-weight: 700;
  color: var(--app-text);
}

/* --------------------------------------------------------------------------
   Barber Avatar Chips Carousel
   -------------------------------------------------------------------------- */
.barber-chips-scroll {
  display: flex;
  gap: 8px;
  overflow-x: auto;
  padding-bottom: 8px;
  margin-bottom: 12px;
  scrollbar-width: none;
  -webkit-overflow-scrolling: touch;
}
.barber-chips-scroll::-webkit-scrollbar {
  display: none;
}
.modern-chip {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  padding: 5px 12px 5px 6px;
  border-radius: var(--app-radius-full);
  background: #FFFFFF;
  border: 1px solid var(--app-border);
  font-size: 13px;
  font-weight: 600;
  color: var(--app-text);
  cursor: pointer;
  white-space: nowrap;
  box-shadow: var(--app-shadow-sm);
  transition: all 0.15s ease;
}
.modern-chip:hover {
  border-color: #CBD5E1;
}
.modern-chip.active {
  background: #0F172A;
  color: #FFFFFF;
  border-color: #0F172A;
  box-shadow: 0 4px 12px rgba(15, 23, 42, 0.15);
}
.modern-chip .chip-avatar {
  width: 22px;
  height: 22px;
  border-radius: 50%;
  object-fit: cover;
  flex-shrink: 0;
}
.modern-chip .chip-initials {
  width: 22px;
  height: 22px;
  border-radius: 50%;
  display: grid;
  place-items: center;
  font-size: 10px;
  font-weight: 700;
  background: #F1F5F9;
}
.modern-chip.active .chip-initials {
  background: rgba(255, 255, 255, 0.2);
  color: #FFFFFF;
}

/* --------------------------------------------------------------------------
   Fixed Modern Search Bar (Resolves Giant Icon Bug)
   -------------------------------------------------------------------------- */
.modern-search-bar {
  display: flex;
  align-items: center;
  gap: 10px;
  height: 42px;
  border-radius: var(--app-radius-md);
  background: #FFFFFF;
  border: 1px solid var(--app-border);
  padding: 0 14px;
  margin-bottom: 14px;
  box-shadow: var(--app-shadow-sm);
  transition: border-color 0.15s ease, box-shadow 0.15s ease;
}
.modern-search-bar:focus-within {
  border-color: var(--app-primary);
  box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.12);
}
.modern-search-bar svg {
  width: 17px !important;
  height: 17px !important;
  color: var(--app-text-muted);
  flex-shrink: 0;
}
.modern-search-bar input {
  flex: 1;
  background: transparent;
  border: none;
  outline: none;
  font-size: 14px;
  color: var(--app-text);
  font-family: inherit;
}
.modern-search-bar input::placeholder {
  color: var(--app-text-dim);
}

/* --------------------------------------------------------------------------
   Modern Client Card List
   -------------------------------------------------------------------------- */
.modern-clients-list {
  display: flex;
  flex-direction: column;
  gap: 10px;
  margin-bottom: 24px;
}
.modern-client-card {
  background: #FFFFFF;
  border-radius: var(--app-radius-lg);
  border: 1px solid var(--app-border-light);
  box-shadow: var(--app-shadow-sm);
  padding: 16px;
  transition: all 0.15s ease;
}
.modern-client-card:hover {
  box-shadow: var(--app-shadow-md);
  border-color: #E2E8F0;
}
.modern-client-card-top {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 10px;
}
.client-avatar-circle {
  width: 44px;
  height: 44px;
  border-radius: 50%;
  display: grid;
  place-items: center;
  font-size: 14px;
  font-weight: 700;
  color: #FFFFFF;
  flex-shrink: 0;
}
.client-info-meta {
  flex: 1;
  min-width: 0;
}
.client-name-title {
  font-size: 16px;
  font-weight: 700;
  color: var(--app-text);
  margin: 0 0 2px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.client-sub-detail {
  font-size: 12px;
  color: var(--app-text-muted);
  margin: 0;
}
.formula-tag-box {
  background: #F8FAFC;
  border-left: 3px solid var(--app-primary);
  border-radius: var(--app-radius-sm);
  padding: 9px 12px;
  font-size: 12.5px;
  line-height: 1.45;
  color: #334155;
  margin-bottom: 12px;
}

/* --------------------------------------------------------------------------
   Responsive Mobile Calendar Grid (Smooth Swipe, No Cramping)
   -------------------------------------------------------------------------- */
.modern-calendar-container {
  background: #FFFFFF;
  border-radius: var(--app-radius-lg);
  border: 1px solid var(--app-border);
  overflow: hidden;
  box-shadow: var(--app-shadow-sm);
}

.calendar-scroll-horizontal {
  overflow-x: auto;
  overflow-y: hidden;
  scrollbar-width: thin;
  -webkit-overflow-scrolling: touch;
}

.calendar-header-row {
  display: flex;
  border-bottom: 1px solid var(--app-border);
  background: #F8FAFC;
  position: sticky;
  top: 0;
  z-index: 5;
}

.time-corner-spacer {
  width: 52px;
  flex-shrink: 0;
  background: #F8FAFC;
  border-right: 1px solid var(--app-border);
}

.barber-col-header {
  min-width: 150px;
  flex: 1;
  padding: 10px 8px;
  text-align: center;
  border-right: 1px solid var(--app-border-light);
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 3px;
}
.barber-col-header strong {
  font-size: 13.5px;
  color: var(--app-text);
  font-weight: 600;
}
.barber-col-header small {
  font-size: 11px;
  color: var(--app-text-muted);
}

.calendar-viewport-body {
  display: flex;
  position: relative;
  height: 520px;
  overflow-y: auto;
}

.time-axis-gutter {
  width: 52px;
  flex-shrink: 0;
  position: sticky;
  left: 0;
  background: #FFFFFF;
  border-right: 1px solid var(--app-border);
  z-index: 4;
}
.time-axis-slot {
  height: 64px;
  padding-top: 4px;
  padding-right: 6px;
  text-align: right;
  font-size: 11px;
  font-weight: 500;
  color: var(--app-text-dim);
  border-top: 1px solid #F1F5F9;
}

.barber-schedule-column {
  min-width: 150px;
  flex: 1;
  position: relative;
  border-right: 1px solid #F1F5F9;
  background: repeating-linear-gradient(to bottom, transparent 0 63px, #F1F5F9 63px 64px);
}

.modern-appt-card {
  position: absolute;
  left: 3px;
  right: 3px;
  border-radius: var(--app-radius-sm);
  padding: 6px 8px;
  color: #FFFFFF;
  font-size: 11px;
  overflow: hidden;
  cursor: pointer;
  box-shadow: 0 2px 6px rgba(0,0,0,0.12);
  transition: transform 0.15s ease, filter 0.15s ease;
  z-index: 2;
  display: flex;
  flex-direction: column;
  gap: 2px;
}
.modern-appt-card:hover {
  filter: brightness(1.05);
  transform: translateY(-1px);
}
.modern-appt-card strong {
  font-size: 12px;
  font-weight: 700;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.modern-appt-card span {
  opacity: 0.95;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

/* --------------------------------------------------------------------------
   Modern Glassmorphic Mobile Tab Bar
   -------------------------------------------------------------------------- */
.modern-glass-tabbar {
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  height: 64px;
  background: rgba(255, 255, 255, 0.92);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border-top: 1px solid rgba(226, 232, 240, 0.8);
  display: flex;
  align-items: center;
  justify-content: space-around;
  padding: 0 8px;
  z-index: 30;
}
.glass-tab-btn {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 4px;
  background: transparent;
  border: none;
  color: var(--app-text-muted);
  cursor: pointer;
  padding: 6px 0;
  font-size: 11px;
  font-weight: 500;
  transition: color 0.15s ease;
}
.glass-tab-btn svg {
  width: 21px;
  height: 21px;
  stroke-width: 2;
}
.glass-tab-btn.active {
  color: var(--app-primary);
  font-weight: 600;
}

/* Scroll padding so tabbar doesn't obscure content */
.scroll-content-padding {
  padding-bottom: 84px !important;
}

/* --------------------------------------------------------------------------
   Modern Modal & Bottom Sheet System
   -------------------------------------------------------------------------- */
.custom-sheet-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(15, 23, 42, 0.6);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  z-index: 9999;
  display: flex;
  align-items: flex-end;
  justify-content: center;
  animation: fadeInBackdrop 0.2s cubic-bezier(0.16, 1, 0.3, 1) forwards;
}

@keyframes fadeInBackdrop {
  from { opacity: 0; }
  to { opacity: 1; }
}

.custom-sheet-content {
  background: #FFFFFF;
  width: 100%;
  max-width: 480px;
  max-height: 90vh;
  overflow-y: auto;
  border-top-left-radius: 24px;
  border-top-right-radius: 24px;
  padding: 24px 20px 32px;
  box-shadow: 0 -10px 40px rgba(0, 0, 0, 0.2);
  animation: slideUpSheet 0.25s cubic-bezier(0.16, 1, 0.3, 1) forwards;
}

@keyframes slideUpSheet {
  from { transform: translateY(100%); }
  to { transform: translateY(0); }
}

@media (min-width: 768px) {
  .custom-sheet-backdrop {
    align-items: center;
  }
  .custom-sheet-content {
    border-radius: 20px;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.25);
    max-height: 85vh;
  }
}

/* Tip selection pills */
.sheet-tip-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 8px;
  margin-bottom: 16px;
}
.sheet-tip-btn {
  padding: 10px 4px;
  border-radius: 12px;
  border: 1px solid var(--app-border);
  background: var(--app-bg);
  color: var(--app-text);
  font-weight: 700;
  font-size: 14px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 2px;
  cursor: pointer;
  transition: all 0.15s ease;
}
.sheet-tip-btn span {
  font-size: 10.5px;
  font-weight: 500;
  color: var(--app-text-muted);
}
.sheet-tip-btn.is-on {
  border-color: var(--app-primary);
  background: var(--app-primary-soft);
  color: var(--app-primary);
}
.sheet-tip-btn.is-on span {
  color: var(--app-primary);
}

/* Payment button rows in checkout */
.sheet-pay-btn {
  width: 100%;
  padding: 14px 16px;
  border-radius: 14px;
  border: 1px solid var(--app-border);
  background: #FFFFFF;
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 10px;
  cursor: pointer;
  transition: all 0.18s ease;
  text-align: left;
}
.sheet-pay-btn:hover {
  border-color: #CBD5E1;
  background: #F8FAFC;
  transform: translateY(-1px);
}
.sheet-pay-btn.dark {
  background: #0F172A;
  color: #FFFFFF;
  border-color: #0F172A;
}
.sheet-pay-btn.dark:hover {
  background: #1E293B;
}
.sheet-pay-btn .pay-icon-box {
  width: 40px;
  height: 40px;
  border-radius: 10px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(37, 99, 235, 0.1);
  color: #2563EB;
}
.sheet-pay-btn.dark .pay-icon-box {
  background: rgba(255, 255, 255, 0.12);
  color: #FFFFFF;
}

/* Form input elements inside sheet */
.sheet-form-group {
  margin-bottom: 14px;
}
.sheet-form-label {
  display: block;
  font-size: 12px;
  font-weight: 600;
  color: var(--app-text-muted);
  text-transform: uppercase;
  margin-bottom: 6px;
}
.sheet-form-input, .sheet-form-select {
  width: 100%;
  padding: 10px 14px;
  border-radius: 10px;
  border: 1px solid var(--app-border);
  background: #FFFFFF;
  color: var(--app-text);
  font-size: 14px;
  font-family: inherit;
  box-sizing: border-box;
  outline: none;
  transition: border-color 0.15s ease;
}
.sheet-form-input:focus, .sheet-form-select:focus {
  border-color: var(--app-primary);
  box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.12);
}
