/* ui-dialogs.css — branded toast + modal (no native alert/prompt) */

.bo-toast-host {
  position: fixed;
  top: max(16px, env(safe-area-inset-top));
  left: 50%;
  transform: translateX(-50%);
  z-index: 10050;
  display: flex;
  flex-direction: column;
  gap: 10px;
  width: min(420px, calc(100vw - 24px));
  pointer-events: none;
}

.bo-toast {
  pointer-events: auto;
  display: flex;
  align-items: flex-start;
  gap: 12px;
  padding: 14px 16px;
  border-radius: 16px;
  background: var(--glass-bg, #fff);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  border: 1px solid var(--glass-border, rgba(0,0,0,0.08));
  box-shadow: var(--shadow-lg, 0 16px 40px rgba(0,0,0,0.18));
  color: var(--text-primary, #111);
  font-family: 'Cairo', sans-serif;
  animation: boToastIn 0.35s cubic-bezier(0.16, 1, 0.3, 1) both;
  direction: rtl;
}
.bo-toast.is-out {
  animation: boToastOut 0.28s ease forwards;
}
.bo-toast-icon {
  width: 36px;
  height: 36px;
  border-radius: 12px;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  font-size: 16px;
  font-weight: 800;
  color: #fff;
}
.bo-toast.success .bo-toast-icon { background: linear-gradient(145deg, #2D9B68, #1E6B47); }
.bo-toast.error .bo-toast-icon { background: linear-gradient(145deg, #E23B3F, #A71C20); }
.bo-toast.info .bo-toast-icon { background: linear-gradient(145deg, #3B9EFF, #007AFF); }
.bo-toast-body { flex: 1; min-width: 0; }
.bo-toast-title { font-weight: 800; font-size: 14px; margin: 0 0 2px; }
.bo-toast-msg { font-size: 13px; color: var(--text-secondary, #555); margin: 0; line-height: 1.45; }

.bo-modal-overlay {
  position: fixed;
  inset: 0;
  z-index: 10040;
  background: rgba(10, 10, 12, 0.55);
  backdrop-filter: blur(6px);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
  opacity: 0;
  transition: opacity 0.22s ease;
  direction: rtl;
}
.bo-modal-overlay.is-open { opacity: 1; }

.bo-modal {
  width: min(440px, 100%);
  background: var(--bg-surface, #fff);
  color: var(--text-primary, #111);
  border: 1px solid var(--border-color, #e5e7eb);
  border-radius: 22px;
  box-shadow: var(--shadow-lg, 0 24px 48px rgba(0,0,0,0.25));
  padding: 24px 22px 18px;
  transform: translateY(16px) scale(0.96);
  transition: transform 0.28s cubic-bezier(0.16, 1, 0.3, 1);
  font-family: 'Cairo', sans-serif;
}
.bo-modal-overlay.is-open .bo-modal {
  transform: translateY(0) scale(1);
}
.bo-modal-icon {
  width: 52px;
  height: 52px;
  border-radius: 16px;
  display: flex;
  align-items: center;
  justify-content: center;
  margin: 0 auto 14px;
  color: #fff;
  font-size: 22px;
  font-weight: 800;
  background: linear-gradient(145deg, #E23B3F, #A71C20);
}
.bo-modal-icon.success { background: linear-gradient(145deg, #2D9B68, #1E6B47); }
.bo-modal-icon.warn { background: linear-gradient(145deg, #F6B73C, #D97706); }
.bo-modal h3 {
  margin: 0 0 8px;
  font-size: 18px;
  font-weight: 800;
  text-align: center;
}
.bo-modal p {
  margin: 0 0 16px;
  font-size: 14px;
  color: var(--text-secondary, #555);
  text-align: center;
  line-height: 1.55;
}
.bo-modal-input {
  width: 100%;
  box-sizing: border-box;
  border: 1px solid var(--border-color, #e5e7eb);
  background: var(--bg-app, #f7f8fa);
  color: var(--text-primary, #111);
  border-radius: 14px;
  padding: 12px 14px;
  font-family: inherit;
  font-size: 14px;
  margin-bottom: 16px;
  outline: none;
  resize: vertical;
  min-height: 88px;
}
.bo-modal-input:focus {
  border-color: var(--primary, #A71C20);
  box-shadow: 0 0 0 3px var(--primary-light, rgba(167,28,32,0.12));
}
.bo-modal-actions {
  display: flex;
  gap: 10px;
}
.bo-modal-actions button {
  flex: 1;
  border: none;
  border-radius: 14px;
  padding: 12px 14px;
  font-family: inherit;
  font-weight: 800;
  font-size: 14px;
  cursor: pointer;
  transition: transform 0.15s ease, opacity 0.15s ease;
}
.bo-modal-actions button:active { transform: scale(0.97); }
.bo-btn-primary {
  background: linear-gradient(145deg, #E23B3F, #A71C20);
  color: #fff;
}
.bo-btn-ghost {
  background: var(--bg-surface-hover, #f3f4f6);
  color: var(--text-primary, #111);
  border: 1px solid var(--border-color, #e5e7eb) !important;
}

@keyframes boToastIn {
  from { opacity: 0; transform: translateY(-12px) scale(0.96); }
  to { opacity: 1; transform: translateY(0) scale(1); }
}
@keyframes boToastOut {
  to { opacity: 0; transform: translateY(-8px) scale(0.96); }
}

@media (prefers-reduced-motion: reduce) {
  .bo-toast, .bo-modal, .bo-modal-overlay { animation: none !important; transition: none !important; }
}
