/* Book Visit Styles */

/* Layout with fixed indicator */
.booking-layout {
  display: grid;
  grid-template-columns: 1fr 220px;
  gap: 24px;
  position: relative;
}

.booking-sections {
  display: grid;
  gap: 18px;
}

.booking-card {
  background: rgba(255, 255, 255, 0.8);
  border-radius: 16px;
  padding: 18px;
  border: 1px solid rgba(16, 16, 20, 0.08);
  display: grid;
  gap: 16px;
  scroll-margin-top: 24px;
}

.booking-card h3 {
  margin: 0;
}

/* Form Styles */
.form-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 16px;
}

.form-field {
  display: grid;
  gap: 6px;
  font-size: 13px;
  color: rgba(16, 16, 20, 0.7);
}

.form-field.full-width {
  grid-column: 1 / -1;
}

.form-field label {
  font-weight: 500;
}

.form-field input,
.form-field select,
.form-field textarea {
  border-radius: 10px;
  border: 1px solid rgba(16, 16, 20, 0.15);
  padding: 10px 12px;
  font-size: 14px;
  background: white;
  transition: border-color 0.15s ease, box-shadow 0.15s ease;
}

.form-field input:focus,
.form-field select:focus,
.form-field textarea:focus {
  outline: none;
  border-color: rgba(59, 126, 140, 0.5);
  box-shadow: 0 0 0 3px rgba(59, 126, 140, 0.1);
}

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

.form-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-top: 8px;
}

/* Availability Grid */
.availability-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(120px, 1fr));
  gap: 10px;
}

.time-slot {
  padding: 12px;
  border-radius: 10px;
  border: 1px solid rgba(16, 16, 20, 0.15);
  background: white;
  text-align: center;
  cursor: pointer;
  transition: all 0.15s ease;
}

.time-slot:hover {
  border-color: rgba(59, 126, 140, 0.4);
  background: rgba(59, 126, 140, 0.05);
}

.time-slot.selected {
  border-color: rgba(59, 126, 140, 0.6);
  background: rgba(59, 126, 140, 0.15);
  box-shadow: 0 0 0 2px rgba(59, 126, 140, 0.2);
}

.time-slot.unavailable {
  opacity: 0.5;
  cursor: not-allowed;
  background: rgba(16, 16, 20, 0.05);
}

.time-slot-time {
  font-weight: 600;
  font-size: 14px;
  margin-bottom: 4px;
}

.time-slot-status {
  font-size: 12px;
  color: rgba(16, 16, 20, 0.6);
}

/* Summary Grid */
.summary-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
  gap: 12px;
}

.summary-item {
  background: rgba(59, 126, 140, 0.08);
  border-radius: 12px;
  padding: 12px;
}

.summary-label {
  font-size: 12px;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: rgba(16, 16, 20, 0.6);
  margin-bottom: 4px;
}

.summary-value {
  font-size: 14px;
  font-weight: 500;
}

.summary-value.highlight {
  color: #1f4f58;
  font-weight: 600;
}

.summary-value.placeholder {
  color: rgba(16, 16, 20, 0.4);
  font-style: italic;
}

/* Alert Boxes */
.alert-box {
  background: rgba(200, 150, 50, 0.12);
  border: 1px solid rgba(200, 150, 50, 0.3);
  border-radius: 10px;
  padding: 12px 14px;
  font-size: 13px;
  color: #8b6914;
}

.alert-box.info {
  background: rgba(59, 126, 140, 0.08);
  border-color: rgba(59, 126, 140, 0.2);
  color: #1f4f58;
}

