/* ============================================================
   FLORA77 - Modal (modal.css)
   Reusable modal dialog styles
   ============================================================ */

/* ── Overlay ── */
.modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(10,10,26,0.85);
  backdrop-filter: blur(6px);
  z-index: 10000;
  display: none;
  align-items: center;
  justify-content: center;
  padding: 20px;
}

.modal-overlay.show {
  display: flex;
  animation: modalFadeIn 0.2s ease;
}

@keyframes modalFadeIn {
  from { opacity: 0; }
  to { opacity: 1; }
}

/* ── Dialog ── */
.modal-dialog {
  background: var(--bg-card, #1a1a2e);
  border: 1px solid var(--border, rgba(255,255,255,0.08));
  border-radius: var(--radius-xl, 20px);
  width: 100%;
  max-width: 480px;
  max-height: 90vh;
  overflow-y: auto;
  box-shadow: var(--shadow-lg, 0 8px 40px rgba(0,0,0,0.6));
  animation: modalSlideUp 0.3s cubic-bezier(0.16, 1, 0.3, 1);
}

@keyframes modalSlideUp {
  from { opacity: 0; transform: translateY(24px) scale(0.96); }
  to { opacity: 1; transform: translateY(0) scale(1); }
}

/* ── Header ── */
.modal-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 20px 24px;
  border-bottom: 1px solid var(--border, rgba(255,255,255,0.08));
}

.modal-title {
  font-size: 18px;
  font-weight: 700;
  color: var(--text-primary, #e8e8f0);
  margin: 0;
  display: flex;
  align-items: center;
  gap: 10px;
}

.modal-icon {
  width: 36px;
  height: 36px;
  border-radius: 10px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.modal-icon.info { background: rgba(14,165,233,0.1); color: var(--info, #0ea5e9); }
.modal-icon.success { background: rgba(34,197,94,0.1); color: var(--accent, #22c55e); }
.modal-icon.warning { background: rgba(245,158,11,0.1); color: var(--warning, #f59e0b); }
.modal-icon.error { background: rgba(239,68,68,0.1); color: var(--danger, #ef4444); }

.modal-close {
  width: 36px;
  height: 36px;
  border-radius: 10px;
  border: 1px solid var(--border, rgba(255,255,255,0.08));
  background: var(--bg-surface, #16213e);
  color: var(--text-muted, #6b6b80);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.2s;
}

.modal-close:hover {
  background: var(--bg-hover, #1e1e3a);
  color: var(--text-primary, #e8e8f0);
}

/* ── Body ── */
.modal-body {
  padding: 24px;
}

.modal-message {
  font-size: 14px;
  color: var(--text-secondary, #a0a0b8);
  line-height: 1.6;
  margin: 0 0 20px;
}

/* ── Actions ── */
.modal-actions {
  display: flex;
  gap: 10px;
  padding: 0 24px 24px;
}

.modal-btn {
  flex: 1;
  padding: 12px 20px;
  border-radius: 10px;
  font-size: 14px;
  font-weight: 700;
  border: none;
  cursor: pointer;
  transition: all 0.2s;
  text-align: center;
}

.modal-btn-primary {
  background: linear-gradient(135deg, var(--accent, #22c55e), var(--accent-dark, #16a34a));
  color: #fff;
}

.modal-btn-primary:hover {
  transform: translateY(-1px);
  box-shadow: 0 4px 12px var(--accent-glow, rgba(34,197,94,0.3));
}

.modal-btn-secondary {
  background: var(--bg-surface, #16213e);
  color: var(--text-secondary, #a0a0b8);
  border: 1px solid var(--border, rgba(255,255,255,0.08));
}

.modal-btn-secondary:hover {
  border-color: var(--accent, #22c55e);
  color: var(--accent, #22c55e);
}

.modal-btn-danger {
  background: var(--danger, #ef4444);
  color: #fff;
}

.modal-btn-danger:hover {
  opacity: 0.9;
  transform: translateY(-1px);
}

.modal-btn:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

/* ── Mobile ── */
@media (max-width: 640px) {
  .modal-dialog {
    border-radius: 20px 20px 0 0;
    margin-top: auto;
    max-height: 85vh;
    max-width: 100%;
  }
  .modal-overlay {
    align-items: flex-end;
    padding: 0;
  }
  .modal-header { padding: 16px 20px; }
  .modal-body { padding: 20px; }
  .modal-actions { padding: 0 20px 20px; }
  .modal-btn { padding: 10px 16px; font-size: 13px; }
}
