/* Customer Dashboard Modal Components */
/* Reuses existing theme system (colors, shadows, radii from tailwind.css) */
/* Full-screen on mobile for app-like experience, centered modal on desktop */

/* Base modal dialog */
dialog.modal {
  padding: 0;
  border: none;
  background: transparent;
  max-width: 100vw;
  max-height: 100vh;
  overflow: visible;
}

/* Modal content container */
.modal-container {
  /* Background with theme colors */
  background: rgb(255 255 255 / 0.95);
  backdrop-filter: blur(0.125rem);

  /* Borders and shadows from theme */
  border-radius: var(--radius-2xl);
  border: 1px solid var(--color-gray-200);
  box-shadow: var(--shadow-soft-xl);

  /* Layout - fixed height prevents overflow issues */
  height: 85vh;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  position: relative;
  z-index: 10;
}

/* Dark mode support */
.dark .modal-container {
  background: rgb(31 41 55 / 0.95);
  border-color: var(--color-gray-700);
}

/* Modal header - fixed at top */
.modal-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 1rem;
  border-bottom: 1px solid var(--color-gray-200);
  background: linear-gradient(to right, var(--color-success-100), var(--color-primary-100));
  flex-shrink: 0;
}

.dark .modal-header {
  border-bottom-color: var(--color-gray-700);
  background: linear-gradient(to right, rgb(4 149 104 / 0.2), rgb(0 102 204 / 0.2));
}

/* Modal title */
.modal-title {
  font-size: 1.25rem;
  font-weight: 700;
  color: var(--color-gray-900);
  font-family: var(--font-serif);
}

.dark .modal-title {
  color: var(--color-gray-100);
}

/* Modal close button */
.modal-close-button {
  color: var(--color-primary-500);
  border-radius: 9999px;
  width: 2rem;
  height: 2rem;
  display: flex;
  align-items: center;
  justify-content: center;
  border: 1px solid var(--color-gray-300);
  transition: all 0.15s ease;
}

.modal-close-button:hover {
  color: var(--color-primary-600);
  background: rgb(0 102 204 / 0.1);
}

.dark .modal-close-button {
  color: var(--color-secondary-400);
  border-color: var(--color-gray-600);
}

.dark .modal-close-button:hover {
  color: var(--color-secondary-500);
  background: rgb(255 107 53 / 0.1);
}

/* Modal body - scrollable content area */
.modal-body {
  padding: 1.5rem;
  overflow-y: auto;
  flex: 1;
  min-height: 0; /* Ensures flex child respects parent height */
}

/* Modal footer - fixed at bottom */
.modal-footer {
  background: rgb(255 255 255 / 0.95);
  padding: 0.75rem 1rem;
  border-top: 1px solid var(--color-gray-200);
  flex-shrink: 0;
}

.dark .modal-footer {
  background: rgb(31 41 55 / 0.95);
  border-top-color: var(--color-gray-700);
}

/* Modal footer actions container */
.modal-footer-actions {
  display: flex;
  justify-content: flex-end;
  gap: 0.75rem;
}

/* Camera modal overlay - full screen */
.modal-camera-overlay {
  position: fixed;
  inset: 0;
  z-index: 50;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgb(0 0 0 / 0.9);
  backdrop-filter: blur(0.125rem);
}

/* Camera modal container */
.modal-camera-container {
  background: white;
  border-radius: var(--radius-2xl);
  box-shadow: var(--shadow-soft-xl);
  width: 100%;
  max-height: 90vh;
  position: relative;
  margin: 1rem;
  display: flex;
  flex-direction: column;
}

.dark .modal-camera-container {
  background: var(--color-gray-900);
}

/* Mobile: Full-screen for app-like experience */
@media (max-width: 640px) {
  /* Position dialog at top of viewport on mobile - override browser default centering */
  dialog.modal {
    top: 0;
    margin: auto 0;
  }

  .modal-container {
    /* Full viewport height on mobile */
    height: 100vh;
    height: 100dvh; /* Dynamic viewport height accounts for mobile browser chrome */

    /* Remove rounded corners for full-screen feel */
    border-radius: 0;

    /* Full width */
    max-width: 100vw;
    width: 100vw;

    /* No border on edges */
    border-left: none;
    border-right: none;
  }

  .modal-body {
    /* Less padding on mobile for more content space */
    padding: 1rem;
  }

  /* Camera modal also full-screen on mobile */
  .modal-camera-container {
    height: 100vh;
    height: 100dvh;
    max-height: 100vh;
    border-radius: 0;
    margin: 0;
    width: 100vw;
    max-width: 100vw;
  }
}
