/*
 * NOTIFICATION SYSTEM CSS - APPLE-LEVEL DESIGN
 * Beautiful, accessible notifications with advanced animations
 */

/* Notification container */
.notification-container {
  position: fixed;
  top: 20px;
  right: 20px;
  z-index: 10000;
  pointer-events: none;
  max-height: calc(100vh - 40px);
  overflow-y: auto;
  width: 400px;
}

.notification-container:hover {
  pointer-events: auto;
}

/* Custom scrollbar for notification container */
.notification-container::-webkit-scrollbar {
  width: 4px;
}

.notification-container::-webkit-scrollbar-track {
  background: rgba(0, 0, 0, 0.1);
  border-radius: 2px;
}

.notification-container::-webkit-scrollbar-thumb {
  background: rgba(0, 0, 0, 0.3);
  border-radius: 2px;
}

.notification-container::-webkit-scrollbar-thumb:hover {
  background: rgba(0, 0, 0, 0.5);
}

/* Base notification styles */
.notification {
  margin-bottom: 12px;
  padding: 16px 20px;
  background: rgba(255, 255, 255, 0.95);
  border-radius: 16px;
  box-shadow: 0 8px 32px rgba(0, 0, 0, 0.12);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  opacity: 0;
  transform: translateX(400px);
  transition: all 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275);
  position: relative;
  overflow: hidden;
  max-width: 400px;
  cursor: pointer;
  pointer-events: auto;
  border: 1px solid rgba(255, 255, 255, 0.3);
}

.notification:hover {
  transform: translateY(-2px) scale(1.02);
  box-shadow: 0 12px 40px rgba(0, 0, 0, 0.16);
}

/* Notification types */
.notification-success {
  border-left: 4px solid #10b981;
  background: linear-gradient(135deg, rgba(16, 185, 129, 0.1), rgba(255, 255, 255, 0.95));
}

.notification-error {
  border-left: 4px solid #ef4444;
  background: linear-gradient(135deg, rgba(239, 68, 68, 0.1), rgba(255, 255, 255, 0.95));
}

.notification-warning {
  border-left: 4px solid #f59e0b;
  background: linear-gradient(135deg, rgba(245, 158, 11, 0.1), rgba(255, 255, 255, 0.95));
}

.notification-info {
  border-left: 4px solid #3b82f6;
  background: linear-gradient(135deg, rgba(59, 130, 246, 0.1), rgba(255, 255, 255, 0.95));
}

.notification-reminder {
  border-left: 4px solid #8b5cf6;
  background: linear-gradient(135deg, rgba(139, 92, 246, 0.1), rgba(255, 255, 255, 0.95));
}

.notification-task {
  border-left: 4px solid #06b6d4;
  background: linear-gradient(135deg, rgba(6, 182, 212, 0.1), rgba(255, 255, 255, 0.95));
}

.notification-deadline {
  border-left: 4px solid #f97316;
  background: linear-gradient(135deg, rgba(249, 115, 22, 0.1), rgba(255, 255, 255, 0.95));
}

/* Priority indicators */
.notification-priority-urgent {
  border: 2px solid #ef4444;
  animation: urgent-shake 0.5s ease-in-out 3;
}

.notification-priority-urgent::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 2px;
  background: linear-gradient(90deg, #ef4444, #f59e0b, #ef4444);
  background-size: 200% 100%;
  animation: urgent-pulse 2s ease-in-out infinite;
}

.notification-priority-high {
  box-shadow: 0 8px 32px rgba(239, 68, 68, 0.2);
}

@keyframes urgent-pulse {
  0%, 100% { background-position: 0% 50%; }
  50% { background-position: 100% 50%; }
}

@keyframes urgent-shake {
  0%, 100% { transform: translateX(0); }
  10%, 30%, 50%, 70%, 90% { transform: translateX(-2px); }
  20%, 40%, 60%, 80% { transform: translateX(2px); }
}

/* Notification content */
.notification-icon {
  font-size: 20px;
  margin-right: 12px;
  flex-shrink: 0;
  display: flex;
  align-items: center;
  animation: icon-bounce 0.6s ease;
}

