/* ============================================================
   bookings.css — feed-layout compatible styles
   Uses CSS variables from video-feed.css
   ============================================================ */

/* ---- Page wrapper ---- */
.bookings-page {
  padding: 16px;
  max-width: 760px;
  margin: 0 auto;
}

@media (min-width: 768px) {
  .bookings-page {
    padding: 24px 0;
  }
}

/* ---- Tab pills ---- */
.bookings-tabs {
  display: flex;
  flex-direction: row;
  gap: 8px;
  margin-bottom: 20px;
}

.tab-pill {
  background: var(--color-surface);
  color: var(--color-text);
  border: none;
  border-radius: var(--radius-full);
  font-family: var(--font);
  font-size: 13px;
  font-weight: 500;
  padding: 8px 20px;
  min-height: 36px;
  cursor: pointer;
  transition: background 0.15s, color 0.15s;
}

.tab-pill.active {
  background: var(--color-text);
  color: var(--color-bg);
}

/* ---- Bookings list ---- */
.bookings-list {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

/* ---- Booking card ---- */
.booking-card-horizontal {
  background: var(--color-bg);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-md);
  overflow: hidden;
}

.booking-card-horizontal.card-cancelled {
  opacity: 0.75;
}

.card-header-date {
  display: flex;
  flex-direction: row;
  align-items: center;
  justify-content: space-between;
  padding: 12px 16px;
  border-bottom: 1px solid var(--color-border);
  font-size: 13px;
  font-weight: 500;
  color: var(--color-text);
  gap: 8px;
}

.card-body-flex {
  display: flex;
  flex-direction: row;
  gap: 14px;
  padding: 14px 16px;
}

.card-image-col {
  flex-shrink: 0;
}

.provider-image {
  width: 60px;
  height: 60px;
  border-radius: 8px;
  object-fit: cover;
}

.card-details-col {
  flex: 1;
  min-width: 0;
}

.provider-title {
  font-size: 15px;
  font-weight: 600;
  margin: 0 0 6px;
  color: var(--color-text);
}

.salon-link {
  color: inherit;
  text-decoration: none;
  cursor: pointer;
  transition: color 0.15s ease;
}

.provider-title .salon-link:hover {
  text-decoration: underline;
}

.card-image-col .salon-link {
  display: block;
}

