/* booking.css — Styles for AI booking agent dashboard, setup, and appointment pages */

/* ---- Page Layout ---- */
.page-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 32px;
  flex-wrap: wrap;
}

.page-header-actions {
  display: flex;
  gap: 10px;
  flex-shrink: 0;
  align-items: center;
}

/* ---- Setup Form ---- */
.setup-form {
  max-width: 760px;
}

.form-section {
  background: #fff;
  border: 1px solid #e2e8f0;
  border-radius: 16px;
  padding: 28px;
  margin-bottom: 24px;
}

.form-section-title {
  font-size: 18px;
  font-weight: 700;
  color: #1e293b;
  margin-bottom: 8px;
}

.form-section-desc {
  font-size: 14px;
  color: #64748b;
  margin-bottom: 20px;
}

.form-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
  margin-bottom: 16px;
}

.form-group {
  display: flex;
  flex-direction: column;
  gap: 6px;
  margin-bottom: 16px;
}

.form-group:last-child {
  margin-bottom: 0;
}

.form-group--sm {
  max-width: 160px;
}

.form-label {
  font-size: 13px;
  font-weight: 600;
  color: #374151;
}

.required {
  color: #ef4444;
}

.form-hint {
  font-weight: 400;
  color: #94a3b8;
}

.form-hint-text {
  font-size: 12px;
  color: #94a3b8;
  margin-top: 4px;
}

.form-input {
  border: 2px solid #e2e8f0;
  border-radius: 10px;
  padding: 10px 14px;
  font-size: 14px;
  font-family: inherit;
  color: #1e293b;
  outline: none;
  transition: border-color 0.2s;
  background: #fff;
}

.form-input:focus {
  border-color: #667eea;
}

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

.form-actions {
  display: flex;
  gap: 12px;
  align-items: center;
  margin-top: 8px;
}

