/**
 * Notification Component Styles - Air Tasman Login Page
 * Success and failure notification styling with animations
 */

/* =====================
   BASE NOTIFICATION STYLES
   ===================== */

.notification {
  display: flex;
  align-items: flex-start;
  gap: var(--space-sm);
  padding: var(--space-lg);
  margin-top: var(--space-lg);
  border-radius: var(--border-radius-md);
  border: 1px solid;
  background-color: var(--color-white);
  box-shadow: var(--shadow-md);
  position: relative;
  overflow: hidden;
  transition: var(--transition-medium);
  transition-property: opacity, transform, max-height;
  max-height: 200px;
  opacity: 1;
  transform: translateY(0);
}

/* Hidden state */
.notification.hidden {
  display: none !important;
}

/* =====================
   NOTIFICATION VARIANTS
   ===================== */

/* Success notification */
.notification--success {
  border-color: var(--color-success);
  background-color: #F0FDF4;
  color: var(--color-gray-800);
}

.notification--success .notification__icon {
  color: var(--color-success);
}

.notification--success::before {
  content: '';
  position: absolute;
  left: 0;
  top: 0;
  bottom: 0;
  width: 4px;
  background: linear-gradient(
    to bottom,
    var(--color-success) 0%,
    #059669 100%
  );
}

/* Error notification */
.notification--error {
  border-color: var(--color-error);
  background-color: #FEF2F2;
  color: var(--color-gray-800);
}

.notification--error .notification__icon {
  color: var(--color-error);
}

.notification--error::before {
  content: '';
  position: absolute;
  left: 0;
  top: 0;
  bottom: 0;
  width: 4px;
  background: linear-gradient(
    to bottom,
    var(--color-error) 0%,
    #DC2626 100%
  );
}

/* =====================
   NOTIFICATION COMPONENTS
   ===================== */

/* Icon container */
.notification__icon {
  flex-shrink: 0;
  width: 24px;
  height: 24px;
  margin-top: 2px;
}

.notification__icon svg {
  width: 100%;
  height: 100%;
}

/* Content area */
.notification__content {
  flex: 1;
  min-width: 0;
}

.notification__title {
  font-size: var(--font-size-base);
  font-weight: var(--font-weight-semibold);
  line-height: var(--line-height-tight);
  margin-bottom: var(--space-xs);
  color: inherit;
}

.notification__message {
  font-size: var(--font-size-sm);
  line-height: var(--line-height-normal);
  color: var(--color-gray-700);
  margin: 0;
}

/* Close button */
.notification__close {
  flex-shrink: 0;
  background: none;
  border: none;
  padding: var(--space-xs);
  margin: calc(var(--space-xs) * -1);
  margin-left: var(--space-xs);
  cursor: pointer;
  border-radius: var(--border-radius-sm);
  color: var(--color-gray-500);
  transition: var(--transition-fast);
  transition-property: color, background-color, transform;
  display: flex;
  align-items: center;
  justify-content: center;
  min-width: var(--space-lg);
  min-height: var(--space-lg);
}

.notification__close:hover {
  color: var(--color-gray-700);
  background-color: rgba(0, 0, 0, 0.05);
  transform: scale(1.1);
}

.notification__close:focus {
  outline: none;
  color: var(--color-gray-800);
  background-color: rgba(0, 0, 0, 0.1);
  box-shadow: var(--focus-ring);
}

.notification__close:active {
  transform: scale(0.95);
}

/* =====================
   ANIMATIONS
   ===================== */

/* Slide in animation for show */
@keyframes notificationSlideIn {
  from {
    opacity: 0;
    transform: translateY(-20px) scale(0.95);
    max-height: 0;
  }
  to {
    opacity: 1;
    transform: translateY(0) scale(1);
    max-height: 200px;
  }
}

/* Slide out animation for hide */
@keyframes notificationSlideOut {
  from {
    opacity: 1;
    transform: translateY(0) scale(1);
    max-height: 200px;
  }
  to {
    opacity: 0;
    transform: translateY(-20px) scale(0.95);
    max-height: 0;
  }
}

