/* Toast Notification System */

.toast-container {
  position: fixed;
  top: 80px;
  right: 20px;
  z-index: 10000;
  display: flex;
  flex-direction: column;
  gap: 12px;
  max-width: 400px;
}

.toast {
  background: white;
  border-radius: 12px;
  box-shadow: 0 10px 40px rgba(0, 0, 0, 0.15), 0 4px 12px rgba(0, 0, 0, 0.1);
  overflow: hidden;
  transform: translateX(450px);
  opacity: 0;
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  position: relative;
}

.toast-show {
  transform: translateX(0);
  opacity: 1;
}

.toast-hide {
  transform: translateX(450px);
  opacity: 0;
}

.toast-content {
  display: flex;
  align-items: center;
  padding: 16px;
  gap: 12px;
  position: relative;
}

.toast-icon {
  font-size: 32px;
  line-height: 1;
  flex-shrink: 0;
}

.toast-body {
  flex: 1;
  min-width: 0;
}

.toast-title {
  font-weight: 600;
  font-size: 15px;
  color: #1a202c;
  margin-bottom: 4px;
}

.toast-message {
  font-size: 14px;
  color: #4a5568;
  line-height: 1.5;
}

.toast-close {
  position: absolute;
  top: 8px;
  right: 8px;
  background: none;
  border: none;
  font-size: 24px;
  color: #a0aec0;
  cursor: pointer;
  padding: 4px 8px;
  line-height: 1;
  transition: color 0.2s;
}

.toast-close:hover {
  color: #718096;
}

.toast-action {
  display: block;
  padding: 12px 16px;
  background: rgba(102, 126, 234, 0.05);
  color: #667eea;
  text-decoration: none;
  font-size: 14px;
  font-weight: 500;
  text-align: center;
  border-top: 1px solid rgba(0, 0, 0, 0.05);
  transition: background 0.2s;
}

.toast-action:hover {
  background: rgba(102, 126, 234, 0.1);
}

