/**
 * modal.css
 * BIXOR Exchange - Modal / Bottom Sheet Styles
 *
 * Depends on: variables.css, animations.css (slideUp keyframe)
 */

/* ============================================================
 * OVERLAY
 * ============================================================ */

.modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.5);
  z-index: 9000;
  display: flex;
  align-items: flex-end; /* mobile: slide up from bottom */
  justify-content: center;
  animation: fadeIn var(--transition-fast) var(--easing-material) both;
}

/* Desktop: center the modal */
@media (min-width: 768px) {
  .modal-overlay {
    align-items: center;
  }
}

/* ============================================================
 * MODAL CONTENT
 * ============================================================ */

.modal-content {
  background-color: var(--color-bg-secondary);
  border-radius: 16px 16px 0 0; /* mobile: bottom sheet style */
  width: 100%;
  max-width: 480px;
  padding: var(--spacing-6);
  animation: slideUp 250ms cubic-bezier(0.4, 0, 0.2, 1) both;
  box-sizing: border-box;
  /* Safe area inset for iOS home indicator */
  padding-bottom: calc(var(--spacing-6) + env(safe-area-inset-bottom, 0));
  max-height: 90vh;
  overflow-y: auto;
}

/* Desktop: fully rounded modal */
@media (min-width: 768px) {
  .modal-content {
    border-radius: var(--radius-xl);
    padding-bottom: var(--spacing-6);
    max-height: 80vh;
  }
}

/* ============================================================
 * MODAL HEADER
 * ============================================================ */

.modal-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: var(--spacing-4);
}

.modal-title {
  font-size: var(--font-size-lg);
  font-weight: var(--font-weight-semibold);
  color: var(--color-text-primary);
  line-height: var(--line-height-tight);
}

.modal-close {
  color: rgba(255, 255, 255, 0.5);
  cursor: pointer;
  font-size: 24px;
  line-height: 1;
  padding: var(--spacing-1);
  border-radius: var(--radius-sm);
  transition: color var(--transition-fast) var(--easing-material);
  user-select: none;
  -webkit-tap-highlight-color: transparent;
  display: flex;
  align-items: center;
  justify-content: center;
}

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

/* ============================================================
 * MODAL BODY
 * ============================================================ */

.modal-body {
  margin-bottom: var(--spacing-6);
  color: var(--color-text-secondary);
  font-size: var(--font-size-sm);
  line-height: var(--line-height-normal);
}

/* ============================================================
 * MODAL FOOTER
 * ============================================================ */

.modal-footer {
  display: flex;
  gap: var(--spacing-3);
  justify-content: flex-end;
}

/* Full-width buttons on mobile */
@media (max-width: 480px) {
  .modal-footer {
    flex-direction: column-reverse;
  }

  .modal-footer .btn {
    width: 100%;
  }
}

/* ============================================================
 * DRAG HANDLE (mobile bottom sheet indicator)
 * ============================================================ */

.modal-drag-handle {
  width: 36px;
  height: 4px;
  background: rgba(255, 255, 255, 0.2);
  border-radius: var(--radius-full);
  margin: 0 auto var(--spacing-4);
}
