/* CutQueue Web Main Stylesheet */

/* Import Design System */
@import url('./design-system.css');
@import url('./calendar.css');
@import url('./profile.css');
@import url('./booking-wizard.css');
@import url('./role-switcher.css');
@import url('./provider-dashboard.css');

/* General Heading Styles with Better Spacing */
h1, h2, h3, h4, h5, h6 {
  padding-top: var(--space-xl);
  margin-bottom: var(--space-m);
}

h1 {
  padding-top: var(--space-2xl);
}

h2 {
  padding-top: var(--space-xl);
}

h3, h4 {
  padding-top: var(--space-lg);
}

/* Page title headings */
.page-title {
  padding-top: var(--space-2xl);
  margin-bottom: var(--space-m);
}

.page-subtitle {
  margin-bottom: var(--space-xl);
}

/* Page Layout Components */

/* Header/Navigation */
.site-header {
  background: var(--panel);
  border-bottom: 1px solid var(--border);
  position: sticky;
  top: 0;
  z-index: 100;
}

.site-nav {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: var(--space-l) 0;
}

.site-logo {
  display: flex;
  align-items: center;
  gap: var(--space-m);
  text-decoration: none;
}

.site-logo img {
  height: 32px;
  width: auto;
}

.site-logo-text {
  font-size: var(--text-xl);
  font-weight: var(--fw-semibold);
  color: var(--text-primary);
}

.nav-menu {
  display: flex;
  align-items: center;
  gap: var(--space-xl);
  list-style: none;
}

.nav-link {
  font-size: var(--text-base);
  font-weight: var(--fw-medium);
  color: var(--text-secondary);
  text-decoration: none;
  transition: color 0.2s ease;
}

.nav-link:hover,
.nav-link.active {
  color: var(--text-primary);
}

.nav-actions {
  display: flex;
  align-items: center;
  gap: var(--space-m);
}

/* Mobile Menu Toggle */
.mobile-menu-toggle {
  display: none;
  background: none;
  border: none;
  cursor: pointer;
  padding: var(--space-s);
  border-radius: var(--radius-button);
  transition: background-color 0.2s ease;
}

.mobile-menu-toggle:hover {
  background: var(--panel-subtle);
}

.mobile-menu-toggle svg {
  width: 24px;
  height: 24px;
  color: var(--text-primary);
}

/* Mobile Menu Overlay */
.mobile-menu-overlay {
  display: none;
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(0, 0, 0, 0.5);
  z-index: 200;
  opacity: 0;
  transition: opacity 0.3s ease;
}

.mobile-menu-overlay.active {
  opacity: 1;
}

.mobile-menu {
  position: fixed;
  top: 0;
  right: -100%;
  width: 280px;
  height: 100%;
  background: var(--panel);
  border-left: 1px solid var(--border);
  z-index: 201;
  transition: right 0.3s ease;
  overflow-y: auto;
}

.mobile-menu.active {
  right: 0;
}

.mobile-menu-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: var(--space-l);
  border-bottom: 1px solid var(--border);
}

.mobile-menu-close {
  background: none;
  border: none;
  cursor: pointer;
  padding: var(--space-s);
  border-radius: var(--radius-button);
  transition: background-color 0.2s ease;
}

.mobile-menu-close:hover {
  background: var(--panel-subtle);
}

.mobile-menu-close svg {
  width: 20px;
  height: 20px;
  color: var(--text-primary);
}

.mobile-menu-nav {
  padding: var(--space-l);
}

.mobile-menu-nav ul {
  list-style: none;
  margin: 0;
  padding: 0;
}

.mobile-menu-nav li {
  margin-bottom: var(--space-m);
}

.mobile-menu-nav a {
  display: block;
  padding: var(--space-m);
  color: var(--text-primary);
  text-decoration: none;
  font-weight: var(--fw-medium);
  border-radius: var(--radius-button);
  transition: background-color 0.2s ease;
}

.mobile-menu-nav a:hover,
.mobile-menu-nav a.active {
  background: var(--panel-subtle);
  color: var(--primary);
}

.mobile-menu-actions {
  padding: var(--space-l);
  border-top: 1px solid var(--border);
  display: flex;
  flex-direction: column;
  gap: var(--space-m);
}