@keyframes icon-bounce {
  0%, 100% { transform: scale(1); }
  50% { transform: scale(1.2); }
}

.notification-content {
  flex: 1;
  min-width: 0;
}

.notification-title {
  font-weight: 600;
  font-size: 14px;
  color: #1f2937;
  margin-bottom: 4px;
  line-height: 1.4;
  word-wrap: break-word;
}

.notification-message {
  font-size: 13px;
  color: #6b7280;
  line-height: 1.4;
  word-wrap: break-word;
}

/* Notification actions */
.notification-actions {
  display: flex;
  gap: 8px;
  margin-top: 12px;
  flex-wrap: wrap;
}

.notification-action-btn {
  padding: 6px 12px;
  background: rgba(59, 130, 246, 0.1);
  color: #3b82f6;
  border: 1px solid rgba(59, 130, 246, 0.2);
  border-radius: 8px;
  font-size: 12px;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.2s ease;
  white-space: nowrap;
}

.notification-action-btn:hover {
  background: rgba(59, 130, 246, 0.2);
  transform: translateY(-1px);
  box-shadow: 0 4px 12px rgba(59, 130, 246, 0.3);
}

.notification-action-btn:active {
  transform: translateY(0);
}

/* Close button */
.notification-close {
  position: absolute;
  top: 8px;
  right: 8px;
  width: 24px;
  height: 24px;
  border: none;
  background: rgba(107, 114, 128, 0.1);
  color: #6b7280;
  border-radius: 50%;
  font-size: 16px;
  line-height: 1;
  cursor: pointer;
  transition: all 0.2s ease;
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 0.7;
}

.notification-close:hover {
  background: rgba(107, 114, 128, 0.2);
  opacity: 1;
  transform: scale(1.1);
}

.notification-close:active {
  transform: scale(0.95);
}

/* Dark mode support */
@media (prefers-color-scheme: dark) {
  .notification {
    background: rgba(17, 24, 39, 0.95);
    border: 1px solid rgba(55, 65, 81, 0.5);
  }

  .notification-title {
    color: #f9fafb;
  }

  .notification-message {
    color: #d1d5db;
  }

  .notification-close {
    background: rgba(156, 163, 175, 0.1);
    color: #9ca3af;
  }

  .notification-close:hover {
    background: rgba(156, 163, 175, 0.2);
  }

  .notification-action-btn {
    background: rgba(59, 130, 246, 0.2);
    color: #93c5fd;
    border-color: rgba(59, 130, 246, 0.3);
  }

  .notification-action-btn:hover {
    background: rgba(59, 130, 246, 0.3);
  }

  /* Dark mode type variations */
  .notification-success {
    background: linear-gradient(135deg, rgba(16, 185, 129, 0.2), rgba(17, 24, 39, 0.95));
  }

  .notification-error {
    background: linear-gradient(135deg, rgba(239, 68, 68, 0.2), rgba(17, 24, 39, 0.95));
  }

  .notification-warning {
    background: linear-gradient(135deg, rgba(245, 158, 11, 0.2), rgba(17, 24, 39, 0.95));
  }

  .notification-info {
    background: linear-gradient(135deg, rgba(59, 130, 246, 0.2), rgba(17, 24, 39, 0.95));
  }

  .notification-reminder {
    background: linear-gradient(135deg, rgba(139, 92, 246, 0.2), rgba(17, 24, 39, 0.95));
  }

  .notification-task {
    background: linear-gradient(135deg, rgba(6, 182, 212, 0.2), rgba(17, 24, 39, 0.95));
  }

  .notification-deadline {
    background: linear-gradient(135deg, rgba(249, 115, 22, 0.2), rgba(17, 24, 39, 0.95));
  }
}

/* High contrast mode */
@media (prefers-contrast: high) {
  .notification {
    border: 2px solid #000;
    background: #fff;
  }

  .notification-title {
    color: #000;
    font-weight: 700;
  }

  .notification-message {
    color: #333;
  }

  .notification-close {
    background: #f0f0f0;
    color: #000;
    border: 1px solid #ccc;
  }

  .notification-action-btn {
    background: #e6f3ff;
    color: #0066cc;
    border: 2px solid #0066cc;
  }
}