.location-row,
.services-row,
.meta-row {
  display: flex;
  flex-direction: row;
  align-items: center;
  gap: 6px;
  font-size: 13px;
  color: var(--color-text-secondary, #6b7280);
  margin-bottom: 4px;
  flex-wrap: wrap;
}

.booking-services-list {
  display: flex;
  flex-direction: column;
  gap: 4px;
  margin-bottom: 4px;
}

.services-row--item .services-text {
  white-space: normal;
}

.location-text {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.services-text {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.service-agent {
  font-weight: 500;
  color: var(--color-text-secondary, #6b7280);
}

.service-agent-separator {
  color: var(--color-text-secondary, #6b7280);
}

.service-name {
  font-weight: 600;
  color: var(--color-text);
}

.separator {
  color: var(--color-border);
}

.price-info .price {
  font-weight: 600;
  color: var(--color-text);
}

.payment-row {
  margin-top: 6px;
  font-size: 13px;
}

.payment-breakdown {
  display: flex;
  flex-direction: row;
  align-items: center;
  gap: 6px;
  flex-wrap: wrap;
}

.text-success { color: #166534; }
.text-danger  { color: #991b1b; }

/* ---- Status badges ---- */
.status-badge-inline {
  display: inline-flex;
  align-items: center;
  font-size: 11px;
  font-weight: 600;
  padding: 3px 8px;
  border-radius: var(--radius-full);
  white-space: nowrap;
  flex-shrink: 0;
}

.status-upcoming    { background: #dbeafe; color: #1e40af; }
.status-past        { background: #f3f4f6; color: #4b5563; }
.status-cancelled   { background: #fee2e2; color: #991b1b; }
.status-completed   { background: #dcfce7; color: #166534; }
.status-reviewed    { background: #dcfce7; color: #166534; }
.status-pending     { background: #fef3c7; color: #92400e; }
.status-in-progress { background: #dbeafe; color: #1e40af; }
.status-booked      { background: #dbeafe; color: #1e40af; }
.status-unknown     { background: #f3f4f6; color: #4b5563; }

/* ---- Fully paid badge ---- */
.badge-fully-paid {
  display: inline-flex;
  align-items: center;
  background: #dcfce7;
  color: #166534;
  font-size: 11px;
  font-weight: 600;
  padding: 3px 8px;
  border-radius: var(--radius-full);
}

/* ---- Action buttons ---- */
.booking-actions {
  display: flex;
  flex-direction: row;
  gap: 8px;
  margin-top: 12px;
  padding-top: 12px;
  border-top: 1px solid var(--color-border);
  flex-wrap: wrap;
}

.btn-action {
  display: inline-flex;
  align-items: center;
  font-family: var(--font);
  font-size: 13px;
  font-weight: 500;
  padding: 9px 20px;
  border-radius: var(--radius-full);
  border: 1.5px solid var(--color-border);
  background: transparent;
  cursor: pointer;
  text-decoration: none;
  transition: opacity 0.15s;
  line-height: 1;
}

.btn-action:hover { opacity: 0.75; }

.btn-rebook-action    { border-color: var(--color-accent); color: var(--color-accent); }
.btn-cancel-action    { border-color: var(--color-accent); color: var(--color-accent); }
.btn-reschedule-action { border-color: var(--color-border); color: var(--color-text); }

/* ---- Empty / Loading / Error states ---- */
.bookings-loading,
.bookings-error,
.bookings-empty {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 60px 20px;
  text-align: center;
  gap: 12px;
  color: var(--color-text-secondary, #6b7280);
}

.bookings-empty-icon svg {
  width: 48px;
  height: 48px;
  color: var(--color-border);
}

.bookings-empty h3,
.bookings-error h3 {
  margin: 0;
  font-size: 16px;
  font-weight: 600;
  color: var(--color-text);
}

.bookings-empty p,
.bookings-error p {
  margin: 0;
  font-size: 14px;
}

/* ---- Spinner ---- */
.spinner {
  width: 28px;
  height: 28px;
  border: 3px solid var(--color-border);
  border-top-color: var(--color-text);
  border-radius: 50%;
  animation: spin 0.75s linear infinite;
}

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

/* ---- Book now CTA ---- */
.btn-book-now {
  display: inline-flex;
  align-items: center;
  background: var(--color-accent);
  color: #fff;
  font-family: var(--font);
  font-size: 14px;
  font-weight: 600;
  padding: 10px 24px;
  border-radius: var(--radius-full);
  text-decoration: none;
  border: none;
  cursor: pointer;
  margin-top: 8px;
  transition: opacity 0.15s;
}

.btn-book-now:hover { opacity: 0.85; }

/* ============================================================
   Cancel Modal — scoped to #cancelModal to beat auth-modals.css
   ============================================================ */
#cancelModal.modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.6);
  z-index: 9000;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 16px;
}

#cancelModal .modal-content {
  background: #fff;
  border-radius: 16px;
  padding: 28px 24px 24px;
  max-width: 400px;
  width: 100%;
  position: relative;
  box-shadow: 0 8px 32px rgba(0, 0, 0, 0.18);
}

#cancelModal .modal-close {
  position: absolute;
  top: 12px;
  right: 14px;
  background: #f0f0f0;
  border: none;
  font-size: 20px;
  line-height: 1;
  cursor: pointer;
  color: #666;
  padding: 0;
  width: 32px;
  height: 32px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
}

#cancelModal .modal-close:hover {
  background: #e50050;
  color: #fff;
}

#cancelModal .modal-icon {
  display: flex;
  justify-content: center;
  margin-bottom: 12px;
}

#cancelModal .modal-icon svg {
  width: 48px;
  height: 48px;
  color: #e50050;
}

#cancelModal .modal-content h3 {
  text-align: center;
  font-size: 17px;
  font-weight: 600;
  margin: 0 0 8px;
  color: #1f2937;
}

#cancelModal .modal-message {
  text-align: center;
  font-size: 14px;
  color: #6b7280;
  margin: 0 0 20px;
  line-height: 1.5;
}

#cancelModal .modal-actions {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

#cancelModal .btn-reschedule,
#cancelModal .btn-confirm-cancel,
#cancelModal .btn-keep-booking {
  font-size: 14px;
  font-weight: 600;
  padding: 12px 20px;
  border-radius: 999px;
  border: 1.5px solid #e5e7eb;
  cursor: pointer;
  width: 100%;
  transition: opacity 0.15s;
}

#cancelModal .btn-reschedule {
  background: #f9fafb;
  color: #1f2937;
}

#cancelModal .btn-confirm-cancel {
  background: #fee2e2;
  color: #991b1b;
  border-color: #fecaca;
}

#cancelModal .btn-keep-booking {
  background: #e50050;
  color: #fff;
  border-color: #e50050;
}

#cancelModal .btn-reschedule:hover,
#cancelModal .btn-confirm-cancel:hover,
#cancelModal .btn-keep-booking:hover { opacity: 0.8; }

#cancelModal .modal-loading {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 12px;
  padding: 12px 0;
  color: #6b7280;
  font-size: 14px;
}

/* ============================================================
   POST-BOOKING OPTIONAL PHONE PROMPT (my-bookings page)
   Self-contained overlay — no Bootstrap modal dependency.
   ============================================================ */
.phone-recall-overlay {
  position: fixed;
  inset: 0;
  z-index: 1080;
  display: none;
  align-items: center;
  justify-content: center;
  padding: 16px;
  background: rgba(0, 0, 0, 0.5);
}

.phone-recall-overlay.show {
  display: flex;
}

.phone-recall-dialog {
  position: relative;
  width: 100%;
  max-width: 420px;
  background: #fff;
  border-radius: 20px;
  padding: 44px 32px 32px;
  box-shadow: 0 12px 40px rgba(0, 0, 0, 0.16);
}

.phone-recall-dialog__close {
  position: absolute;
  top: 18px;
  right: 18px;
  width: 22px;
  height: 22px;
  padding: 0;
  background: none;
  background-image: url("data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23666' stroke-width='2' stroke-linecap='round'%3e%3cpath d='M18 6L6 18M6 6l12 12'/%3e%3c/svg%3e");
  background-repeat: no-repeat;
  background-position: center;
  background-size: 20px 20px;
  border: none;
  cursor: pointer;
  transition: opacity 0.2s ease;
}

.phone-recall-dialog__close:hover {
  opacity: 0.55;
}

.phone-recall-dialog__header {
  text-align: center;
  margin-bottom: 28px;
  padding: 0 16px;
}

.phone-recall-dialog__title {
  margin: 0 0 10px;
  font-size: 22px;
  font-weight: 700;
  line-height: 1.3;
  color: #111;
}

.phone-recall-dialog__subtitle {
  margin: 0;
  font-size: 14px;
  line-height: 1.45;
  color: #888;
}

.phone-recall-dialog__label {
  display: block;
  margin-bottom: 10px;
  font-size: 14px;
  font-weight: 700;
  color: #111;
}

.phone-recall-dialog__phone-row {
  display: flex;
  align-items: stretch;
  gap: 10px;
  margin-bottom: 10px;
}

.phone-recall-dialog__country {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  height: 44px;
  padding: 0 14px;
  border: 1.5px solid #e0e0e0;
  border-radius: 12px;
  background: #fff;
  font-size: 15px;
  font-weight: 500;
  color: #333;
}

.phone-recall-dialog__input {
  flex: 1;
  min-width: 0;
  height: 44px;
  padding: 0 14px;
  border: 1.5px solid #e0e0e0;
  border-radius: 12px;
  background: #fff;
  font-size: 15px;
  color: #333;
  outline: none;
  box-sizing: border-box;
  transition: border-color 0.2s ease, box-shadow 0.2s ease;
}

.phone-recall-dialog__input::placeholder {
  color: #bbb;
}

.phone-recall-dialog__input:focus {
  border-color: #e50050;
  box-shadow: 0 0 0 3px rgba(229, 0, 80, 0.1);
}

.phone-recall-dialog__hint {
  margin: 0 0 24px;
  font-size: 13px;
  line-height: 1.4;
  color: #999;
}

.phone-recall-dialog__error {
  margin: -12px 0 16px;
  padding: 10px 12px;
  border-radius: 10px;
  background: #fff5f7;
  border: 1px solid #ffd0dc;
  color: #c9003f;
  font-size: 13px;
  line-height: 1.4;
}

.phone-recall-dialog__error.d-none {
  display: none;
}

.phone-recall-dialog__submit {
  display: block;
  width: 100%;
  padding: 14px 24px;
  border: none;
  border-radius: 999px;
  background: #e50050;
  color: #fff;
  font-size: 15px;
  font-weight: 700;
  cursor: pointer;
  transition: background 0.2s ease;
}

.phone-recall-dialog__submit:hover {
  background: #c9003f;
}

.phone-recall-dialog__submit:disabled {
  background: #ccc;
  cursor: not-allowed;
}

.phone-recall-dialog__skip {
  display: block;
  width: 100%;
  margin-top: 12px;
  padding: 8px;
  border: none;
  background: transparent;
  color: #888;
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
}

.phone-recall-dialog__skip:hover {
  color: #555;
  text-decoration: underline;
}

@media (max-width: 575px) {
  .phone-recall-dialog {
    padding: 40px 24px 28px;
  }
  .phone-recall-dialog__country,
  .phone-recall-dialog__input {
    height: 42px;
  }
}