/* Hero Section */
.hero {
  background: linear-gradient(135deg, var(--bg) 0%, var(--panel-subtle) 100%);
  padding: var(--section-spacing) 0;
  text-align: center;
}

.hero-title {
  font-size: clamp(var(--text-xl), 5vw, var(--text-2xl));
  font-weight: var(--fw-semibold);
  color: var(--text-primary);
  margin-bottom: var(--space-l);
  line-height: 1.2;
}

.hero-subtitle {
  font-size: var(--text-lg);
  color: var(--text-secondary);
  margin-bottom: var(--space-2xl);
  max-width: 600px;
  margin-left: auto;
  margin-right: auto;
}

.hero-search {
  max-width: 600px;
  margin: 0 auto var(--space-2xl);
}

.hero-actions {
  display: flex;
  gap: var(--space-l);
  justify-content: center;
  flex-wrap: wrap;
}

/* Featured Providers Section */
.featured-providers {
  padding: var(--section-spacing) 0;
}

.section-header {
  text-align: center;
  margin-bottom: var(--subsection-spacing);
  padding-top: var(--space-xl); /* Add padding above section headers */
}

.section-title {
  font-size: var(--text-xl);
  font-weight: var(--fw-semibold);
  color: var(--text-primary);
  margin-bottom: var(--space-m);
  padding-top: var(--space-lg); /* Add padding above titles */
}

.section-subtitle {
  font-size: var(--text-base);
  color: var(--text-secondary);
}


/* Provider Card Component - Matching Discover Page Exactly */
.provider-card {
  display: block;
  text-decoration: none;
  color: inherit;
  background: white;
  border: 1px solid var(--border);
  border-radius: var(--radius-card);
  overflow: hidden;
  cursor: pointer;
  transition: all 0.3s ease;
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
  position: relative;
  height: 100%;
}

.provider-card:hover {
  transform: translateY(-4px);
  box-shadow: 0 12px 25px rgba(0, 0, 0, 0.15);
  border-color: var(--primary);
}

/* Provider Image Section */
.provider-image {
  position: relative;
  height: 200px;
  overflow: hidden;
}

.provider-image img,
.provider-card-image {
  width: 100%;
  height: 200px;
  object-fit: cover;
  transition: transform 0.3s ease;
}

.provider-card:hover .provider-image img,
.provider-card:hover .provider-card-image {
  transform: scale(1.05);
}

/* Status Badge (top-right) */
.provider-status {
  position: absolute;
  top: var(--space-s);
  right: var(--space-s);
  padding: var(--space-xs) var(--space-s);
  border-radius: var(--radius);
  font-size: var(--text-xs);
  font-weight: var(--fw-semibold);
  text-transform: uppercase;
  backdrop-filter: blur(4px);
}

.provider-status.active,
.provider-status.open {
  background: rgba(22, 163, 74, 0.9);
  color: white;
}

.provider-status.inactive,
.provider-status.closed {
  background: rgba(220, 38, 38, 0.9);
  color: white;
}

/* Distance Badge (bottom-left) */
.provider-distance {
  position: absolute;
  bottom: var(--space-s);
  left: var(--space-s);
  background: rgba(0, 0, 0, 0.7);
  color: white;
  padding: var(--space-xs) var(--space-s);
  border-radius: var(--radius);
  font-size: var(--text-xs);
  font-weight: var(--fw-medium);
  backdrop-filter: blur(4px);
}

/* Provider Info Section */
.provider-info,
.provider-card-content {
  padding: var(--space-l);
}

/* Business Name */
.provider-name,
.provider-card-title {
  font-size: var(--text-lg);
  font-weight: var(--fw-bold);
  color: var(--text-primary); /* Fixed to use proper dark color */
  margin-bottom: var(--space-xs);
  line-height: 1.2;
}

/* Address */
.provider-address,
.provider-card-location {
  display: flex;
  align-items: center;
  gap: var(--space-xs);
  color: var(--text-muted);
  font-size: var(--text-sm);
  margin-bottom: var(--space-s);
  line-height: 1.4;
}

/* Description (if shown) */
.provider-description {
  color: var(--text-secondary);
  font-size: var(--text-sm);
  line-height: 1.5;
  margin-bottom: var(--space-m);
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
  min-height: 2.8rem;
}

