/**
 * WD Booking Frontend Styles
 */

.wd-booking-form {
  display: flex;
  max-width: 1200px;
  margin: 2rem auto;
  background: #fff;
  border-radius: 8px;
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
  overflow: hidden;
  min-height: 600px;
}

/* Host Info Section */
.wd-booking-host-info {
  flex: 0 0 300px;
  padding: 2rem;
  background: #f8f9fa;
  border-right: 1px solid #e9ecef;
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  position: relative;
}

.wd-booking-host-info .host-avatar {
  margin-bottom: 1.5rem;
  width: 80px;
  height: 80px;
  border-radius: 50%;
  overflow: hidden;
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
  background: #fff;
}

.wd-booking-host-info .host-avatar img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.wd-booking-host-info .default-avatar {
  width: 100%;
  height: 100%;
  background-color: #e9ecef;
  display: flex;
  align-items: center;
  justify-content: center;
  position: relative;
}

.wd-booking-host-info .default-avatar::before {
  content: "\f338";
  font-family: dashicons;
  font-size: 36px;
  color: #adb5bd;
}

.wd-booking-host-info .host-name {
  font-size: 1.15rem;
  font-weight: 600;
  color: #212529;
  margin: 0 0 0.3rem;
  line-height: 1.2;
}

.wd-booking-host-info .host-title {
  font-size: 1rem;
  color: #6c757d;
  font-weight: normal;
  line-height: 1.4;
}

.wd-booking-host-info .form-title {
  font-size: 1.5rem;
  font-weight: 600;
  color: #212529;
  margin: 1.5rem 0 0.75rem;
  line-height: 1.2;
}

/* Main Section */
.wd-booking-main {
  flex: 1;
  padding: 2rem;
  min-width: 0;
  position: relative;
  overflow: hidden;
}

.wd-booking-main .calendar-title,
.wd-booking-main .form-step-title {
  font-size: 1.25rem;
  margin: 0 0 1.5rem;
  color: #212529;
  font-weight: 500;
}

.wd-booking-main .calendar-title {
  display: block;
}

.wd-booking-main .form-step-title {
  display: none;
}

/* When form is visible */
.wd-booking-details-form:not([style*="display: none"]) ~ .calendar-title {
  display: none;
}

.wd-booking-details-form:not([style*="display: none"]) ~ .form-step-title {
  display: block;
}

/* Timezone Selector */
.wd-booking-timezone {
  width: 100%;
  display: flex;
  align-items: center;
  gap: 0.5rem;
  padding: 1rem 0;
  margin-top: auto;
  border-top: 1px solid #dee2e6;
}

.timezone-icon {
  color: #6c757d;
  font-size: 1.1rem;
  width: 1.1rem;
  height: 1.1rem;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.wd-booking-timezone select {
  flex: 1;
  min-width: 0;
  appearance: none;
  border: none;
  background: transparent;
  padding: 0;
  color: #212529;
  font-size: 0.95rem;
  cursor: pointer;
}

.wd-booking-timezone select:focus {
  outline: none;
}

/* Calendar Styling */
.wd-booking-calendar {
  width: 100%;
  margin-bottom: 2rem;
}

.fc {
  width: 100% !important;
  background: transparent;
  border: none !important;
  font-family: inherit;
}

.fc .fc-toolbar.fc-header-toolbar {
  margin: 0 0 1rem;
  padding: 0;
  border: none;
}

.fc .fc-toolbar-title {
  font-size: 1.25rem;
  font-weight: 600;
}

.fc .fc-button {
  background: #fff !important;
  border: 1px solid #e0e0e0 !important;
  color: #666 !important;
  box-shadow: none !important;
  padding: 0.5rem 0.75rem;
  font-size: 0.9rem;
}

.fc .fc-button:hover {
  background: #f8f9fa !important;
  border-color: #dee2e6 !important;
  color: #0d6efd !important;
}

/* Calendar Grid */
.fc .fc-scrollgrid {
  border: none !important;
}

.fc .fc-scrollgrid-section > * {
  border: none !important;
}

/* Calendar Headers */
.fc .fc-col-header-cell {
  padding: 0.5rem 0;
  border: none !important;
}

.fc .fc-col-header-cell-cushion {
  padding: 0;
  color: #212529;
  font-weight: 600;
  text-decoration: none !important;
  text-transform: uppercase;
  font-size: 0.8rem;
}

/* Calendar Days */
.fc .fc-daygrid-day {
  border: 1px solid #f1f1f1 !important;
}

.fc .fc-daygrid-day:not(.fc-day-disabled) {
  cursor: pointer;
}

.fc .fc-daygrid-day-frame {
  padding: 0.25rem;
  min-height: 4.5rem;
  display: grid;
  place-content: center;
}

.fc .fc-daygrid-day-top {
  justify-content: center;
  padding-top: 0.25rem;
}

.fc .fc-daygrid-day-number {
  font-size: 1rem;
  font-weight: 600;
  padding: 0;
  color: #212529;
  text-decoration: none !important;
}

.fc .fc-day-other .fc-daygrid-day-number {
  color: #adb5bd;
  font-weight: normal;
}

.fc .fc-day-disabled {
  background: transparent;
}

.fc .fc-day-disabled .fc-daygrid-day-number {
  color: #dee2e6;
}

/* Empty day cell content */
.fc .fc-daygrid-day-events {
  display: none;
}

.fc .fc-daygrid-body-balanced .fc-daygrid-day-events {
  position: relative !important;
}

.fc .fc-daygrid-day-bottom {
  padding: 0;
}

/* Remove scrollbar */
.fc .fc-scroller {
  overflow: hidden !important;
}

.fc .fc-scroller-liquid-absolute {
  position: static !important;
  overflow: visible !important;
}

/* Month/Week View */
.fc .fc-view {
  overflow: visible !important;
}

.fc-view-harness {
  height: auto !important;
}

.fc .fc-view-harness-active > .fc-view {
  position: static !important;
}

/* Time Slots Section */
.time-slots-section {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  background: #fff;
  padding: 2rem;
  border-radius: 8px;
  box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
  z-index: 1001;
  width: 90%;
  max-width: 600px;
}

.time-slots-section h3 {
  margin: 0 0 1.5rem;
  font-size: 1.25rem;
  color: #212529;
  font-weight: 500;
}

.time-slots-container {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(120px, 1fr));
  gap: 0.75rem;
  padding: 0.5rem;
}

