/* ===== Workshop Booking Widget – CSS ===== */
/* All classes prefixed with wb- to avoid theme conflicts */

:root {
  --wb-primary: #2563eb;
  --wb-primary-hover: #1d4ed8;
  --wb-primary-light: #eff6ff;
  --wb-text: #1f2937;
  --wb-text-light: #6b7280;
  --wb-border: #e5e7eb;
  --wb-bg: #ffffff;
  --wb-bg-alt: #f9fafb;
  --wb-success: #059669;
  --wb-success-light: #ecfdf5;
  --wb-error: #dc2626;
  --wb-error-light: #fef2f2;
  --wb-radius: 8px;
  --wb-font: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  --wb-max-width: 560px;
}

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

.wb-widget {
  font-family: var(--wb-font);
  color: var(--wb-text);
  max-width: var(--wb-max-width);
  margin: 0 auto;
  background: var(--wb-bg);
  border: 1px solid var(--wb-border);
  border-radius: var(--wb-radius);
  overflow: hidden;
  line-height: 1.5;
}

/* ===== Progress Bar ===== */
.wb-progress {
  display: flex;
  padding: 16px 24px;
  background: var(--wb-bg-alt);
  border-bottom: 1px solid var(--wb-border);
  gap: 8px;
}
.wb-progress-step {
  flex: 1;
  text-align: center;
  font-size: 12px;
  font-weight: 500;
  color: var(--wb-text-light);
}
.wb-progress-step .wb-step-num {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 28px;
  height: 28px;
  border-radius: 50%;
  background: var(--wb-border);
  color: var(--wb-text-light);
  font-size: 13px;
  font-weight: 600;
  margin-bottom: 4px;
  transition: all 0.2s ease;
}
.wb-progress-step.active .wb-step-num {
  background: var(--wb-primary);
  color: #fff;
}
.wb-progress-step.completed .wb-step-num {
  background: var(--wb-success);
  color: #fff;
}
.wb-progress-step .wb-step-label {
  display: block;
  font-size: 11px;
  margin-top: 2px;
}
.wb-progress-step.active .wb-step-label { color: var(--wb-primary); font-weight: 600; }
.wb-progress-step.completed .wb-step-label { color: var(--wb-success); }

/* ===== Step Container ===== */
.wb-step { display: none; padding: 24px; }
.wb-step.active { display: block; }
.wb-step h2 {
  font-size: 18px;
  font-weight: 600;
  margin-bottom: 4px;
}
.wb-step .wb-subtitle {
  font-size: 14px;
  color: var(--wb-text-light);
  margin-bottom: 20px;
}

/* ===== Service Cards ===== */
.wb-services { display: flex; flex-direction: column; gap: 10px; }
.wb-service-card {
  display: flex;
  align-items: center;
  padding: 14px 16px;
  border: 2px solid var(--wb-border);
  border-radius: var(--wb-radius);
  cursor: pointer;
  transition: all 0.15s ease;
  user-select: none;
}
.wb-service-card:hover { border-color: var(--wb-primary); background: var(--wb-primary-light); }
.wb-service-card.selected { border-color: var(--wb-primary); background: var(--wb-primary-light); }
.wb-service-card .wb-checkbox {
  width: 20px;
  height: 20px;
  border: 2px solid var(--wb-border);
  border-radius: 4px;
  margin-right: 12px;
  flex-shrink: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.15s ease;
}
.wb-service-card.selected .wb-checkbox {
  background: var(--wb-primary);
  border-color: var(--wb-primary);
}
.wb-service-card.selected .wb-checkbox::after {
  content: '';
  width: 6px;
  height: 10px;
  border: solid #fff;
  border-width: 0 2px 2px 0;
  transform: rotate(45deg);
  margin-top: -2px;
}
.wb-service-name { font-weight: 500; flex: 1; }
.wb-service-duration {
  font-size: 13px;
  color: var(--wb-text-light);
  margin-left: 8px;
}