/* ---- Hours Grid ---- */
.hours-grid {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.hours-row {
  display: grid;
  grid-template-columns: 100px auto 1fr;
  align-items: center;
  gap: 16px;
}

.hours-day-label {
  font-size: 14px;
  font-weight: 600;
  color: #374151;
}

.hours-closed-label {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 13px;
  color: #64748b;
  cursor: pointer;
  white-space: nowrap;
}

.hours-range {
  display: flex;
  align-items: center;
  gap: 10px;
  transition: opacity 0.2s;
}

.hours-input {
  width: 120px;
  padding: 8px 10px;
  font-size: 13px;
}

.hours-separator {
  color: #94a3b8;
  font-weight: 600;
}

/* ---- Stats Cards (reused from app.css but extended) ---- */
.stat-card--green {
  background: linear-gradient(135deg, #d1fae5 0%, #a7f3d0 100%);
  border-color: #6ee7b7;
}

.stat-card--green .stat-card-value {
  color: #065f46;
}

.stat-card--green .stat-card-label {
  color: #047857;
}

/* ---- Appointments List (Dashboard) ---- */
.appt-list {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.appt-item {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 14px 16px;
  background: #f8fafc;
  border: 1px solid #e2e8f0;
  border-radius: 12px;
}

.appt-item-date {
  flex-shrink: 0;
  text-align: center;
  min-width: 60px;
}

.appt-date-day {
  font-size: 14px;
  font-weight: 700;
  color: #1e293b;
}

.appt-date-time {
  font-size: 12px;
  color: #64748b;
}

.appt-item-info {
  flex: 1;
}

.appt-item-name {
  font-size: 14px;
  font-weight: 600;
  color: #1e293b;
}

.appt-item-service {
  font-size: 13px;
  color: #64748b;
}

.appt-item-contact {
  font-size: 12px;
  color: #94a3b8;
}

/* ---- Status Badges ---- */
.appt-status {
  display: inline-flex;
  align-items: center;
  padding: 4px 10px;
  border-radius: 20px;
  font-size: 12px;
  font-weight: 600;
  text-transform: capitalize;
  white-space: nowrap;
}

.appt-status--confirmed {
  background: #d1fae5;
  color: #065f46;
}

.appt-status--pending {
  background: #fef3c7;
  color: #92400e;
}

.appt-status--cancelled {
  background: #fee2e2;
  color: #991b1b;
}

.appt-status--completed {
  background: #e0e7ff;
  color: #3730a3;
}

/* ---- Appointments Table ---- */
.filter-tabs {
  display: flex;
  gap: 4px;
  margin-bottom: 24px;
  background: #f1f5f9;
  border-radius: 10px;
  padding: 4px;
  width: fit-content;
}

.filter-tab {
  padding: 8px 16px;
  border-radius: 8px;
  font-size: 13px;
  font-weight: 600;
  text-decoration: none;
  color: #64748b;
  transition: all 0.2s;
}

.filter-tab--active {
  background: #fff;
  color: #1e293b;
  box-shadow: 0 1px 3px rgba(0,0,0,0.1);
}

.appt-table-wrap {
  overflow-x: auto;
  border-radius: 12px;
  border: 1px solid #e2e8f0;
}

.appt-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 14px;
}

.appt-table th {
  background: #f8fafc;
  padding: 12px 16px;
  text-align: left;
  font-size: 12px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: #64748b;
  border-bottom: 1px solid #e2e8f0;
}

.appt-table td {
  padding: 14px 16px;
  border-bottom: 1px solid #f1f5f9;
  color: #1e293b;
  vertical-align: middle;
}

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

.appt-table-date { font-weight: 600; font-size: 14px; }
.appt-table-time { font-size: 12px; color: #64748b; }
.appt-table-name { font-weight: 600; }
.appt-table-notes { font-size: 12px; color: #94a3b8; margin-top: 2px; }
.appt-contact-email { font-size: 13px; }
.appt-contact-phone { font-size: 12px; color: #64748b; }

.appt-actions {
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
}

/* ---- Services ---- */
.service-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.service-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 10px 14px;
  background: #f8fafc;
  border: 1px solid #e2e8f0;
  border-radius: 10px;
}

.service-item-name {
  font-size: 14px;
  font-weight: 600;
  color: #1e293b;
}

.service-item-meta {
  font-size: 12px;
  color: #64748b;
  margin-top: 2px;
}

.add-service-section {
  max-width: 760px;
}

.add-service-form {
  display: flex;
  flex-direction: column;
  gap: 0;
}

/* ---- Widget Embed ---- */
.widget-embed-section {
  background: linear-gradient(135deg, #f0f4ff 0%, #faf5ff 100%);
  border-color: #c4b5fd;
}

.widget-embed-desc {
  font-size: 13px;
  color: #64748b;
  margin-bottom: 12px;
}

.widget-embed-code {
  background: #1e293b;
  border-radius: 10px;
  padding: 14px 16px;
  cursor: pointer;
  position: relative;
  transition: opacity 0.2s;
}

.widget-embed-code:hover {
  opacity: 0.9;
}

.widget-embed-code code {
  font-family: 'Courier New', monospace;
  font-size: 12px;
  color: #94a3b8;
  word-break: break-all;
  display: block;
}

.copy-hint {
  display: block;
  font-size: 11px;
  color: #64748b;
  margin-top: 6px;
  text-align: right;
}

/* ---- Conversations ---- */
.conv-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.conv-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 10px 14px;
  background: #f8fafc;
  border: 1px solid #e2e8f0;
  border-radius: 10px;
}

.conv-item-name {
  font-size: 13px;
  font-weight: 600;
  color: #1e293b;
}

.conv-item-time {
  font-size: 12px;
  color: #94a3b8;
}

.conv-outcome {
  display: inline-flex;
  align-items: center;
  padding: 3px 10px;
  border-radius: 20px;
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.conv-outcome--booked {
  background: #d1fae5;
  color: #065f46;
}

.conv-outcome--chat {
  background: #e0e7ff;
  color: #3730a3;
}

/* ---- Button Extensions ---- */
.btn-lg {
  padding: 14px 28px;
  font-size: 16px;
}

.btn-xs {
  padding: 4px 10px;
  font-size: 12px;
  font-weight: 600;
  border-radius: 6px;
  border: none;
  cursor: pointer;
  font-family: inherit;
  text-decoration: none;
  display: inline-flex;
  align-items: center;
}

.btn-green {
  background: #d1fae5;
  color: #065f46;
}

.btn-green:hover {
  background: #a7f3d0;
}

.btn-danger {
  background: #fee2e2;
  color: #991b1b;
}

.btn-danger:hover {
  background: #fecaca;
}

.btn-xs.btn-outline {
  background: transparent;
  border: 1px solid #e2e8f0;
  color: #64748b;
}

.btn-xs.btn-outline:hover {
  background: #f1f5f9;
}

/* ---- Alert ---- */
.alert {
  padding: 14px 18px;
  border-radius: 10px;
  font-size: 14px;
  margin-bottom: 20px;
}

.alert-error {
  background: #fee2e2;
  border: 1px solid #fca5a5;
  color: #991b1b;
}

@media (max-width: 640px) {
  .form-row {
    grid-template-columns: 1fr;
  }
  .hours-row {
    grid-template-columns: 80px auto;
    flex-wrap: wrap;
  }
  .hours-range {
    grid-column: 1 / -1;
  }
  .appt-table th, .appt-table td {
    padding: 10px 12px;
  }
  .page-header {
    flex-direction: column;
  }
}