.toast-progress {
  position: absolute;
  bottom: 0;
  left: 0;
  height: 4px;
  width: 100%;
  background: linear-gradient(90deg, #667eea, #764ba2);
  transform-origin: left;
}

@keyframes toast-progress {
  from {
    transform: scaleX(1);
  }
  to {
    transform: scaleX(0);
  }
}

/* Toast Type Styles */

.toast-achievement {
  border-left: 4px solid #fbbf24;
}

.toast-achievement .toast-progress {
  background: linear-gradient(90deg, #fbbf24, #f59e0b);
}

.toast-level-up {
  border-left: 4px solid #667eea;
}

.toast-level-up .toast-progress {
  background: linear-gradient(90deg, #667eea, #764ba2);
}

.toast-streak {
  border-left: 4px solid #f56565;
}

.toast-streak .toast-progress {
  background: linear-gradient(90deg, #f56565, #ed8936);
}

.toast-milestone {
  border-left: 4px solid #48bb78;
}

.toast-milestone .toast-progress {
  background: linear-gradient(90deg, #48bb78, #38a169);
}

.toast-reminder {
  border-left: 4px solid #4299e1;
}

.toast-reminder .toast-progress {
  background: linear-gradient(90deg, #4299e1, #3182ce);
}

.toast-info {
  border-left: 4px solid #4299e1;
}

.toast-success {
  border-left: 4px solid #48bb78;
}

.toast-warning {
  border-left: 4px solid #ed8936;
}

.toast-error {
  border-left: 4px solid #f56565;
}

/* Confetti Animation */

.confetti-container {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  pointer-events: none;
  z-index: 9999;
  overflow: hidden;
}

.confetti {
  position: absolute;
  width: 10px;
  height: 10px;
  top: -10px;
  opacity: 0;
  animation: confetti-fall linear forwards;
}

@keyframes confetti-fall {
  0% {
    opacity: 1;
    transform: translateY(0) rotate(0deg);
  }
  100% {
    opacity: 0;
    transform: translateY(100vh) rotate(720deg);
  }
}

/* Notification Bell Badge */

.notification-bell {
  position: relative;
  display: inline-block;
}

.notification-badge {
  position: absolute;
  top: -8px;
  right: -8px;
  background: linear-gradient(135deg, #f56565, #ed8936);
  color: white;
  font-size: 11px;
  font-weight: bold;
  padding: 2px 6px;
  border-radius: 10px;
  min-width: 20px;
  text-align: center;
  line-height: 1.4;
  box-shadow: 0 2px 8px rgba(245, 101, 101, 0.4);
  display: none;
  animation: notification-pulse 2s infinite;
}

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

/* Notification Center Dropdown */

.notification-center {
  width: 380px !important;
  max-height: 500px;
  border-radius: 12px;
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.2), 0 4px 12px rgba(0, 0, 0, 0.1);
  overflow: hidden;
  padding: 0;
  border: none;
}

.notification-center-header {
  padding: 16px 20px;
  border-bottom: 1px solid rgba(0, 0, 0, 0.05);
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.notification-center-title {
  font-weight: 600;
  font-size: 16px;
  color: #1a202c;
}

.notification-center-actions {
  display: flex;
  gap: 8px;
}

.notification-center-btn {
  background: none;
  border: none;
  color: #667eea;
  font-size: 13px;
  font-weight: 500;
  cursor: pointer;
  padding: 4px 8px;
  border-radius: 4px;
  transition: background 0.2s;
}

.notification-center-btn:hover {
  background: rgba(102, 126, 234, 0.1);
}

.notification-center-list {
  max-height: 400px;
  overflow-y: auto;
}

.notification-item {
  padding: 16px 20px;
  border-bottom: 1px solid rgba(0, 0, 0, 0.05);
  cursor: pointer;
  transition: background 0.2s;
  display: flex;
  gap: 12px;
  align-items: start;
}

.notification-item:hover {
  background: rgba(102, 126, 234, 0.02);
}

.notification-item.unread {
  background: rgba(102, 126, 234, 0.05);
}

.notification-item.unread::before {
  content: '';
  position: absolute;
  left: 0;
  top: 0;
  bottom: 0;
  width: 4px;
  background: #667eea;
}

.notification-item-icon {
  font-size: 24px;
  line-height: 1;
  flex-shrink: 0;
}

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

.notification-item-title {
  font-weight: 500;
  font-size: 14px;
  color: #1a202c;
  margin-bottom: 4px;
}

.notification-item-message {
  font-size: 13px;
  color: #4a5568;
  line-height: 1.5;
  margin-bottom: 4px;
}

.notification-item-time {
  font-size: 12px;
  color: #a0aec0;
}

.notification-empty {
  padding: 60px 20px;
  text-align: center;
  color: #a0aec0;
}

.notification-empty-icon {
  font-size: 48px;
  margin-bottom: 12px;
  opacity: 0.5;
}

.notification-empty-text {
  font-size: 14px;
}

/* Mobile Responsive */

@media (max-width: 768px) {
  .toast-container {
    left: 20px;
    right: 20px;
    max-width: none;
  }

  .notification-center {
    width: calc(100vw - 40px);
    right: 20px;
  }

  .toast {
    transform: translateY(-100px);
  }

  .toast-show {
    transform: translateY(0);
  }

  .toast-hide {
    transform: translateY(-100px);
  }
}

/* Dark Mode Support */

@media (prefers-color-scheme: dark) {
  .toast {
    background: #2d3748;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.4), 0 4px 12px rgba(0, 0, 0, 0.2);
  }

  .toast-title {
    color: #f7fafc;
  }

  .toast-message {
    color: #cbd5e0;
  }

  .toast-close {
    color: #718096;
  }

  .toast-close:hover {
    color: #a0aec0;
  }

  .notification-center {
    background: #2d3748;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.5), 0 4px 12px rgba(0, 0, 0, 0.3);
  }

  .notification-center-title,
  .notification-item-title {
    color: #f7fafc;
  }

  .notification-item-message {
    color: #cbd5e0;
  }

  .notification-item:hover {
    background: rgba(102, 126, 234, 0.1);
  }

  .notification-item.unread {
    background: rgba(102, 126, 234, 0.15);
  }
}
