/* ============================================================
   FIXEO V7 — RESERVATION MODULE — CSS
   Centralized Reservation & Booking Modal Styles
   Compatible with existing Fixeo design system
   ============================================================ */

/* ── BACKDROP ─────────────────────────────────────────────── */
.fixeo-res-backdrop {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.75);
  backdrop-filter: blur(6px);
  -webkit-backdrop-filter: blur(6px);
  z-index: 2998;
  animation: fixeoResBackdropIn .25s ease;
}

.fixeo-res-backdrop.open {
  display: block;
}

@keyframes fixeoResBackdropIn {
  from { opacity: 0; }
  to   { opacity: 1; }
}

/* ── MODAL WRAPPER ────────────────────────────────────────── */
#fixeo-reservation-modal {
  display: none;
  position: fixed;
  inset: 0;
  z-index: 2999;
  overflow-y: auto;
  padding: 1.5rem 1rem;
  /* Center the dialog */
  display: none;
  align-items: flex-start;
  justify-content: center;
}

#fixeo-reservation-modal.open {
  display: flex;
}

/* ── DIALOG BOX ───────────────────────────────────────────── */
.fixeo-res-dialog {
  background: linear-gradient(160deg, #1a1a2e 0%, #16213e 50%, #0f3460 100%);
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 20px;
  width: 100%;
  max-width: 560px;
  box-shadow: 0 25px 80px rgba(0, 0, 0, 0.7), 0 0 0 1px rgba(255,255,255,0.05);
  animation: fixeoResDialogIn .3s cubic-bezier(0.34, 1.56, 0.64, 1);
  overflow: hidden;
  position: relative;
  margin: auto;
}

@keyframes fixeoResDialogIn {
  from { opacity: 0; transform: scale(0.92) translateY(-20px); }
  to   { opacity: 1; transform: scale(1) translateY(0); }
}

/* ── HEADER ───────────────────────────────────────────────── */
.fixeo-res-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 20px 24px 16px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
  background: linear-gradient(135deg, rgba(225,48,108,.12) 0%, rgba(131,58,180,.08) 100%);
}

.fixeo-res-header-left {
  display: flex;
  align-items: center;
  gap: 12px;
}