/* Reduced motion support */
@media (prefers-reduced-motion: reduce) {
  .notification {
    transition: opacity 0.2s ease !important;
    animation: none !important;
  }

  .notification:hover {
    transform: none !important;
  }

  .notification-icon {
    animation: none !important;
  }

  .notification-priority-urgent {
    animation: none !important;
  }

  .notification-priority-urgent::before {
    animation: none !important;
    background: #ef4444 !important;
  }

  .notification-action-btn:hover,
  .notification-close:hover {
    transform: none !important;
  }
}

/* Mobile optimizations */
@media (max-width: 480px) {
  .notification-container {
    width: calc(100vw - 20px);
    right: 10px;
    left: 10px;
  }

  .notification {
    max-width: none;
    margin-bottom: 8px;
    padding: 14px 16px;
  }

  .notification-title {
    font-size: 13px;
  }

  .notification-message {
    font-size: 12px;
  }

  .notification-actions {
    margin-top: 10px;
  }

  .notification-action-btn {
    padding: 8px 12px;
    font-size: 11px;
    min-height: 32px;
  }

  .notification-close {
    width: 28px;
    height: 28px;
    top: 6px;
    right: 6px;
  }
}

/* Notification entrance animations */
.notification.animate-in {
  opacity: 1;
  transform: translateX(0);
}

.notification.animate-out {
  opacity: 0;
  transform: translateX(400px);
}

/* Progress indicator for persistent notifications */
.notification-progress {
  position: absolute;
  bottom: 0;
  left: 0;
  height: 3px;
  background: rgba(59, 130, 246, 0.3);
  border-radius: 0 0 16px 16px;
  animation: progress-countdown linear;
}

@keyframes progress-countdown {
  from { width: 100%; }
  to { width: 0%; }
}

/* Notification grouping */
.notification-group {
  margin-bottom: 16px;
}

.notification-group-header {
  font-size: 12px;
  color: #6b7280;
  margin-bottom: 8px;
  padding: 0 4px;
  font-weight: 500;
  text-transform: uppercase;
  letter-spacing: 0.025em;
}

/* Special highlighting for task navigation */
.highlighted {
  animation: highlight-pulse 3s ease-in-out;
  border: 2px solid #3b82f6 !important;
  box-shadow: 0 0 0 4px rgba(59, 130, 246, 0.2) !important;
}

@keyframes highlight-pulse {
  0%, 100% {
    background-color: transparent;
  }
  50% {
    background-color: rgba(59, 130, 246, 0.1);
  }
}

/* Touch optimizations */
@media (hover: none) and (pointer: coarse) {
  .notification {
    padding: 18px 22px;
  }

  .notification-action-btn {
    padding: 10px 16px;
    font-size: 13px;
    min-height: 40px;
  }

  .notification-close {
    width: 32px;
    height: 32px;
    top: 8px;
    right: 8px;
  }
}

/* Print styles */
@media print {
  .notification-container,
  .notification {
    display: none !important;
  }
}

/* Focus styles for accessibility */
.notification:focus-visible {
  outline: 3px solid rgba(59, 130, 246, 0.6);
  outline-offset: 2px;
}

.notification-action-btn:focus-visible,
.notification-close:focus-visible {
  outline: 2px solid rgba(59, 130, 246, 0.6);
  outline-offset: 2px;
}

/* Stack multiple notifications nicely */
.notification:nth-child(n+4) {
  opacity: 0.8;
  transform: scale(0.98) translateY(-4px);
}

.notification:nth-child(n+6) {
  opacity: 0.6;
  transform: scale(0.96) translateY(-8px);
}

.notification:nth-child(n+8) {
  opacity: 0.4;
  transform: scale(0.94) translateY(-12px);
}

/* Notification sound visualization */
.notification.with-sound::after {
  content: '🔊';
  position: absolute;
  top: 8px;
  right: 40px;
  font-size: 12px;
  opacity: 0.7;
  animation: sound-pulse 2s ease-in-out;
}

@keyframes sound-pulse {
  0%, 100% { opacity: 0.7; transform: scale(1); }
  50% { opacity: 1; transform: scale(1.1); }
}