.time-slot {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0.75rem 1rem;
  background: #fff;
  border: 1px solid #dee2e6;
  border-radius: 4px;
  color: #212529;
  font-size: 0.95rem;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.2s ease;
  width: 100%;
  text-align: center;
  line-height: 1.2;
}

.time-slot:hover {
  background-color: #f8f9fa;
  border-color: #0d6efd;
  color: #0d6efd;
}

.time-slot:active,
.time-slot:focus {
  outline: none;
  box-shadow: 0 0 0 2px rgba(13, 110, 253, 0.25);
}

.time-slot.selected {
  background-color: #0d6efd;
  border-color: #0d6efd;
  color: #fff;
}

/* Loading and Error States */
.time-slots-container .loading,
.time-slots-container .error,
.time-slots-container .no-slots {
  grid-column: 1 / -1;
  text-align: center;
  padding: 2rem;
  color: #6c757d;
}

.time-slots-container .error {
  color: #dc3545;
}

/* Responsive Adjustments */
@media (max-width: 576px) {
  .time-slots-container {
    grid-template-columns: repeat(auto-fill, minmax(100px, 1fr));
    gap: 0.5rem;
  }

  .time-slot {
    padding: 0.5rem;
    font-size: 0.9rem;
  }
}

/* Form */
.wd-booking-details-form {
  margin-top: 2rem;
  padding-top: 2rem;
  border-top: 1px solid #dee2e6;
}

.wd-booking-field {
  margin-bottom: 1.5rem;
}

.wd-booking-field label {
  display: block;
  margin-bottom: 0.5rem;
  color: #212529;
  font-size: 0.9rem;
  font-weight: 500;
}

.wd-booking-field label .required {
  color: #dc3545;
}

.wd-booking-field input[type="text"],
.wd-booking-field input[type="email"],
.wd-booking-field input[type="tel"],
.wd-booking-field select,
.wd-booking-field textarea {
  width: 100%;
  padding: 0.75rem;
  border: 1px solid #ced4da;
  border-radius: 4px;
  background-color: #fff;
  color: #212529;
  transition: border-color 0.2s ease;
  box-sizing: border-box;
}

.wd-booking-field input:focus,
.wd-booking-field select:focus,
.wd-booking-field textarea:focus {
  border-color: #0d6efd;
  outline: none;
  box-shadow: 0 0 0 0.2rem rgba(13, 110, 253, 0.25);
}

.wd-booking-submit {
  display: inline-block;
  padding: 0.75rem 1.5rem;
  font-size: 1rem;
  font-weight: 500;
  text-align: center;
  text-decoration: none;
  background-color: #0d6efd;
  color: #fff;
  border: 1px solid #0d6efd;
  border-radius: 4px;
  cursor: pointer;
  transition: all 0.2s ease;
}

.wd-booking-submit:hover {
  background-color: #0b5ed7;
  border-color: #0a58ca;
}

