:root {
  --primary-color: #8D9B6A; /* Soft green */
  --secondary-color: #F7F6F2; /* Light beige */
  --text-color: #3C403D;
  --background-color: #FFFFFF;
  --border-color: #E0E0E0;
  --disabled-color: #D3D3D3;
  --hover-color: #A4B48A;
}

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

body {
  font-family: 'Poppins', sans-serif;
  background-color: var(--secondary-color);
  color: var(--text-color);
  display: flex;
  justify-content: center;
  align-items: flex-start;
  min-height: 100vh;
  padding: 2rem;
  transition: background-color 0.3s ease, color 0.3s ease;
}

#root {
  width: 100%;
  max-width: 600px;
}

.booking-container {
  background-color: var(--background-color);
  padding: 2.5rem;
  border-radius: 12px;
  box-shadow: 0 10px 25px rgba(0, 0, 0, 0.08);
  display: flex;
  flex-direction: column;
  gap: 1.5rem; /* Adjusted gap */
  position: relative;
  transition: background-color 0.3s ease;
}

.theme-trigger-area {
    position: absolute;
    top: 0;
    right: 0;
    width: 80px;
    height: 80px;
    cursor: default;
    z-index: 10;
    /* This element is invisible */
}


.header {
  text-align: center;
  margin-bottom: 1rem;
}

.header h1 {
  font-size: 1.54rem;
  font-weight: 600;
  color: var(--primary-color);
  transition: color 0.3s ease;
}

.header p {
  font-size: 1rem;
  color: #666;
}

.step {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
  opacity: 1;
  transition: opacity 0.5s ease-in-out, max-height 0.5s ease-in-out;
  max-height: 1000px; /* Increased to accommodate calendar */
  overflow: hidden;
}

.step.hidden {
  opacity: 0;
  max-height: 0;
  padding-top: 0;
  padding-bottom: 0;
  margin-top: 0;
  margin-bottom: 0;
  border: none;
  gap: 0;
}


.step label {
  font-size: 1.1rem;
  font-weight: 600;
}

.step select,
.step input[type="text"],
.step input[type="tel"],
.step input[type="email"],
.step input[type="date"],
.step input[type="number"],
.step textarea {
  width: 100%;
  padding: 0.8rem 1rem;
  border: 1px solid var(--border-color);
  border-radius: 8px;
  font-size: 1rem;
  font-family: 'Poppins', sans-serif;
  background-color: var(--background-color);
  color: var(--text-color);
  transition: background-color 0.3s ease, border-color 0.3s ease;
}

.step textarea {
  resize: vertical;
  min-height: 100px;
}


.step select {
  appearance: none;
  background-image: url("data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16'%3e%3cpath fill='none' stroke='%23343a40' stroke-linecap='round' stroke-linejoin='round' stroke-width='2' d='m2 5 6 6 6-6'/%3e%3c/svg%3e");
  background-repeat: no-repeat;
  background-position: right 1rem center;
  background-size: 1em;
}

.step select:disabled {
  background-color: var(--secondary-color);
  cursor: not-allowed;
  opacity: 0.7;
}

/* --- CALENDAR STYLES --- */
.calendar-container {
  border: 1px solid var(--border-color);
  border-radius: 8px;
  padding: 1rem;
  margin-top: 0.5rem;
  transition: border-color 0.3s ease;
}

.calendar-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 1rem;
}

.calendar-month-year {
  font-weight: 600;
  font-size: 1.1rem;
  text-transform: capitalize;
}

.nav-arrow {
  background: none;
  border: none;
  font-size: 1.5rem;
  cursor: pointer;
  color: var(--primary-color);
  padding: 0 0.5rem;
  border-radius: 4px;
  transition: background-color 0.3s ease, color 0.3s ease;
}

.nav-arrow:hover:not(:disabled) {
  background-color: var(--secondary-color);
}

.nav-arrow:disabled {
  color: var(--disabled-color);
  cursor: not-allowed;
}

.calendar-grid {
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  gap: 0.25rem;
  text-align: center;
}

.calendar-day-name {
  font-weight: 600;
  color: #666;
  font-size: 0.9rem;
  padding: 0.5rem 0;
}

