/**
 * Modal Component Styles
 * Modal dialogs with overlay and scroll lock
 */

/* ═══════════════════════════════════════════════════════════════════
   MODAL OVERLAY
   ═══════════════════════════════════════════════════════════════════ */
.modal-overlay {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  width: 100%;
  height: 100%;
  background: rgba(0, 0, 0, 0.7);
  backdrop-filter: blur(4px);
  -webkit-backdrop-filter: blur(4px);
  z-index: 9998;
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.25s ease, visibility 0.25s ease;
}

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

.modal-overlay[hidden] {
  display: none;
}

/* ═══════════════════════════════════════════════════════════════════
   MODAL
   ═══════════════════════════════════════════════════════════════════ */

/* Modal Container - Full screen overlay with centered content */
#modal,
#modalContainer,
.modal-container {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  width: 100%;
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 9999;
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.25s ease, visibility 0.25s ease;
  padding: 16px;
  box-sizing: border-box;
}

#modal.visible,
#modalContainer.visible,
.modal-container.visible {
  opacity: 1;
  visibility: visible;
}

/* Modal Box - The actual dialog - supports both div and dialog elements */
.modal,
dialog.modal {
  position: relative;
  width: 100%;
  max-width: 480px;
  max-height: calc(100vh - 32px);
  max-height: calc(100dvh - 32px);
  background: linear-gradient(135deg, rgba(var(--color-elevated-rgb, 30, 41, 59), 0.98), rgba(var(--color-surface-rgb, 15, 23, 42), 0.98));
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 16px;
  z-index: 10000;
  opacity: 1;
  visibility: visible;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  transform: scale(0.95);
  transition: transform 0.25s ease;
  box-shadow:
    0 25px 50px -12px rgba(0, 0, 0, 0.5),
    0 0 0 1px rgba(255, 255, 255, 0.05),
    inset 0 1px 0 rgba(255, 255, 255, 0.1);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  padding: 0;
  margin: auto;
}

/* Dialog native support */
dialog.modal::backdrop {
  background: rgba(0, 0, 0, 0.7);
  backdrop-filter: blur(4px);
  -webkit-backdrop-filter: blur(4px);
}

dialog.modal[open] {
  transform: scale(1);
}

#modal.visible .modal,
#modalContainer.visible .modal,
.modal-container.visible .modal {
  transform: scale(1);
}

/* Small modal */
.modal.modal-sm,
.modal-sm .modal {
  max-width: 380px;
}

/* Medium modal */
.modal.modal-md,
.modal-md .modal {
  max-width: 480px;
}

/* Large Modal */
.modal.modal-lg,
.modal-lg .modal {
  max-width: 600px;
}

/* Mobile responsive */
@media (max-width: 480px) {
  #modal,
  #modalContainer,
  .modal-container {
    padding: 12px;
  }

  .modal {
    max-width: 100%;
    max-height: calc(100vh - 24px);
    max-height: calc(100dvh - 24px);
    border-radius: 12px;
  }
}

.modal[hidden] {
  display: none;
}

/* ═══════════════════════════════════════════════════════════════════
   MODAL HEADER
   ═══════════════════════════════════════════════════════════════════ */
.modal-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 20px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.1);
  flex-shrink: 0;
}

.modal-header h3,
.modal-header .modal-title {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 1.125rem;
  font-weight: 600;
  color: #fff;
  margin: 0;
}

.modal-header h3 svg,
.modal-header .modal-title svg {
  width: 22px;
  height: 22px;
  color: #fb923c;
}

.modal-close {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 32px;
  height: 32px;
  padding: 0;
  background: rgba(255, 255, 255, 0.05);
  border: none;
  color: rgba(255, 255, 255, 0.6);
  cursor: pointer;
  border-radius: 8px;
  font-size: 1.25rem;
  line-height: 1;
  transition: all 0.2s ease;
}

.modal-close:hover {
  background: rgba(255, 255, 255, 0.1);
  color: #fff;
}

/* ═══════════════════════════════════════════════════════════════════
   MODAL BODY
   ═══════════════════════════════════════════════════════════════════ */
.modal-body {
  flex: 1;
  overflow-y: auto;
  padding: 20px;
  color: var(--color-text);
}

.modal-body p {
  margin: 0 0 12px 0;
  line-height: 1.6;
}

.modal-body.text-center {
  text-align: center;
}

/* ═══════════════════════════════════════════════════════════════════
   MODAL FOOTER
   ═══════════════════════════════════════════════════════════════════ */
.modal-footer {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 12px;
  padding: 16px 20px;
  border-top: 1px solid rgba(255, 255, 255, 0.1);
  flex-shrink: 0;
}

