/**
 * Queens Homestay — Premium Booking Alert Styles
 *
 * Overrides the default Easy Hotel plugin alert/status box with an
 * elegant, hotel-themed design. Targets only the booking form status
 * wrappers so nothing else in the site is affected.
 *
 * Also speeds up the post-booking redirect by reducing the artificial
 * 2-second success delay (handled in booking-flow-optimizer.js).
 */

/* ─── Google Font: Cormorant Garamond for serif elegance ─── */
@import url('https://fonts.googleapis.com/css2?family=Cormorant+Garamond:wght@400;500;600&family=Inter:wght@300;400;500&display=swap');

/* ─── CSS custom properties scoped to the alert ─── */
:root {
  --qh-alert-error-bg:        #1a0a08;
  --qh-alert-error-border:    #8b2a1a;
  --qh-alert-error-accent:    #c0392b;
  --qh-alert-error-glow:      rgba(192, 57, 43, 0.18);
  --qh-alert-error-text:      #f5e6e3;
  --qh-alert-error-subtext:   #d4a89a;
  --qh-alert-success-bg:      #07130e;
  --qh-alert-success-border:  #1e6b41;
  --qh-alert-success-accent:  #27ae60;
  --qh-alert-success-glow:    rgba(39, 174, 96, 0.15);
  --qh-alert-success-text:    #e3f5ec;
  --qh-alert-success-subtext: #88c9a3;
  --qh-alert-radius:          4px;
  --qh-alert-font-body:       'Inter', sans-serif;
  --qh-alert-font-display:    'Cormorant Garamond', serif;
}

/* ─── Reset the plugin's baseline wrapper ─── */
.eshb-booking .eshb-booking-form .eshb-form-err {
  display: none;
  margin: 0;
  padding: 0;
  background: transparent;
}

/* ─── Base status panel (shared error + success) ─── */
.eshb-booking .eshb-booking-form .eshb-form-err .status {
  display: none;
  align-items: flex-start;
  gap: 14px;
  min-height: unset;
  padding: 18px 22px 18px 18px;
  border-radius: var(--qh-alert-radius);
  border-left: 3px solid transparent;
  border: 1px solid transparent;
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  animation: qhAlertSlideIn 0.35s cubic-bezier(0.16, 1, 0.3, 1) forwards;
  position: relative;
  overflow: hidden;
}