.calendar-day {
  padding: 0.5rem;
  border-radius: 50%;
  aspect-ratio: 1 / 1;
  display: flex;
  justify-content: center;
  align-items: center;
  cursor: pointer;
  transition: background-color 0.2s, color 0.2s, border-color 0.2s;
  border: 1px solid transparent;
}

.calendar-day.empty {
  cursor: default;
}

.calendar-day:not(.empty):not(.disabled):hover {
  background-color: var(--secondary-color);
}

.calendar-day.today {
  border-color: var(--primary-color);
}

.calendar-day.selected {
  background-color: var(--primary-color);
  color: var(--background-color);
  border-color: var(--primary-color);
}

.calendar-day.disabled {
  color: var(--disabled-color);
  cursor: not-allowed;
  text-decoration: line-through;
}
/* --- END CALENDAR STYLES --- */

/* --- TIME FILTER STYLES --- */
.time-filter-buttons {
    display: flex;
    justify-content: center;
    gap: 0.5rem;
    margin-bottom: 1rem;
    flex-wrap: wrap;
}

.filter-button {
    background-color: transparent;
    border: 1px solid var(--border-color);
    color: var(--text-color);
    padding: 0.5rem 1rem;
    border-radius: 20px;
    cursor: pointer;
    font-size: 0.9rem;
    transition: all 0.2s ease-in-out;
}

.filter-button:hover {
    background-color: var(--secondary-color);
    border-color: var(--primary-color);
}

.filter-button.active {
    background-color: var(--primary-color);
    color: var(--background-color);
    border-color: var(--primary-color);
    font-weight: 600;
}
/* --- END TIME FILTER STYLES --- */

.time-slots {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(100px, 1fr));
  gap: 0.75rem;
  /* margin-top: 0.5rem; */ /* Removed to be handled by filter buttons container */
}

.time-slot {
  padding: 0.75rem;
  border: 1px solid var(--border-color);
  border-radius: 8px;
  text-align: center;
  cursor: pointer;
  transition: background-color 0.2s, color 0.2s, border-color 0.2s;
}

.time-slot.disabled {
  background-color: var(--secondary-color);
  color: #a0a0a0;
  border-color: var(--border-color);
  cursor: not-allowed;
  opacity: 0.6;
}

.time-slot:not(.disabled):hover {
  background-color: var(--secondary-color);
  border-color: var(--primary-color);
}

.time-slot.selected:not(.disabled) {
  background-color: var(--primary-color);
  color: var(--background-color);
  border-color: var(--primary-color);
}

.no-slots-message {
  grid-column: 1 / -1; /* Span all columns */
  text-align: center;
  color: #666;
  font-style: italic;
  padding: 1rem;
  background-color: var(--secondary-color);
  border-radius: 8px;
}

.confirmation, .success-message {
  padding: 1.5rem;
  background-color: var(--secondary-color);
  border-left: 5px solid var(--primary-color);
  border-radius: 8px;
  margin-top: 1rem;
  transition: background-color 0.3s ease, border-color 0.3s ease;
}

.info-message {
  padding: 1rem;
  background-color: var(--secondary-color);
  border-left: 5px solid var(--primary-color);
  color: var(--text-color);
  border-radius: 8px;
  margin-top: -0.5rem; /* Pull up slightly */
  margin-bottom: 0.75rem;
  font-style: italic;
  font-size: 0.95rem;
}

.confirmation h3, .success-message h3 {
  margin-bottom: 1rem;
}

.confirmation ul, .success-message ul {
  list-style-type: none;
  padding-left: 0;
}

.confirmation li, .success-message li {
  margin-bottom: 0.5rem;
}

.confirmation li strong, .success-message li strong {
  color: var(--primary-color);
  transition: color 0.3s ease;
}

.book-button {
  background-color: var(--primary-color);
  color: var(--background-color);
  border: none;
  padding: 1rem;
  font-size: 1.1rem;
  font-weight: 600;
  border-radius: 8px;
  cursor: pointer;
  transition: background-color 0.2s;
  width: 100%;
  margin-top: 1rem;
}

.book-button:hover:not(:disabled) {
  background-color: var(--hover-color);
}

