/* ═══════════════════════════════════════════════════════════
   BOOKING CALENDAR — Cal.com style
   3D glassmorphism card, dark premium theme
═══════════════════════════════════════════════════════════ */

/* ── Section wrapper ─────────────────────────────────────── */
#buchen {
  background: var(--bg-2);
  border-top: 1px solid var(--border);
  border-bottom: 1px solid var(--border);
}

.buchen-header {
  text-align: center;
  margin-bottom: 52px;
}
.buchen-header .section-sub {
  max-width: 420px;
  margin: 10px auto 0;
}

/* ── 3D Tilt card container ──────────────────────────────── */
.cal-scene {
  perspective: 1200px;
  width: 100%;
  max-width: 980px;
  margin: 0 auto;
}

.cal-card {
  background: #020B26;
  border: 1px solid rgba(255,255,255,0.09);
  border-radius: 22px;
  display: grid;
  grid-template-columns: 240px 1fr auto;
  min-height: 460px;
  overflow: hidden;
  box-shadow:
    0 0 0 0.5px rgba(255,255,255,0.06),
    0 24px 80px rgba(0,0,0,0.7),
    0 4px 20px rgba(0,0,0,0.5);
  transform-style: preserve-3d;
  transition:
    transform 0.12s ease-out,
    box-shadow 0.12s ease-out;
  will-change: transform;
  position: relative;
}

/* Subtle rainbow shimmer on hover */
.cal-card::before {
  content: '';
  position: absolute;
  inset: 0;
  border-radius: 22px;
  background: linear-gradient(
    135deg,
    rgba(166,133,93,0.07) 0%,
    transparent 40%,
    rgba(166,133,93,0.04) 100%
  );
  pointer-events: none;
  z-index: 1;
  opacity: 0;
  transition: opacity 0.3s ease;
}
.cal-card:hover::before { opacity: 1; }


/* ── LEFT PANEL — Barber info ────────────────────────────── */
.cal-info {
  padding: 32px 28px;
  border-right: 1px solid rgba(255,255,255,0.07);
  display: flex;
  flex-direction: column;
  gap: 0;
  position: relative;
  z-index: 2;
}

.cal-avatar {
  width: 52px;
  height: 52px;
  border-radius: 50%;
  background: var(--bg-3);
  border: 2px solid var(--accent);
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 800;
  font-size: 1.1rem;
  color: var(--accent);
  letter-spacing: 0.02em;
  margin-bottom: 18px;
  overflow: hidden;
  flex-shrink: 0;
}
.cal-avatar img { width: 100%; height: 100%; object-fit: cover; }

.cal-profession {
  font-size: 0.64rem;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  color: var(--text-muted);
  margin-bottom: 6px;
}

.cal-name {
  font-weight: 800;
  font-size: 1.15rem;
  color: var(--text);
  line-height: 1.2;
  margin-bottom: 10px;
}

.cal-desc {
  font-size: 0.82rem;
  color: var(--text-muted);
  line-height: 1.6;
  margin-bottom: 24px;
}

.cal-meta {
  margin-top: auto;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.cal-meta-row {
  display: flex;
  align-items: center;
  gap: 9px;
  font-size: 0.79rem;
  color: var(--text-muted);
}
.cal-meta-row svg {
  width: 14px;
  height: 14px;
  flex-shrink: 0;
  color: var(--accent);
}

/* Service selector in meta */
.cal-service-select {
  background: rgba(255,255,255,0.05);
  border: 1px solid rgba(255,255,255,0.09);
  border-radius: 8px;
  color: var(--text-muted);
  font-family: var(--font-sans);
  font-size: 0.75rem;
  padding: 6px 26px 6px 10px;
  appearance: none;
  -webkit-appearance: none;
  cursor: pointer;
  width: 100%;
  outline: none;
  transition: border-color 0.2s, color 0.2s;
  margin-top: 8px;
}
.cal-service-select:focus {
  border-color: var(--accent);
  color: var(--text);
}

.cal-service-wrap {
  position: relative;
}
.cal-service-wrap svg.sel-arrow {
  position: absolute;
  right: 8px;
  top: 50%;
  transform: translateY(-50%);
  width: 12px;
  height: 12px;
  pointer-events: none;
  color: var(--text-muted);
}


/* ── CENTRE PANEL — Calendar ─────────────────────────────── */
.cal-calendar {
  padding: 28px 24px;
  display: flex;
  flex-direction: column;
  gap: 18px;
  position: relative;
  z-index: 2;
  min-width: 320px;
}

/* Month nav */
.cal-month-nav {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 4px;
}

.cal-month-label {
  font-size: 0.95rem;
  font-weight: 600;
  color: var(--text);
}
.cal-month-label span {
  color: var(--text-muted);
  font-weight: 400;
  margin-left: 5px;
}

.cal-nav-btn {
  width: 30px;
  height: 30px;
  border: 1px solid rgba(255,255,255,0.1);
  border-radius: 8px;
  background: transparent;
  color: var(--text-muted);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: border-color 0.2s, color 0.2s, background 0.2s;
}
.cal-nav-btn:hover {
  border-color: var(--accent);
  color: var(--accent);
  background: rgba(166,133,93,0.12);
}
.cal-nav-btn svg { width: 14px; height: 14px; }

/* Day header row */
.cal-days-header {
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  text-align: center;
}
.cal-day-label {
  font-size: 0.62rem;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--text-muted);
  padding-bottom: 8px;
  font-weight: 600;
}

