/* ═══════════════════════════════════════════════════════════════════════════
   Bella's Hair Studio - Stylesheet
   ═══════════════════════════════════════════════════════════════════════════ */

:root {
  --primary: #8b5cf6;
  --primary-dark: #7c3aed;
  --primary-light: #a78bfa;
  --primary-50: #f5f3ff;
  --primary-100: #ede9fe;
  --accent: #ec4899;
  --accent-light: #f9a8d4;
  --text: #1f2937;
  --text-light: #6b7280;
  --text-lighter: #9ca3af;
  --bg: #ffffff;
  --bg-alt: #faf5ff;
  --bg-section: #f9fafb;
  --border: #e5e7eb;
  --shadow-sm: 0 1px 2px rgba(0, 0, 0, 0.05);
  --shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.07), 0 2px 4px -2px rgba(0, 0, 0, 0.05);
  --shadow-lg: 0 10px 25px -3px rgba(0, 0, 0, 0.08), 0 4px 10px -4px rgba(0, 0, 0, 0.04);
  --shadow-xl: 0 20px 40px -5px rgba(0, 0, 0, 0.1);
  --radius: 12px;
  --radius-lg: 16px;
  --max-width: 1200px;
  --transition: 0.2s ease;
}

/* ── Reset & Base ──────────────────────────────────────────────────────────── */

*, *::before, *::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

html {
  scroll-behavior: smooth;
  -webkit-font-smoothing: antialiased;
}

body {
  font-family: 'Inter', system-ui, -apple-system, sans-serif;
  color: var(--text);
  background: var(--bg);
  line-height: 1.6;
}

a {
  color: var(--primary);
  text-decoration: none;
  transition: color var(--transition);
}

a:hover {
  color: var(--primary-dark);
}

img {
  max-width: 100%;
  display: block;
}

/* ── Typography ────────────────────────────────────────────────────────────── */

h1, h2, h3, h4 {
  line-height: 1.2;
  font-weight: 700;
}

.section-title {
  font-size: 2.25rem;
  text-align: center;
  margin-bottom: 0.5rem;
}

.section-subtitle {
  text-align: center;
  color: var(--text-light);
  font-size: 1.1rem;
  margin-bottom: 3rem;
  max-width: 600px;
  margin-left: auto;
  margin-right: auto;
}

/* ── Navigation ────────────────────────────────────────────────────────────── */

.navbar {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 100;
  background: rgba(255, 255, 255, 0.95);
  backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--border);
  padding: 0 2rem;
  transition: box-shadow var(--transition);
}

.navbar.scrolled {
  box-shadow: var(--shadow);
}

.navbar-inner {
  max-width: var(--max-width);
  margin: 0 auto;
  display: flex;
  justify-content: space-between;
  align-items: center;
  height: 72px;
}

.logo {
  font-size: 1.35rem;
  font-weight: 800;
  color: var(--primary);
  letter-spacing: -0.02em;
}

.logo span {
  color: var(--accent);
}

.nav-links {
  display: flex;
  gap: 2rem;
  list-style: none;
  align-items: center;
}

.nav-links a {
  color: var(--text);
  font-size: 0.95rem;
  font-weight: 500;
  transition: color var(--transition);
  position: relative;
}

.nav-links a:hover {
  color: var(--primary);
}

.nav-links a.cta-link {
  background: var(--primary);
  color: white;
  padding: 0.5rem 1.25rem;
  border-radius: 8px;
  font-weight: 600;
}

.nav-links a.cta-link:hover {
  background: var(--primary-dark);
  color: white;
}

.mobile-toggle {
  display: none;
  background: none;
  border: none;
  font-size: 1.5rem;
  cursor: pointer;
  color: var(--text);
}

/* ── Hero ──────────────────────────────────────────────────────────────────── */

