/* Modales et Dialogues Universels - Whisp It */
.whisp-modal-overlay {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  width: 100vw;
  height: 100vh;
  height: 100dvh;
  min-width: 100%;
  min-height: 100%;
  z-index: 99999;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 16px;
  background: rgba(11, 15, 25, 0.65);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.22s ease, visibility 0.22s ease;
}

.whisp-modal-overlay.active {
  opacity: 1;
  visibility: visible;
}

.whisp-modal-card {
  width: 100%;
  max-width: 380px;
  background: var(--bg-card, #ffffff);
  color: var(--text-primary, #0f172a);
  border-radius: var(--radius-card, 24px);
  border: 1px solid var(--border-card, #e2e8f0);
  box-shadow: 0 20px 40px -15px rgba(0, 0, 0, 0.25);
  padding: 24px 20px 20px 20px;
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  transform: scale(0.92) translateY(12px);
  opacity: 0;
  transition: transform 0.26s cubic-bezier(0.16, 1, 0.3, 1), opacity 0.22s ease;
  box-sizing: border-box;
}

.whisp-modal-overlay.active .whisp-modal-card {
  transform: scale(1) translateY(0);
  opacity: 1;
}

/* Icone d en-tete */
.whisp-modal-icon-wrap {
  width: 52px;
  height: 52px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  margin-bottom: 16px;
  flex-shrink: 0;
}

.whisp-modal-icon-wrap.type-info {
  background: rgba(15, 23, 42, 0.06);
  color: #0f172a;
}

.whisp-modal-icon-wrap.type-success {
  background: rgba(16, 185, 129, 0.12);
  color: #059669;
}

.whisp-modal-icon-wrap.type-warning {
  background: rgba(245, 158, 11, 0.14);
  color: #d97706;
}

.whisp-modal-icon-wrap.type-error {
  background: rgba(239, 68, 68, 0.12);
  color: #dc2626;
}

.whisp-modal-icon-wrap.type-meeting {
  background: rgba(255, 94, 58, 0.12);
  color: #ff5e3a;
}

.whisp-modal-icon-wrap svg {
  width: 26px;
  height: 26px;
}

/* Typographie */
.whisp-modal-title {
  font-size: 18px;
  font-weight: 700;
  color: var(--text-primary, #0f172a);
  margin-bottom: 8px;
  line-height: 1.3;
}

.whisp-modal-message {
  font-size: 14px;
  color: var(--text-secondary, #64748b);
  line-height: 1.5;
  margin-bottom: 16px;
  word-break: break-word;
}

/* Badge de code d erreur */
.whisp-modal-code-badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 4px 10px;
  border-radius: var(--radius-pill, 9999px);
  background: #f1f5f9;
  border: 1px solid #e2e8f0;
  font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace;
  font-size: 11px;
  font-weight: 600;
  color: #64748b;
  margin-bottom: 16px;
  user-select: all;
}

/* Case a cocher et options de modale */
.whisp-modal-checkbox-container {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 100%;
  margin-top: 4px;
  margin-bottom: 16px;
}

.whisp-modal-checkbox-label {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-size: 13px;
  color: var(--text-secondary, #64748b);
  cursor: pointer;
  user-select: none;
}

.whisp-modal-checkbox-label input[type="checkbox"] {
  width: 16px;
  height: 16px;
  accent-color: var(--accent-orange, #ff5e3a);
  cursor: pointer;
  border-radius: 4px;
}

/* Boutons d action */
.whisp-modal-actions {
  display: flex;
  width: 100%;
  gap: 10px;
  margin-top: 6px;
}

.whisp-modal-btn {
  flex: 1;
  min-height: 44px;
  padding: 10px 16px;
  border-radius: var(--radius-pill, 9999px);
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
  transition: transform 0.15s ease, background-color 0.15s ease, opacity 0.15s ease;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border: none;
  outline: none;
}

.whisp-modal-btn:active {
  transform: scale(0.97);
}

.whisp-modal-btn-cancel {
  background: #f1f5f9;
  color: #475569;
  border: 1px solid #e2e8f0;
}

.whisp-modal-btn-cancel:hover {
  background: #e2e8f0;
}

.whisp-modal-btn-primary {
  background: var(--btn-primary-bg, #0f172a);
  color: var(--btn-primary-text, #ffffff);
}

.whisp-modal-btn-primary:hover {
  background: var(--btn-primary-hover, #1e293b);
}

.whisp-modal-btn-accent {
  background: var(--accent-orange, #ff5e3a);
  color: #ffffff;
}

.whisp-modal-btn-accent:hover {
  background: #e04a27;
}

.whisp-modal-btn-destructive {
  background: #dc2626;
  color: #ffffff;
}

.whisp-modal-btn-destructive:hover {
  background: #b91c1c;
}

/* TOAST NOTIFICATIONS */
.whisp-toast-container {
  position: fixed;
  top: max(16px, env(safe-area-inset-top));
  left: 50%;
  transform: translateX(-50%);
  z-index: 100000;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
  pointer-events: none;
  width: 90%;
  max-width: 360px;
}

.whisp-toast-item {
  pointer-events: auto;
  display: inline-flex;
  align-items: center;
  gap: 10px;
  padding: 10px 18px;
  background: #0f172a;
  color: #ffffff;
  border-radius: var(--radius-pill, 9999px);
  font-size: 13.5px;
  font-weight: 500;
  box-shadow: 0 10px 25px -5px rgba(0, 0, 0, 0.3);
  animation: whispToastSlideDown 0.28s cubic-bezier(0.16, 1, 0.3, 1) forwards;
  opacity: 0;
  max-width: 100%;
}

.whisp-toast-item.toast-success {
  background: #065f46;
  color: #ecfdf5;
}

.whisp-toast-item.toast-error {
  background: #991b1b;
  color: #fef2f2;
}

.whisp-toast-item.toast-fadeout {
  animation: whispToastFadeOut 0.25s ease forwards;
}

@keyframes whispToastSlideDown {
  from {
    opacity: 0;
    transform: translateY(-16px) scale(0.94);
  }
  to {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
}

@keyframes whispToastFadeOut {
  from {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
  to {
    opacity: 0;
    transform: translateY(-10px) scale(0.96);
  }
}