/* Modal Footer Buttons */
.modal-footer .btn {
  padding: 10px 20px;
  font-size: 0.875rem;
  font-weight: 500;
  border-radius: 8px;
  cursor: pointer;
  transition: all 0.2s ease;
}

.modal-footer .btn-outline {
  background: transparent;
  border: 1px solid rgba(255, 255, 255, 0.2);
  color: var(--color-text);
}

.modal-footer .btn-outline:hover {
  background: rgba(255, 255, 255, 0.1);
  border-color: rgba(255, 255, 255, 0.3);
}

.modal-footer .btn-primary {
  background: linear-gradient(135deg, #fb923c, #ea580c);
  border: none;
  color: white;
}

.modal-footer .btn-primary:hover {
  background: linear-gradient(135deg, #f97316, #dc2626);
  transform: translateY(-1px);
  box-shadow: 0 4px 12px rgba(251, 146, 60, 0.3);
}

/* ═══════════════════════════════════════════════════════════════════
   TOAST CONTAINER
   ═══════════════════════════════════════════════════════════════════ */
.toast-container {
  position: fixed;
  top: calc(var(--topbar-height) + var(--space-4));
  right: var(--space-4);
  z-index: var(--z-toast);
  display: flex;
  flex-direction: column;
  gap: var(--space-2);
  max-width: 360px;
  pointer-events: none;
}

@media (max-width: 480px) {
  .toast-container {
    left: var(--space-4);
    right: var(--space-4);
    max-width: none;
  }
}

/* ═══════════════════════════════════════════════════════════════════
   TOAST
   ═══════════════════════════════════════════════════════════════════ */
.toast {
  display: flex;
  align-items: flex-start;
  gap: var(--space-3);
  padding: var(--space-4);
  background: var(--dash-card);
  border: 1px solid var(--dash-border);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-lg);
  animation: toastIn 0.3s ease;
  pointer-events: auto;
}

.toast.toast-exit {
  animation: toastOut 0.25s ease forwards;
}

@keyframes toastIn {
  from {
    opacity: 0;
    transform: translateX(100%);
  }
  to {
    opacity: 1;
    transform: translateX(0);
  }
}

@keyframes toastOut {
  from {
    opacity: 1;
    transform: translateX(0);
  }
  to {
    opacity: 0;
    transform: translateX(100%);
  }
}

.toast-icon {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 24px;
  height: 24px;
  flex-shrink: 0;
}

.toast-icon svg {
  width: 20px;
  height: 20px;
}

.toast-content {
  flex: 1;
  min-width: 0;
}

.toast-title {
  font-size: var(--text-sm);
  font-weight: var(--font-semibold);
  color: var(--color-text);
  margin: 0 0 var(--space-1);
}

.toast-message {
  font-size: var(--text-sm);
  color: var(--color-text-muted);
  margin: 0;
}

.toast-close {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 24px;
  height: 24px;
  padding: 0;
  background: transparent;
  border: none;
  color: var(--color-text-muted);
  cursor: pointer;
  border-radius: var(--radius-sm);
  font-size: var(--text-lg);
  line-height: 1;
  flex-shrink: 0;
  transition: color 0.2s ease;
}

.toast-close:hover {
  color: var(--color-text);
}

/* Toast variants */
.toast.toast-success .toast-icon {
  color: var(--color-success);
}

.toast.toast-error .toast-icon {
  color: var(--color-danger);
}

.toast.toast-warning .toast-icon {
  color: var(--color-warning);
}

.toast.toast-info .toast-icon {
  color: var(--color-info);
}

/* ═══════════════════════════════════════════════════════════════════
   CONFIRM MODAL - CANCEL BOOKING STYLE
   ═══════════════════════════════════════════════════════════════════ */
.cancel-icon-wrap {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 80px;
  height: 80px;
  margin: 0 auto;
  background: linear-gradient(135deg, rgba(239, 68, 68, 0.2), rgba(220, 38, 38, 0.1));
  border-radius: 50%;
  animation: pulse-danger 2s ease-in-out infinite;
}

.cancel-icon-wrap svg {
  color: #ef4444;
}

@keyframes pulse-danger {
  0%, 100% {
    box-shadow: 0 0 0 0 rgba(239, 68, 68, 0.4);
  }
  50% {
    box-shadow: 0 0 0 15px rgba(239, 68, 68, 0);
  }
}

/* Danger button styling */
.btn-danger {
  background: linear-gradient(135deg, #ef4444, #dc2626);
  color: white;
  border: none;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

.btn-danger:hover {
  background: linear-gradient(135deg, #dc2626, #b91c1c);
  transform: translateY(-1px);
  box-shadow: 0 4px 12px rgba(239, 68, 68, 0.3);
}

/* Modal body text center */
.modal-body.text-center {
  text-align: center;
}