/* Entry animation */
@keyframes qhAlertSlideIn {
  from {
    opacity: 0;
    transform: translateY(-8px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

/* Shimmer line at top of alert */
.eshb-booking .eshb-booking-form .eshb-form-err .status::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 1px;
  background: linear-gradient(90deg, transparent, currentColor, transparent);
  opacity: 0.4;
}

/* ─── ERROR / Failed state ─── */
.eshb-booking .eshb-booking-form .eshb-form-err .status-failed {
  background: var(--qh-alert-error-bg);
  border-color: var(--qh-alert-error-border);
  border-left-color: var(--qh-alert-error-accent);
  box-shadow:
    0 0 0 1px var(--qh-alert-error-glow),
    0 4px 24px rgba(0,0,0,0.35),
    inset 0 0 40px rgba(139, 42, 26, 0.06);
  color: var(--qh-alert-error-text);
}

.eshb-booking .eshb-booking-form .eshb-form-err .status-failed::before {
  color: var(--qh-alert-error-accent);
}

/* ─── SUCCESS state ─── */
.eshb-booking .eshb-booking-form .eshb-form-err .status-success {
  background: var(--qh-alert-success-bg);
  border-color: var(--qh-alert-success-border);
  border-left-color: var(--qh-alert-success-accent);
  box-shadow:
    0 0 0 1px var(--qh-alert-success-glow),
    0 4px 24px rgba(0,0,0,0.35),
    inset 0 0 40px rgba(30, 107, 65, 0.06);
  color: var(--qh-alert-success-text);
}

.eshb-booking .eshb-booking-form .eshb-form-err .status-success::before {
  color: var(--qh-alert-success-accent);
}

/* ─── Icon container: replace image with SVG icon character ─── */
.eshb-booking .eshb-booking-form .eshb-form-err .status .status-icon {
  flex-shrink: 0;
  width: 36px;
  height: 36px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  position: relative;
  margin-top: 1px;
}

/* Hide the plugin's default img icon */
.eshb-booking .eshb-booking-form .eshb-form-err .status .status-icon img {
  display: none !important;
}

/* Replace with a CSS pseudo-element icon */
.eshb-booking .eshb-booking-form .eshb-form-err .status-failed .status-icon {
  background: rgba(192, 57, 43, 0.15);
  border: 1px solid rgba(192, 57, 43, 0.35);
}
.eshb-booking .eshb-booking-form .eshb-form-err .status-failed .status-icon::after {
  content: '✕';
  font-size: 14px;
  font-weight: 600;
  color: var(--qh-alert-error-accent);
  line-height: 1;
}

.eshb-booking .eshb-booking-form .eshb-form-err .status-success .status-icon {
  background: rgba(39, 174, 96, 0.12);
  border: 1px solid rgba(39, 174, 96, 0.3);
}
.eshb-booking .eshb-booking-form .eshb-form-err .status-success .status-icon::after {
  content: '✓';
  font-size: 16px;
  font-weight: 600;
  color: var(--qh-alert-success-accent);
  line-height: 1;
}

/* ─── Message text ─── */
.eshb-booking .eshb-booking-form .eshb-form-err .status .status-msg {
  font-family: var(--qh-alert-font-body);
  font-size: 13.5px;
  font-weight: 400;
  line-height: 1.65;
  letter-spacing: 0.01em;
  flex: 1;
  padding-top: 1px;
}

/* Duplicate room error: bold the room name (it's quoted in the message) */
.eshb-booking .eshb-booking-form .eshb-form-err .status-failed .status-msg {
  color: var(--qh-alert-error-text);
}

/* Italic styling for content inside quotes */
.eshb-booking .eshb-booking-form .eshb-form-err .status-failed .status-msg::first-line {
  font-style: italic;
}

/* ─── Success message ─── */
.eshb-booking .eshb-booking-form .eshb-form-err .status-success .status-msg {
  color: var(--qh-alert-success-text);
}

/* ─── Decorative hotel rule below the status panel ─── */
.eshb-booking .eshb-booking-form .eshb-form-err .status-failed::after {
  content: '';
  position: absolute;
  bottom: 0;
  left: 18px;
  right: 18px;
  height: 1px;
  background: linear-gradient(90deg, transparent, var(--qh-alert-error-border), transparent);
  opacity: 0.5;
}

/* ─── Responsive: tighten on small screens ─── */
@media (max-width: 480px) {
  .eshb-booking .eshb-booking-form .eshb-form-err .status {
    padding: 14px 16px;
    gap: 12px;
  }
  .eshb-booking .eshb-booking-form .eshb-form-err .status .status-icon {
    width: 30px;
    height: 30px;
  }
  .eshb-booking .eshb-booking-form .eshb-form-err .status .status-msg {
    font-size: 13px;
  }
}

/* ─── Locked qty display on cart page ─── */
.eshb-qty-locked {
  display: inline-block;
  padding: 4px 12px;
  background: rgba(139, 42, 26, 0.08);
  border: 1px solid rgba(139, 42, 26, 0.2);
  border-radius: 3px;
  font-family: var(--qh-alert-font-body), sans-serif;
  font-size: 13px;
  font-weight: 500;
  color: inherit;
  letter-spacing: 0.05em;
}

/* ─────────────────────────────────────────────────────────────────
   Rich Duplicate-Room Error (injected by booking-flow-optimizer.js)
   ───────────────────────────────────────────────────────────────── */

/* Status msg becomes a flex column when it holds rich HTML */
.eshb-booking .eshb-booking-form .eshb-form-err .status-failed .status-msg {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

/* "Room Already Reserved" heading */
.qh-dup-room-title {
  font-family: var(--qh-alert-font-display), serif;
  font-size: 15px;
  font-weight: 600;
  letter-spacing: 0.04em;
  color: #f0d0ca;
  text-transform: uppercase;
  line-height: 1.2;
}

/* Room name highlight */
.qh-dup-room-name {
  font-family: var(--qh-alert-font-display), serif;
  font-size: 16px;
  font-weight: 500;
  font-style: italic;
  color: #f5e6e3;
  border-left: 2px solid var(--qh-alert-error-accent);
  padding-left: 10px;
  line-height: 1.3;
}

/* Explanatory body text */
.qh-dup-room-body {
  font-family: var(--qh-alert-font-body), sans-serif;
  font-size: 12.5px;
  font-weight: 300;
  color: var(--qh-alert-error-subtext);
  line-height: 1.6;
}

/* CTA action row */
.qh-dup-room-actions {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
  margin-top: 4px;
}

/* Shared link styles */
.qh-dup-link {
  display: inline-block;
  font-family: var(--qh-alert-font-body), sans-serif;
  font-size: 11.5px;
  font-weight: 500;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  text-decoration: none;
  padding: 6px 14px;
  border-radius: 2px;
  transition: all 0.2s ease;
  cursor: pointer;
}

/* Primary: "Proceed to Checkout" */
.qh-dup-link--primary {
  background: var(--qh-alert-error-accent);
  color: #fff !important;
  border: 1px solid var(--qh-alert-error-accent);
}
.qh-dup-link--primary:hover {
  background: #e74c3c;
  border-color: #e74c3c;
  color: #fff !important;
}

/* Secondary: "View Cart" */
.qh-dup-link--secondary {
  background: transparent;
  color: var(--qh-alert-error-subtext) !important;
  border: 1px solid rgba(192, 57, 43, 0.35);
}
.qh-dup-link--secondary:hover {
  border-color: var(--qh-alert-error-accent);
  color: var(--qh-alert-error-text) !important;
}

/* Responsive */
@media (max-width: 480px) {
  .qh-dup-room-actions {
    flex-direction: column;
    align-items: flex-start;
    gap: 8px;
  }
  .qh-dup-link {
    width: 100%;
    text-align: center;
  }
}