.fixeo-res-header-icon {
  width: 44px;
  height: 44px;
  border-radius: 12px;
  background: var(--grad-primary, linear-gradient(135deg,#E1306C,#833AB4));
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.3rem;
  flex-shrink: 0;
  box-shadow: 0 4px 15px rgba(225,48,108,.35);
}

.fixeo-res-header-title {
  font-size: 1.05rem;
  font-weight: 800;
  color: #fff;
  line-height: 1.2;
}

.fixeo-res-header-sub {
  font-size: .72rem;
  color: rgba(255,255,255,.5);
  margin-top: 2px;
}

.fixeo-res-close {
  background: rgba(255,255,255,.07);
  border: 1px solid rgba(255,255,255,.12);
  color: rgba(255,255,255,.7);
  border-radius: 50%;
  width: 34px;
  height: 34px;
  cursor: pointer;
  font-size: .9rem;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all .2s;
  flex-shrink: 0;
}

.fixeo-res-close:hover {
  background: rgba(225,48,108,.25);
  color: #fff;
  border-color: rgba(225,48,108,.4);
}

/* ── STEPS INDICATOR ──────────────────────────────────────── */
.fixeo-res-steps {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0;
  padding: 14px 24px 10px;
}

.fixeo-res-step {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
}

.fixeo-res-step-dot {
  width: 28px;
  height: 28px;
  border-radius: 50%;
  border: 2px solid rgba(255,255,255,.18);
  background: rgba(255,255,255,.06);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: .72rem;
  font-weight: 800;
  color: rgba(255,255,255,.4);
  transition: all .3s;
}

.fixeo-res-step-dot.active {
  background: var(--grad-primary, linear-gradient(135deg,#E1306C,#833AB4));
  border-color: transparent;
  color: #fff;
  box-shadow: 0 0 14px rgba(225,48,108,.45);
}

.fixeo-res-step-dot.completed {
  background: linear-gradient(135deg, #20c997, #0dcaf0);
  border-color: transparent;
  color: #fff;
}

.fixeo-res-step-label {
  font-size: .65rem;
  color: rgba(255,255,255,.4);
  font-weight: 600;
}

.fixeo-res-step.active .fixeo-res-step-label,
.fixeo-res-step.completed .fixeo-res-step-label {
  color: rgba(255,255,255,.75);
}

.fixeo-res-step-line {
  flex: 1;
  height: 2px;
  background: rgba(255,255,255,.1);
  max-width: 60px;
  margin: 0 6px;
  margin-bottom: 14px;
  transition: background .3s;
}

.fixeo-res-step-line.active {
  background: linear-gradient(90deg, #20c997, #E1306C);
}

/* ── BODY ─────────────────────────────────────────────────── */
.fixeo-res-body {
  padding: 20px 24px 24px;
}

/* ── ARTISAN CARD ─────────────────────────────────────────── */
.fixeo-res-artisan-card {
  display: flex;
  align-items: flex-start;
  gap: 14px;
  background: rgba(255,255,255,.05);
  border: 1px solid rgba(255,255,255,.1);
  border-radius: 16px;
  padding: 14px 16px;
  margin-bottom: 20px;
}

.fixeo-res-artisan-avatar {
  width: 52px;
  height: 52px;
  border-radius: 50%;
  background: var(--grad-primary, linear-gradient(135deg,#E1306C,#833AB4));
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.1rem;
  font-weight: 800;
  color: #fff;
  flex-shrink: 0;
  box-shadow: 0 4px 15px rgba(225,48,108,.3);
}

.fixeo-res-artisan-info {
  flex: 1;
  min-width: 0;
}

.fixeo-res-artisan-name {
  font-size: 1rem;
  font-weight: 800;
  color: #fff;
  margin-bottom: 3px;
}

.fixeo-res-artisan-meta {
  font-size: .72rem;
  color: rgba(255,255,255,.55);
  margin-bottom: 5px;
}

.fixeo-res-artisan-row {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 6px;
  margin-bottom: 6px;
}

.fixeo-res-stars {
  color: #FCAF45;
  font-size: .85rem;
  letter-spacing: 1px;
}

.fixeo-res-stars.small { font-size: .7rem; }

.fixeo-res-rating {
  font-size: .82rem;
  font-weight: 800;
  color: #FCAF45;
}

.fixeo-res-reviews {
  font-size: .72rem;
  color: rgba(255,255,255,.45);
}

.fixeo-res-avail {
  font-size: .68rem;
  font-weight: 700;
  padding: 2px 8px;
  border-radius: 20px;
}

.fixeo-res-avail.available {
  color: #20c997;
  background: rgba(32,201,151,.12);
}

.fixeo-res-avail.busy {
  color: #ffa502;
  background: rgba(255,165,2,.12);
}

.fixeo-res-avail.small {
  font-size: .62rem;
  padding: 1px 6px;
}

.fixeo-res-badges {
  display: flex;
  flex-wrap: wrap;
  gap: 4px;
}

.fixeo-res-badge {
  font-size: .6rem;
  font-weight: 700;
  padding: 2px 8px;
  border-radius: 20px;
  background: rgba(255,255,255,.08);
  border: 1px solid rgba(255,255,255,.1);
  color: rgba(255,255,255,.75);
  white-space: nowrap;
}

.fixeo-res-artisan-price {
  text-align: right;
  flex-shrink: 0;
}

.fixeo-res-price-val {
  font-size: 1.1rem;
  font-weight: 800;
  background: var(--ig-gradient-short, linear-gradient(135deg,#405DE6,#E1306C,#F77737));
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  line-height: 1.1;
}

.fixeo-res-price-unit {
  font-size: .68rem;
  color: rgba(255,255,255,.45);
  margin-top: 2px;
}

/* ── EXPRESS BANNER ───────────────────────────────────────── */
.fixeo-res-express-banner {
  display: flex;
  align-items: center;
  gap: 12px;
  background: linear-gradient(135deg, rgba(255,107,53,.12) 0%, rgba(255,165,2,.08) 100%);
  border: 1px solid rgba(255,107,53,.3);
  border-radius: 12px;
  padding: 12px 16px;
  margin-bottom: 18px;
}

.fixeo-res-express-icon {
  font-size: 1.6rem;
  flex-shrink: 0;
}

.fixeo-res-express-title {
  font-size: .9rem;
  font-weight: 800;
  color: #FF6B35;
}

.fixeo-res-express-sub {
  font-size: .72rem;
  color: rgba(255,255,255,.55);
  margin-top: 2px;
}

/* ── FORM FIELDS ──────────────────────────────────────────── */
.fixeo-res-field {
  margin-bottom: 16px;
}

.fixeo-res-label {
  display: block;
  font-size: .78rem;
  font-weight: 700;
  color: rgba(255,255,255,.75);
  margin-bottom: 7px;
  letter-spacing: .3px;
}

.fixeo-res-input,
.fixeo-res-select,
.fixeo-res-textarea {
  width: 100%;
  background: rgba(255,255,255,.06);
  border: 1.5px solid rgba(255,255,255,.12);
  border-radius: 12px;
  padding: 11px 14px;
  font-size: .88rem;
  color: #fff;
  font-family: var(--font-main, 'Cairo', sans-serif);
  transition: border-color .2s, box-shadow .2s;
  outline: none;
  box-sizing: border-box;
  appearance: none;
  -webkit-appearance: none;
}

.fixeo-res-select {
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8' viewBox='0 0 12 8'%3E%3Cpath d='M1 1l5 5 5-5' stroke='rgba(255,255,255,0.4)' stroke-width='1.5' fill='none' stroke-linecap='round'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 12px center;
  padding-right: 36px;
}

.fixeo-res-input:focus,
.fixeo-res-select:focus,
.fixeo-res-textarea:focus {
  border-color: #E1306C;
  box-shadow: 0 0 0 3px rgba(225,48,108,.15);
}

.fixeo-res-input::placeholder,
.fixeo-res-textarea::placeholder {
  color: rgba(255,255,255,.3);
}

/* Fix date input color in WebKit */
.fixeo-res-input[type="date"]::-webkit-calendar-picker-indicator {
  filter: invert(1) opacity(0.5);
  cursor: pointer;
}

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

/* ── TIME SLOTS ───────────────────────────────────────────── */
.fixeo-res-slot-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 8px;
}

.fixeo-res-slot {
  background: rgba(255,255,255,.05);
  border: 1.5px solid rgba(255,255,255,.1);
  border-radius: 10px;
  padding: 10px 8px;
  text-align: center;
  font-size: .75rem;
  font-weight: 700;
  color: rgba(255,255,255,.6);
  cursor: pointer;
  transition: all .2s;
  user-select: none;
}

.fixeo-res-slot:hover {
  background: rgba(225,48,108,.1);
  border-color: rgba(225,48,108,.3);
  color: #fff;
}

.fixeo-res-slot.active {
  background: linear-gradient(135deg, rgba(225,48,108,.25), rgba(131,58,180,.2));
  border-color: #E1306C;
  color: #fff;
  box-shadow: 0 0 12px rgba(225,48,108,.2);
}

/* ── PRICE INFO ───────────────────────────────────────────── */
.fixeo-res-price-info {
  background: rgba(32,201,151,.07);
  border: 1px solid rgba(32,201,151,.18);
  border-radius: 10px;
  padding: 10px 14px;
  margin-bottom: 16px;
  font-size: .78rem;
  color: rgba(255,255,255,.65);
  line-height: 1.5;
}

/* ── ERROR ────────────────────────────────────────────────── */
.fixeo-res-error {
  background: rgba(255,71,87,.1);
  border: 1px solid rgba(255,71,87,.3);
  border-radius: 10px;
  padding: 10px 14px;
  font-size: .8rem;
  color: #ff6b6b;
  margin-bottom: 14px;
  animation: fixeoResShake .3s ease;
}

@keyframes fixeoResShake {
  0%, 100% { transform: translateX(0); }
  25% { transform: translateX(-4px); }
  75% { transform: translateX(4px); }
}

/* ── BUTTONS ──────────────────────────────────────────────── */
.fixeo-res-btn-primary {
  width: 100%;
  padding: 14px;
  background: var(--grad-primary, linear-gradient(135deg,#E1306C,#833AB4));
  border: none;
  border-radius: 14px;
  color: #fff;
  font-size: .95rem;
  font-weight: 800;
  cursor: pointer;
  transition: all .25s;
  font-family: var(--font-main, 'Cairo', sans-serif);
  letter-spacing: .3px;
  box-shadow: 0 4px 20px rgba(225,48,108,.35);
}

.fixeo-res-btn-primary:hover {
  transform: translateY(-1px);
  box-shadow: 0 8px 28px rgba(225,48,108,.5);
  filter: brightness(1.08);
}

.fixeo-res-btn-primary:active {
  transform: translateY(0);
}

.fixeo-res-btn-pay {
  background: linear-gradient(135deg, #20c997 0%, #0dcaf0 100%);
  box-shadow: 0 4px 20px rgba(32,201,151,.35);
}

.fixeo-res-btn-pay:hover {
  box-shadow: 0 8px 28px rgba(32,201,151,.5);
}

.fixeo-res-btn-secondary {
  flex: 0 0 auto;
  padding: 12px 20px;
  background: rgba(255,255,255,.07);
  border: 1.5px solid rgba(255,255,255,.15);
  border-radius: 12px;
  color: rgba(255,255,255,.8);
  font-size: .88rem;
  font-weight: 700;
  cursor: pointer;
  transition: all .2s;
  font-family: var(--font-main, 'Cairo', sans-serif);
}

.fixeo-res-btn-secondary:hover {
  background: rgba(255,255,255,.12);
  border-color: rgba(255,255,255,.25);
  color: #fff;
}

/* ── SUMMARY TABLE (Step 2) ───────────────────────────────── */
.fixeo-res-summary {
  background: rgba(255,255,255,.04);
  border: 1px solid rgba(255,255,255,.1);
  border-radius: 16px;
  overflow: hidden;
  margin-bottom: 18px;
}

.fixeo-res-summary-row {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  padding: 10px 16px;
  border-bottom: 1px solid rgba(255,255,255,.06);
  font-size: .82rem;
}

.fixeo-res-summary-row:last-child {
  border-bottom: none;
}

.fixeo-res-summary-label {
  color: rgba(255,255,255,.55);
  flex: 0 0 45%;
}

.fixeo-res-summary-val {
  color: rgba(255,255,255,.9);
  font-weight: 600;
  text-align: right;
  flex: 1;
}

.fixeo-res-summary-total {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 14px 16px;
  background: linear-gradient(135deg, rgba(225,48,108,.1), rgba(131,58,180,.08));
  border-top: 1px solid rgba(225,48,108,.2);
  font-size: .9rem;
  font-weight: 800;
  color: #fff;
}

.fixeo-res-total-amount {
  font-size: 1.2rem;
  font-weight: 900;
  background: var(--ig-gradient-short, linear-gradient(135deg,#E1306C,#F77737));
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

/* ── TRUST ROW ────────────────────────────────────────────── */
.fixeo-res-trust-row {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  margin-bottom: 18px;
}

.fixeo-res-trust-item {
  flex: 1;
  min-width: 90px;
  display: flex;
  align-items: center;
  gap: 5px;
  background: rgba(32,201,151,.06);
  border: 1px solid rgba(32,201,151,.15);
  border-radius: 10px;
  padding: 8px 10px;
  font-size: .7rem;
  color: rgba(255,255,255,.65);
  font-weight: 600;
}

.fixeo-res-trust-icon {
  font-size: .9rem;
}

/* ── ACTIONS ROW (Step 2) ─────────────────────────────────── */
.fixeo-res-actions {
  display: flex;
  gap: 10px;
  align-items: stretch;
}

.fixeo-res-actions .fixeo-res-btn-primary {
  flex: 1;
}

/* ── FOOTER ───────────────────────────────────────────────── */
.fixeo-res-footer {
  padding: 10px 24px 14px;
  border-top: 1px solid rgba(255,255,255,.06);
}

.fixeo-res-security {
  display: flex;
  justify-content: center;
  gap: 16px;
  flex-wrap: wrap;
}

.fixeo-res-security span {
  font-size: .65rem;
  color: rgba(255,255,255,.35);
  font-weight: 600;
  white-space: nowrap;
}

/* ── ARTISAN PICKER GRID ──────────────────────────────────── */
.fixeo-res-picker-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 10px;
}

.fixeo-res-picker-card {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  background: rgba(255,255,255,.05);
  border: 1.5px solid rgba(255,255,255,.1);
  border-radius: 14px;
  padding: 12px;
  cursor: pointer;
  transition: all .2s;
}

.fixeo-res-picker-card:hover {
  background: rgba(225,48,108,.1);
  border-color: rgba(225,48,108,.3);
  transform: translateY(-1px);
}

.fixeo-res-picker-avatar {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  background: var(--grad-primary, linear-gradient(135deg,#E1306C,#833AB4));
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: .8rem;
  font-weight: 800;
  color: #fff;
  flex-shrink: 0;
}

.fixeo-res-picker-info { flex: 1; min-width: 0; }

.fixeo-res-picker-name {
  font-size: .82rem;
  font-weight: 800;
  color: #fff;
  margin-bottom: 2px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.fixeo-res-picker-cat {
  font-size: .68rem;
  color: rgba(255,255,255,.5);
  margin-bottom: 4px;
}

.fixeo-res-picker-meta {
  display: flex;
  align-items: center;
  gap: 4px;
  margin-bottom: 3px;
}

.fixeo-res-picker-meta span {
  font-size: .68rem;
  color: rgba(255,255,255,.6);
}

.fixeo-res-picker-price {
  font-size: .72rem;
  font-weight: 800;
  color: #E1306C;
}

/* ── SELECT OPTION STYLES ─────────────────────────────────── */
.fixeo-res-select option {
  background: #1a1a2e;
  color: #fff;
}

/* ══════════════════════════════════════════════════════════
   RESPONSIVE
══════════════════════════════════════════════════════════ */
@media (max-width: 600px) {
  #fixeo-reservation-modal {
    padding: .5rem .5rem 1rem;
    align-items: flex-start;
  }

  .fixeo-res-dialog {
    border-radius: 18px 18px 16px 16px;
    max-width: 100%;
  }

  .fixeo-res-header {
    padding: 16px 18px 12px;
  }

  .fixeo-res-body {
    padding: 16px 18px 18px;
  }

  .fixeo-res-footer {
    padding: 8px 18px 12px;
  }

  .fixeo-res-slot-grid {
    grid-template-columns: 1fr;
  }

  .fixeo-res-artisan-card {
    flex-wrap: wrap;
  }

  .fixeo-res-artisan-price {
    order: -1;
    width: 100%;
    text-align: left;
    padding-bottom: 8px;
    margin-bottom: 8px;
    border-bottom: 1px solid rgba(255,255,255,.07);
    display: flex;
    align-items: center;
    gap: 6px;
  }

  .fixeo-res-picker-grid {
    grid-template-columns: 1fr;
  }

  .fixeo-res-actions {
    flex-direction: column-reverse;
  }

  .fixeo-res-trust-row {
    gap: 6px;
  }

  .fixeo-res-trust-item {
    min-width: 80px;
    font-size: .65rem;
  }

  .fixeo-res-security {
    gap: 8px;
  }

  .fixeo-res-btn-secondary {
    width: 100%;
    text-align: center;
  }

  .fixeo-res-summary-row {
    flex-direction: column;
    gap: 2px;
  }

  .fixeo-res-summary-val {
    text-align: left;
    font-size: .78rem;
  }
}

@media (max-width: 400px) {
  .fixeo-res-header-title {
    font-size: .92rem;
  }
  .fixeo-res-artisan-name {
    font-size: .88rem;
  }
}

/* ── Dark input placeholders ──────────────────────────────── */
@media (prefers-color-scheme: dark) {
  .fixeo-res-input[type="date"]::-webkit-calendar-picker-indicator {
    filter: invert(1) opacity(0.4);
  }
}

/* ══════════════════════════════════════════════════════
   V7 — RESERVE BUTTON ACTIVATION STYLES
   Applied to all "Réserver" buttons on artisan cards
   ══════════════════════════════════════════════════════ */

/* Profile card & grid card Reserve button */
.fixeo-reserve-btn {
  position: relative;
  overflow: hidden;
  transition: transform 0.15s ease, box-shadow 0.15s ease, opacity 0.15s ease !important;
}

.fixeo-reserve-btn:hover {
  transform: translateY(-1px) scale(1.02) !important;
  box-shadow: 0 4px 16px rgba(225, 48, 108, 0.45) !important;
}

.fixeo-reserve-btn:active {
  transform: scale(0.96) !important;
  opacity: 0.9 !important;
}

/* Ripple effect on click */
.fixeo-reserve-btn::after {
  content: '';
  position: absolute;
  inset: 0;
  background: rgba(255, 255, 255, 0.18);
  opacity: 0;
  border-radius: inherit;
  transition: opacity 0.3s ease;
  pointer-events: none;
}
.fixeo-reserve-btn:active::after {
  opacity: 1;
}

/* Loading state */
.fixeo-reserve-btn.loading {
  pointer-events: none;
  opacity: 0.7;
}
.fixeo-reserve-btn.loading::before {
  content: '';
  position: absolute;
  width: 14px;
  height: 14px;
  border: 2px solid rgba(255,255,255,0.4);
  border-top-color: #fff;
  border-radius: 50%;
  animation: fixeo-spin 0.6s linear infinite;
  margin-right: 6px;
}

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

/* Artisan modal Reserve button */
#artisan-modal .btn-primary {
  transition: transform 0.15s ease, box-shadow 0.15s ease !important;
}
#artisan-modal .btn-primary:hover {
  transform: translateY(-1px) !important;
  box-shadow: 0 4px 16px rgba(225, 48, 108, 0.4) !important;
}
#artisan-modal .btn-primary:active {
  transform: scale(0.97) !important;
}

/* Map popup Reserve button */
.leaflet-popup-content button {
  transition: transform 0.15s ease, opacity 0.15s ease;
}
.leaflet-popup-content button:hover {
  transform: translateY(-1px) !important;
  opacity: 0.92;
}
.leaflet-popup-content button:active {
  transform: scale(0.97) !important;
}

/* Smart search dropdown Reserve button */
.ssb-art-btn-reserve {
  transition: transform 0.15s ease, box-shadow 0.15s ease !important;
}
.ssb-art-btn-reserve:hover {
  transform: translateY(-1px) scale(1.02) !important;
  box-shadow: 0 3px 12px rgba(225, 48, 108, 0.4) !important;
}
.ssb-art-btn-reserve:active {
  transform: scale(0.96) !important;
}

/* Mobile responsiveness */
@media (max-width: 480px) {
  .fixeo-reserve-btn {
    padding: .35rem .7rem !important;
    font-size: .72rem !important;
  }
}