.hero {
  position: relative;
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  text-align: center;
  padding: 120px 2rem 80px;
  background: linear-gradient(135deg, #1e1b4b 0%, #4c1d95 30%, #7c3aed 60%, #a78bfa 100%);
  overflow: hidden;
}

.hero::before {
  content: '';
  position: absolute;
  inset: 0;
  background: radial-gradient(ellipse at 30% 50%, rgba(236, 72, 153, 0.15) 0%, transparent 60%),
              radial-gradient(ellipse at 70% 30%, rgba(139, 92, 246, 0.2) 0%, transparent 50%);
}

.hero::after {
  content: '';
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  height: 120px;
  background: linear-gradient(to top, var(--bg), transparent);
}

.hero-content {
  position: relative;
  z-index: 1;
  max-width: 800px;
}

.hero h1 {
  font-size: 4rem;
  color: white;
  margin-bottom: 1rem;
  letter-spacing: -0.03em;
  font-weight: 800;
}

.hero .tagline {
  font-size: 1.5rem;
  color: rgba(255, 255, 255, 0.85);
  margin-bottom: 0.75rem;
  font-weight: 300;
  letter-spacing: 0.02em;
}

.hero .sub-tagline {
  font-size: 1.1rem;
  color: rgba(255, 255, 255, 0.6);
  margin-bottom: 2.5rem;
}

.hero-buttons {
  display: flex;
  gap: 1rem;
  justify-content: center;
  flex-wrap: wrap;
}

.btn {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.875rem 2rem;
  border-radius: 10px;
  font-size: 1rem;
  font-weight: 600;
  cursor: pointer;
  border: none;
  transition: all var(--transition);
  font-family: inherit;
}

.btn-primary {
  background: white;
  color: var(--primary);
  box-shadow: 0 4px 15px rgba(0, 0, 0, 0.15);
}

.btn-primary:hover {
  transform: translateY(-2px);
  box-shadow: 0 6px 20px rgba(0, 0, 0, 0.2);
}

.btn-outline {
  background: transparent;
  color: white;
  border: 2px solid rgba(255, 255, 255, 0.4);
}

.btn-outline:hover {
  background: rgba(255, 255, 255, 0.1);
  border-color: rgba(255, 255, 255, 0.7);
  color: white;
}

.btn-accent {
  background: var(--primary);
  color: white;
}

.btn-accent:hover {
  background: var(--primary-dark);
}

/* ── Section Base ──────────────────────────────────────────────────────────── */

.section {
  padding: 5rem 2rem;
}

.section-alt {
  background: var(--bg-section);
}

.section-purple {
  background: var(--bg-alt);
}

.container {
  max-width: var(--max-width);
  margin: 0 auto;
}

/* ── Services ──────────────────────────────────────────────────────────────── */

.services-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 1.5rem;
}

.service-card {
  background: var(--bg);
  border-radius: var(--radius);
  padding: 1.75rem;
  box-shadow: var(--shadow-sm);
  border: 1px solid var(--border);
  transition: all var(--transition);
  display: flex;
  flex-direction: column;
}

.service-card:hover {
  box-shadow: var(--shadow-lg);
  transform: translateY(-2px);
  border-color: var(--primary-light);
}

.service-card h3 {
  font-size: 1.15rem;
  margin-bottom: 0.5rem;
  color: var(--text);
}

.service-card p {
  color: var(--text-light);
  font-size: 0.9rem;
  flex: 1;
  margin-bottom: 1rem;
}

.service-meta {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding-top: 1rem;
  border-top: 1px solid var(--border);
}

.service-price {
  font-size: 1.35rem;
  font-weight: 700;
  color: var(--primary);
}

.service-duration {
  font-size: 0.85rem;
  color: var(--text-lighter);
  display: flex;
  align-items: center;
  gap: 0.3rem;
}

/* ── Stylists ──────────────────────────────────────────────────────────────── */

.stylists-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(340px, 1fr));
  gap: 2rem;
}

.stylist-card {
  background: var(--bg);
  border-radius: var(--radius-lg);
  overflow: hidden;
  box-shadow: var(--shadow);
  transition: all var(--transition);
}

.stylist-card:hover {
  box-shadow: var(--shadow-xl);
  transform: translateY(-3px);
}

.stylist-avatar {
  width: 100%;
  height: 240px;
  background: linear-gradient(135deg, var(--primary-100), var(--primary-50));
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 4rem;
}

.stylist-info {
  padding: 1.5rem;
}

