/* CSS/notifications.css
   Logic in Script/notifications.js
   Include in an HTML page:
   <link rel="stylesheet" href="CSS/notifications.css">
*/

/* =========================
   Container Configuration
   ========================= */
#notification-container {
  position: fixed;
  bottom: 24px;
  right: 24px;
  display: flex;
  flex-direction: column-reverse; /* Newest items at the bottom visually */
  gap: 12px;
  z-index: var(--z-notification);
  pointer-events: none; /* Click-through empty space */
}

/* =========================
   Glass Notification Base
   ========================= */
.notification.glass-toast {
  pointer-events: auto; /* Re-enable clicks on the toast itself */
  position: relative;
  display: flex;

  /* Glassmorphism Look (From Visual Source) */
  background: rgba(255, 255, 255, 0.75);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border: 1px solid rgba(255, 255, 255, 0.4);
  box-shadow: 0 8px 32px rgba(0, 0, 0, 0.1);

  /* Layout */
  border-radius: 12px;
  padding: 16px;
  min-width: 320px;
  max-width: 400px;
  color: #333;

  /* Animation Entry */
  animation: toastSlideIn 0.5s cubic-bezier(0.68, -0.55, 0.27, 1.55);
  transition: all 0.3s ease;
}

/* Dark Mode Support */
@media (prefers-color-scheme: dark) {
  .notification.glass-toast {
    background: rgba(30, 30, 30, 0.85);
    border: 1px solid rgba(255, 255, 255, 0.1);
    color: #fff;
  }
}

/* =========================
   Inner Content Styling
   ========================= */
.notification-content {
  display: flex;
  align-items: center; /* Center icon vertically with text */
  gap: 16px;
  width: 100%;
}

.notification-icon {
  font-size: 2rem;
  line-height: 1;
}

.notification-image {
  width: 70px;
  height: 70px;
  object-fit: cover;
  border-radius: 8px;
}

/* Typography */
.notification-content div {
  display: flex;
  flex-direction: column;
  gap: 4px;
  flex: 1; /* Take up remaining space */
}

.notification-content strong {
  font-size: 0.95rem;
  font-weight: 700;
}

.notification-content p {
  margin: 0;
  font-size: 0.85rem;
  opacity: 0.9;
  line-height: 1.4;
}

/* =========================
   Close Button
   ========================= */
.close-btn {
  position: absolute;
  top: -8px;
  right: -8px;

  background: rgba(255, 255, 255, 0.9);
  border: 1px solid rgba(0, 0, 0, 0.1);
  color: #333;

  border-radius: 50%;
  width: 24px;
  height: 24px;

  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  font-size: 1rem;
  box-shadow: 0 2px 5px rgba(0, 0, 0, 0.1);
  transition:
    transform 0.2s,
    background 0.2s;
  padding: 0;
}

.close-btn:hover {
  transform: scale(1.1);
  background: #fff;
}

@media (prefers-color-scheme: dark) {
  .close-btn {
    background: rgba(50, 50, 50, 0.9);
    border-color: rgba(255, 255, 255, 0.2);
    color: #fff;
  }
}

/* =========================
   Type-Specific Accents
   (Optional: Adds subtle border color)
   ========================= */
.notification.success {
  border-left: 4px solid #4caf50;
}
.notification.error {
  border-left: 4px solid #f44336;
}
.notification.warning {
  border-left: 4px solid #ff9800;
}
.notification.info {
  border-left: 4px solid #2196f3;
}

/* =========================
   Animations
   ========================= */
@keyframes toastSlideIn {
  from {
    transform: translateX(120%);
    opacity: 0;
  }
  to {
    transform: translateX(0);
    opacity: 1;
  }
}

@keyframes toastSlideOut {
  from {
    transform: translateX(0);
    opacity: 1;
  }
  to {
    transform: translateX(120%);
    opacity: 0;
  }
}
/* ===========================
   Confirmation Modal Styles
   =========================== */

.confirmation-overlay {
  position: fixed;
  top: 0;
  left: 0;
  width: 100vw;
  height: 100vh;
  background: rgba(0, 0, 0, 0.4); /* Fallback */
  backdrop-filter: blur(4px);
  z-index: var(--z-modal-top);
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 0;
  transition: opacity 0.3s ease;
  pointer-events: none; /* Prevent interaction while hidden */
}

.confirmation-overlay.show {
  opacity: 1;
  pointer-events: auto;
}

.confirmation-modal {
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  border-radius: 16px;
  box-shadow: var(--shadow-xl);
  padding: 24px;
  max-width: 400px;
  width: 90%;
  transform: scale(0.9);
  opacity: 0;
  transition: all 0.3s cubic-bezier(0.34, 1.56, 0.64, 1); /* Bouncy scale */
}

.confirmation-modal.show {
  transform: scale(1);
  opacity: 1;
}

.confirmation-content {
  display: flex;
  flex-direction: column;
  gap: 20px;
}

.confirmation-message {
  font-size: 1.1rem;
  color: var(--color-text-primary);
  text-align: center;
  line-height: 1.5;
  margin: 0;
}

.confirmation-actions {
  display: flex;
  gap: 12px;
  justify-content: center;
}

.confirmation-btn {
  padding: 10px 20px;
  border-radius: 8px;
  border: none;
  font-weight: 600;
  cursor: pointer;
  font-size: 1rem;
  transition: all 0.2s ease;
}

.confirmation-btn.confirm {
  background: var(--gradient-accent);
  color: white;
  box-shadow: 0 4px 15px rgba(99, 102, 241, 0.3);
}

.confirmation-btn.confirm:hover {
  filter: brightness(1.1);
  transform: translateY(-2px) scale(1.02);
  box-shadow: 0 6px 20px rgba(99, 102, 241, 0.4);
}

.confirmation-btn.confirm:focus-visible {
  outline: 2px solid var(--color-primary);
  outline-offset: 2px;
}

.confirmation-btn.cancel {
  background: transparent;
  border: 1px solid var(--color-border);
  color: var(--color-text-primary);
}

.confirmation-btn.cancel:hover {
  background: var(--color-background-secondary);
}

/* Dark Mode specific overrides if needed (though vars handle most) */
[data-theme="dark-slate"] .confirmation-overlay,
[data-theme="dark"] .confirmation-overlay {
  background: rgba(0, 0, 0, 0.6);
}
