/**
 * Ultra Modern Notification System
 * Isolated CSS with unique prefixes to prevent conflicts
 * Author: MiniMax Agent
 */

:root {
  --notif-success: #10b981;
  --notif-error: #ef4444;
  --notif-warning: #f59e0b;
  --notif-info: #3b82f6;
  --notif-dark: #1f2937;
  --notif-light: #ffffff;
  --notif-text-dark: #111827;
  --notif-text-light: #f9fafb;
  --notif-shadow: 0 10px 40px rgba(0, 0, 0, 0.15);
  --notif-radius: 12px;
  --notif-backdrop: rgba(255, 255, 255, 0.8);
}

/* Container for notifications */
.notif-container {
  position: fixed;
  z-index: 9999;
  pointer-events: none;
  display: flex;
  flex-direction: column;
  gap: 12px;
  padding: 20px;
  max-width: 420px;
  width: 100%;
}

/* Position variants */
.notif-container.notif-top-right {
  top: 0;
  right: 0;
}

.notif-container.notif-top-left {
  top: 0;
  left: 0;
}

.notif-container.notif-bottom-right {
  bottom: 0;
  right: 0;
}

.notif-container.notif-bottom-left {
  bottom: 0;
  left: 0;
}

.notif-container.notif-top-center {
  top: 0;
  left: 50%;
  transform: translateX(-50%);
}

.notif-container.notif-bottom-center {
  bottom: 0;
  left: 50%;
  transform: translateX(-50%);
}

