/**
 * Tutor Booking Page Styles
 * Theme matching personal-tutor-landing.css and existing DeenVerse design
 */

/* =========================================
   Base & Shell — Warm Parchment Theme
   ========================================= */
.tutor-booking-page {
  --booking-bg: #f8f3e7;
  --booking-cream: #f2e8d7;
  --booking-card: linear-gradient(180deg, rgba(255, 255, 255, 0.95), rgba(247, 238, 225, 0.98));
  --booking-panel: rgba(255, 255, 255, 0.85);
  --booking-stroke: rgba(199, 173, 132, 0.35);
  --booking-stroke-hover: rgba(199, 173, 132, 0.6);
  --booking-gold: #C9A227;
  --booking-gold-light: #FFE156;
  --booking-text: #3d3226;
  --booking-muted: #7a6b5a;
  --ink-soft: #3d3226;
  --ink-muted: #7a6b5a;
}

.tutor-booking-page .site-footer {
  position: relative;
  z-index: 1;
  margin-top: 0;
}

.tutor-booking-page main {
  display: block;
  position: relative;
}

.booking-shell {
  position: relative;
  z-index: 2;
  padding: clamp(2rem, 4vw, 3rem) 0;
  margin-bottom: 0;
  min-height: auto;
  background:
    radial-gradient(120% 140% at 12% 12%, rgba(255, 231, 10, 0.15), transparent 45%),
    radial-gradient(120% 140% at 82% 10%, rgba(238, 210, 150, 0.25), transparent 52%),
    linear-gradient(180deg, #f8f3e7 0%, #f2e8d7 100%);
  color: var(--booking-text);
}

.booking-container {
  max-width: 640px;
  margin: 0 auto;
  padding: 0 1.25rem;
  padding-bottom: 3rem;
}

/* =========================================
   Page Header
   ========================================= */
.booking-page-header {
  text-align: center;
  margin-bottom: 2rem;
}

.booking-page-header h1 {
  margin: 0 0 0.5rem;
  font-size: clamp(1.5rem, 2vw + 1rem, 2rem);
  color: var(--ink-soft);
}

.booking-page-header p {
  margin: 0;
  color: var(--ink-muted);
  font-size: 1rem;
}

/* =========================================
   Tutor Context Card
   ========================================= */
.booking-tutor-card {
  display: flex;
  align-items: center;
  gap: 1rem;
  padding: 1.25rem 1.5rem;
  background: var(--booking-card);
  border: 1px solid var(--booking-stroke);
  border-radius: 16px;
  margin-bottom: 2rem;
  box-shadow: 0 8px 24px rgba(57, 39, 20, 0.08);
}

.booking-tutor-photo {
  width: 64px;
  height: 64px;
  border-radius: 12px;
  object-fit: cover;
  border: 2px solid rgba(199, 173, 132, 0.4);
  background: var(--booking-cream);
  flex-shrink: 0;
}

.booking-tutor-initial {
  width: 64px;
  height: 64px;
  border-radius: 12px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.5rem;
  font-weight: 800;
  background: linear-gradient(135deg, rgba(255, 231, 10, 0.22), rgba(238, 210, 150, 0.28));
  border: 2px solid rgba(199, 173, 132, 0.4);
  color: var(--ink-soft);
  flex-shrink: 0;
}

.booking-tutor-info {
  flex: 1;
  min-width: 0;
}

.booking-tutor-info h2 {
  margin: 0 0 0.25rem;
  font-size: 1.15rem;
  color: var(--ink-soft);
}

.booking-tutor-info p {
  margin: 0;
  color: var(--ink-muted);
  font-size: 0.9rem;
}

.booking-tutor-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem;
  margin-top: 0.5rem;
}

.booking-tutor-tag {
  display: inline-flex;
  padding: 0.2rem 0.5rem;
  font-size: 0.75rem;
  border-radius: 6px;
  background: rgba(255, 231, 10, 0.15);
  color: #7c6034;
  border: 1px solid rgba(255, 231, 10, 0.3);
  font-weight: 600;
}