/* Rating Section */
.provider-rating,
.provider-card-rating {
  display: flex;
  align-items: center;
  gap: var(--space-s);
  margin-bottom: var(--space-m);
}

.stars {
  color: #fbbf24;
  font-size: var(--text-sm);
}

.rating,
.rating-text {
  display: flex;
  align-items: center;
  gap: var(--space-xs);
  color: var(--text-muted);
  font-size: var(--text-2xs);
}

/* Meta Section */
.provider-card-meta {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding-top: var(--space-m);
  border-top: 1px solid var(--border);
}

/* Action Buttons */
.provider-actions {
  display: flex;
  gap: var(--space-s);
  margin-top: var(--space-m);
  padding-top: var(--space-m);
  border-top: 1px solid var(--border);
}

.action-btn {
  flex: 1;
  padding: var(--space-s) var(--space-m);
  border-radius: var(--radius);
  border: 1px solid var(--border);
  cursor: pointer;
  transition: all 0.2s ease;
  font-size: var(--text-sm);
  font-weight: var(--fw-medium);
  display: flex;
  align-items: center;
  justify-content: center;
  gap: var(--space-xs);
  min-height: 44px;
  text-decoration: none;
}

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

.action-btn.primary:hover {
  background: var(--primary-dark);
  border-color: var(--primary-dark);
}

.action-btn.secondary {
  background: white;
  color: var(--text);
}

.action-btn.secondary:hover {
  background: var(--panel-subtle);
  border-color: var(--text);
}

/* Price (if shown) */
.provider-card-price {
  font-size: var(--text-base);
  font-weight: var(--fw-semibold);
  color: var(--text-primary);
}

/* Mobile Responsiveness for Provider Cards */
@media (max-width: 768px) {
  .provider-actions {
    flex-direction: column;
  }
  
  .provider-info,
  .provider-card-content {
    padding: var(--space-m);
  }
  
  .provider-card-title {
    font-size: 1rem;
    line-height: 1.2;
  }
  
  .provider-image {
    height: 150px;
  }
  
  .provider-image img,
  .provider-card-image {
    height: 150px;
  }
  
  .action-btn {
    min-height: 48px;
    font-size: 16px;
    padding: 12px 24px;
  }
}

/* Touch device optimizations */
@media (hover: none) and (pointer: coarse) {
  .provider-card:active {
    transform: scale(0.98);
    opacity: 0.9;
  }
  
  .action-btn:active {
    transform: scale(0.95);
    opacity: 0.9;
  }
  
  /* Ensure minimum touch targets */
  .provider-card,
  .action-btn {
    min-height: 44px;
    -webkit-tap-highlight-color: transparent;
    touch-action: manipulation;
  }
}

/* Small phones and compact devices */
@media (max-width: 480px) {
  .provider-info,
  .provider-card-content {
    padding: var(--space-m);
  }
  
  .provider-image {
    height: 200px;
  }
  
  .provider-image img,
  .provider-card-image {
    height: 200px;
  }
  
  /* Ensure touch-friendly elements */
  .action-btn {
    min-height: 48px;
    padding: var(--space-m);
    font-size: 16px;
  }
}

/* Discovery/Search Page */
.discovery-header {
  background: var(--panel);
  border-bottom: 1px solid var(--border);
  padding: var(--space-2xl) 0;
}

.discovery-title {
  font-size: var(--text-xl);
  font-weight: var(--fw-semibold);
  color: var(--text-primary);
  margin-bottom: var(--space-l);
}

.discovery-filters {
  display: flex;
  flex-direction: column;
  gap: var(--space-l);
}

.filter-row {
  display: flex;
  align-items: center;
  gap: var(--space-l);
  flex-wrap: wrap;
}

.filter-label {
  font-size: var(--text-sm);
  font-weight: var(--fw-medium);
  color: var(--text-secondary);
  white-space: nowrap;
}

.discovery-results {
  padding: var(--space-2xl) 0;
}

.results-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: var(--space-xl);
  flex-wrap: wrap;
  gap: var(--space-l);
}

.results-count {
  font-size: var(--text-base);
  color: var(--text-secondary);
}

.sort-controls {
  display: flex;
  align-items: center;
  gap: var(--space-m);
}

/* Provider Details Page */
.provider-header {
  background: var(--panel);
  border-bottom: 1px solid var(--border);
  padding: var(--space-2xl) 0;
}