/* ===== Calendar ===== */
.wb-calendar-nav {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 16px;
}
.wb-calendar-nav button {
  background: none;
  border: 1px solid var(--wb-border);
  border-radius: var(--wb-radius);
  padding: 8px 14px;
  cursor: pointer;
  font-size: 14px;
  color: var(--wb-text);
  transition: all 0.15s ease;
}
.wb-calendar-nav button:hover { background: var(--wb-bg-alt); }
.wb-calendar-nav button:disabled { opacity: 0.4; cursor: not-allowed; }
.wb-calendar-nav .wb-week-label { font-weight: 600; font-size: 15px; }
.wb-days { display: flex; flex-direction: column; gap: 8px; }
.wb-day {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 12px 16px;
  border: 2px solid var(--wb-border);
  border-radius: var(--wb-radius);
  cursor: pointer;
  transition: all 0.15s ease;
}
.wb-day:hover:not(.unavailable) { border-color: var(--wb-primary); background: var(--wb-primary-light); }
.wb-day.selected { border-color: var(--wb-primary); background: var(--wb-primary-light); }
.wb-day.unavailable {
  opacity: 0.5;
  cursor: not-allowed;
  background: var(--wb-bg-alt);
}
.wb-day-name { font-weight: 500; }
.wb-day-date { font-size: 13px; color: var(--wb-text-light); }
.wb-day-status {
  font-size: 12px;
  font-weight: 500;
  padding: 3px 10px;
  border-radius: 99px;
}
.wb-day.unavailable .wb-day-status { background: var(--wb-error-light); color: var(--wb-error); }
.wb-day:not(.unavailable) .wb-day-status { background: var(--wb-success-light); color: var(--wb-success); }

/* ===== Time Picker ===== */
.wb-time-section {
  margin-top: 20px;
  padding-top: 20px;
  border-top: 1px solid var(--wb-border);
}
.wb-time-section label {
  display: block;
  font-weight: 500;
  margin-bottom: 8px;
  font-size: 14px;
}
.wb-time-slots {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}
.wb-time-slot {
  padding: 8px 16px;
  border: 2px solid var(--wb-border);
  border-radius: var(--wb-radius);
  cursor: pointer;
  font-size: 14px;
  transition: all 0.15s ease;
  background: var(--wb-bg);
}
.wb-time-slot:hover { border-color: var(--wb-primary); background: var(--wb-primary-light); }
.wb-time-slot.selected { border-color: var(--wb-primary); background: var(--wb-primary-light); font-weight: 600; }

/* ===== Form ===== */
.wb-form-group { margin-bottom: 16px; }
.wb-form-group label {
  display: block;
  font-size: 14px;
  font-weight: 500;
  margin-bottom: 6px;
}
.wb-form-group label .wb-required { color: var(--wb-error); }
.wb-form-row { display: flex; gap: 12px; }
.wb-form-row .wb-form-group { flex: 1; }
.wb-form-group input,
.wb-form-group select,
.wb-form-group textarea {
  width: 100%;
  padding: 10px 12px;
  border: 1px solid var(--wb-border);
  border-radius: var(--wb-radius);
  font-size: 14px;
  font-family: var(--wb-font);
  color: var(--wb-text);
  transition: border-color 0.15s ease;
  background: var(--wb-bg);
}
.wb-form-group input:focus,
.wb-form-group select:focus,
.wb-form-group textarea:focus {
  outline: none;
  border-color: var(--wb-primary);
  box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.1);
}
.wb-form-group textarea { resize: vertical; min-height: 80px; }
.wb-form-group .wb-field-error {
  font-size: 12px;
  color: var(--wb-error);
  margin-top: 4px;
  display: none;
}
.wb-form-group.error input,
.wb-form-group.error select { border-color: var(--wb-error); }
.wb-form-group.error .wb-field-error { display: block; }

.wb-contact-toggle {
  display: flex;
  gap: 8px;
  margin-bottom: 16px;
}
.wb-contact-toggle button {
  flex: 1;
  padding: 10px;
  border: 2px solid var(--wb-border);
  border-radius: var(--wb-radius);
  background: var(--wb-bg);
  color: var(--wb-text);
  cursor: pointer;
  font-size: 14px;
  font-family: var(--wb-font);
  transition: all 0.15s ease;
}
.wb-contact-toggle button:hover { border-color: var(--wb-primary); }
.wb-contact-toggle button.active {
  border-color: var(--wb-primary);
  background: var(--wb-primary-light);
  font-weight: 600;
  color: var(--wb-primary);
}

