/* ========================================
   MARKETPLACE STYLES - THEME-AWARE
   All colors use theme variables
   ======================================== */

/* ========================================
   ACCOUNT & LOGIN BUTTONS
   ======================================== */

.account-btn {
  background: var(--theme-background, #ffffff);
  border: 2px solid var(--theme-primary, #667eea);
  color: var(--theme-primary, #667eea);
  padding: 10px 20px;
  border-radius: 8px;
  font-weight: 600;
  font-size: 14px;
  cursor: pointer;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
  transition: all 0.2s;
  z-index: 10;
}

.account-btn:hover {
  background: var(--theme-surface, #f8f9fa);
  box-shadow: 0 6px 16px rgba(0, 0, 0, 0.2);
  transform: translateY(-1px);
}

/* Desktop: Fixed position at viewport top-right */
@media (min-width: 1280px) {
  /* Positioning handled by .top-header container */
}

/* Mobile Portrait: Position at top right of viewport */
@media (max-width: 1279px) and (orientation: portrait) {
  .account-btn {
    position: fixed;
    top: 20px;
    right: 20px;
    z-index: 1000000;
  }
}

/* Mobile Landscape: Position at top right of viewport */
@media (max-width: 1279px) and (orientation: landscape) {
  .account-btn {
    position: fixed;
    top: 20px;
    right: 20px;
    z-index: 1000000;
  }
}

/* ========================================
   TOP HEADER CONTAINER
   ======================================== */

.top-header {
  position: fixed;
  top: 8px;
  right: 8px;
  z-index: 1000001;
  display: flex;
  gap: 12px;
  align-items: center;
  transition: right 0.4s cubic-bezier(0.4, 0, 0.2, 1);
  background: transparent;
}

/* When calendar visible, position relative to month card */
body:not(.calendar-hidden) .top-header {
  right: calc(var(--month-card-width, 416px) + 8px);
  max-width: calc(100vw - var(--month-card-width, 416px) - 16px);
}

/* ========================================
   BOOK STUDIO BUTTON
   ======================================== */

.book-studio-btn {
  background: linear-gradient(135deg, var(--theme-primary, #667eea) 0%, var(--theme-primary-alt, #764ba2) 100%);
  border: none;
  color: var(--theme-text-on-primary, #ffffff);
  padding: 10px 20px;
  border-radius: 8px;
  font-weight: 600;
  font-size: 14px;
  cursor: pointer;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.2);
  transition: all 0.2s;
  white-space: nowrap;
}

.book-studio-btn:hover {
  box-shadow: 0 6px 16px rgba(0, 0, 0, 0.3);
  transform: translateY(-1px);
}

.book-studio-btn:active {
  transform: translateY(0);
}

/* Override positioning when inside header */
.top-header .account-btn {
  position: static !important;
  transform: none !important;
  margin: 0;
}

/* Mobile adjustments */
@media (max-width: 1279px) {
  .top-header {
    top: 20px;
    right: 20px;
  }
}

/* ========================================
   CALENDAR TRANSITIONS
   ======================================== */

@media (min-width: 1280px) {
  /* Week calendar slides down */
  body.calendar-hidden #weekCard {
    transform: translateY(100%);
    transition: transform 0.4s cubic-bezier(0.4, 0, 0.2, 1);
  }

  /* Month calendar slides right */
  body.calendar-hidden #monthCard {
    transform: translateX(100vw);
    transition: transform 0.4s cubic-bezier(0.4, 0, 0.2, 1);
  }

  /* Time slots slide right */
  body.calendar-hidden #timesCard {
    transform: translateX(100vw);
    transition: transform 0.4s cubic-bezier(0.4, 0, 0.2, 1);
  }

  /* Main panel slides up */
  body.calendar-hidden #mainPanel {
    position: fixed !important;
    top: 0 !important;
    left: 0 !important;
    width: 100vw !important;
    transform: translateY(-100%);
    transition: transform 0.4s cubic-bezier(0.4, 0, 0.2, 1);
  }

  /* Hide book now button when calendar hidden */
  body.calendar-hidden #continue.cta-float,
  body.calendar-hidden #continue {
    display: none !important;
  }

  /* Calendar active - smooth transitions back */
  body:not(.calendar-hidden) #weekCard,
  body:not(.calendar-hidden) #monthCard,
  body:not(.calendar-hidden) #timesCard,
  body:not(.calendar-hidden) #mainPanel,
  body:not(.calendar-hidden) #continue.cta-float,
  body:not(.calendar-hidden) #continue {
    transform: translate(0, 0) !important;
    transition: transform 0.4s cubic-bezier(0.4, 0, 0.2, 1);
  }
}

/* ========================================
   MARKETPLACE NAVIGATION
   ======================================== */