.wd-booking-submit:disabled {
  background-color: #6c757d;
  border-color: #6c757d;
  cursor: not-allowed;
}

/* Loading States */
.loading {
  text-align: center;
  padding: 2rem;
  color: #6c757d;
}

.wd-booking-form.loading {
  opacity: 0.7;
  pointer-events: none;
}

/* Responsive Design */
@media (max-width: 768px) {
  .wd-booking-form {
    flex-direction: column;
  }

  .wd-booking-host-info {
    flex: none;
    border-right: none;
    border-bottom: 1px solid #e9ecef;
  }

  .time-slots {
    grid-template-columns: repeat(auto-fill, minmax(100px, 1fr));
  }
}

/* Messages */
.notice {
  padding: 1rem;
  margin: 1rem 0;
  border-radius: 4px;
}

.notice-success {
  background-color: #d4edda;
  border: 1px solid #c3e6cb;
  color: #155724;
}

.notice-error {
  background-color: #f8d7da;
  border: 1px solid #f5c6cb;
  color: #721c24;
}

.no-slots {
  text-align: center;
  padding: 2rem;
  color: #6c757d;
  background: #f8f9fa;
  border-radius: 4px;
}

.form-description {
  font-size: 0.95rem;
  color: #6c757d;
  line-height: 1.5;
  margin-bottom: 1.5rem;
}

/* Time Slots Modal */
.wd-booking-time-slots-modal {
  display: none;
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(0, 0, 0, 0.5);
  z-index: 9999;
  align-items: center;
  justify-content: center;
}

.wd-booking-time-slots-modal.active {
  display: flex;
}

.wd-booking-time-slots-modal .modal-content {
  background: #fff;
  padding: 2rem;
  border-radius: 8px;
  box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
  max-width: 600px;
  width: 90%;
  max-height: 90vh;
  overflow-y: auto;
  position: relative;
  z-index: 100000;
}

.wd-booking-time-slots-modal .modal-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 1.5rem;
  padding-bottom: 1rem;
  border-bottom: 1px solid #eee;
}

.wd-booking-time-slots-modal .modal-header h3 {
  margin: 0;
  font-size: 1.25rem;
  color: #212529;
}

.wd-booking-time-slots-modal .close-modal {
  background: none;
  border: none;
  font-size: 1.5rem;
  line-height: 1;
  padding: 0.25rem;
  cursor: pointer;
  color: #666;
}

.wd-booking-time-slots-modal .close-modal:hover {
  color: #000;
}

.time-slots-section .close-slots {
  position: absolute;
  top: 1rem;
  right: 1rem;
  background: none;
  border: none;
  font-size: 1.5rem;
  line-height: 1;
  padding: 0.25rem;
  cursor: pointer;
  color: #666;
  transition: color 0.2s ease;
}

.time-slots-section .close-slots:hover {
  color: #000;
}

/* Meeting Info */
.booking-info {
  width: 100%;
  padding-top: 1rem;
  border-top: 1px solid #dee2e6;
}

.duration-type,
.selected-datetime-info {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
  margin-bottom: 1rem;
}

.meeting-duration,
.meeting-type,
.selected-date-display,
.selected-time-display {
  display: flex;
  align-items: center;
  font-size: 0.95rem;
  font-weight: 500;
}

.booking-info .icon,
.selected-datetime .icon {
  margin-right: 0.75rem;
  display: flex;
  align-items: center;
  justify-content: center;
}

.booking-info .icon {
  color: #0d6efd;
  font-size: 1.25rem;
  width: 1.25rem;
  height: 1.25rem;
}

/* Selected Date/Time Display */
.selected-datetime {
  margin-top: 1.5rem;
  padding-top: 1.5rem;
  border-top: 1px solid #dee2e6;
}

.selected-datetime-info {
  margin-bottom: 0.75rem;
}

.selected-datetime .icon {
  color: #6c757d;
  font-size: 1.1rem;
  width: 1.1rem;
  height: 1.1rem;
}

.change-datetime-link {
  display: inline-flex;
  margin-block: 0.75rem;
  font-size: 0.95rem;
  text-decoration: none;
  transition: color 0.2s ease;
  align-items: center;
  font-weight: 500;
  opacity: 0.5;
}

.change-datetime-link:hover {
  color: #510dfd;
  text-decoration: none;
}

/* Show Change Date & Time link when form is visible */
.wd-booking-details-form:not([style*="display: none"])
  ~ .selected-datetime
  .change-datetime-link {
  display: inline-block !important;
}

/* Calendar overlay */
.calendar-overlay {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(0, 0, 0, 0.5);
  z-index: 1000;
  display: none;
}