/* ===== Review ===== */
.wb-review-section {
  padding: 16px;
  background: var(--wb-bg-alt);
  border-radius: var(--wb-radius);
  margin-bottom: 16px;
}
.wb-review-section h3 {
  font-size: 13px;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--wb-text-light);
  margin-bottom: 10px;
}
.wb-review-row {
  display: flex;
  justify-content: space-between;
  font-size: 14px;
  padding: 4px 0;
}
.wb-review-row .wb-review-label { color: var(--wb-text-light); }
.wb-review-row .wb-review-value { font-weight: 500; text-align: right; }

/* ===== Buttons ===== */
.wb-actions {
  display: flex;
  justify-content: space-between;
  padding: 16px 24px;
  border-top: 1px solid var(--wb-border);
  background: var(--wb-bg-alt);
  gap: 12px;
}
.wb-btn {
  padding: 10px 24px;
  border-radius: var(--wb-radius);
  font-size: 14px;
  font-weight: 500;
  font-family: var(--wb-font);
  cursor: pointer;
  transition: all 0.15s ease;
  border: none;
}
.wb-btn-primary {
  background: var(--wb-primary);
  color: #fff;
}
.wb-btn-primary:hover { background: var(--wb-primary-hover); }
.wb-btn-primary:disabled { opacity: 0.5; cursor: not-allowed; }
.wb-btn-secondary {
  background: var(--wb-bg);
  color: var(--wb-text);
  border: 1px solid var(--wb-border);
}
.wb-btn-secondary:hover { background: var(--wb-bg-alt); }
.wb-btn-submit {
  background: var(--wb-success);
  color: #fff;
  width: 100%;
  padding: 12px;
  font-size: 15px;
  border: none;
  border-radius: var(--wb-radius);
  cursor: pointer;
  font-family: var(--wb-font);
  font-weight: 500;
}
.wb-btn-submit:hover { background: #047857; }
.wb-btn-submit:disabled { opacity: 0.5; cursor: not-allowed; }
.wb-spacer { flex: 1; }

/* ===== Loading ===== */
.wb-loading {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 40px;
  color: var(--wb-text-light);
}
.wb-spinner {
  width: 32px;
  height: 32px;
  border: 3px solid var(--wb-border);
  border-top-color: var(--wb-primary);
  border-radius: 50%;
  animation: wb-spin 0.8s linear infinite;
  margin-bottom: 12px;
}
@keyframes wb-spin { to { transform: rotate(360deg); } }

/* ===== Success ===== */
.wb-success-screen {
  text-align: center;
  padding: 40px 24px;
}
.wb-success-icon {
  width: 64px;
  height: 64px;
  background: var(--wb-success-light);
  border-radius: 50%;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  margin-bottom: 16px;
}
.wb-success-icon svg { width: 32px; height: 32px; color: var(--wb-success); }
.wb-success-screen h2 { margin-bottom: 8px; }
.wb-success-screen p { color: var(--wb-text-light); font-size: 14px; line-height: 1.5; }

/* ===== Error Banner ===== */
.wb-error-banner {
  background: var(--wb-error-light);
  color: var(--wb-error);
  padding: 12px 16px;
  border-radius: var(--wb-radius);
  font-size: 14px;
  margin-bottom: 16px;
  display: none;
}
.wb-error-banner.visible { display: block; }

/* ===== Responsive ===== */
@media (max-width: 480px) {
  .wb-step { padding: 16px; }
  .wb-actions { padding: 12px 16px; }
  .wb-form-row { flex-direction: column; gap: 0; }
  .wb-progress { padding: 12px 16px; }
  .wb-progress-step .wb-step-label { font-size: 10px; }
  .wb-time-slots { gap: 6px; }
  .wb-time-slot { padding: 8px 12px; font-size: 13px; }
}
