/*
 * VibePostAI Core - Notifications & Feedback System
 * Version: 1.2.0
 * 
 * Toast notifications, achievement badges, and user feedback styling
 */

/* ====== NOTIFICATION CONTAINER ====== */
.vpa-notifications {
  position: fixed;
  top: 32px;
  right: 2rem;
  z-index: 10000;
  max-width: 400px;
  pointer-events: none;
}

.vpa-notification {
  background: var(--vpa-core-bg-dark);
  border: 1px solid var(--vpa-core-border);
  border-radius: var(--vpa-core-radius);
  padding: 1rem;
  margin-bottom: 1rem;
  box-shadow: var(--vpa-core-shadow);
  display: flex;
  align-items: flex-start;
  gap: 1rem;
  transform: translateX(100%);
  opacity: 0;
  transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
  pointer-events: auto;
  position: relative;
  overflow: hidden;
}

.vpa-notification.show {
  transform: translateX(0);
  opacity: 1;
}

.vpa-notification::before {
  content: '';
  position: absolute;
  bottom: 0;
  left: 0;
  width: 100%;
  height: 3px;
  background: currentColor;
  transform: scaleX(1);
  transform-origin: left;
  animation: vpa-notification-timer 4s linear forwards;
}

/* ====== NOTIFICATION TYPES ====== */
.vpa-notification.success {
  border-left: 4px solid var(--vpa-core-success);
  color: var(--vpa-core-success);
}

.vpa-notification.error {
  border-left: 4px solid var(--vpa-core-error);
  color: var(--vpa-core-error);
}

.vpa-notification.warning {
  border-left: 4px solid var(--vpa-core-warning);
  color: var(--vpa-core-warning);
}

.vpa-notification.info {
  border-left: 4px solid var(--vpa-core-primary);
  color: var(--vpa-core-primary);
}

/* ====== NOTIFICATION CONTENT ====== */
.vpa-notification-icon {
  width: 20px;
  height: 20px;
  flex-shrink: 0;
  margin-top: 0.125rem;
}

.vpa-notification-content {
  flex: 1;
  min-width: 0;
}

.vpa-notification-title {
  font-weight: 600;
  color: var(--vpa-core-text-main);
  margin-bottom: 0.25rem;
  font-size: 0.875rem;
}

.vpa-notification-message {
  color: var(--vpa-core-text-muted);
  font-size: 0.875rem;
  line-height: 1.4;
}

.vpa-notification-close {
  background: none;
  border: none;
  color: var(--vpa-core-text-muted);
  cursor: pointer;
  padding: 0.25rem;
  border-radius: 4px;
  transition: var(--vpa-core-transition);
  flex-shrink: 0;
}

.vpa-notification-close:hover {
  background: var(--vpa-core-border);
  color: var(--vpa-core-text-main);
}

/* ====== NOTIFICATION ANIMATIONS ====== */
@keyframes vpa-notification-timer {
  to { transform: scaleX(0); }
}

@keyframes vpa-notification-in {
  from {
    transform: translateX(100%) scale(0.8);
    opacity: 0;
  }
  to {
    transform: translateX(0) scale(1);
    opacity: 1;
  }
}

@keyframes vpa-notification-out {
  to {
    transform: translateX(100%) scale(0.8);
    opacity: 0;
  }
}