/* Show animation class */
.notification--show {
  animation: notificationSlideIn var(--transition-medium) var(--ease-out) forwards;
}

/* Hide animation class */
.notification--hide {
  animation: notificationSlideOut var(--transition-medium) var(--ease-in) forwards;
}

/* Pulse animation for attention */
.notification--pulse {
  animation: pulse 2s infinite;
}

/* =====================
   RESPONSIVE DESIGN
   ===================== */

@media (max-width: 767px) {
  .notification {
    padding: var(--space-md);
    margin-top: var(--space-md);
    flex-direction: column;
    align-items: stretch;
  }
  
  .notification__icon {
    align-self: flex-start;
    margin-bottom: var(--space-xs);
  }
  
  .notification__close {
    position: absolute;
    top: var(--space-sm);
    right: var(--space-sm);
    margin: 0;
  }
  
  .notification__title {
    font-size: var(--font-size-sm);
    padding-right: var(--space-lg);
  }
  
  .notification__message {
    font-size: var(--font-size-xs);
  }
}

/* =====================
   ACCESSIBILITY ENHANCEMENTS
   ===================== */

/* High contrast mode */
@media (prefers-contrast: high) {
  .notification {
    border-width: 2px;
  }
  
  .notification--success {
    border-color: #059669;
  }
  
  .notification--error {
    border-color: #DC2626;
  }
  
  .notification__close {
    border: 1px solid currentColor;
  }
}

/* Reduced motion */
@media (prefers-reduced-motion: reduce) {
  .notification {
    transition: opacity var(--transition-fast);
  }
  
  .notification--show,
  .notification--hide {
    animation: none;
  }
  
  .notification--pulse {
    animation: none;
  }
  
  .notification__close:hover {
    transform: none;
  }
}

/* =====================
   DARK MODE SUPPORT
   ===================== */

@media (prefers-color-scheme: dark) {
  .notification {
    background-color: var(--color-gray-800);
    color: var(--color-gray-100);
    border-color: var(--color-gray-600);
  }
  
  .notification--success {
    background-color: rgba(16, 185, 129, 0.1);
    border-color: var(--color-success);
  }
  
  .notification--error {
    background-color: rgba(239, 68, 68, 0.1);
    border-color: var(--color-error);
  }
  
  .notification__message {
    color: var(--color-gray-300);
  }
  
  .notification__close {
    color: var(--color-gray-400);
  }
  
  .notification__close:hover {
    color: var(--color-gray-200);
    background-color: rgba(255, 255, 255, 0.1);
  }
}

/* =====================
   UTILITY CLASSES
   ===================== */

/* Auto-hide after delay */
.notification--auto-hide {
  animation: 
    notificationSlideIn var(--transition-medium) var(--ease-out),
    notificationSlideOut var(--transition-medium) var(--ease-in) 4s forwards;
}

/* Sticky notification (doesn't auto-hide) */
.notification--sticky {
  position: relative;
}

/* Compact notification for smaller spaces */
.notification--compact {
  padding: var(--space-md);
  gap: var(--space-xs);
}

.notification--compact .notification__title {
  font-size: var(--font-size-sm);
  margin-bottom: 2px;
}

.notification--compact .notification__message {
  font-size: var(--font-size-xs);
}

.notification--compact .notification__icon {
  width: 20px;
  height: 20px;
}

/* =====================
   JAVASCRIPT HELPERS
   ===================== */

/* Classes for JavaScript manipulation */
.notification[data-auto-hide="true"] {
  animation: 
    notificationSlideIn var(--transition-medium) var(--ease-out),
    notificationSlideOut var(--transition-medium) var(--ease-in) 5s forwards;
}

/* Loading state for dynamic content */
.notification--loading .notification__message::after {
  content: '';
  display: inline-block;
  width: 0;
  animation: loadingDots 1.5s infinite;
}

@keyframes loadingDots {
  0%, 20% { content: ''; }
  40% { content: '.'; }
  60% { content: '..'; }
  80%, 100% { content: '...'; }
}