/* Date grid */
.cal-grid {
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  gap: 3px;
}

.cal-date-cell {
  aspect-ratio: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.82rem;
  border-radius: 9px;
  cursor: default;
  color: var(--text-muted);
  transition: background 0.15s, color 0.15s, transform 0.15s;
  position: relative;
  font-weight: 400;
}

/* Empty spacer cells */
.cal-date-cell.empty { pointer-events: none; }

/* Past / unavailable dates */
.cal-date-cell.unavailable {
  opacity: 0.22;
  cursor: not-allowed;
}

/* Available dates */
.cal-date-cell.available {
  color: var(--text);
  cursor: pointer;
  font-weight: 500;
  background: rgba(255,255,255,0.04);
}
.cal-date-cell.available:hover {
  background: rgba(166,133,93,0.2);
  color: var(--accent);
  transform: scale(1.08);
}

/* Selected date */
.cal-date-cell.selected {
  background: var(--accent);
  color: #020B26;
  font-weight: 700;
  transform: scale(1.1);
  box-shadow: 0 4px 16px rgba(166,133,93,0.5);
}
.cal-date-cell.selected::after {
  display: none;
}

/* Today marker dot */
.cal-date-cell.today::after {
  content: '';
  position: absolute;
  bottom: 4px;
  left: 50%;
  transform: translateX(-50%);
  width: 3px;
  height: 3px;
  border-radius: 50%;
  background: var(--accent);
}
.cal-date-cell.today.selected::after { background: #020B26; }

/* Available slots count indicator */
.cal-slot-count {
  position: absolute;
  bottom: 2px;
  left: 50%;
  transform: translateX(-50%);
  font-size: 0.55rem;
  color: var(--accent);
  opacity: 0.8;
  font-weight: 600;
}
.cal-date-cell.selected .cal-slot-count {
  color: #020B26;
}


/* ── RIGHT PANEL — Time slots ────────────────────────────── */
.cal-times {
  width: 180px;
  border-left: 1px solid rgba(255,255,255,0.07);
  display: flex;
  flex-direction: column;
  position: relative;
  z-index: 2;
  overflow: hidden;
}

.cal-times-header {
  padding: 20px 16px 12px;
  border-bottom: 1px solid rgba(255,255,255,0.06);
  flex-shrink: 0;
}
.cal-times-date {
  font-size: 0.72rem;
  font-weight: 600;
  color: var(--text);
  margin-bottom: 8px;
}

/* 12h / 24h toggle */
.cal-fmt-toggle {
  display: inline-flex;
  border: 1px solid rgba(255,255,255,0.1);
  border-radius: 8px;
  overflow: hidden;
}
.cal-fmt-btn {
  padding: 4px 10px;
  font-size: 0.67rem;
  font-family: var(--font-sans);
  font-weight: 600;
  background: transparent;
  color: var(--text-muted);
  border: none;
  cursor: pointer;
  transition: background 0.15s, color 0.15s;
  letter-spacing: 0.04em;
}
.cal-fmt-btn.active {
  background: rgba(255,255,255,0.1);
  color: var(--text);
}

/* Scrollable slot list */
.cal-slots-list {
  flex: 1;
  overflow-y: auto;
  padding: 12px 12px 20px;
  display: flex;
  flex-direction: column;
  gap: 6px;
  scrollbar-width: thin;
  scrollbar-color: rgba(255,255,255,0.1) transparent;
}
.cal-slots-list::-webkit-scrollbar { width: 3px; }
.cal-slots-list::-webkit-scrollbar-thumb { background: rgba(255,255,255,0.1); border-radius: 3px; }

.cal-slot-btn {
  width: 100%;
  padding: 10px 0;
  background: rgba(255,255,255,0.04);
  border: 1px solid rgba(255,255,255,0.08);
  border-radius: 9px;
  color: var(--text);
  font-family: var(--font-sans);
  font-size: 0.82rem;
  font-weight: 500;
  cursor: pointer;
  transition: background 0.15s, border-color 0.15s, color 0.15s, transform 0.15s;
  flex-shrink: 0;
  text-align: center;
}
.cal-slot-btn:hover {
  background: rgba(166,133,93,0.15);
  border-color: var(--accent);
  color: var(--accent);
  transform: translateX(-2px);
}
.cal-slot-btn.selected {
  background: var(--accent);
  border-color: var(--accent);
  color: #F3F1ED;
  font-weight: 700;
  transform: translateX(-2px);
}

/* Empty state */
.cal-no-date {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 10px;
  padding: 24px;
  color: var(--text-muted);
  font-size: 0.75rem;
  text-align: center;
  line-height: 1.6;
  opacity: 0.7;
}
.cal-no-date svg {
  width: 28px;
  height: 28px;
  opacity: 0.4;
}


/* ── STEP 2 — Confirm form overlay ──────────────────────── */
.cal-step2 {
  position: absolute;
  inset: 0;
  background: #020B26;
  border-radius: 22px;
  z-index: 10;
  padding: 36px 40px;
  display: flex;
  flex-direction: column;
  gap: 20px;
  transform: translateX(40px);
  opacity: 0;
  pointer-events: none;
  transition: transform 0.4s cubic-bezier(0.4,0,0.2,1), opacity 0.4s ease;
}
.cal-step2.visible {
  transform: translateX(0);
  opacity: 1;
  pointer-events: all;
}

.step2-header {
  display: flex;
  align-items: flex-start;
  gap: 16px;
}
.step2-back {
  width: 34px; height: 34px;
  border: 1px solid rgba(255,255,255,0.1);
  border-radius: 9px;
  background: transparent;
  color: var(--text-muted);
  cursor: pointer;
  display: flex; align-items: center; justify-content: center;
  flex-shrink: 0;
  transition: border-color 0.2s, color 0.2s;
}
.step2-back:hover { border-color: var(--accent); color: var(--accent); }
.step2-back svg { width: 16px; height: 16px; }

.step2-summary {
  flex: 1;
}
.step2-title {
  font-weight: 700;
  font-size: 1rem;
  color: var(--text);
  margin-bottom: 4px;
}
.step2-meta {
  font-size: 0.76rem;
  color: var(--accent);
  letter-spacing: 0.04em;
}

.step2-form {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 14px;
  flex: 1;
}
.step2-form .form-group { display: flex; flex-direction: column; gap: 6px; }
.step2-form .form-group.span2 { grid-column: 1 / -1; }
.step2-form label {
  font-size: 0.68rem;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--text-muted);
  font-weight: 600;
}
.step2-form input,
.step2-form textarea {
  background: rgba(255,255,255,0.04);
  border: 1px solid rgba(255,255,255,0.09);
  border-radius: 10px;
  color: var(--text);
  font-family: var(--font-sans);
  font-size: 0.88rem;
  padding: 11px 14px;
  width: 100%;
  outline: none;
  transition: border-color 0.2s, box-shadow 0.2s;
  appearance: none;
  -webkit-appearance: none;
}
.step2-form input:focus,
.step2-form textarea:focus {
  border-color: var(--accent);
  box-shadow: 0 0 0 2px rgba(166,133,93,0.2);
}
.step2-form textarea { resize: none; height: 72px; }