.book-button:disabled {
  background-color: var(--disabled-color);
  cursor: not-allowed;
}

/* --- LOADER AND ERROR STYLES --- */
.loader {
  text-align: center;
  padding: 0.8rem 1rem;
  font-style: italic;
  color: #666;
  background-color: var(--secondary-color);
  border-radius: 8px;
}

.error-message {
  padding: 1rem;
  background-color: #ffebee;
  border-left: 5px solid #c62828;
  color: #c62828;
  border-radius: 8px;
  margin-bottom: 1rem;
}


/* --- THEME SELECTOR STYLES --- */
.theme-selector-overlay {
  position: fixed;
  top: 0;
  left: 0;
  width: 100vw;
  height: 100vh;
  background-color: rgba(0, 0, 0, 0.6);
  z-index: 1000;
  display: flex;
  justify-content: center;
  align-items: center;
  padding: 1rem;
}

.theme-selector-modal {
  background-color: var(--background-color);
  color: var(--text-color);
  padding: 2rem;
  border-radius: 12px;
  width: 100%;
  max-width: 700px;
  max-height: 90vh;
  overflow-y: auto;
  position: relative;
  display: flex;
  flex-direction: column;
}

.theme-selector-modal h3 {
  text-align: center;
  margin-bottom: 1.5rem;
  color: var(--primary-color);
}

.close-button {
    position: absolute;
    top: 1rem;
    right: 1rem;
    background: none;
    border: none;
    font-size: 2rem;
    line-height: 1;
    cursor: pointer;
    color: var(--text-color);
}

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

.theme-swatch-container {
  cursor: pointer;
  text-align: center;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.5rem;
}

.theme-swatch {
  width: 100px;
  height: 50px;
  border-radius: 8px;
  overflow: hidden;
  display: flex;
  border: 1px solid var(--border-color);
  transition: transform 0.2s ease;
}

.theme-swatch-container:hover .theme-swatch {
    transform: scale(1.05);
}

.swatch-color {
  width: 50%;
  height: 100%;
}
.theme-swatch-container span {
    font-size: 0.9rem;
    font-weight: 500;
}


/* --- USER DETAILS STYLES --- */
.step-label-container {
    display: flex;
    justify-content: space-between;
    align-items: baseline;
    flex-wrap: wrap;
    gap: 0.5rem;
}

.required-info {
    font-size: 0.85rem;
    font-style: italic;
    color: #888;
}

.user-details-inputs {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

/* --- CAPTCHA STYLES --- */
.captcha-container {
  display: flex;
  align-items: center;
  gap: 1rem;
  background-color: var(--secondary-color);
  padding: 1rem;
  border-radius: 8px;
}

.captcha-question {
  font-weight: 600;
  font-size: 1.1rem;
  white-space: nowrap;
}

.captcha-container input {
  flex-grow: 1;
}

/* --- PROCESSING MODAL STYLES --- */
.processing-overlay {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background-color: rgba(255, 255, 255, 0.85);
  display: flex;
  justify-content: center;
  align-items: center;
  z-index: 100;
  border-radius: 12px; /* Match parent container */
  padding: 2rem;
  backdrop-filter: blur(4px);
}

.processing-modal {
  text-align: center;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 1rem;
}

.processing-modal h3 {
  font-size: 1.3rem;
  color: var(--primary-color);
}

.processing-modal p {
  font-size: 1rem;
  color: var(--text-color);
}

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

@keyframes spin {
  0% { transform: rotate(0deg); }
  100% { transform: rotate(360deg); }
}
/* --- END PROCESSING MODAL STYLES --- */


/* Responsive adjustments */
@media (max-width: 768px) {
  body {
    padding: 1rem;
  }
  .booking-container {
    padding: 1.5rem;
  }
  .header h1 {
    font-size: 1.26rem;
  }
}

@media (max-width: 480px) {
    .time-slots {
        grid-template-columns: repeat(auto-fill, minmax(80px, 1fr));
    }
    .calendar-day, .calendar-day-name {
        padding: 0.3rem;
        font-size: 0.8rem;
    }
    .filter-button {
      padding: 0.4rem 0.8rem;
      font-size: 0.85rem;
    }
}
