/* ============================================
   Dr. Nidhi Gupta — Booking, Chatbot & WhatsApp
   Styles for appointment modal, chatbot, widgets
   ============================================ */

/* ═══════════════════════════════════════════
   BOOKING MODAL
   ═══════════════════════════════════════════ */
.booking-modal-overlay {
  display: none;
  position: fixed;
  inset: 0;
  z-index: 1000;
  background: rgba(0, 0, 0, 0.5);
  backdrop-filter: blur(4px);
  align-items: center;
  justify-content: center;
  padding: 1rem;
}

.booking-modal-overlay.open {
  display: flex;
}

.booking-modal {
  background: var(--white);
  border-radius: var(--radius-lg);
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.2);
  width: 100%;
  max-width: 520px;
  max-height: 90vh;
  overflow-y: auto;
  padding: 1.5rem;
  position: relative;
  animation: modalSlideUp 0.3s ease;
}

@keyframes modalSlideUp {
  from { opacity: 0; transform: translateY(30px); }
  to { opacity: 1; transform: translateY(0); }
}

.booking-modal-close {
  position: absolute;
  top: 0.75rem;
  right: 0.75rem;
  width: 36px;
  height: 36px;
  border-radius: 50%;
  border: none;
  background: var(--secondary);
  color: var(--text-secondary);
  font-size: 1.5rem;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all var(--transition);
  line-height: 1;
}

.booking-modal-close:hover {
  background: var(--error);
  color: var(--white);
}

/* --- Progress Steps --- */
.booking-progress {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0;
  margin-bottom: 1.75rem;
  padding: 0 0.5rem;
}

.booking-step-indicator {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.25rem;
  flex-shrink: 0;
}

.step-num {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  background: var(--border);
  color: var(--text-light);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.8125rem;
  font-weight: 700;
  transition: all var(--transition);
}

.booking-step-indicator.active .step-num {
  background: var(--primary);
  color: var(--white);
  box-shadow: 0 0 0 4px rgba(13, 110, 110, 0.15);
}

.booking-step-indicator.completed .step-num {
  background: var(--success);
  color: var(--white);
}

.step-label {
  font-size: 0.6875rem;
  font-weight: 600;
  color: var(--text-light);
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.booking-step-indicator.active .step-label {
  color: var(--primary);
}

.booking-step-indicator.completed .step-label {
  color: var(--success);
}

.booking-step-line {
  flex: 1;
  height: 2px;
  background: var(--border);
  margin: 0 0.5rem;
  margin-bottom: 1.25rem;
  min-width: 20px;
}

/* --- Step Content --- */
.booking-step-content h3 {
  text-align: center;
  color: var(--primary-dark);
  font-size: 1.25rem;
  margin-bottom: 0.375rem;
}

.booking-subtitle {
  text-align: center;
  color: var(--text-light);
  font-size: 0.875rem;
  margin-bottom: 1.25rem;
}

/* --- Calendar --- */
.booking-calendar {
  background: var(--secondary);
  border-radius: var(--radius-md);
  padding: 1rem;
}

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

.calendar-month-year {
  font-weight: 700;
  font-size: 1rem;
  color: var(--text-primary);
}

.calendar-nav {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  border: 1px solid var(--border);
  background: var(--white);
  color: var(--text-secondary);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all var(--transition);
}

.calendar-nav:hover:not(:disabled) {
  border-color: var(--primary);
  color: var(--primary);
}

.calendar-weekdays {
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  gap: 2px;
  text-align: center;
  margin-bottom: 0.5rem;
}

.calendar-weekdays span {
  font-size: 0.6875rem;
  font-weight: 700;
  color: var(--text-light);
  text-transform: uppercase;
  padding: 0.375rem 0;
}

.calendar-days {
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  gap: 3px;
}

.calendar-day {
  aspect-ratio: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
  border: none;
  background: var(--white);
  color: var(--text-primary);
  font-size: 0.8125rem;
  font-weight: 500;
  cursor: pointer;
  transition: all var(--transition);
  font-family: var(--font-main);
}

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

.calendar-day.selected {
  background: var(--primary) !important;
  color: var(--white) !important;
  font-weight: 700;
  box-shadow: 0 2px 8px rgba(13, 110, 110, 0.3);
}

.calendar-day.today:not(.selected) {
  border: 2px solid var(--accent);
  font-weight: 700;
}

.calendar-day.disabled {
  color: var(--text-light);
  opacity: 0.35;
  cursor: not-allowed;
  background: transparent;
}

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

/* --- Consultation Type Selector --- */
.booking-type-selector {
  display: flex;
  gap: 0.5rem;
  margin-bottom: 1.25rem;
}

.type-btn {
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.375rem;
  padding: 0.75rem;
  border: 2px solid var(--border);
  border-radius: var(--radius-md);
  background: var(--white);
  color: var(--text-secondary);
  font-size: 0.8125rem;
  font-weight: 600;
  font-family: var(--font-main);
  cursor: pointer;
  transition: all var(--transition);
}

.type-btn:hover {
  border-color: var(--primary);
  color: var(--primary);
}

.type-btn.active {
  border-color: var(--primary);
  background: var(--primary-light);
  color: var(--primary);
}

/* --- Time Slots Grid --- */
.time-slots-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 0.5rem;
}

