/* ═══════════════════════════════════════════════
   Ákotí Toast v2 — Popover API + CSS Animations
   Minimal JS (only for auto-dismiss timer).

   Usage:
     <!-- Container anchored to corner -->
     <div id="toasts" class="akt2-toasts akt2-top-right" popover="manual"></div>

     <!-- Trigger via JS (timer needs JS, but display/animation is CSS) -->
     <script>
       AkotiToast2.success('Saved!', { message: 'Plot A1 updated.' });
     </script>
   ═══════════════════════════════════════════════ */

/* Toast container — uses popover for top-layer rendering */
.akt2-toasts {
  position: fixed;
  z-index: 9999;
  display: flex;
  flex-direction: column;
  gap: 8px;
  max-width: 400px;
  width: calc(100% - 32px);
  border: none;
  background: none;
  padding: 0;
  margin: 0;
  overflow: visible;
}

.akt2-top-right { top: 16px; right: 16px; }
.akt2-top-left { top: 16px; left: 16px; }
.akt2-bottom-right { bottom: 16px; right: 16px; }
.akt2-bottom-left { bottom: 16px; left: 16px; }

/* Individual toast */
.akt2-toast {
  font-family: 'Outfit', system-ui, sans-serif;
  display: flex;
  align-items: flex-start;
  gap: 10px;
  padding: 12px 16px;
  border-radius: 20px 6px 20px 6px;
  box-shadow: 0 4px 20px rgba(0,0,0,0.1), inset 0 1px 3px rgba(0,0,0,0.04);
  position: relative;
  overflow: hidden;

  /* Entry animation */
  animation: akt2-toast-in 0.4s cubic-bezier(0.34, 1.56, 0.64, 1);
}

/* Exit animation */
.akt2-toast.akt2-out {
  animation: akt2-toast-out 0.3s cubic-bezier(0.4, 0, 1, 1) forwards;
}

@keyframes akt2-toast-in {
  from { opacity: 0; transform: translateX(40px) scale(0.95); }
  to { opacity: 1; transform: translateX(0) scale(1); }
}

@keyframes akt2-toast-out {
  from { opacity: 1; transform: translateX(0) scale(1); }
  to { opacity: 0; transform: translateX(40px) scale(0.95); max-height: 0; padding: 0; margin: 0; overflow: hidden; }
}

/* Left accent bar */
.akt2-toast::before {
  content: '';
  position: absolute;
  left: 0; top: 0; bottom: 0;
  width: 4px;
  border-radius: 0 3px 3px 0;
}

/* Timer progress bar */
.akt2-toast::after {
  content: '';
  position: absolute;
  bottom: 0; left: 0;
  height: 3px;
  width: 100%;
  border-radius: 0 2px 0 0;
  animation: akt2-timer var(--toast-duration, 4s) linear forwards;
}

@keyframes akt2-timer {
  from { width: 100%; }
  to { width: 0%; }
}

/* ═══ TYPES ═══ */
.akt2-success { background: #e8f5ef; color: #1e1e24; }
.akt2-success::before { background: #2D6A4F; }
.akt2-success::after { background: rgba(45, 106, 79, 0.2); }

.akt2-error { background: #fde8e8; color: #1e1e24; }
.akt2-error::before { background: #9D0208; }
.akt2-error::after { background: rgba(157, 2, 8, 0.2); }

.akt2-info { background: #e8f1fa; color: #1e1e24; }
.akt2-info::before { background: #a8c8e8; }
.akt2-info::after { background: rgba(168, 200, 232, 0.3); }

.akt2-warning { background: #fdf3e7; color: #1e1e24; }
.akt2-warning::before { background: #CD7F32; }
.akt2-warning::after { background: rgba(205, 127, 50, 0.2); }

/* ═══ ICON ═══ */
.akt2-icon {
  width: 24px; height: 24px;
  border-radius: 12px 4px 12px 4px;
  display: flex; align-items: center; justify-content: center;
  font-size: 12px; font-weight: 800;
  flex-shrink: 0;
}
.akt2-success .akt2-icon { background: #2D6A4F; color: white; }
.akt2-error .akt2-icon { background: #9D0208; color: white; }
.akt2-info .akt2-icon { background: #a8c8e8; color: #0f1b3d; }
.akt2-warning .akt2-icon { background: #CD7F32; color: white; }

/* ═══ CONTENT ═══ */
.akt2-body { flex: 1; min-width: 0; }
.akt2-title { font-size: 13px; font-weight: 700; line-height: 1.3; }
.akt2-message { font-size: 12px; color: #4a4a56; margin-top: 2px; line-height: 1.4; }

/* ═══ CLOSE ═══ */
.akt2-close-btn {
  width: 20px; height: 20px;
  border: none; background: rgba(0,0,0,0.05);
  border-radius: 50%; color: #8a8a96;
  cursor: pointer; font-size: 10px;
  display: flex; align-items: center; justify-content: center;
  flex-shrink: 0; transition: all 0.2s; padding: 0;
}
.akt2-close-btn:hover { background: rgba(0,0,0,0.1); color: #1e1e24; }

/* ═══ ACTION BUTTON ═══ */
.akt2-action {
  margin-top: 6px;
  padding: 3px 10px;
  font-family: inherit;
  font-size: 11px; font-weight: 700;
  border: 1px solid rgba(0,0,0,0.1);
  border-radius: 10px 3px 10px 3px;
  background: white; cursor: pointer;
  transition: all 0.2s;
}
.akt2-action:hover { border-radius: 3px 10px 3px 10px; background: rgba(0,0,0,0.03); }
