/* ═══════════════════════════════════════════════════════════════ */
/* MODAL SYSTEM — Styling & Animations */
/* ═══════════════════════════════════════════════════════════════ */

/* ── OVERLAY (Solid dark background, full page) ──────────────── */
.modal-overlay {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: #1a1a1a;
  z-index: 2000;
  opacity: 0;
  transition: opacity 0.3s ease-out;
}

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

/* ── MODAL CONTENT (Solid background, full height) ──────────────*/
.modal-content {
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  width: 100%;
  height: 100vh;
  background: var(--color-bg);
  display: flex;
  flex-direction: column;
  transform: translateY(100%);
  transition: transform 0.5s cubic-bezier(0.32, 0.72, 0.24, 1);
  overflow: hidden;
}

.modal-overlay.modal-visible .modal-content {
  transform: translateY(0);
}

/* ── BODY ────────────────────────────────────────────────────── */
.modal-body {
  flex: 1;
  overflow-y: auto;
  padding: 80px 40px 120px 40px;
  display: flex;
  flex-direction: column;
  justify-content: center;
  max-width: 900px;
  margin: 0 auto;
  width: 100%;
  opacity: 1;
  transition: opacity 0.4s ease-in-out;
}

.modal-body.fade-out {
  opacity: 0;
}

.modal-title {
  font-size: clamp(28px, 5vw, 48px);
  font-weight: 800;
  margin-bottom: 32px;
  color: var(--color-on-surface);
}

.modal-inner {
  font-size: clamp(16px, 2vw, 18px);
  line-height: 1.8;
  color: var(--color-on-surface);
}

.modal-inner p {
  margin-bottom: 16px;
}

.modal-inner p:last-child {
  margin-bottom: 0;
}

/* ── ACTION BAR ──────────────────────────────────────────────── */
.modal-actions {
  position: fixed;
  bottom: 40px;
  left: 50%;
  transform: translateX(-50%);
  display: flex;
  gap: 16px;
  z-index: 10;
  align-items: center;
}

/* ── NAV CONTROLS ────────────────────────────────────────────── */
.modal-nav-controls {
  display: flex;
  align-items: center;
  height: 112px;
  background: var(--color-surface-2);
  border-radius: 9999px;
  overflow: hidden;
  box-shadow: 0 8px 32px rgba(0, 0, 0, 0.1);
}

.modal-nav-btn {
  width: 112px;
  height: 112px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: transparent;
  border: none;
  cursor: pointer;
  font-size: 20px;
  font-weight: 600;
  color: var(--color-on-surface);
  transition: background-color 0.3s;
}

.modal-nav-btn:hover {
  background-color: var(--color-surface-3);
}

.modal-nav-btn:active {
  transform: scale(0.95);
}

.modal-page-indicator {
  padding: 0 24px;
  font-weight: 600;
  font-size: 16px;
  color: var(--color-on-surface);
  white-space: nowrap;
}

/* ── CLOSE BUTTON ────────────────────────────────────────────– */
.modal-close-btn {
  width: 112px;
  height: 112px;
  border-radius: 50%;
  background: var(--color-surface-2);
  border: none;
  cursor: pointer;
  font-size: 24px;
  font-weight: 600;
  color: var(--color-on-surface);
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background-color 0.3s, transform 0.2s;
  box-shadow: 0 8px 32px rgba(0, 0, 0, 0.1);
}

.modal-close-btn:hover {
  background-color: var(--color-surface-3);
}

.modal-close-btn:active {
  transform: scale(0.95);
}

/* ═══════════════════════════════════════════════════════════════ */
/* RESPONSIVE */
/* ═══════════════════════════════════════════════════════════════ */

@media (max-width: 768px) {
  .modal-body {
    padding: 60px 24px 140px 24px;
  }

  .modal-title {
    margin-bottom: 24px;
  }

  .modal-actions {
    bottom: 24px;
    gap: 12px;
  }

  .modal-nav-controls {
    height: 96px;
  }

  .modal-nav-btn {
    width: 96px;
    height: 96px;
    font-size: 18px;
  }

  .modal-page-indicator {
    padding: 0 16px;
    font-size: 14px;
  }

  .modal-close-btn {
    width: 96px;
    height: 96px;
    font-size: 20px;
  }
}

@media (max-width: 480px) {
  .modal-body {
    padding: 48px 16px 120px 16px;
  }

  .modal-title {
    font-size: 24px;
    margin-bottom: 20px;
  }

  .modal-inner {
    font-size: 16px;
  }

  .modal-actions {
    width: 100%;
    padding: 0 16px;
    box-sizing: border-box;
    flex-direction: column;
  }

  .modal-nav-controls {
    width: 100%;
    height: 64px;
  }

  .modal-nav-btn {
    width: auto;
    flex: 1;
    height: 64px;
    font-size: 16px;
  }

  .modal-page-indicator {
    padding: 0 12px;
    font-size: 12px;
  }

  .modal-close-btn {
    width: 64px;
    height: 64px;
    font-size: 18px;
  }
}

/* ═══════════════════════════════════════════════════════════════ */
/* SCROLLBAR STYLING */
/* ═══════════════════════════════════════════════════════════════ */

.modal-body::-webkit-scrollbar {
  width: 8px;
}

.modal-body::-webkit-scrollbar-track {
  background: transparent;
}

.modal-body::-webkit-scrollbar-thumb {
  background: var(--color-surface-2);
  border-radius: 4px;
}

.modal-body::-webkit-scrollbar-thumb:hover {
  background: var(--color-surface-3);
}