.stylist-info h3 {
  font-size: 1.3rem;
  margin-bottom: 0.75rem;
}

.stylist-info p {
  color: var(--text-light);
  font-size: 0.92rem;
  margin-bottom: 1rem;
  line-height: 1.6;
}

.specialties {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
}

.specialty-tag {
  background: var(--primary-50);
  color: var(--primary);
  padding: 0.3rem 0.75rem;
  border-radius: 20px;
  font-size: 0.8rem;
  font-weight: 500;
}

/* ── Reviews ───────────────────────────────────────────────────────────────── */

.reviews-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
  gap: 1.5rem;
}

.review-card {
  background: var(--bg);
  border-radius: var(--radius);
  padding: 1.75rem;
  box-shadow: var(--shadow-sm);
  border: 1px solid var(--border);
  transition: box-shadow var(--transition);
}

.review-card:hover {
  box-shadow: var(--shadow);
}

.review-stars {
  color: #f59e0b;
  font-size: 1.1rem;
  margin-bottom: 0.75rem;
  letter-spacing: 2px;
}

.review-card blockquote {
  color: var(--text-light);
  font-size: 0.95rem;
  line-height: 1.6;
  margin-bottom: 1rem;
  font-style: italic;
}

.review-author {
  font-weight: 600;
  font-size: 0.9rem;
  color: var(--text);
}

/* ── Booking ───────────────────────────────────────────────────────────────── */

.booking-wrapper {
  max-width: 700px;
  margin: 0 auto;
  background: var(--bg);
  border-radius: var(--radius-lg);
  padding: 2.5rem;
  box-shadow: var(--shadow-lg);
  border: 1px solid var(--border);
}

.booking-step {
  margin-bottom: 2rem;
}

.booking-step:last-child {
  margin-bottom: 0;
}

.step-label {
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--primary);
  text-transform: uppercase;
  letter-spacing: 0.05em;
  margin-bottom: 0.5rem;
}

.step-title {
  font-size: 1.1rem;
  font-weight: 600;
  margin-bottom: 0.75rem;
}

.form-group {
  margin-bottom: 1rem;
}

.form-group label {
  display: block;
  font-size: 0.9rem;
  font-weight: 500;
  margin-bottom: 0.4rem;
  color: var(--text);
}

.form-control {
  width: 100%;
  padding: 0.75rem 1rem;
  border: 1px solid var(--border);
  border-radius: 8px;
  font-size: 0.95rem;
  font-family: inherit;
  color: var(--text);
  background: var(--bg);
  transition: border-color var(--transition), box-shadow var(--transition);
  appearance: none;
}

.form-control:focus {
  outline: none;
  border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(139, 92, 246, 0.1);
}

select.form-control {
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' fill='%236b7280' viewBox='0 0 16 16'%3E%3Cpath d='M8 11L3 6h10z'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 12px center;
  padding-right: 2.5rem;
}

.form-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1rem;
}

.slots-container {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(140px, 1fr));
  gap: 0.5rem;
  margin-top: 0.75rem;
}

.slot-btn {
  padding: 0.6rem 0.75rem;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: var(--bg);
  cursor: pointer;
  font-size: 0.85rem;
  font-family: inherit;
  text-align: center;
  transition: all var(--transition);
  color: var(--text);
}

.slot-btn:hover {
  border-color: var(--primary);
  background: var(--primary-50);
}

.slot-btn.selected {
  background: var(--primary);
  color: white;
  border-color: var(--primary);
}

.slot-btn .slot-time {
  font-weight: 600;
  display: block;
}

.slot-btn .slot-stylist {
  font-size: 0.75rem;
  opacity: 0.7;
  display: block;
  margin-top: 2px;
}

.booking-message {
  padding: 1rem 1.25rem;
  border-radius: 8px;
  font-size: 0.95rem;
  margin-top: 1rem;
}

.booking-message.success {
  background: #ecfdf5;
  color: #065f46;
  border: 1px solid #a7f3d0;
}

.booking-message.error {
  background: #fef2f2;
  color: #991b1b;
  border: 1px solid #fecaca;
}

.booking-message.info {
  background: var(--primary-50);
  color: var(--primary-dark);
  border: 1px solid var(--primary-100);
}