.step2-submit {
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  background: var(--accent);
  color: #020B26;
  font-family: var(--font-sans);
  font-weight: 700;
  font-size: 0.84rem;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  border: none;
  border-radius: 50px;
  padding: 15px;
  cursor: pointer;
  transition: background 0.2s, transform 0.15s, box-shadow 0.2s;
  grid-column: 1 / -1;
}
.step2-submit:hover {
  background: var(--accent-2);
  transform: translateY(-1px);
  box-shadow: 0 8px 24px rgba(166,133,93,0.4);
}
.step2-submit:active { transform: translateY(0); }
.step2-submit:disabled { opacity: 0.6; cursor: not-allowed; transform: none; }

/* Step 2 success state */
.step2-success {
  display: none;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 16px;
  text-align: center;
  padding: 40px;
  height: 100%;
}
.step2-success.visible { display: flex; animation: fadeUp 0.5s ease; }
.step2-success svg { width: 56px; height: 56px; color: var(--accent); }
.step2-success h3 { font-size: 1.3rem; font-weight: 700; color: var(--text); }
.step2-success p { font-size: 0.88rem; color: var(--text-muted); max-width: 300px; line-height: 1.6; }


/* ── RESPONSIVE ──────────────────────────────────────────── */
@media (max-width: 860px) {
  .cal-card {
    grid-template-columns: 1fr;
    grid-template-rows: auto auto auto;
    min-height: unset;
  }
  .cal-info {
    border-right: none;
    border-bottom: 1px solid rgba(255,255,255,0.07);
    padding: 24px 20px;
  }
  .cal-meta { flex-direction: row; flex-wrap: wrap; gap: 12px; }
  .cal-times {
    width: 100%;
    border-left: none;
    border-top: 1px solid rgba(255,255,255,0.07);
  }
  .cal-slots-list {
    flex-direction: row;
    flex-wrap: wrap;
    max-height: 160px;
  }
  .cal-slot-btn { width: auto; padding: 9px 18px; flex: 0 0 auto; }
  .cal-slot-btn:hover { transform: translateY(-2px); }
  .cal-slot-btn.selected { transform: translateY(-2px); }
  .cal-calendar { min-width: unset; }
  .step2-form { grid-template-columns: 1fr; }
  .cal-step2 { padding: 24px 20px; }
}
