/* modal-helper.css – Mobile-compatible modal overlay */
/* Uses existing CSS variables so dark/light theme is inherited automatically */

#app-modal-root {
  display: none;
  position: fixed;
  inset: 0;
  z-index: 9999;
  align-items: center;
  justify-content: center;
}

#app-modal-root.open {
  display: flex;
}

.app-modal-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(0, 0, 0, 0.55);
  backdrop-filter: blur(4px);
  animation: modal-fade-in 0.2s ease;
}

.app-modal-card {
  position: relative;
  background: var(--bg-secondary, #1e1e2e);
  color: var(--text-primary, #e0e0f0);
  border: 1px solid var(--border-color, rgba(255,255,255,0.1));
  border-radius: 16px;
  padding: 28px 28px 22px;
  width: min(420px, calc(100vw - 32px));
  max-height: calc(100vh - 80px);
  overflow-y: auto;
  box-shadow: 0 24px 64px rgba(0,0,0,0.5);
  animation: modal-slide-up 0.25s cubic-bezier(0.34, 1.56, 0.64, 1);
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.app-modal-icon {
  font-size: 2rem;
  line-height: 1;
  text-align: center;
  margin-bottom: 2px;
}

.app-modal-title {
  margin: 0;
  font-size: 1rem;
  font-weight: 700;
  text-align: center;
  color: var(--text-primary, #e0e0f0);
}

.app-modal-body {
  margin: 0;
  font-size: 0.92rem;
  line-height: 1.55;
  color: var(--text-secondary, #a0a0b8);
  text-align: center;
  white-space: pre-wrap;
}

.app-modal-input {
  width: 100%;
  box-sizing: border-box;
  padding: 10px 14px;
  border-radius: 10px;
  border: 1px solid var(--border-color, rgba(255,255,255,0.15));
  background: var(--bg-primary, #12121c);
  color: var(--text-primary, #e0e0f0);
  font-size: 0.95rem;
  outline: none;
  transition: border-color 0.2s;
}

.app-modal-input:focus {
  border-color: var(--accent-primary, #6c63ff);
}

.app-modal-actions {
  display: flex;
  gap: 10px;
  justify-content: flex-end;
  margin-top: 6px;
}

.app-modal-btn-cancel,
.app-modal-btn-ok {
  padding: 9px 20px;
  border-radius: 10px;
  border: none;
  font-size: 0.9rem;
  font-weight: 600;
  cursor: pointer;
  transition: opacity 0.15s, transform 0.1s;
  min-width: 88px;
  text-align: center;
}

.app-modal-btn-cancel {
  background: var(--bg-primary, #12121c);
  color: var(--text-secondary, #a0a0b8);
  border: 1px solid var(--border-color, rgba(255,255,255,0.12));
}

.app-modal-btn-ok {
  background: var(--accent-primary, #6c63ff);
  color: #fff;
}

#app-modal-root.danger .app-modal-btn-ok {
  background: #ef4444;
}

.app-modal-btn-cancel:hover,
.app-modal-btn-ok:hover {
  opacity: 0.85;
  transform: translateY(-1px);
}

.app-modal-btn-cancel:active,
.app-modal-btn-ok:active {
  transform: translateY(0);
}

@keyframes modal-fade-in {
  from { opacity: 0; }
  to   { opacity: 1; }
}

@keyframes modal-slide-up {
  from { opacity: 0; transform: translateY(28px) scale(0.97); }
  to   { opacity: 1; transform: translateY(0) scale(1); }
}

/* Mobile adjustments */
@media (max-width: 480px) {
  .app-modal-card {
    border-radius: 14px;
    padding: 22px 18px 18px;
  }
  .app-modal-actions {
    flex-direction: column-reverse;
  }
  .app-modal-btn-cancel,
  .app-modal-btn-ok {
    width: 100%;
    padding: 12px;
  }
}