/* Section Header */
.section-header {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.section-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

/* Video Meeting */
.video-meeting-container {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

#video-meeting-pending {
  display: flex;
  align-items: center;
  gap: 12px;
  flex-wrap: wrap;
}

.video-meeting-hint {
  font-size: 12px;
  color: rgba(16, 16, 20, 0.5);
}

.video-meeting-link-box {
  display: flex;
  align-items: center;
  gap: 10px;
  background: rgba(59, 126, 140, 0.08);
  border-radius: 10px;
  padding: 10px 14px;
  flex-wrap: wrap;
}

.video-meeting-label {
  font-size: 13px;
  font-weight: 500;
  color: rgba(16, 16, 20, 0.7);
}

.video-meeting-link {
  color: #1f4f58;
  font-size: 13px;
  word-break: break-all;
}

.button-small {
  padding: 6px 12px;
  font-size: 12px;
}

.video-meeting-status {
  font-size: 12px;
  color: #2a7a4d;
  font-weight: 500;
}

/* Client Selector Button */
.client-selector-btn {
  display: flex;
  align-items: center;
  justify-content: space-between;
  width: 100%;
  border-radius: 10px;
  border: 1px solid rgba(16, 16, 20, 0.15);
  padding: 10px 12px;
  font-size: 14px;
  background: white;
  cursor: pointer;
  transition: border-color 0.15s ease, box-shadow 0.15s ease;
  text-align: left;
}

.client-selector-btn:hover {
  border-color: rgba(59, 126, 140, 0.4);
}

.client-selector-btn:focus {
  outline: none;
  border-color: rgba(59, 126, 140, 0.5);
  box-shadow: 0 0 0 3px rgba(59, 126, 140, 0.1);
}

.client-selector-btn .placeholder {
  color: rgba(16, 16, 20, 0.5);
}

.client-selector-btn .icon {
  font-size: 12px;
  color: rgba(16, 16, 20, 0.4);
}

/* Modal Styles */
.modal-overlay {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(16, 16, 20, 0.5);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 1000;
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.2s ease, visibility 0.2s ease;
}

.modal-overlay.active {
  opacity: 1;
  visibility: visible;
}

.modal {
  background: white;
  border-radius: 16px;
  width: 90%;
  max-width: 500px;
  max-height: 80vh;
  display: flex;
  flex-direction: column;
  box-shadow: 0 20px 60px rgba(16, 16, 20, 0.3);
  transform: translateY(20px);
  transition: transform 0.2s ease;
}

.modal-overlay.active .modal {
  transform: translateY(0);
}

.modal-header {
  padding: 18px 20px;
  border-bottom: 1px solid rgba(16, 16, 20, 0.1);
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.modal-header h3 {
  margin: 0;
  font-size: 16px;
}

.modal-close {
  background: none;
  border: none;
  font-size: 20px;
  cursor: pointer;
  color: rgba(16, 16, 20, 0.5);
  padding: 4px 8px;
  border-radius: 6px;
}

.modal-close:hover {
  background: rgba(16, 16, 20, 0.05);
  color: rgba(16, 16, 20, 0.8);
}

.modal-search {
  padding: 12px 20px;
  border-bottom: 1px solid rgba(16, 16, 20, 0.1);
}

.modal-search input {
  width: 100%;
  border-radius: 10px;
  border: 1px solid rgba(16, 16, 20, 0.15);
  padding: 10px 12px;
  font-size: 14px;
}

.modal-search input:focus {
  outline: none;
  border-color: rgba(59, 126, 140, 0.5);
  box-shadow: 0 0 0 3px rgba(59, 126, 140, 0.1);
}

.modal-body {
  flex: 1;
  overflow-y: auto;
  padding: 8px 0;
}

/* Client List Items */
.client-list-item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 20px;
  cursor: pointer;
  transition: background 0.15s ease;
}

.client-list-item:hover {
  background: rgba(59, 126, 140, 0.08);
}

.client-list-item.selected {
  background: rgba(59, 126, 140, 0.15);
}

.client-avatar {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  background: linear-gradient(135deg, #3b7e8c, #1f4f58);
  color: white;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 600;
  font-size: 14px;
}

.client-info {
  flex: 1;
}

.client-name {
  font-weight: 500;
  font-size: 14px;
  margin-bottom: 2px;
}

.client-meta {
  font-size: 12px;
  color: rgba(16, 16, 20, 0.6);
}

.no-results {
  padding: 24px 20px;
  text-align: center;
  color: rgba(16, 16, 20, 0.5);
  font-size: 14px;
}

/* Schedule Visualization */
.schedule-visualization {
  display: none;
  margin-top: 16px;
}

.schedule-visualization.visible {
  display: block;
}

.schedule-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 12px;
}

.schedule-header h4 {
  margin: 0;
  font-size: 14px;
  font-weight: 500;
}

.schedule-legend {
  display: flex;
  gap: 16px;
  font-size: 12px;
}

.legend-item {
  display: flex;
  align-items: center;
  gap: 6px;
}

.legend-dot {
  width: 12px;
  height: 12px;
  border-radius: 3px;
}

.legend-dot.working {
  background: rgba(59, 126, 140, 0.15);
  border: 1px solid rgba(59, 126, 140, 0.3);
}

.legend-dot.booked {
  background: rgba(200, 80, 80, 0.2);
  border: 1px solid rgba(200, 80, 80, 0.4);
}

.legend-dot.available {
  background: rgba(80, 180, 100, 0.2);
  border: 1px solid rgba(80, 180, 100, 0.4);
}

.schedule-timeline {
  position: relative;
  height: 80px;
  background: rgba(16, 16, 20, 0.03);
  border-radius: 10px;
  border: 1px solid rgba(16, 16, 20, 0.1);
  overflow: hidden;
}

.schedule-hours {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 100%;
  display: flex;
}

.schedule-hour {
  flex: 1;
  border-right: 1px dashed rgba(16, 16, 20, 0.1);
  position: relative;
}

.schedule-hour:last-child {
  border-right: none;
}

.schedule-hour-label {
  position: absolute;
  bottom: 4px;
  left: 4px;
  font-size: 10px;
  color: rgba(16, 16, 20, 0.4);
}

.schedule-working-hours {
  position: absolute;
  top: 8px;
  height: 40px;
  background: rgba(59, 126, 140, 0.12);
  border: 1px solid rgba(59, 126, 140, 0.25);
  border-radius: 6px;
}

.schedule-block {
  position: absolute;
  top: 8px;
  height: 40px;
  border-radius: 6px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 11px;
  font-weight: 500;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  padding: 0 6px;
}

.schedule-block.booked {
  background: rgba(200, 80, 80, 0.2);
  border: 1px solid rgba(200, 80, 80, 0.4);
  color: #8b3030;
}

.schedule-block.lunch {
  background: rgba(200, 150, 50, 0.15);
  border: 1px solid rgba(200, 150, 50, 0.3);
  color: #8b6914;
}

.schedule-block.proposed {
  background: rgba(59, 126, 140, 0.25);
  border: 2px solid rgba(59, 126, 140, 0.6);
  color: #1f4f58;
}

.schedule-block.conflict {
  background: rgba(200, 80, 80, 0.35);
  border: 2px dashed rgba(200, 80, 80, 0.7);
  color: #8b3030;
}

.schedule-info {
  margin-top: 12px;
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  font-size: 13px;
}

.schedule-info-item {
  display: flex;
  align-items: center;
  gap: 6px;
}

.schedule-info-item strong {
  color: #1f4f58;
}

.schedule-prompt {
  padding: 16px;
  text-align: center;
  color: rgba(16, 16, 20, 0.5);
  font-size: 13px;
  background: rgba(16, 16, 20, 0.03);
  border-radius: 10px;
  border: 1px dashed rgba(16, 16, 20, 0.15);
}

/* Therapist Settings Info Box */
.therapist-settings-box {
  display: none;
  margin-top: 16px;
  background: rgba(59, 126, 140, 0.06);
  border: 1px solid rgba(59, 126, 140, 0.15);
  border-radius: 12px;
  overflow: hidden;
}

.therapist-settings-box.visible {
  display: block;
}

.therapist-settings-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 12px 14px;
  background: rgba(59, 126, 140, 0.08);
  border-bottom: 1px solid rgba(59, 126, 140, 0.12);
}