.provider-info {
  display: grid;
  grid-template-columns: auto 1fr auto;
  gap: var(--space-xl);
  align-items: start;
}

.provider-avatar {
  width: 120px;
  height: 120px;
  border-radius: var(--radius-card);
  object-fit: cover;
  border: 1px solid var(--border);
}

.provider-details h1 {
  font-size: var(--text-xl);
  font-weight: var(--fw-semibold);
  color: var(--text-primary);
  margin-bottom: var(--space-s);
}

.provider-details p {
  color: var(--text-secondary);
  margin-bottom: var(--space-m);
}

.provider-actions {
  display: flex;
  flex-direction: column;
  gap: var(--space-m);
  align-items: stretch;
}

/* Services List */
.services-section {
  padding: var(--space-2xl) 0;
}

.services-grid {
  display: grid;
  gap: var(--space-l);
}

.service-item {
  display: flex;
  align-items: center;
  gap: var(--space-l);
  padding: var(--space-l);
  background: var(--panel);
  border: 1px solid var(--border);
  border-radius: var(--radius-card);
  transition: all 0.2s ease;
}

.service-item:hover {
  box-shadow: var(--shadow-sm);
}

.service-image {
  width: 64px;
  height: 64px;
  border-radius: var(--radius-chip);
  object-fit: cover;
  flex-shrink: 0;
}

.service-info {
  flex: 1;
}

.service-name {
  font-size: var(--text-lg);
  font-weight: var(--fw-semibold);
  color: var(--text-primary);
  margin-bottom: var(--space-s);
}

.service-description {
  color: var(--text-secondary);
  font-size: var(--text-sm);
  margin-bottom: var(--space-s);
}

.service-duration {
  color: var(--text-muted);
  font-size: var(--text-xs);
}

.service-price {
  font-size: var(--text-lg);
  font-weight: var(--fw-semibold);
  color: var(--text-primary);
  margin-right: var(--space-l);
}

.service-book-btn {
  min-width: 120px;
}

/* Dashboard Layouts */
.dashboard {
  display: grid;
  grid-template-columns: 250px 1fr;
  min-height: calc(100vh - 73px); /* Assuming header height */
}

.dashboard-sidebar {
  background: var(--panel);
  border-right: 1px solid var(--border);
  padding: var(--space-xl);
}

.dashboard-main {
  padding: var(--space-xl);
  background: var(--bg);
}

.dashboard-nav {
  list-style: none;
}

.dashboard-nav li {
  margin-bottom: var(--space-s);
}

.dashboard-nav a {
  display: flex;
  align-items: center;
  gap: var(--space-m);
  padding: var(--space-m);
  color: var(--text-secondary);
  text-decoration: none;
  border-radius: var(--radius-chip);
  transition: all 0.2s ease;
}

.dashboard-nav a:hover,
.dashboard-nav a.active {
  background: var(--panel-subtle);
  color: var(--text-primary);
}

/* Stats Cards */
.stats-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
  gap: var(--space-xl);
  margin-bottom: var(--space-2xl);
}

.stat-card {
  background: var(--panel);
  border: 1px solid var(--border);
  border-radius: var(--radius-card);
  padding: var(--space-xl);
}

.stat-value {
  font-size: var(--text-2xl);
  font-weight: var(--fw-semibold);
  color: var(--text-primary);
  margin-bottom: var(--space-s);
}

.stat-label {
  color: var(--text-secondary);
  font-size: var(--text-sm);
  margin-bottom: var(--space-s);
}

.stat-change {
  font-size: var(--text-xs);
  font-weight: var(--fw-medium);
}

.stat-change.positive {
  color: #10b981;
}

.stat-change.negative {
  color: #ef4444;
}

/* Footer */
.site-footer {
  background: var(--panel);
  border-top: 1px solid var(--border);
  padding: var(--section-spacing) 0 var(--space-2xl);
  margin-top: auto;
}

.footer-content {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
  gap: var(--space-2xl);
}

.footer-section h3 {
  font-size: var(--text-lg);
  font-weight: var(--fw-semibold);
  color: var(--text-primary);
  margin-bottom: var(--space-l);
}

.footer-links {
  list-style: none;
}