.booking-tutor-tag--lang {
  background: rgba(82, 240, 196, 0.12);
  color: #3d6b52;
  border-color: rgba(82, 240, 196, 0.3);
}

/* =========================================
   Section Headers
   ========================================= */
.booking-section {
  margin-bottom: 2rem;
}

.booking-section-title {
  margin: 0 0 0.25rem;
  font-size: 1rem;
  font-weight: 700;
  color: var(--ink-soft);
}

.booking-section-subtitle {
  margin: 0 0 1rem;
  font-size: 0.875rem;
  color: var(--ink-muted);
}

/* =========================================
   Plan Selection Cards
   ========================================= */
.plan-options {
  display: grid;
  gap: 1rem;
}

.plan-card {
  position: relative;
  padding: 1.25rem 1.5rem;
  background: var(--booking-card);
  border: 2px solid var(--booking-stroke);
  border-radius: 16px;
  cursor: pointer;
  box-shadow: 0 4px 16px rgba(57, 39, 20, 0.06);
  transition: border-color 0.2s ease, box-shadow 0.2s ease, transform 0.15s ease;
}

.plan-card:hover {
  border-color: var(--booking-stroke-hover);
  box-shadow: 0 8px 24px rgba(57, 39, 20, 0.1);
}

.plan-card.selected {
  border-color: var(--booking-gold);
  background: linear-gradient(135deg, rgba(255, 245, 200, 0.5) 0%, rgba(255, 231, 10, 0.12) 100%);
  box-shadow:
    0 0 0 3px rgba(201, 162, 39, 0.25),
    0 8px 32px rgba(201, 162, 39, 0.2),
    inset 0 0 0 1px rgba(255, 231, 10, 0.3);
  transform: scale(1.01);
}

.plan-card.selected::before {
  content: '';
  position: absolute;
  left: 0;
  top: 0;
  bottom: 0;
  width: 4px;
  background: linear-gradient(180deg, #FFE156, #C9A227);
  border-radius: 16px 0 0 16px;
}

.plan-card input[type="radio"] {
  position: absolute;
  opacity: 0;
  pointer-events: none;
}

.plan-card-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  margin-bottom: 0.5rem;
}

.plan-card-title {
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.plan-card-title h3 {
  margin: 0;
  font-size: 1.1rem;
  color: var(--ink-soft);
}

.plan-card-badge {
  display: inline-flex;
  padding: 0.15rem 0.4rem;
  font-size: 0.65rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  border-radius: 4px;
  background: rgba(255, 231, 10, 0.25);
  color: #7c6034;
}

.plan-card-price {
  text-align: right;
}

.plan-card-price .price {
  font-size: 1.25rem;
  font-weight: 800;
  color: var(--booking-gold);
}

.plan-card-price .price-note {
  font-size: 0.75rem;
  color: var(--ink-muted);
}

.plan-card-price .price-original {
  font-size: 0.9rem;
  font-weight: 600;
  color: var(--ink-muted);
  text-decoration: line-through;
  opacity: 0.7;
}

.plan-card-desc {
  margin: 0;
  font-size: 0.875rem;
  color: var(--ink-muted);
  line-height: 1.5;
}

.plan-card-check {
  display: none;
}

.plan-card.selected .plan-card-check {
  display: none;
}

/* =========================================
   Monthly Configuration Panel
   ========================================= */
.config-panel {
  background: var(--booking-panel);
  border: 1px solid var(--booking-stroke);
  border-radius: 12px;
  padding: 1rem 1.25rem;
  margin-top: 1rem;
  display: none;
}

.config-panel.visible {
  display: block;
  animation: slideIn 0.25s ease;
}

@keyframes slideIn {
  from {
    opacity: 0;
    transform: translateY(-8px);
  }

  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.config-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1rem;
}

@media (max-width: 400px) {
  .config-grid {
    grid-template-columns: 1fr;
  }
}

.config-field {
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
}

.config-field label {
  font-size: 0.8rem;
  font-weight: 600;
  color: var(--ink-muted);
}

.config-field select {
  padding: 0.6rem 0.75rem;
  font-size: 0.95rem;
  background: #fff;
  border: 1px solid var(--booking-stroke);
  border-radius: 8px;
  color: var(--ink-soft);
  cursor: pointer;
  transition: border-color 0.2s ease;
}

.config-field select:hover,
.config-field select:focus {
  border-color: var(--booking-gold);
  outline: none;
}

.config-summary {
  margin-top: 1rem;
  padding: 0.75rem 1rem;
  background: rgba(255, 231, 10, 0.08);
  border: 1px solid rgba(255, 231, 10, 0.25);
  border-radius: 8px;
}

.config-summary-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 0.3rem 0;
}