.therapist-settings-header h5 {
  margin: 0;
  font-size: 13px;
  font-weight: 600;
  color: #1f4f58;
}

.therapist-settings-link {
  font-size: 11px;
  color: var(--sea);
  text-decoration: none;
}

.therapist-settings-link:hover {
  text-decoration: underline;
}

.therapist-settings-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
  gap: 12px;
  padding: 14px;
}

.therapist-settings-item {
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.therapist-settings-label {
  font-size: 10px;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: rgba(16, 16, 20, 0.5);
}

.therapist-settings-value {
  font-size: 12px;
  font-weight: 500;
  color: rgba(16, 16, 20, 0.85);
}

.therapist-settings-value.warning {
  color: #8b6914;
}

.therapist-settings-value.success {
  color: #4a7a4a;
}

/* ============================================
   Booking Indicator Panel
   ============================================ */

.booking-indicator {
  position: sticky;
  top: 24px;
  height: fit-content;
  background: rgba(255, 255, 255, 0.95);
  border-radius: 14px;
  padding: 16px;
  border: 1px solid rgba(16, 16, 20, 0.1);
  box-shadow: 0 8px 24px rgba(16, 16, 20, 0.1);
}

.indicator-progress {
  font-size: 14px;
  font-weight: 700;
  color: var(--sea);
  margin-bottom: 14px;
  padding-bottom: 12px;
  border-bottom: 1px solid rgba(16, 16, 20, 0.1);
}

.indicator-nav {
  display: grid;
  gap: 4px;
}

.indicator-item {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 8px 10px;
  border-radius: 8px;
  font-size: 12px;
  color: rgba(16, 16, 20, 0.7);
  text-decoration: none;
  transition: all 0.15s ease;
}

.indicator-item:hover {
  background: rgba(59, 126, 140, 0.08);
  color: var(--sea);
}

.indicator-item.active {
  background: rgba(59, 126, 140, 0.12);
  color: var(--sea);
  font-weight: 600;
}

.indicator-dot {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  border: 2px solid rgba(16, 16, 20, 0.25);
  flex-shrink: 0;
}

.indicator-item.complete .indicator-dot {
  background: #7aa060;
  border-color: #7aa060;
}

.indicator-item.warning .indicator-dot {
  background: #c8a03c;
  border-color: #c8a03c;
}

.indicator-item.error .indicator-dot {
  background: #c85050;
  border-color: #c85050;
}

.indicator-item.ongoing .indicator-dot {
  background: rgba(59, 126, 140, 0.5);
  border-color: rgba(59, 126, 140, 0.5);
}

/* Indicator Summary */
.indicator-summary {
  margin-top: 14px;
  padding-top: 14px;
  border-top: 1px solid rgba(16, 16, 20, 0.1);
  display: grid;
  gap: 10px;
}

.indicator-summary-item {
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.indicator-summary-label {
  font-size: 10px;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: rgba(16, 16, 20, 0.5);
}

.indicator-summary-value {
  font-size: 12px;
  font-weight: 500;
  color: rgba(16, 16, 20, 0.85);
}

.indicator-summary-value.placeholder {
  color: rgba(16, 16, 20, 0.4);
  font-style: italic;
  font-weight: 400;
}

/* Indicator Actions */
.indicator-actions {
  display: grid;
  gap: 8px;
  margin-top: 16px;
  padding-top: 16px;
  border-top: 1px solid rgba(16, 16, 20, 0.1);
}

.indicator-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  padding: 10px 12px;
  border-radius: 8px;
  border: none;
  font-size: 12px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.15s ease;
  text-decoration: none;
  text-align: center;
}

.indicator-btn.primary {
  background: var(--sea);
  color: white;
}

.indicator-btn.primary:hover:not(:disabled) {
  background: #2a6a7a;
}

.indicator-btn.primary:disabled {
  background: rgba(59, 126, 140, 0.4);
  cursor: not-allowed;
}

.indicator-btn.secondary {
  background: rgba(16, 16, 20, 0.06);
  color: rgba(16, 16, 20, 0.7);
}

.indicator-btn.secondary:hover {
  background: rgba(16, 16, 20, 0.1);
}

.indicator-btn.danger {
  background: rgba(200, 80, 80, 0.1);
  color: #a03030;
}

.indicator-btn.danger:hover {
  background: rgba(200, 80, 80, 0.15);
}

.indicator-btn.warning {
  background: rgba(200, 150, 50, 0.1);
  color: #8b6914;
}

.indicator-btn.warning:hover {
  background: rgba(200, 150, 50, 0.15);
}

/* ============================================
   Validation Messages
   ============================================ */

.validation-messages {
  display: grid;
  gap: 8px;
  margin-top: 12px;
}

.validation-message {
  display: flex;
  align-items: flex-start;
  gap: 8px;
  padding: 10px 12px;
  border-radius: 8px;
  font-size: 12px;
  line-height: 1.4;
}

.validation-message-icon {
  flex-shrink: 0;
  width: 16px;
  height: 16px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 10px;
  font-weight: 700;
}

.validation-message.error {
  background: rgba(200, 80, 80, 0.1);
  border: 1px solid rgba(200, 80, 80, 0.25);
  color: #8b3030;
}

.validation-message.error .validation-message-icon {
  background: rgba(200, 80, 80, 0.2);
  color: #a03030;
}

.validation-message.warning {
  background: rgba(200, 150, 50, 0.1);
  border: 1px solid rgba(200, 150, 50, 0.25);
  color: #8b6914;
}

.validation-message.warning .validation-message-icon {
  background: rgba(200, 150, 50, 0.2);
  color: #8b6914;
}

.validation-message.info {
  background: rgba(59, 126, 140, 0.08);
  border: 1px solid rgba(59, 126, 140, 0.2);
  color: #1f4f58;
}

.validation-message.info .validation-message-icon {
  background: rgba(59, 126, 140, 0.2);
  color: #1f4f58;
}

/* ============================================
   Edit Visit Specific Styles
   ============================================ */

.change-indicator {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 2px 8px;
  border-radius: 999px;
  font-size: 10px;
  font-weight: 600;
  text-transform: uppercase;
  margin-left: 8px;
}

.change-indicator.modified {
  background: rgba(200, 150, 50, 0.15);
  color: #8b6914;
}

.change-indicator.original {
  background: rgba(16, 16, 20, 0.08);
  color: rgba(16, 16, 20, 0.5);
}

.original-value {
  font-size: 11px;
  color: rgba(16, 16, 20, 0.5);
  margin-top: 4px;
}

.original-value::before {
  content: "Original: ";
  font-weight: 500;
}

/* ============================================
   Session Mode Toggle (Multi-participant)
   ============================================ */

.session-mode-toggle {
  display: flex;
  gap: 8px;
  margin-bottom: 16px;
  padding-bottom: 16px;
  border-bottom: 1px solid rgba(16, 16, 20, 0.1);
}

.session-mode-btn {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
  flex: 1;
  padding: 12px 8px;
  border-radius: 10px;
  border: 1px solid rgba(16, 16, 20, 0.15);
  background: white;
  cursor: pointer;
  transition: all 0.15s ease;
}

.session-mode-btn:hover {
  border-color: rgba(59, 126, 140, 0.4);
  background: rgba(59, 126, 140, 0.04);
}

.session-mode-btn.active {
  border-color: rgba(59, 126, 140, 0.5);
  background: rgba(59, 126, 140, 0.1);
  box-shadow: 0 0 0 2px rgba(59, 126, 140, 0.15);
}

.session-mode-btn .mode-icon {
  font-size: 16px;
  color: rgba(16, 16, 20, 0.5);
}

.session-mode-btn.active .mode-icon {
  color: var(--sea);
}

.session-mode-btn .mode-label {
  font-size: 11px;
  font-weight: 500;
  color: rgba(16, 16, 20, 0.7);
}

.session-mode-btn.active .mode-label {
  color: var(--sea);
  font-weight: 600;
}

/* Group Preview */
.group-preview {
  margin-top: 12px;
  padding: 12px;
  background: rgba(59, 126, 140, 0.06);
  border: 1px solid rgba(59, 126, 140, 0.15);
  border-radius: 10px;
}

.group-preview-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 10px;
}