/* Individual notification card */
.notif-card {
  position: relative;
  display: flex;
  align-items: flex-start;
  gap: 14px;
  padding: 16px 20px;
  background: var(--notif-light);
  border-radius: var(--notif-radius);
  box-shadow: var(--notif-shadow);
  pointer-events: auto;
  cursor: pointer;
  overflow: hidden;
  min-height: 70px;
  backdrop-filter: blur(10px);
  border: 1px solid rgba(0, 0, 0, 0.05);
  transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.notif-card:hover {
  transform: translateY(-2px);
  box-shadow: 0 15px 50px rgba(0, 0, 0, 0.2);
}

/* Icon container */
.notif-icon {
  flex-shrink: 0;
  width: 24px;
  height: 24px;
  display: flex;
  align-items: center;
  justify-content: center;
  margin-top: 2px;
}

.notif-icon svg {
  width: 24px;
  height: 24px;
}

/* Content area */
.notif-content {
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 4px;
  min-width: 0;
}

.notif-title {
  font-size: 15px;
  font-weight: 600;
  color: var(--notif-text-dark);
  line-height: 1.4;
  margin: 0;
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
}

.notif-message {
  font-size: 14px;
  font-weight: 400;
  color: #6b7280;
  line-height: 1.5;
  margin: 0;
  word-wrap: break-word;
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
}

/* Close button */
.notif-close {
  flex-shrink: 0;
  width: 20px;
  height: 20px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: transparent;
  border: none;
  cursor: pointer;
  color: #9ca3af;
  transition: color 0.2s ease, transform 0.2s ease;
  padding: 0;
  margin-top: 2px;
}

.notif-close:hover {
  color: var(--notif-text-dark);
  transform: rotate(90deg);
}

.notif-close svg {
  width: 18px;
  height: 18px;
}

/* Progress bar */
.notif-progress {
  position: absolute;
  bottom: 0;
  left: 0;
  height: 4px;
  background: currentColor;
  opacity: 0.3;
  transition: width linear;
  border-radius: 0 0 0 var(--notif-radius);
}

/* Type variants */
.notif-card.notif-success {
  border-left: 4px solid var(--notif-success);
}

.notif-card.notif-success .notif-icon {
  color: var(--notif-success);
}

.notif-card.notif-success .notif-progress {
  background: var(--notif-success);
}

.notif-card.notif-error {
  border-left: 4px solid var(--notif-error);
}

.notif-card.notif-error .notif-icon {
  color: var(--notif-error);
}

.notif-card.notif-error .notif-progress {
  background: var(--notif-error);
}

.notif-card.notif-warning {
  border-left: 4px solid var(--notif-warning);
}

.notif-card.notif-warning .notif-icon {
  color: var(--notif-warning);
}

.notif-card.notif-warning .notif-progress {
  background: var(--notif-warning);
}

.notif-card.notif-info {
  border-left: 4px solid var(--notif-info);
}

.notif-card.notif-info .notif-icon {
  color: var(--notif-info);
}

.notif-card.notif-info .notif-progress {
  background: var(--notif-info);
}

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

@keyframes notifSlideInLeft {
  from {
    transform: translateX(-120%);
    opacity: 0;
  }
  to {
    transform: translateX(0);
    opacity: 1;
  }
}

@keyframes notifSlideInTop {
  from {
    transform: translateY(-120%);
    opacity: 0;
  }
  to {
    transform: translateY(0);
    opacity: 1;
  }
}

@keyframes notifSlideInBottom {
  from {
    transform: translateY(120%);
    opacity: 0;
  }
  to {
    transform: translateY(0);
    opacity: 1;
  }
}

@keyframes notifSlideOutRight {
  from {
    transform: translateX(0);
    opacity: 1;
  }
  to {
    transform: translateX(120%);
    opacity: 0;
  }
}

@keyframes notifSlideOutLeft {
  from {
    transform: translateX(0);
    opacity: 1;
  }
  to {
    transform: translateX(-120%);
    opacity: 0;
  }
}

@keyframes notifSlideOutTop {
  from {
    transform: translateY(0);
    opacity: 1;
  }
  to {
    transform: translateY(-120%);
    opacity: 0;
  }
}

@keyframes notifSlideOutBottom {
  from {
    transform: translateY(0);
    opacity: 1;
  }
  to {
    transform: translateY(120%);
    opacity: 0;
  }
}

/* Animation classes */
.notif-card.notif-enter-right {
  animation: notifSlideInRight 0.4s cubic-bezier(0.68, -0.55, 0.265, 1.55);
}

.notif-card.notif-enter-left {
  animation: notifSlideInLeft 0.4s cubic-bezier(0.68, -0.55, 0.265, 1.55);
}

.notif-card.notif-enter-top {
  animation: notifSlideInTop 0.4s cubic-bezier(0.68, -0.55, 0.265, 1.55);
}

.notif-card.notif-enter-bottom {
  animation: notifSlideInBottom 0.4s cubic-bezier(0.68, -0.55, 0.265, 1.55);
}

.notif-card.notif-exit-right {
  animation: notifSlideOutRight 0.3s ease-in forwards;
}

.notif-card.notif-exit-left {
  animation: notifSlideOutLeft 0.3s ease-in forwards;
}

.notif-card.notif-exit-top {
  animation: notifSlideOutTop 0.3s ease-in forwards;
}

.notif-card.notif-exit-bottom {
  animation: notifSlideOutBottom 0.3s ease-in forwards;
}

/* Dark mode support */
@media (prefers-color-scheme: dark) {
  :root {
    --notif-light: #1f2937;
    --notif-text-dark: #f9fafb;
    --notif-backdrop: rgba(31, 41, 55, 0.8);
  }
  
  .notif-card {
    background: var(--notif-light);
    border-color: rgba(255, 255, 255, 0.1);
  }
  
  .notif-message {
    color: #d1d5db;
  }
  
  .notif-close {
    color: #9ca3af;
  }
  
  .notif-close:hover {
    color: var(--notif-text-light);
  }
}

/* Responsive design */
@media (max-width: 640px) {
  .notif-container {
    max-width: 100%;
    padding: 12px;
  }
  
  .notif-card {
    padding: 14px 16px;
    min-height: 60px;
  }
  
  .notif-title {
    font-size: 14px;
  }
  
  .notif-message {
    font-size: 13px;
  }
}

/* Accessibility */
.notif-card:focus {
  outline: 2px solid currentColor;
  outline-offset: 2px;
}

.notif-close:focus {
  outline: 2px solid currentColor;
  outline-offset: 2px;
}

/* Print styles */
@media print {
  .notif-container {
    display: none;
  }
}
