/* ============================================================
   BOOKERAI REDESIGN FIXES
   Comprehensive patch for all UI/UX issues
   ============================================================ */

/* ============================================================
   1. HERO BUTTON CONTRAST FIX
   ============================================================ */

.hero-buttons {
  display: flex;
  flex-wrap: wrap;
  gap: 1rem;
  justify-content: center;
  margin-top: 2.5rem;
  position: relative;
  z-index: 1;
  width: 100%;
}

.hero-buttons .btn.large {
  margin-top: 0;
  flex: 0 1 auto;
  min-width: 180px;
  max-width: 220px;
  font-weight: 700;
  padding: 1rem 2.2rem;
  border-radius: 12px;
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  border: none;
  min-height: 48px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  text-decoration: none;
  cursor: pointer;
}

/* Primary button - gradient background with WHITE text */
.hero-buttons .btn.large:first-child {
  background: linear-gradient(135deg, #0ea5e9, #14b8a6);
  color: #ffffff !important;
  box-shadow: 0 8px 25px rgba(14, 165, 233, 0.3);
}

.hero-buttons .btn.large:first-child:hover {
  transform: translateY(-2px);
  box-shadow: 0 12px 30px rgba(14, 165, 233, 0.45);
  color: #ffffff !important;
}

/* Secondary button - WHITE background with DARK text */
.hero-buttons .btn.large:last-child {
  background: #ffffff;
  color: #0ea5e9 !important;
  border: 2px solid #ffffff;
  box-shadow: 0 8px 25px rgba(0, 0, 0, 0.1);
}

.hero-buttons .btn.large:last-child:hover {
  transform: translateY(-2px);
  background: #f0faff;
  box-shadow: 0 12px 30px rgba(0, 0, 0, 0.15);
  color: #0ea5e9 !important;
}

/* Dark mode button fixes */
[data-theme="dark"] .hero-buttons .btn.large:last-child {
  background: #0f172a;
  color: #38bdf8 !important;
  border: 2px solid #1e293b;
  box-shadow: 0 8px 25px rgba(0, 0, 0, 0.5);
}

[data-theme="dark"] .hero-buttons .btn.large:last-child:hover {
  background: #1e293b;
  color: #38bdf8 !important;
}

/* ============================================================
   2. FULL-WIDTH SECTIONS
   ============================================================ */

/* Full-bleed sections fill their parent container naturally.
   Using width:100% is safe on iOS; the 100vw + negative-margin trick
   caused horizontal overflow on iPhone (100vw includes scrollbar width
   and breaks when the parent is a flex container). */
.vibrant-hero,
.looking-services,
.category-carousel-section,
.category-buttons-section,
.how-it-works-section,
.footer-cta {
  width: 100%;
  margin-left: 0;
}

/* Service bubbles section */
.looking-services {
  background: var(--bg-main, #f8fafc);
  padding: 3rem var(--container-padding) 4rem;
  text-align: center;
  position: relative;
}

[data-theme="dark"] .looking-services {
  background: #0b1121;
}

.looking-services h2 {
  color: var(--text-main, #0f172a);
  font-weight: 800;
  margin-bottom: 0.5rem;
}

[data-theme="dark"] .looking-services h2 {
  color: #f8fafc;
}

.looking-services .muted {
  margin-bottom: 2.5rem;
}

/* Service bubbles container */
.service-bubbles {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(120px, 1fr));
  gap: 1.5rem;
  max-width: 600px;
  margin: 0 auto;
  padding: 0 var(--container-padding);
}

.service-bubbles .bubble {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 0.75rem;
  padding: 1.5rem 1rem;
  border-radius: 16px;
  background: #ffffff;
  border: 1px solid rgba(14, 165, 233, 0.1);
  box-shadow: 0 4px 12px rgba(14, 165, 233, 0.08);
  text-decoration: none;
  color: var(--text-main, #0f172a);
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  font-weight: 600;
  min-height: 150px;
  cursor: pointer;
}

[data-theme="dark"] .service-bubbles .bubble {
  background: #1e293b;
  border: 1px solid rgba(255, 255, 255, 0.1);
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.2);
  color: #f8fafc;
}

.service-bubbles .bubble:hover {
  transform: translateY(-6px);
  box-shadow: 0 12px 24px rgba(14, 165, 233, 0.15);
  border-color: rgba(14, 165, 233, 0.3);
}

[data-theme="dark"] .service-bubbles .bubble:hover {
  box-shadow: 0 12px 24px rgba(14, 165, 233, 0.2);
  border-color: rgba(56, 189, 248, 0.3);
}

.service-bubbles .bubble img {
  width: 64px;
  height: 64px;
  object-fit: cover;
  border-radius: 12px;
}

.service-bubbles .bubble span {
  font-size: 0.95rem;
  text-align: center;
}

/* ============================================================
   3. CATEGORY CAROUSEL
   ============================================================ */

.category-carousel-section {
  background: #f8fafc;
  padding: 2rem var(--container-padding) 3rem;
  overflow: hidden;
}

[data-theme="dark"] .category-carousel-section {
  background: #0b1121;
}

.carousel-container {
  max-width: 1200px;
  margin: 0 auto;
  position: relative;
}

.carousel-title {
  font-size: 1.25rem;
  font-weight: 700;
  margin-bottom: 1.5rem;
  color: var(--text-main, #0f172a);
}

[data-theme="dark"] .carousel-title {
  color: #f8fafc;
}

/* Auto-rotating carousel */
.carousel-wrapper {
  position: relative;
  overflow: hidden;
  border-radius: 12px;
}

.carousel-slides {
  display: flex;
  animation: autoSlide 20s linear infinite;
  gap: 1rem;
}

.carousel-slide {
  flex: 0 0 calc(25% - 0.75rem);
  min-width: 180px;
  background: #ffffff;
  border-radius: 12px;
  padding: 1.5rem 1rem;
  text-align: center;
  border: 1px solid rgba(14, 165, 233, 0.1);
  box-shadow: 0 4px 12px rgba(14, 165, 233, 0.08);
  transition: all 0.3s ease;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 0.75rem;
}

[data-theme="dark"] .carousel-slide {
  background: #1e293b;
  border: 1px solid rgba(255, 255, 255, 0.1);
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.2);
}

.carousel-slide:hover {
  transform: translateY(-4px);
  box-shadow: 0 12px 24px rgba(14, 165, 233, 0.15);
}

[data-theme="dark"] .carousel-slide:hover {
  box-shadow: 0 12px 24px rgba(14, 165, 233, 0.2);
}

.carousel-slide-icon {
  font-size: 2.5rem;
  margin-bottom: 0.5rem;
}

.carousel-slide-label {
  font-weight: 600;
  color: var(--text-main, #0f172a);
  font-size: 0.95rem;
}

[data-theme="dark"] .carousel-slide-label {
  color: #f8fafc;
}

@keyframes autoSlide {
  0% { transform: translateX(0); }
  100% { transform: translateX(calc(-100% - 4rem)); }
}

/* Pause on hover */
.carousel-slides:hover {
  animation-play-state: paused;
}

@media (max-width: 768px) {
  .carousel-slide {
    flex: 0 0 calc(50% - 0.5rem);
  }
}

/* ============================================================
   4. CATEGORY BUTTONS (STATIC QUICK ACCESS)
   ============================================================ */

.category-buttons-section {
  background: var(--bg-main, #f8fafc);
  padding: 2rem var(--container-padding) 3rem;
}

[data-theme="dark"] .category-buttons-section {
  background: #0b1121;
}

.category-buttons {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(100px, 1fr));
  gap: 1rem;
  max-width: 800px;
  margin: 0 auto;
  padding: 0 var(--container-padding);
}

.category-btn {
  padding: 0.75rem 1.25rem;
  border-radius: 10px;
  background: #ffffff;
  border: 2px solid var(--sky-blue);
  color: var(--sky-blue);
  font-weight: 600;
  font-size: 0.95rem;
  cursor: pointer;
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  text-decoration: none;
  display: inline-block;
  text-align: center;
  min-height: 44px;
  display: flex;
  align-items: center;
  justify-content: center;
}

[data-theme="dark"] .category-btn {
  background: #1e293b;
  border: 2px solid #38bdf8;
  color: #38bdf8;
}

.category-btn:hover {
  background: var(--sky-blue);
  color: #ffffff;
  box-shadow: 0 8px 20px rgba(14, 165, 233, 0.3);
  transform: translateY(-2px);
}

[data-theme="dark"] .category-btn:hover {
  background: #38bdf8;
  color: #0b1121;
  box-shadow: 0 8px 20px rgba(56, 189, 248, 0.3);
}

/* ============================================================
   5. "HOW IT WORKS" ACCORDION (MOBILE OPTIMIZED)
   ============================================================ */

.how-it-works-section {
  background: #ffffff;
  padding: 3rem var(--container-padding) 4rem;
}

[data-theme="dark"] .how-it-works-section {
  background: #0f172a;
}

.how-it-works-section h2 {
  color: var(--text-main, #0f172a);
  font-weight: 800;
  margin-bottom: 0.5rem;
  text-align: center;
}

[data-theme="dark"] .how-it-works-section h2 {
  color: #f8fafc;
}

.how-it-works-steps {
  max-width: 800px;
  margin: 0 auto;
}

/* Accordion cards */
.step-accordion {
  margin-bottom: 1rem;
}

.step-accordion-header {
  background: #f8fafc;
  border: 1px solid rgba(14, 165, 233, 0.15);
  border-radius: 12px;
  padding: 1rem 1.25rem;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-weight: 600;
  color: var(--text-main, #0f172a);
  transition: all 0.3s ease;
  min-height: 48px;
}

[data-theme="dark"] .step-accordion-header {
  background: #1e293b;
  border: 1px solid rgba(255, 255, 255, 0.1);
  color: #f8fafc;
}

.step-accordion-header:hover {
  background: #e0f2ff;
  border-color: var(--sky-blue);
}

[data-theme="dark"] .step-accordion-header:hover {
  background: #0f172a;
  border-color: #38bdf8;
}

.step-accordion-header.active {
  background: linear-gradient(135deg, rgba(14, 165, 233, 0.1), rgba(20, 184, 166, 0.1));
  border-color: var(--sky-blue);
}

[data-theme="dark"] .step-accordion-header.active {
  background: linear-gradient(135deg, rgba(56, 189, 248, 0.1), rgba(45, 212, 191, 0.1));
  border-color: #38bdf8;
}

.step-number {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 32px;
  height: 32px;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--sky-blue), var(--teal));
  color: #ffffff;
  font-weight: 700;
  font-size: 0.9rem;
  margin-right: 1rem;
  flex-shrink: 0;
}

[data-theme="dark"] .step-number {
  background: linear-gradient(135deg, #38bdf8, #2dd4bf);
}

.step-title {
  flex: 1;
}

.step-chevron {
  width: 20px;
  height: 20px;
  margin-left: 1rem;
  transition: transform 0.3s ease;
  color: var(--sky-blue);
}

[data-theme="dark"] .step-chevron {
  color: #38bdf8;
}

.step-accordion-header.active .step-chevron {
  transform: rotate(180deg);
}

.step-accordion-body {
  background: rgba(255, 255, 255, 0.7);
  border: 1px solid rgba(14, 165, 233, 0.1);
  border-top: none;
  border-radius: 0 0 12px 12px;
  padding: 1.25rem;
  display: none;
  max-height: 0;
  overflow: hidden;
  transition: max-height 0.3s ease, padding 0.3s ease;
}

[data-theme="dark"] .step-accordion-body {
  background: rgba(30, 41, 59, 0.7);
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-top: none;
}

.step-accordion-body.active {
  display: block;
  max-height: 500px;
  padding: 1.25rem;
}

.step-accordion-body p {
  color: var(--text-muted, #64748b);
  margin: 0;
  line-height: 1.6;
}

[data-theme="dark"] .step-accordion-body p {
  color: #94a3b8;
}

/* Desktop: Show all steps side-by-side */
@media (min-width: 769px) {
  .how-it-works-steps {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
    gap: 1.5rem;
  }

  .step-accordion {
    margin-bottom: 0;
  }

  .step-accordion-header {
    padding: 1.75rem 1.25rem;
    flex-direction: column;
    justify-content: flex-start;
    text-align: center;
  }

  .step-accordion-header:hover,
  .step-accordion-header.active {
    transform: translateY(-2px);
  }

  .step-number {
    margin-right: 0;
    margin-bottom: 1rem;
    width: 48px;
    height: 48px;
    font-size: 1.1rem;
  }

  .step-title {
    font-size: 1rem;
  }

  .step-chevron {
    display: none;
  }

  .step-accordion-body {
    border: none;
    background: transparent;
    padding: 1rem 0 0;
    display: block;
    max-height: none;
  }

  .step-accordion-body.active {
    max-height: none;
  }
}

/* ============================================================
   6. FULL-WIDTH FOOTER CTA SECTION
   ============================================================ */

.footer-cta {
  background: linear-gradient(135deg, var(--sky-blue), var(--teal));
  color: #ffffff;
  padding: 4rem var(--container-padding) 5rem;
  text-align: center;
  position: relative;
  overflow: hidden;
}

.footer-cta h2 {
  color: #ffffff;
  font-weight: 800;
  margin-bottom: 0.75rem;
}

.footer-cta .muted {
  color: rgba(255, 255, 255, 0.9);
  font-size: 1.1rem;
  margin-bottom: 2rem;
}

.footer-inner {
  position: relative;
  z-index: 1;
  max-width: 600px;
  margin: 0 auto;
}

.vibrant-auth {
  background: linear-gradient(135deg, #0ea5e9, #14b8a6);
}

.vibrant-auth h2 {
  color: #ffffff;
}

.vibrant-auth .muted {
  color: rgba(255, 255, 255, 0.85);
}

/* ============================================================
   7. DASHBOARD IMPROVEMENTS
   ============================================================ */

.card {
  background: #ffffff;
  border-radius: 16px;
  padding: clamp(1rem, 5%, 2.5rem);
  box-shadow: 0 4px 12px rgba(14, 165, 233, 0.08),
             0 2px 6px rgba(0, 0, 0, 0.04);
  border: 1px solid rgba(14, 165, 233, 0.1);
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  margin-bottom: 2rem;
}

[data-theme="dark"] .card {
  background: #1e293b;
  border: 1px solid rgba(255, 255, 255, 0.1);
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.2),
             0 2px 6px rgba(0, 0, 0, 0.1);
}

.card:hover {
  box-shadow: 0 8px 20px rgba(14, 165, 233, 0.12),
             0 4px 12px rgba(0, 0, 0, 0.06);
  transform: translateY(-2px);
}

[data-theme="dark"] .card:hover {
  box-shadow: 0 8px 20px rgba(14, 165, 233, 0.15),
             0 4px 12px rgba(0, 0, 0, 0.15);
}

.card h3 {
  color: var(--text-main, #0f172a);
  font-weight: 700;
  margin-bottom: 1rem;
}

[data-theme="dark"] .card h3 {
  color: #f8fafc;
}

/* Services list redesign */
.services-list {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
}

.service-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 1rem;
  background: #f8fafc;
  border-radius: 10px;
  border: 1px solid rgba(14, 165, 233, 0.1);
  cursor: pointer;
  transition: all 0.2s ease;
  min-height: 56px;
}

[data-theme="dark"] .service-item {
  background: #0f172a;
  border: 1px solid rgba(255, 255, 255, 0.1);
}

.service-item:hover {
  background: #e0f2ff;
  border-color: var(--sky-blue);
  transform: translateX(2px);
}

[data-theme="dark"] .service-item:hover {
  background: #0b1121;
  border-color: #38bdf8;
}

.service-info {
  flex: 1;
}

.service-name {
  font-weight: 600;
  color: var(--text-main, #0f172a);
  margin-bottom: 0.25rem;
}

[data-theme="dark"] .service-name {
  color: #f8fafc;
}

.service-meta {
  font-size: 0.85rem;
  color: var(--text-muted, #64748b);
}

[data-theme="dark"] .service-meta {
  color: #94a3b8;
}

.service-price {
  font-weight: 700;
  color: var(--sky-blue);
  font-size: 1.1rem;
}

[data-theme="dark"] .service-price {
  color: #38bdf8;
}

/* ============================================================
   8. IMAGE LOADING SKELETON
   ============================================================ */

.skeleton {
  background: linear-gradient(90deg, #f0f0f0 25%, #e0e0e0 50%, #f0f0f0 75%);
  background-size: 200% 100%;
  animation: shimmer 2s infinite;
}

[data-theme="dark"] .skeleton {
  background: linear-gradient(90deg, #2d3748 25%, #4a5568 50%, #2d3748 75%);
}

@keyframes shimmer {
  0% { background-position: 200% 0; }
  100% { background-position: -200% 0; }
}

.skeleton-image {
  width: 100%;
  aspect-ratio: 1 / 1;
  border-radius: 12px;
  display: block;
}

/* ============================================================
   9. DARK MODE GLOBAL FIXES
   ============================================================ */

[data-theme="dark"] {
  --text-main: #f8fafc;
  --text-muted: #94a3b8;
  --bg-main: #0b1121;
}

[data-theme="dark"] input,
[data-theme="dark"] select,
[data-theme="dark"] textarea {
  background: #0f172a;
  color: #f8fafc;
  border: 1px solid rgba(255, 255, 255, 0.1);
}

[data-theme="dark"] input::placeholder,
[data-theme="dark"] textarea::placeholder {
  color: #64748b;
}

[data-theme="dark"] label {
  color: #f8fafc;
}

[data-theme="dark"] .muted {
  color: #94a3b8;
}

[data-theme="dark"] .table,
[data-theme="dark"] table {
  color: #f8fafc;
  border-color: rgba(255, 255, 255, 0.1);
}

[data-theme="dark"] th,
[data-theme="dark"] td {
  color: #f8fafc;
  border-color: rgba(255, 255, 255, 0.08);
}

[data-theme="dark"] tr:hover {
  background: rgba(56, 189, 248, 0.05) !important;
}

/* ============================================================
   10. MOBILE OPTIMIZATION
   ============================================================ */

@media (max-width: 768px) {
  .hero-buttons {
    flex-direction: column;
    gap: 0.75rem;
  }

  .hero-buttons .btn.large {
    max-width: 100%;
    width: 100%;
  }

  .service-bubbles {
    grid-template-columns: repeat(auto-fit, minmax(100px, 1fr));
    gap: 1rem;
  }

  .category-buttons {
    grid-template-columns: repeat(auto-fit, minmax(80px, 1fr));
    gap: 0.75rem;
  }

  .category-btn {
    padding: 0.6rem 0.8rem;
    font-size: 0.85rem;
  }

  .carousel-slide {
    flex: 0 0 calc(33.333% - 0.67rem);
  }

  .step-accordion-header {
    padding: 0.9rem 1rem;
  }

  .step-number {
    width: 28px;
    height: 28px;
    font-size: 0.8rem;
  }

  .footer-cta {
    padding: 2.5rem var(--container-padding) 3rem;
  }
}

/* ============================================================
   11. MODALS AND FORMS - DARK MODE COMPLIANCE
   ============================================================ */

.calendar-modal,
.modal,
[role="dialog"] {
  background: #ffffff;
}

[data-theme="dark"] .calendar-modal,
[data-theme="dark"] .modal,
[data-theme="dark"] [role="dialog"] {
  background: #1e293b;
}

.calendar-modal .calendar-header,
.modal-header,
[data-theme="dark"] .calendar-modal .calendar-header,
[data-theme="dark"] .modal-header {
  border-color: rgba(255, 255, 255, 0.1);
}

[data-theme="dark"] .calendar-modal .calendar-header h2,
[data-theme="dark"] .modal-header h2 {
  color: #f8fafc;
}

/* Form Elements Dark Mode */
[data-theme="dark"] .form-group,
[data-theme="dark"] .form-row {
  color: #f8fafc;
}

[data-theme="dark"] label {
  color: #f8fafc;
}

[data-theme="dark"] input[type="text"],
[data-theme="dark"] input[type="email"],
[data-theme="dark"] input[type="password"],
[data-theme="dark"] input[type="tel"],
[data-theme="dark"] input[type="number"],
[data-theme="dark"] input[type="date"],
[data-theme="dark"] input[type="time"],
[data-theme="dark"] textarea,
[data-theme="dark"] select {
  background: #0f172a;
  color: #f8fafc;
  border-color: rgba(255, 255, 255, 0.1);
}

[data-theme="dark"] input::placeholder,
[data-theme="dark"] textarea::placeholder {
  color: #64748b;
}

[data-theme="dark"] input:focus,
[data-theme="dark"] textarea:focus,
[data-theme="dark"] select:focus {
  border-color: #38bdf8;
  outline: none;
  box-shadow: 0 0 0 2px rgba(56, 189, 248, 0.2);
}

/* Button dark mode for modals */
[data-theme="dark"] .btn-secondary {
  background: #0f172a;
  color: #38bdf8;
  border-color: #38bdf8;
}

[data-theme="dark"] .btn-secondary:hover {
  background: #38bdf8;
  color: #0f172a;
}

/* Status badges dark mode */
[data-theme="dark"] .status-badge {
  background: rgba(56, 189, 248, 0.1);
  color: #38bdf8;
}

[data-theme="dark"] .status-booked {
  background: rgba(56, 189, 248, 0.1);
  color: #38bdf8;
}

[data-theme="dark"] .status-cancelled {
  background: rgba(239, 68, 68, 0.1);
  color: #fca5a5;
}

/* Table dark mode */
[data-theme="dark"] tbody tr {
  border-color: rgba(255, 255, 255, 0.08);
}

[data-theme="dark"] tbody tr:nth-child(even) {
  background: rgba(56, 189, 248, 0.03);
}

[data-theme="dark"] tbody tr:hover {
  background: rgba(56, 189, 248, 0.08) !important;
}

/* Links in dark mode */
[data-theme="dark"] a {
  color: #38bdf8;
}

[data-theme="dark"] a:hover {
  color: #2dd4bf;
}

/* ============================================================
   12. UTILITY: No Scroll Lock
   ============================================================ */

html,
body {
  overflow-y: auto !important;
  overflow-x: hidden !important;
}

.v2 {
  overflow: visible !important;
}

main {
  overflow: visible !important;
  height: auto !important;
  min-height: auto !important;
}

/* ============================================================
   13. ENHANCED BUTTON ACCESSIBILITY
   ============================================================ */

button:focus-visible,
a:focus-visible,
input:focus-visible,
select:focus-visible,
textarea:focus-visible {
  outline: 2px solid var(--sky-blue);
  outline-offset: 2px;
}

[data-theme="dark"] button:focus-visible,
[data-theme="dark"] a:focus-visible,
[data-theme="dark"] input:focus-visible,
[data-theme="dark"] select:focus-visible,
[data-theme="dark"] textarea:focus-visible {
  outline: 2px solid #38bdf8;
  outline-offset: 2px;
}

/* ============================================================
   14. LOADING STATES AND ANIMATIONS
   ============================================================ */

.loading-services,
.loading-clients,
.loading-reviews {
  animation: pulse 1.5s ease-in-out infinite;
}

@keyframes pulse {
  0%, 100% {
    opacity: 1;
  }
  50% {
    opacity: 0.5;
  }
}