@media (min-width: 480px) {
  .time-slots-grid {
    grid-template-columns: repeat(4, 1fr);
  }
}

.time-slot {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.25rem;
  padding: 0.625rem 0.5rem;
  border: 1.5px solid var(--border);
  border-radius: var(--radius-sm);
  background: var(--white);
  color: var(--text-secondary);
  font-size: 0.8125rem;
  font-weight: 500;
  font-family: var(--font-main);
  cursor: pointer;
  transition: all var(--transition);
}

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

.time-slot.selected {
  border-color: var(--primary);
  background: var(--primary);
  color: var(--white);
  font-weight: 700;
}

.time-slot.booked {
  border-color: #e0e0e0;
  background: #f5f5f5;
  color: #aaa;
  cursor: not-allowed;
  opacity: 0.65;
  text-decoration: line-through;
}
.time-slot.booked:hover {
  box-shadow: none;
  border-color: #e0e0e0;
}

.time-slot svg {
  flex-shrink: 0;
}

.no-slots {
  text-align: center;
  color: var(--text-light);
  padding: 2rem;
  grid-column: 1 / -1;
  font-size: 0.875rem;
}

/* --- Booking Form --- */
.booking-form {
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

.booking-form-group label {
  display: block;
  font-size: 0.8125rem;
  font-weight: 600;
  color: var(--text-primary);
  margin-bottom: 0.25rem;
}

.booking-form-group .req {
  color: var(--error);
}

.booking-form-group input,
.booking-form-group textarea {
  width: 100%;
  padding: 0.625rem 0.875rem;
  font-size: 0.9375rem;
  font-family: var(--font-main);
  color: var(--text-primary);
  background: var(--white);
  border: 1.5px solid var(--border);
  border-radius: var(--radius-sm);
  transition: border-color var(--transition), box-shadow var(--transition);
}

.booking-form-group input:focus,
.booking-form-group textarea:focus {
  outline: none;
  border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(13, 110, 110, 0.12);
}

.booking-form-group input.invalid,
.booking-form-group textarea.invalid {
  border-color: var(--error);
  box-shadow: 0 0 0 3px rgba(192, 57, 43, 0.1);
}

.booking-form-group input::placeholder,
.booking-form-group textarea::placeholder {
  color: var(--text-light);
}

.booking-form-group textarea {
  resize: vertical;
  min-height: 80px;
}

/* --- Summary --- */
.booking-summary {
  background: var(--secondary);
  border-radius: var(--radius-md);
  padding: 1rem;
  margin-bottom: 1rem;
}

.summary-row {
  display: flex;
  gap: 0.75rem;
  align-items: flex-start;
  padding: 0.625rem 0;
  border-bottom: 1px solid var(--border);
}

.summary-row:last-child {
  border-bottom: none;
}

.summary-icon {
  width: 32px;
  height: 32px;
  background: var(--primary-light);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  color: var(--primary);
}

.summary-row strong {
  color: var(--text-primary);
  font-size: 0.75rem;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.summary-row div {
  font-size: 0.875rem;
  color: var(--text-secondary);
  line-height: 1.4;
}

/* --- Consent --- */
.booking-consent {
  display: flex;
  gap: 0.5rem;
  align-items: flex-start;
  font-size: 0.8125rem;
  color: var(--text-secondary);
  cursor: pointer;
  margin-top: 0.5rem;
}

.booking-consent input[type="checkbox"] {
  width: 18px;
  height: 18px;
  accent-color: var(--primary);
  flex-shrink: 0;
  margin-top: 0.125rem;
}

/* --- Navigation Buttons --- */
.booking-nav {
  display: flex;
  gap: 0.75rem;
  margin-top: 1.5rem;
}

.booking-nav .btn-primary {
  flex: 1;
}

.booking-nav .btn:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

/* --- Error --- */
.booking-error {
  text-align: center;
  color: var(--error);
  font-size: 0.875rem;
  padding: 0.75rem;
  background: #FEF2F2;
  border-radius: var(--radius-sm);
  margin-top: 0.75rem;
}

/* --- Spinner --- */
.spinner {
  display: inline-block;
  width: 18px;
  height: 18px;
  border: 2px solid rgba(255,255,255,0.3);
  border-top-color: var(--white);
  border-radius: 50%;
  animation: spin 0.6s linear infinite;
}

@keyframes spin {
  to { transform: rotate(360deg); }
}

/* --- Success Screen --- */
.booking-success {
  text-align: center;
  padding: 1rem 0;
}

.success-icon {
  margin-bottom: 1rem;
}

.success-title {
  color: var(--primary) !important;
  font-size: 1.5rem !important;
  margin-bottom: 0.75rem !important;
}

.success-msg {
  color: var(--text-secondary);
  font-size: 0.9375rem;
  margin-bottom: 1.25rem;
}

.success-details {
  background: var(--secondary);
  border-radius: var(--radius-md);
  padding: 1rem;
  margin-bottom: 1.25rem;
  display: inline-block;
}

.success-detail-row {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.375rem 0;
  font-size: 0.875rem;
  color: var(--text-secondary);
}

.success-detail-row svg {
  color: var(--primary);
  flex-shrink: 0;
}

.success-note {
  font-size: 0.8125rem;
  color: var(--text-light);
  margin-bottom: 1.25rem;
}

.success-actions {
  display: flex;
  gap: 0.75rem;
  justify-content: center;
  flex-wrap: wrap;
}

/* ═══════════════════════════════════════════
   WHATSAPP FLOATING WIDGET
   ═══════════════════════════════════════════ */
.whatsapp-float {
  position: fixed;
  bottom: 6rem;
  right: 1.25rem;
  z-index: 900;
}

.whatsapp-float-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 56px;
  height: 56px;
  border-radius: 50%;
  background: #25D366;
  color: white;
  box-shadow: 0 4px 16px rgba(37, 211, 102, 0.4);
  transition: all 0.3s ease;
  text-decoration: none;
  position: relative;
}

.whatsapp-float-btn:hover {
  transform: scale(1.1);
  box-shadow: 0 6px 24px rgba(37, 211, 102, 0.5);
  color: white;
}

.whatsapp-tooltip {
  position: absolute;
  right: calc(100% + 10px);
  top: 50%;
  transform: translateY(-50%);
  background: var(--text-primary);
  color: var(--white);
  padding: 0.375rem 0.75rem;
  border-radius: var(--radius-sm);
  font-size: 0.75rem;
  font-weight: 600;
  white-space: nowrap;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.2s ease;
}

.whatsapp-float-btn:hover .whatsapp-tooltip {
  opacity: 1;
}

/* Pulse animation */
.whatsapp-float-btn::after {
  content: '';
  position: absolute;
  inset: -4px;
  border-radius: 50%;
  border: 2px solid #25D366;
  animation: whatsappPulse 2s ease infinite;
}

@keyframes whatsappPulse {
  0% { transform: scale(1); opacity: 0.6; }
  100% { transform: scale(1.3); opacity: 0; }
}

/* ═══════════════════════════════════════════
   CHATBOT WIDGET
   ═══════════════════════════════════════════ */
.chatbot-widget {
  position: fixed;
  bottom: 1.25rem;
  right: 1.25rem;
  z-index: 950;
}

.chatbot-trigger {
  width: 56px;
  height: 56px;
  border-radius: 50%;
  border: none;
  background: linear-gradient(135deg, var(--primary), var(--primary-dark));
  color: white;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 4px 16px rgba(13, 110, 110, 0.35);
  transition: all 0.3s ease;
  position: relative;
}

.chatbot-trigger:hover {
  transform: scale(1.05);
  box-shadow: 0 6px 24px rgba(13, 110, 110, 0.45);
}

.chatbot-badge {
  position: absolute;
  top: -2px;
  right: -2px;
  width: 20px;
  height: 20px;
  border-radius: 50%;
  background: var(--error);
  color: white;
  font-size: 0.6875rem;
  font-weight: 700;
  display: flex;
  align-items: center;
  justify-content: center;
  border: 2px solid white;
}

/* --- Chat Window --- */
.chatbot-window {
  position: absolute;
  bottom: calc(100% + 0.75rem);
  right: 0;
  width: 360px;
  max-width: calc(100vw - 2rem);
  height: 480px;
  max-height: calc(100vh - 120px);
  background: var(--white);
  border-radius: var(--radius-lg);
  box-shadow: 0 12px 40px rgba(0, 0, 0, 0.15);
  flex-direction: column;
  overflow: hidden;
  animation: chatSlideUp 0.3s ease;
}

@keyframes chatSlideUp {
  from { opacity: 0; transform: translateY(10px); }
  to { opacity: 1; transform: translateY(0); }
}

.chatbot-header {
  background: linear-gradient(135deg, var(--primary), var(--primary-dark));
  color: white;
  padding: 0.875rem 1rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.chatbot-header-info {
  display: flex;
  align-items: center;
  gap: 0.625rem;
}

.chatbot-avatar {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.2);
  display: flex;
  align-items: center;
  justify-content: center;
}

.chatbot-header-info strong {
  font-size: 0.875rem;
  display: block;
}

.chatbot-status {
  font-size: 0.6875rem;
  color: #90EE90;
  display: block;
}

.chatbot-minimize {
  width: 28px;
  height: 28px;
  border-radius: 50%;
  border: none;
  background: rgba(255, 255, 255, 0.15);
  color: white;
  cursor: pointer;
  font-size: 1.25rem;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background 0.2s ease;
  line-height: 1;
}

.chatbot-minimize:hover {
  background: rgba(255, 255, 255, 0.25);
}

/* --- Messages --- */
.chatbot-messages {
  flex: 1;
  overflow-y: auto;
  padding: 1rem;
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
}

.chat-message {
  display: flex;
  max-width: 85%;
}

.chat-message.bot {
  align-self: flex-start;
}

.chat-message.user {
  align-self: flex-end;
}

.chat-bubble {
  padding: 0.625rem 0.875rem;
  border-radius: var(--radius-md);
  font-size: 0.8125rem;
  line-height: 1.5;
  word-wrap: break-word;
}

.chat-message.bot .chat-bubble {
  background: var(--secondary);
  color: var(--text-primary);
  border-bottom-left-radius: 4px;
}

.chat-message.user .chat-bubble {
  background: var(--primary);
  color: var(--white);
  border-bottom-right-radius: 4px;
}

.chat-bubble a {
  color: var(--primary);
  text-decoration: underline;
}

.chat-message.user .chat-bubble a {
  color: rgba(255, 255, 255, 0.9);
}

/* --- Quick Replies --- */
.chatbot-quick-replies {
  display: flex;
  flex-wrap: wrap;
  gap: 0.375rem;
  padding: 0 0.75rem;
}

.quick-reply-btn {
  padding: 0.375rem 0.75rem;
  border: 1.5px solid var(--primary);
  border-radius: 100px;
  background: var(--white);
  color: var(--primary);
  font-size: 0.75rem;
  font-weight: 600;
  font-family: var(--font-main);
  cursor: pointer;
  transition: all var(--transition);
  white-space: nowrap;
}

.quick-reply-btn:hover {
  background: var(--primary);
  color: var(--white);
}

/* --- Input Area --- */
.chatbot-input-area {
  border-top: 1px solid var(--border);
  padding: 0.625rem;
}

.chatbot-input-row {
  display: flex;
  gap: 0.375rem;
  margin-top: 0.375rem;
}

.chatbot-input-row input {
  flex: 1;
  padding: 0.5rem 0.75rem;
  border: 1.5px solid var(--border);
  border-radius: 100px;
  font-size: 0.8125rem;
  font-family: var(--font-main);
  color: var(--text-primary);
  background: var(--secondary);
  outline: none;
  transition: border-color var(--transition);
}

.chatbot-input-row input:focus {
  border-color: var(--primary);
}

.chatbot-input-row input::placeholder {
  color: var(--text-light);
}

#chatbot-send {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  border: none;
  background: var(--primary);
  color: var(--white);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background 0.2s ease;
  flex-shrink: 0;
}

#chatbot-send:hover {
  background: var(--primary-dark);
}

/* ═══════════════════════════════════════════
   RESPONSIVE ADJUSTMENTS
   ═══════════════════════════════════════════ */
@media (max-width: 480px) {
  .booking-modal {
    border-radius: var(--radius-md);
    padding: 1.25rem;
    max-height: 95vh;
  }

  .step-label {
    display: none;
  }

  .booking-step-line {
    margin-bottom: 0;
  }

  .time-slots-grid {
    grid-template-columns: repeat(2, 1fr);
  }

  .chatbot-window {
    width: calc(100vw - 2rem);
    height: calc(100vh - 120px);
    right: -0.25rem;
  }

  .success-actions {
    flex-direction: column;
  }

  .success-actions .btn {
    width: 100%;
  }
}

/* Adjust WhatsApp position when chatbot is visible */
@media (min-width: 769px) {
  .whatsapp-float {
    bottom: 6rem;
  }
}

/* Print: hide widgets */
@media print {
  .booking-modal-overlay,
  .whatsapp-float,
  .chatbot-widget {
    display: none !important;
  }
}