.config-summary-row:not(:last-child) {
  border-bottom: 1px solid rgba(199, 173, 132, 0.15);
}

.config-summary-label {
  color: var(--ink-muted);
  font-size: 0.85rem;
}

.config-summary-value {
  font-weight: 700;
  color: var(--ink-soft);
  font-size: 0.95rem;
}

.config-summary-value.price {
  color: var(--booking-gold);
  font-size: 1.1rem;
}

.config-summary-value .discount {
  font-size: 0.7rem;
  color: #7c6034;
  margin-left: 0.4rem;
  background: rgba(255, 231, 10, 0.25);
  padding: 0.1rem 0.35rem;
  border-radius: 4px;
  font-weight: 600;
}

/* =========================================
   Schedule Preference
   ========================================= */
.schedule-options {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
}

.schedule-option {
  position: relative;
}

.schedule-option input {
  position: absolute;
  opacity: 0;
  pointer-events: none;
}

.schedule-option label {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  padding: 0.5rem 0.85rem;
  font-size: 0.85rem;
  background: #fff;
  border: 1px solid var(--booking-stroke);
  border-radius: 8px;
  cursor: pointer;
  transition: all 0.15s ease;
  color: var(--ink-soft);
}

.schedule-option input:checked+label {
  background: rgba(255, 231, 10, 0.15);
  border-color: var(--booking-gold);
  color: #7c6034;
}

.schedule-option label:hover {
  border-color: var(--booking-stroke-hover);
}

/* =========================================
   CTA Section
   ========================================= */
.booking-cta-section {
  padding: 1.25rem 1.5rem;
  background: var(--booking-card);
  border: 1px solid var(--booking-stroke);
  border-radius: 16px;
  box-shadow: 0 8px 24px rgba(57, 39, 20, 0.08);
}

.booking-cta-btn {
  width: 100%;
  padding: 0.875rem 1.5rem;
  font-size: 1rem;
  font-weight: 700;
  border: none;
  border-radius: 10px;
  background: linear-gradient(135deg, #FFE156 0%, #C9A227 100%);
  color: #1a120a;
  cursor: pointer;
  transition: all 0.2s ease;
  box-shadow: 0 6px 20px rgba(201, 162, 39, 0.3);
}

.booking-cta-btn:hover:not(:disabled) {
  transform: translateY(-1px);
  box-shadow: 0 8px 24px rgba(201, 162, 39, 0.4);
}

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

/* =========================================
   Trust Section
   ========================================= */
.booking-trust {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 0.75rem 1rem;
  margin-top: 1rem;
  padding-top: 1rem;
  border-top: 1px solid var(--booking-stroke);
}

.booking-trust-item {
  display: flex;
  align-items: center;
  gap: 0.3rem;
  font-size: 0.8rem;
  color: var(--ink-muted);
}

.booking-trust-item span:first-child {
  color: var(--booking-gold);
  font-weight: 700;
}

/* =========================================
   Login Modal
   ========================================= */
.booking-modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.5);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 1000;
  padding: 1rem;
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.25s ease, visibility 0.25s ease;
}

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