.marketplace-nav {
  display: flex;
  gap: 0;
  background: var(--theme-surface, #f8f9fa);
  border-bottom: 2px solid var(--theme-border, #e0e0e0);
  padding: 0 20px;
}

.marketplace-tab {
  padding: 16px 32px;
  background: transparent;
  border: none;
  border-bottom: 3px solid transparent;
  cursor: pointer;
  font-weight: 600;
  font-size: 16px;
  color: var(--theme-text-secondary, #666666);
  transition: all 0.2s;
  margin-bottom: -2px;
}

.marketplace-tab:hover {
  color: var(--theme-primary, #667eea);
  background: var(--theme-background, #ffffff);
}

.marketplace-tab.active {
  color: var(--theme-primary, #667eea);
  border-bottom-color: var(--theme-primary, #667eea);
  background: transparent;
}

/* ========================================
   MARKETPLACE SECTIONS
   ======================================== */

.marketplace-section {
  display: none;
  padding: 40px;
  max-width: 1200px;
  margin: 0 auto;
}

.marketplace-section.active {
  display: block;
}

.marketplace-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 20px;
  margin-top: 20px;
}

/* ========================================
   MARKETPLACE HEADERS
   ======================================== */

.marketplace-header {
  margin-bottom: 30px;
}

.marketplace-header h2 {
  font-size: 32px;
  margin-bottom: 10px;
  color: var(--theme-text, #1a1a1a);
}

.marketplace-header .subtitle {
  font-size: 16px;
  color: var(--theme-text-secondary, #666666);
}

/* ========================================
   FILTERS
   ======================================== */

.marketplace-filters {
  display: flex;
  gap: 15px;
  margin-bottom: 30px;
  flex-wrap: wrap;
}

.filter-select {
  padding: 10px 15px;
  border: 1px solid var(--theme-border, #e0e0e0);
  border-radius: 6px;
  font-size: 14px;
  background: var(--theme-background, #ffffff);
  color: var(--theme-text, #1a1a1a);
  cursor: pointer;
  flex: 1;
  min-width: 200px;
  transition: all 0.2s;
}

.filter-select:hover,
.filter-select:focus {
  border-color: var(--theme-primary, #667eea);
  outline: none;
}

/* ========================================
   PROVIDER GRID
   ======================================== */

.provider-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
  gap: 20px;
}

.provider-card {
  background: var(--theme-surface, #f8f9fa);
  border: 1px solid var(--theme-border, #e0e0e0);
  border-radius: 8px;
  padding: 20px;
  cursor: pointer;
  transition: transform 0.2s, box-shadow 0.2s, border-color 0.2s;
}

.provider-card:hover {
  transform: translateY(-4px);
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.15);
  border-color: var(--theme-primary, #667eea);
}

/* ========================================
   PROVIDER PROFILE
   ======================================== */

.back-button {
  background: var(--theme-surface, #f8f9fa);
  border: 1px solid var(--theme-border, #e0e0e0);
  color: var(--theme-text, #1a1a1a);
  padding: 10px 20px;
  border-radius: 6px;
  cursor: pointer;
  margin-bottom: 20px;
  font-size: 14px;
  transition: all 0.2s;
}

.back-button:hover {
  background: var(--theme-background, #ffffff);
  border-color: var(--theme-primary, #667eea);
}

.provider-header {
  display: flex;
  gap: 20px;
  margin-bottom: 30px;
  align-items: center;
}

.provider-photo {
  width: 120px;
  height: 120px;
  border-radius: 50%;
  border: 3px solid var(--theme-border, #e0e0e0);
  object-fit: cover;
}

.provider-info h2 {
  font-size: 28px;
  margin-bottom: 5px;
  color: var(--theme-text, #1a1a1a);
}

.provider-tagline {
  font-size: 16px;
  color: var(--theme-text-secondary, #666666);
  margin-bottom: 10px;
}

.provider-rating {
  font-size: 18px;
  color: var(--theme-primary, #667eea);
  font-weight: 600;
}

/* ========================================
   SERVICES GRID
   ======================================== */

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

.service-card {
  background: var(--theme-surface, #f8f9fa);
  border: 1px solid var(--theme-border, #e0e0e0);
  border-radius: 6px;
  padding: 15px;
  cursor: pointer;
  transition: border-color 0.2s, box-shadow 0.2s;
}

.service-card:hover {
  border-color: var(--theme-primary, #667eea);
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}

.service-card h4 {
  margin: 0 0 10px 0;
  font-size: 16px;
  color: var(--theme-text, #1a1a1a);
}

.service-card .price {
  font-size: 18px;
  font-weight: 600;
  color: var(--theme-primary, #667eea);
  margin: 10px 0;
}

.service-card .book-service-btn {
  width: 100%;
  padding: 10px;
  background: var(--theme-primary, #667eea);
  color: var(--theme-text-on-primary, #ffffff);
  border: none;
  border-radius: 4px;
  cursor: pointer;
  font-size: 14px;
  font-weight: 600;
  margin-top: 10px;
  transition: background 0.2s;
}

.service-card .book-service-btn:hover {
  background: var(--theme-primary-alt, #764ba2);
}

/* ========================================
   PROVIDER DASHBOARD
   ======================================== */

.earnings-card {
  background: linear-gradient(135deg, var(--theme-primary, #667eea) 0%, var(--theme-primary-alt, #764ba2) 100%);
  color: var(--theme-text-on-primary, #ffffff);
  border-radius: 8px;
  padding: 25px;
  margin-bottom: 30px;
}

.earnings-amount {
  font-size: 36px;
  font-weight: 700;
  margin: 10px 0;
}

/* ========================================
   PORTFOLIO GRID
   ======================================== */

.portfolio-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
  gap: 15px;
}

.portfolio-item {
  aspect-ratio: 1;
  background: var(--theme-surface, #f8f9fa);
  border: 1px solid var(--theme-border, #e0e0e0);
  border-radius: 6px;
  overflow: hidden;
  transition: border-color 0.2s;
}

.portfolio-item:hover {
  border-color: var(--theme-primary, #667eea);
}

.portfolio-item img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

/* ========================================
   MOBILE RESPONSIVE
   ======================================== */

@media (max-width: 768px) {
  body:not(.calendar-hidden) #marketplace-container {
    top: auto;
    left: 0;
    right: 0;
    bottom: 0;
    width: 100vw;
    height: 40vh;
  }

  body:not(.calendar-hidden) #mainPanelSelectors {
    width: 100vw;
    position: relative;
  }

  .provider-header {
    flex-direction: column;
    text-align: center;
  }

  .marketplace-filters {
    flex-direction: column;
  }

  .filter-select {
    min-width: 100%;
  }

  .marketplace-section {
    padding: 20px;
  }
}
