/* ============================================================
   modals.css — همه مودال‌ها و overlayها
   ============================================================
   شامل:
   - overlay عمومی پلن (.plan-modal-overlay)
   - کارت مودال پلن (.plan-modal-card) + انیمیشن slideUp
   - مودال ایجاد آیتم (.create-modal-overlay + .create-modal-card)
     + انیمیشن popUp
   - مودال ورود (login-modal-card)
   - مودال صفحه login (custom-card) + انیمیشن slideUpLogin
   - عنوان مودال (.modal-main-title)
   - جداکننده «و:» (.or-divider)
   - پیام‌های وضعیت (loading / success)
   - اسپینر چرخان
   ============================================================ */

/* ---------- Overlay عمومی پلن ---------- */
.plan-modal-overlay {
  position: fixed;
  top: 0;
  left: 0;
  width: 100vw;
  height: 100vh;
  background-color: rgba(16, 24, 22, 0.45);
  display: none;
  align-items: flex-end;
  justify-content: center;
  z-index: 10000;
}
.plan-modal-overlay.open {
  display: flex !important;
}

.plan-modal-card {
  background-color: var(--color-bg-white);
  border-radius: var(--radius-sm) var(--radius-sm) 0 0;
  width: 100%;
  max-width: 480px;
  height: 92vh;
  display: flex;
  flex-direction: column;
  padding: 10px 16px 16px 16px;
  position: relative;
  animation: slideUp var(--transition-smooth);
  overflow: hidden;
}

@keyframes slideUp {
  from {
    transform: translateY(100%);
  }
  to {
    transform: translateY(0);
  }
}

/* ---------- مودال ایجاد آیتم ---------- */
.create-modal-overlay {
  position: fixed;
  top: 0;
  left: 0;
  width: 100vw;
  height: 100vh;
  background-color: rgba(16, 24, 22, 0.45);
  display: none;
  align-items: center;
  justify-content: center;
  z-index: 9999;
  padding: 20px;
}
.create-modal-overlay.open {
  display: flex !important;
}

.create-modal-card {
  background-color: var(--color-bg-white);
  border-radius: var(--radius-sm);
  width: 100%;
  max-width: 410px;
  padding: 24px 18px;
  box-shadow: 0 10px 30px rgba(16, 24, 22, 0.15);
  position: relative;
  animation: popUp 0.22s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

@keyframes popUp {
  from {
    transform: scale(0.92);
    opacity: 0;
  }
  to {
    transform: scale(1);
    opacity: 1;
  }
}

.create-modal-title {
  color: var(--color-text-dark);
  font-size: var(--fs-md);
}

/* ---------- مودال ورود (index) ---------- */
.login-modal-card {
  height: auto !important;
  max-height: 90vh;
  padding: 12px 20px 24px 20px;
  overflow-y: auto;
}

.login-modal-card .drag-handle {
  background-color: #d1d5db;
  margin-bottom: 1rem;
}

/* ---------- مودال صفحه login (bottom sheet) ---------- */
.custom-card {
  background-color: var(--color-bg-white);
  border-radius: var(--radius-sm) var(--radius-sm) 0 0;
  padding: 10px 20px 24px 20px;
  max-width: 480px;
  width: 100%;
  margin: 0;
  box-shadow: 0 -4px 30px rgba(16, 24, 22, 0.1);
  max-height: 90vh;
  overflow-y: auto;
  will-change: transform;
  animation: slideUpLogin 0.7s cubic-bezier(0.22, 1, 0.36, 1);
  scrollbar-width: none;
  -ms-overflow-style: none;
}
.custom-card::-webkit-scrollbar {
  display: none;
}

@keyframes slideUpLogin {
  from {
    transform: translate3d(0, 100%, 0);
  }
  to {
    transform: translate3d(0, 0, 0);
  }
}

/* ---------- عنوان مودال ---------- */
.modal-main-title {
  font-size: var(--fs-lg);
  font-weight: var(--fw-black);
  color: var(--color-text-dark);
  text-align: center;
  margin-bottom: 1.25rem;
}

/* ---------- جداکننده «و:» ---------- */
.or-divider {
  text-align: right;
  color: var(--color-text-dark);
  font-size: var(--fs-lg);
  font-weight: var(--fw-normal);
  margin: 1.25rem 0;
}

/* ---------- پیام‌های وضعیت (loading / success) ---------- */
.status-message {
  display: flex;
  align-items: center;
  justify-content: flex-start;
  gap: 8px;
  padding: 4px 0;
  font-size: var(--fs-base);
  margin-top: 8px;
  text-align: right;
  line-height: var(--lh-tight);
}

.status-loading {
  color: var(--color-text-lighter);
  font-weight: var(--fw-normal);
}

.status-success {
  color: var(--color-text-dark);
  font-weight: var(--fw-bold);
}

.status-icon {
  font-size: var(--fs-md);
  color: var(--color-primary);
  flex-shrink: 0;
}

/* ---------- اسپینر چرخان ---------- */
.status-spinner {
  width: 14px;
  height: 14px;
  border: 2px solid var(--color-primary-light);
  border-top-color: var(--color-primary);
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
  flex-shrink: 0;
}

@keyframes spin {
  to {
    transform: rotate(360deg);
  }
}