.booking-modal {
  background: linear-gradient(180deg, #fff 0%, #f8f3e7 100%);
  border: 1px solid var(--booking-stroke);
  border-radius: 20px;
  padding: 2rem;
  max-width: 360px;
  width: 100%;
  text-align: center;
  transform: scale(0.95);
  transition: transform 0.25s ease;
  box-shadow: 0 24px 60px rgba(57, 39, 20, 0.2);
}

.booking-modal-overlay.visible .booking-modal {
  transform: scale(1);
}

.booking-modal h3 {
  margin: 0 0 0.5rem;
  font-size: 1.2rem;
  color: var(--ink-soft);
}

.booking-modal p {
  margin: 0 0 1.25rem;
  color: var(--ink-muted);
  font-size: 0.9rem;
  line-height: 1.5;
}

.booking-modal-actions {
  display: flex;
  flex-direction: column;
  gap: 0.6rem;
}

.booking-modal .btn {
  width: 100%;
}

.booking-modal-close {
  margin-top: 0.75rem;
  background: none;
  border: none;
  color: var(--ink-muted);
  cursor: pointer;
  font-size: 0.85rem;
}

.booking-modal-close:hover {
  color: var(--ink-soft);
}

/* =========================================
   Confirmation State
   ========================================= */
.booking-confirmation {
  text-align: center;
  padding: 2.5rem 1.5rem;
  background: var(--booking-card);
  border: 1px solid var(--booking-stroke);
  border-radius: 20px;
  box-shadow: 0 12px 40px rgba(57, 39, 20, 0.1);
}

.booking-confirmation-icon {
  width: 64px;
  height: 64px;
  margin: 0 auto 1.25rem;
  border-radius: 50%;
  background: linear-gradient(135deg, rgba(255, 231, 10, 0.25), rgba(201, 162, 39, 0.15));
  border: 2px solid var(--booking-gold);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.75rem;
  color: var(--booking-gold);
}

.booking-confirmation h2 {
  margin: 0 0 0.5rem;
  font-size: 1.3rem;
  color: var(--ink-soft);
}

.booking-confirmation p {
  margin: 0 0 1.25rem;
  color: var(--ink-muted);
  font-size: 0.9rem;
  line-height: 1.5;
  max-width: 360px;
  margin-left: auto;
  margin-right: auto;
}

.booking-confirmation-details {
  background: var(--booking-panel);
  border: 1px solid var(--booking-stroke);
  border-radius: 12px;
  padding: 0.875rem 1rem;
  margin: 1.25rem 0;
  text-align: left;
}

.booking-confirmation-row {
  display: flex;
  justify-content: space-between;
  padding: 0.4rem 0;
  color: var(--ink-muted);
  font-size: 0.9rem;
}

.booking-confirmation-row strong {
  color: var(--ink-soft);
}

.booking-confirmation-row:not(:last-child) {
  border-bottom: 1px solid var(--booking-stroke);
}

/* Auth error */
.auth-error {
  margin-bottom: 1.5rem;
  padding: 0.875rem 1rem;
  border-radius: 10px;
  background: rgba(200, 80, 80, 0.08);
  border: 1px solid rgba(200, 80, 80, 0.2);
  color: #8a4040;
  font-size: 0.9rem;
}

/* =========================================
   Responsive
   ========================================= */
@media (max-width: 500px) {
  .booking-tutor-card {
    flex-direction: column;
    text-align: center;
    padding: 1.25rem;
  }

  .booking-tutor-meta {
    justify-content: center;
  }

  .plan-card-header {
    flex-direction: column;
    align-items: flex-start;
    gap: 0.5rem;
  }

  .plan-card-price {
    text-align: left;
  }

  .plan-card-check {
    top: 0.75rem;
    right: 0.75rem;
  }

  .schedule-options {
    justify-content: center;
  }
}