.group-preview-title {
  font-size: 13px;
  font-weight: 600;
  color: #1f4f58;
}

.group-preview-link {
  font-size: 11px;
  color: var(--sea);
}

.group-preview-members {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.member-chip {
  display: inline-flex;
  align-items: center;
  padding: 4px 10px;
  border-radius: 999px;
  background: white;
  border: 1px solid rgba(16, 16, 20, 0.12);
  font-size: 12px;
  color: rgba(16, 16, 20, 0.8);
}

/* Ad-hoc Clients Selected */
.adhoc-clients-selected {
  min-height: 44px;
  padding: 8px 12px;
  border-radius: 10px;
  border: 1px dashed rgba(16, 16, 20, 0.2);
  background: rgba(16, 16, 20, 0.02);
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  align-items: center;
}

.adhoc-placeholder {
  font-size: 13px;
  color: rgba(16, 16, 20, 0.4);
  font-style: italic;
}

.adhoc-client-chip {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 4px 10px;
  border-radius: 999px;
  background: rgba(59, 126, 140, 0.1);
  border: 1px solid rgba(59, 126, 140, 0.2);
  font-size: 12px;
  color: #1f4f58;
}

.adhoc-client-chip .remove-btn {
  width: 14px;
  height: 14px;
  border-radius: 50%;
  border: none;
  background: rgba(16, 16, 20, 0.1);
  color: rgba(16, 16, 20, 0.5);
  font-size: 10px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 0;
}

.adhoc-client-chip .remove-btn:hover {
  background: rgba(200, 80, 80, 0.2);
  color: #a03030;
}

/* ============================================
   Responsive
   ============================================ */

@media (max-width: 900px) {
  .booking-layout {
    grid-template-columns: 1fr;
  }

  .booking-indicator {
    position: fixed;
    bottom: 20px;
    right: 20px;
    top: auto;
    z-index: 100;
    max-width: 220px;
  }

  .indicator-summary {
    display: none;
  }
}