.loading-spinner {
  display: inline-block;
  width: 18px;
  height: 18px;
  border: 2px solid var(--border);
  border-top-color: var(--primary);
  border-radius: 50%;
  animation: spin 0.6s linear infinite;
  vertical-align: middle;
  margin-right: 0.5rem;
}

@keyframes spin {
  to { transform: rotate(360deg); }
}

/* ── Contact / Hours ───────────────────────────────────────────────────────── */

.contact-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 3rem;
}

.contact-info h3 {
  font-size: 1.2rem;
  margin-bottom: 1.5rem;
}

.contact-item {
  display: flex;
  gap: 1rem;
  margin-bottom: 1.25rem;
  align-items: flex-start;
}

.contact-icon {
  width: 40px;
  height: 40px;
  border-radius: 10px;
  background: var(--primary-50);
  color: var(--primary);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.1rem;
  flex-shrink: 0;
}

.contact-item .label {
  font-size: 0.8rem;
  color: var(--text-lighter);
  text-transform: uppercase;
  letter-spacing: 0.05em;
  margin-bottom: 0.15rem;
}

.contact-item .value {
  font-weight: 500;
  color: var(--text);
}

.hours-table {
  width: 100%;
  border-collapse: collapse;
}

.hours-table td {
  padding: 0.6rem 0;
  border-bottom: 1px solid var(--border);
  font-size: 0.95rem;
}

.hours-table td:first-child {
  font-weight: 500;
  color: var(--text);
}

.hours-table td:last-child {
  text-align: right;
  color: var(--text-light);
}

.hours-table tr.today td {
  color: var(--primary);
  font-weight: 600;
}

.hours-table tr.closed td:last-child {
  color: var(--accent);
}

/* ── Footer ────────────────────────────────────────────────────────────────── */

.footer {
  background: #1e1b4b;
  color: rgba(255, 255, 255, 0.7);
  padding: 3rem 2rem 2rem;
}

.footer-inner {
  max-width: var(--max-width);
  margin: 0 auto;
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 1rem;
}

.footer .logo {
  color: white;
}

.footer .logo span {
  color: var(--accent-light);
}

.footer-links {
  display: flex;
  gap: 1.5rem;
  list-style: none;
}

.footer-links a {
  color: rgba(255, 255, 255, 0.6);
  font-size: 0.9rem;
  transition: color var(--transition);
}

.footer-links a:hover {
  color: white;
}

.footer-bottom {
  max-width: var(--max-width);
  margin: 2rem auto 0;
  padding-top: 1.5rem;
  border-top: 1px solid rgba(255, 255, 255, 0.1);
  text-align: center;
  font-size: 0.85rem;
}

/* ── Chat Widget Overrides ─────────────────────────────────────────────────── */

#chat-toggle {
  position: fixed;
  bottom: 24px;
  right: 24px;
  width: 64px;
  height: 64px;
  border-radius: 50%;
  border: none;
  background: var(--primary);
  color: white;
  font-size: 28px;
  cursor: pointer;
  box-shadow: 0 4px 16px rgba(139, 92, 246, 0.5);
  z-index: 9999;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: transform var(--transition);
  animation: chat-pulse 2s ease-in-out infinite;
}

#chat-toggle:hover {
  transform: scale(1.1);
  animation: none;
}

@keyframes chat-pulse {
  0%, 100% { box-shadow: 0 4px 16px rgba(139, 92, 246, 0.5); }
  50% { box-shadow: 0 4px 24px rgba(139, 92, 246, 0.8); }
}

#chat-window {
  position: fixed;
  bottom: 96px;
  right: 24px;
  width: 420px;
  height: 580px;
  background: white;
  border-radius: var(--radius-lg);
  box-shadow: 0 8px 32px rgba(0, 0, 0, 0.15);
  z-index: 9998;
  display: none;
  flex-direction: column;
  overflow: hidden;
}

#chat-window.open {
  display: flex;
}

#chat-header {
  background: var(--primary);
  color: white;
  padding: 16px 20px;
  display: flex;
  justify-content: space-between;
  align-items: center;
}