.footer-links li {
  margin-bottom: var(--space-s);
}

.footer-links a {
  color: var(--text-secondary);
  text-decoration: none;
  transition: color 0.2s ease;
}

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

.footer-bottom {
  border-top: 1px solid var(--border);
  margin-top: var(--space-2xl);
  padding-top: var(--space-l);
  text-align: center;
  color: var(--text-muted);
  font-size: var(--text-sm);
}

/* Modal/Dialog */
.modal-overlay {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(0, 0, 0, 0.5);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 1000;
  opacity: 0;
  transition: opacity 0.3s ease;
}

.modal-overlay.open {
  opacity: 1;
}

.modal {
  background: var(--panel);
  border-radius: var(--radius-card);
  box-shadow: var(--shadow-hover);
  max-width: 90vw;
  max-height: 90vh;
  overflow-y: auto;
  transform: scale(0.9);
  transition: transform 0.3s ease;
}

.modal-overlay.open .modal {
  transform: scale(1);
}

.modal-header {
  padding: var(--space-xl);
  border-bottom: 1px solid var(--border);
}

.modal-title {
  font-size: var(--text-lg);
  font-weight: var(--fw-semibold);
  color: var(--text-primary);
}

.modal-content {
  padding: var(--space-xl);
}

.modal-actions {
  padding: var(--space-xl);
  border-top: 1px solid var(--border);
  display: flex;
  gap: var(--space-m);
  justify-content: flex-end;
}

/* Form Styles */
.form-group {
  margin-bottom: var(--space-l);
}

.form-label {
  display: block;
  font-size: var(--text-sm);
  font-weight: var(--fw-medium);
  color: var(--text-primary);
  margin-bottom: var(--space-s);
}

.form-input {
  width: 100%;
  padding: var(--space-m) var(--space-l);
  border: 1px solid var(--border);
  border-radius: var(--radius-button);
  font-family: var(--font-primary);
  font-size: var(--text-base);
  color: var(--text-primary);
  background: var(--panel);
  transition: all 0.2s ease;
}

.form-input:focus {
  outline: none;
  border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(108, 207, 201, 0.1);
}

.form-textarea {
  min-height: 120px;
  resize: vertical;
}

.form-error {
  color: #ef4444;
  font-size: var(--text-xs);
  margin-top: var(--space-s);
}

/* Loading States */
.loading {
  display: inline-flex;
  align-items: center;
  gap: var(--space-s);
}

.spinner {
  width: 20px;
  height: 20px;
  border: 2px solid var(--border);
  border-top: 2px solid var(--primary);
  border-radius: 50%;
  animation: spin 1s linear infinite;
}

@keyframes spin {
  0% { transform: rotate(0deg); }
  100% { transform: rotate(360deg); }
}

/* Responsive Design */
@media (max-width: 1024px) {
  .dashboard {
    grid-template-columns: 1fr;
  }
  
  .dashboard-sidebar {
    border-right: none;
    border-bottom: 1px solid var(--border);
  }
  
  .provider-info {
    grid-template-columns: 1fr;
    text-align: center;
  }
  
  .provider-actions {
    align-items: center;
  }
}

@media (max-width: 768px) {
  .nav-menu {
    display: none;
  }
  
  .mobile-menu-toggle {
    display: block;
  }
  
  .mobile-menu-overlay {
    display: block;
  }
  
  .hero-actions {
    flex-direction: column;
    align-items: center;
  }
  
  .filter-row {
    flex-direction: column;
    align-items: stretch;
  }
  
  .results-header {
    flex-direction: column;
    align-items: stretch;
  }
  
  .service-item {
    flex-direction: column;
    text-align: center;
  }
  
  .service-image {
    align-self: center;
  }
  
  .modal {
    margin: var(--space-l);
    max-width: calc(100vw - 2 * var(--space-l));
  }
}

/* Utility Classes */
.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

.text-center { text-align: center; }
.text-left { text-align: left; }
.text-right { text-align: right; }

.flex { display: flex; }
.flex-col { flex-direction: column; }
.items-center { align-items: center; }
.justify-center { justify-content: center; }
.justify-between { justify-content: space-between; }

.w-full { width: 100%; }
.h-full { height: 100%; }

.hidden { display: none; }
.block { display: block; }
.inline-block { display: inline-block; }