/* ====== ACHIEVEMENT NOTIFICATIONS ====== */
.vpa-achievement-notification {
  background: linear-gradient(135deg, var(--vpa-core-warning), #F97316);
  border: none;
  color: white;
}

.vpa-achievement-notification::before {
  background: rgba(255, 255, 255, 0.3);
}

.vpa-achievement-icon {
  font-size: 1.5rem;
  animation: vpa-achievement-glow 2s ease-in-out infinite alternate;
}

@keyframes vpa-achievement-glow {
  from { filter: drop-shadow(0 0 5px currentColor); }
  to { filter: drop-shadow(0 0 15px currentColor); }
}

.vpa-achievement-title {
  color: white;
  font-weight: 700;
}

.vpa-achievement-description {
  color: rgba(255, 255, 255, 0.9);
}

/* ====== RATE LIMIT NOTIFICATIONS ====== */
.vpa-rate-limit-notification {
  background: var(--vpa-core-warning);
  border: none;
  color: white;
}

.vpa-rate-limit-notification .vpa-notification-content {
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.vpa-rate-limit-timer {
  font-weight: 600;
  font-family: monospace;
  font-size: 1rem;
}

/* ====== BULK OPERATION NOTIFICATIONS ====== */
.vpa-bulk-notification {
  max-width: 500px;
}

.vpa-bulk-progress {
  margin-top: 0.75rem;
}

.vpa-bulk-progress-bar {
  width: 100%;
  height: 6px;
  background: var(--vpa-core-border);
  border-radius: 3px;
  overflow: hidden;
}

.vpa-bulk-progress-fill {
  height: 100%;
  background: linear-gradient(90deg, var(--vpa-core-primary), var(--vpa-core-primary-dark));
  transition: width 0.3s ease;
  position: relative;
}

.vpa-bulk-progress-fill::after {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  bottom: 0;
  width: 100px;
  background: linear-gradient(90deg, transparent, rgba(255,255,255,0.3), transparent);
  animation: vpa-progress-shine 2s ease-in-out infinite;
  transform: translateX(-100px);
}

@keyframes vpa-progress-shine {
  0% { transform: translateX(-100px); }
  50% { transform: translateX(100%); }
  100% { transform: translateX(-100px); }
}

.vpa-bulk-status {
  margin-top: 0.5rem;
  font-size: 0.75rem;
  color: var(--vpa-core-text-muted);
}

/* ====== MINI NOTIFICATIONS ====== */
.vpa-mini-notification {
  position: absolute;
  top: -40px;
  left: 50%;
  transform: translateX(-50%);
  background: var(--vpa-core-bg-dark);
  border: 1px solid var(--vpa-core-border);
  padding: 0.5rem 0.75rem;
  border-radius: var(--vpa-core-radius);
  font-size: 0.75rem;
  white-space: nowrap;
  z-index: 1000;
  opacity: 0;
  pointer-events: none;
  transition: all 0.3s ease;
}

.vpa-mini-notification.show {
  opacity: 1;
  transform: translateX(-50%) translateY(-5px);
}

.vpa-mini-notification::after {
  content: '';
  position: absolute;
  top: 100%;
  left: 50%;
  transform: translateX(-50%);
  border: 5px solid transparent;
  border-top-color: var(--vpa-core-border);
}

.vpa-mini-notification.success {
  background: var(--vpa-core-success);
  border-color: var(--vpa-core-success);
  color: white;
}

.vpa-mini-notification.success::after {
  border-top-color: var(--vpa-core-success);
}

/* ====== FLOATING ACTION FEEDBACK ====== */
.vpa-action-feedback {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(0, 0, 0, 0.8);
  border-radius: inherit;
  color: white;
  font-weight: 600;
  font-size: 0.875rem;
  opacity: 0;
  transition: all 0.3s ease;
  pointer-events: none;
}

.vpa-action-feedback.show {
  opacity: 1;
}

.vpa-action-feedback.success {
  background: rgba(16, 185, 129, 0.9);
}

.vpa-action-feedback.error {
  background: rgba(239, 68, 68, 0.9);
}

/* ====== LOADING OVERLAYS ====== */
.vpa-loading-overlay {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(0, 0, 0, 0.5);
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: inherit;
  opacity: 0;
  transition: all 0.3s ease;
  pointer-events: none;
}

.vpa-loading-overlay.show {
  opacity: 1;
  pointer-events: auto;
}

.vpa-loading-spinner {
  width: 24px;
  height: 24px;
  border: 3px solid rgba(255, 255, 255, 0.3);
  border-top-color: white;
  border-radius: 50%;
  animation: vpa-spin 1s linear infinite;
}

/* ====== ANALYTICS NOTIFICATIONS ====== */
.vpa-analytics-notification {
  background: linear-gradient(135deg, var(--vpa-core-primary), var(--vpa-core-primary-dark));
  border: none;
  color: white;
}

.vpa-analytics-chart {
  margin-top: 0.75rem;
  display: flex;
  align-items: end;
  gap: 2px;
  height: 40px;
}

.vpa-analytics-bar {
  flex: 1;
  background: rgba(255, 255, 255, 0.3);
  border-radius: 1px;
  animation: vpa-bar-grow 0.6s ease-out backwards;
}

@keyframes vpa-bar-grow {
  from { height: 0; }
}

/* ====== RESPONSIVE DESIGN ====== */
@media (max-width: 768px) {
  .vpa-notifications {
    top: 16px;
    right: 1rem;
    left: 1rem;
    max-width: none;
  }
  
  .vpa-notification {
    padding: 0.75rem;
  }
  
  .vpa-bulk-notification {
    max-width: none;
  }
}

/* ====== NOTIFICATION GROUPS ====== */
.vpa-notification-group {
  background: var(--vpa-core-bg-darker);
  border-radius: var(--vpa-core-radius);
  overflow: hidden;
  margin-bottom: 1rem;
}

.vpa-notification-group .vpa-notification {
  border-radius: 0;
  border-left: none;
  border-right: none;
  border-top: none;
  margin: 0;
}

.vpa-notification-group .vpa-notification:last-child {
  border-bottom: none;
}

.vpa-notification-group-header {
  padding: 0.75rem 1rem;
  background: var(--vpa-core-bg-lighter);
  border-bottom: 1px solid var(--vpa-core-border);
  font-weight: 600;
  color: var(--vpa-core-text-main);
  font-size: 0.875rem;
}

/* ====== NOTIFICATION BADGES ====== */
.vpa-notification-badge {
  position: absolute;
  top: -8px;
  right: -8px;
  min-width: 20px;
  height: 20px;
  background: var(--vpa-core-error);
  color: white;
  border-radius: 10px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.75rem;
  font-weight: 600;
  border: 2px solid var(--vpa-core-bg-dark);
  animation: vpa-badge-pulse 2s infinite;
}

@keyframes vpa-badge-pulse {
  0%, 100% { transform: scale(1); }
  50% { transform: scale(1.1); }
}

/* ====== ACCESSIBILITY IMPROVEMENTS ====== */
@media (prefers-reduced-motion: reduce) {
  .vpa-notification,
  .vpa-achievement-icon,
  .vpa-loading-spinner,
  .vpa-notification-badge {
    animation: none;
  }
  
  .vpa-notification {
    transition: opacity 0.3s ease;
  }
}

/* ====== HIGH CONTRAST MODE ====== */
@media (prefers-contrast: high) {
  .vpa-notification {
    border-width: 2px;
  }
  
  .vpa-notification.success {
    border-left-width: 6px;
  }
  
  .vpa-notification.error {
    border-left-width: 6px;
  }
  
  .vpa-notification.warning {
    border-left-width: 6px;
  }
}

/* ====== DARK MODE ENHANCEMENTS ====== */
@media (prefers-color-scheme: dark) {
  .vpa-notification {
    background: var(--vpa-core-bg-darker, #111827);
    border-color: var(--vpa-core-border, #374151);
  }
}

/* ====== NOTIFICATION SOUND INDICATORS ====== */
.vpa-notification.has-sound::before {
  background: linear-gradient(90deg, 
    currentColor 0%, 
    transparent 20%, 
    currentColor 40%, 
    transparent 60%, 
    currentColor 80%, 
    transparent 100%);
  animation: vpa-sound-wave 1s ease-in-out infinite;
}

@keyframes vpa-sound-wave {
  0%, 100% { opacity: 0.5; }
  50% { opacity: 1; }
}