#chat-header h3 {
  margin: 0;
  font-size: 16px;
}

#chat-header small {
  opacity: 0.8;
  font-size: 12px;
}

#chat-header .status {
  display: flex;
  align-items: center;
  gap: 6px;
}

#chat-header .dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: #86efac;
}

#chat-header .dot.offline {
  background: #fca5a5;
}

#chat-close {
  background: none;
  border: none;
  color: white;
  font-size: 20px;
  cursor: pointer;
}

#chat-messages {
  flex: 1;
  overflow-y: auto;
  padding: 16px;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.msg {
  max-width: 80%;
  padding: 10px 14px;
  border-radius: 12px;
  font-size: 14px;
  line-height: 1.4;
  word-wrap: break-word;
}

.msg.user {
  align-self: flex-end;
  background: var(--primary);
  color: white;
  border-bottom-right-radius: 4px;
}

.msg.assistant {
  align-self: flex-start;
  background: #f3f4f6;
  color: #1f2937;
  border-bottom-left-radius: 4px;
  max-width: 90%;
}

.msg.assistant table {
  border-radius: 6px;
  overflow: hidden;
}

.msg.assistant ul {
  margin: 4px 0;
}

.msg.assistant strong {
  font-weight: 600;
}

.msg.system {
  align-self: center;
  background: none;
  color: #9ca3af;
  font-size: 12px;
  font-style: italic;
}

.msg.error {
  align-self: center;
  background: #fef2f2;
  color: #dc2626;
  font-size: 12px;
}

#typing-indicator {
  padding: 0 16px 8px;
  font-size: 12px;
  color: #9ca3af;
  display: none;
}

#typing-indicator.visible {
  display: block;
}

#chat-input-area {
  display: flex;
  border-top: 1px solid #e5e7eb;
  padding: 12px;
}

#chat-input {
  flex: 1;
  border: 1px solid #d1d5db;
  border-radius: 8px;
  padding: 8px 12px;
  font-size: 14px;
  outline: none;
  resize: none;
  font-family: inherit;
}

#chat-input:focus {
  border-color: var(--primary);
}

#chat-send {
  margin-left: 8px;
  background: var(--primary);
  color: white;
  border: none;
  border-radius: 8px;
  padding: 8px 16px;
  cursor: pointer;
  font-size: 14px;
}

#chat-send:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

/* ── Responsive ────────────────────────────────────────────────────────────── */

@media (max-width: 768px) {
  .hero h1 {
    font-size: 2.5rem;
  }

  .hero .tagline {
    font-size: 1.15rem;
  }

  .navbar-inner {
    height: 60px;
  }

  .nav-links {
    display: none;
  }

  .mobile-toggle {
    display: block;
  }

  .nav-links.open {
    display: flex;
    flex-direction: column;
    position: absolute;
    top: 60px;
    left: 0;
    right: 0;
    background: white;
    padding: 1rem 2rem;
    border-bottom: 1px solid var(--border);
    box-shadow: var(--shadow);
    gap: 1rem;
  }

  .section-title {
    font-size: 1.75rem;
  }

  .section {
    padding: 3rem 1.25rem;
  }

  .contact-grid {
    grid-template-columns: 1fr;
    gap: 2rem;
  }

  .form-row {
    grid-template-columns: 1fr;
  }

  .stylists-grid {
    grid-template-columns: 1fr;
  }

  .booking-wrapper {
    padding: 1.5rem;
  }

  .footer-inner {
    flex-direction: column;
    text-align: center;
  }

  #chat-window {
    width: calc(100vw - 24px);
    height: calc(100vh - 120px);
    bottom: 80px;
    right: 12px;
  }
}

@media (max-width: 480px) {
  .hero {
    padding: 100px 1.25rem 60px;
    min-height: auto;
  }

  .hero h1 {
    font-size: 2rem;
  }

  .hero-buttons {
    flex-direction: column;
    align-items: center;
  }

  .services-grid {
    grid-template-columns: 1fr;
  }

  .reviews-grid {
    grid-template-columns: 1fr;
  }

  .slots-container {
    grid-template-columns: repeat(auto-fill, minmax(110px, 1fr));
  }
}
