/**
 * AIGF Plugin - Unified Notification System
 * Consistent notifications across all pages using CSS variables
 * Version: 1.0.0
 */

/* ========================================================================
   Base Notification Styles
   ======================================================================== */

.aigf-notification {
    position: fixed;
    top: var(--spacing-lg);
    right: var(--spacing-lg);
    z-index: var(--z-notification);
    
    /* Layout */
    display: flex;
    align-items: flex-start;
    gap: var(--spacing-md);
    max-width: 400px;
    min-width: 300px;
    padding: var(--spacing-lg);
    
    /* Typography */
    font-family: var(--font-primary);
    font-size: var(--font-xs);
    line-height: var(--line-height-normal);
    
    /* Appearance */
    background: var(--notification-bg);
    border: 1px solid var(--notification-border);
    border-radius: var(--radius-lg);
    backdrop-filter: blur(10px);
    box-shadow: var(--notification-shadow);
    
    /* Animation */
    transform: translateX(100%);
    opacity: 0;
    transition: all var(--transition-base);
    animation: slideInNotification 0.4s ease forwards;
}

.aigf-notification.show {
    transform: translateX(0);
    opacity: 1;
}

.aigf-notification.hide {
    transform: translateX(100%);
    opacity: 0;
}

/* ========================================================================
   Notification Icon
   ======================================================================== */

.aigf-notification-icon {
    flex-shrink: 0;
    width: var(--icon-md);
    height: var(--icon-md);
    border-radius: var(--radius-full);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: var(--font-sm);
    font-weight: var(--font-bold);
}

/* ========================================================================
   Notification Content
   ======================================================================== */

.aigf-notification-content {
    flex: 1;
    min-width: 0; /* Prevent text overflow */
}

.aigf-notification-title {
    font-size: var(--font-sm);
    font-weight: var(--font-semibold);
    color: var(--notification-text);
    margin: 0 0 var(--spacing-xs) 0;
}

.aigf-notification-message {
    font-size: var(--font-xs);
    color: var(--text-muted1);
    margin: 0;
    word-wrap: break-word;
}

/* ========================================================================
   Close Button
   ======================================================================== */

.aigf-notification-close {
    flex-shrink: 0;
    background: none;
    border: none;
    color: var(--text-muted1);
    cursor: pointer;
    padding: var(--spacing-xs);
    margin: calc(var(--spacing-xs) * -1);
    border-radius: var(--radius-sm);
    font-size: var(--font-md);
    line-height: 1;
    transition: all var(--transition-fast);
}

.aigf-notification-close:hover {
    background: rgba(255, 255, 255, 0.1);
    color: var(--notification-text);
}

/* ========================================================================
   Notification Types
   ======================================================================== */

/* Success Notifications */
.aigf-notification.success .aigf-notification-icon {
    background: var(--success);
    color: var(--text-dark);
}

.aigf-notification.success {
    border-color: var(--success-border);
}

.aigf-notification.success .aigf-notification-title {
    color: var(--success);
}

/* Error Notifications */
.aigf-notification.error .aigf-notification-icon {
    background: var(--error);
    color: var(--text-light1);
}

.aigf-notification.error {
    border-color: var(--error-border);
}

.aigf-notification.error .aigf-notification-title {
    color: var(--error);
}

/* Warning Notifications */
.aigf-notification.warning .aigf-notification-icon {
    background: var(--warning);
    color: var(--text-dark);
}

.aigf-notification.warning {
    border-color: var(--warning-border);
}

.aigf-notification.warning .aigf-notification-title {
    color: var(--warning);
}

/* Info Notifications */
.aigf-notification.info .aigf-notification-icon {
    background: var(--info);
    color: var(--text-light1);
}

.aigf-notification.info {
    border-color: var(--info-border);
}

.aigf-notification.info .aigf-notification-title {
    color: var(--info);
}

/* Primary Notifications */
.aigf-notification.primary .aigf-notification-icon {
    background: var(--primary);
    color: var(--text-light1);
}

.aigf-notification.primary {
    border-color: var(--glass-border);
    box-shadow: var(--shadow-glow);
}

.aigf-notification.primary .aigf-notification-title {
    color: var(--primary);
}

/* ========================================================================
   Multiple Notifications Stacking
   ======================================================================== */

.aigf-notification:nth-child(1) { 
    top: var(--spacing-lg); 
}

.aigf-notification:nth-child(2) { 
    top: calc(var(--spacing-lg) * 2 + 80px); 
}

.aigf-notification:nth-child(3) { 
    top: calc(var(--spacing-lg) * 3 + 160px); 
}

.aigf-notification:nth-child(4) { 
    top: calc(var(--spacing-lg) * 4 + 240px); 
}

/* ========================================================================
   Responsive Design
   ======================================================================== */

@media (max-width: 768px) {
    .aigf-notification {
        top: var(--spacing-sm);
        right: var(--spacing-sm);
        left: var(--spacing-sm);
        max-width: none;
        min-width: 0;
        padding: var(--spacing-md);
        gap: var(--spacing-sm);
    }
    
    .aigf-notification-icon {
        width: var(--icon-sm);
        height: var(--icon-sm);
        font-size: var(--font-xs);
    }
    
    .aigf-notification-title {
        font-size: var(--font-xs);
    }
    
    .aigf-notification-message {
        font-size: 11px;
    }
    
    /* Mobile stacking */
    .aigf-notification:nth-child(1) { 
        top: var(--spacing-sm); 
    }
    
    .aigf-notification:nth-child(2) { 
        top: calc(var(--spacing-sm) * 2 + 70px); 
    }
    
    .aigf-notification:nth-child(3) { 
        top: calc(var(--spacing-sm) * 3 + 140px); 
    }
}

@media (max-width: 480px) {
    .aigf-notification {
        font-size: 11px;
        padding: var(--spacing-sm);
        gap: var(--spacing-xs);
    }
    
    .aigf-notification-title {
        font-size: 11px;
        margin-bottom: 2px;
    }
    
    .aigf-notification-message {
        font-size: 10px;
    }
}

/* ========================================================================
   Animations
   ======================================================================== */

@keyframes slideInNotification {
    0% {
        transform: translateX(100%);
        opacity: 0;
    }
    100% {
        transform: translateX(0);
        opacity: 1;
    }
}

@keyframes slideOutNotification {
    0% {
        transform: translateX(0);
        opacity: 1;
    }
    100% {
        transform: translateX(100%);
        opacity: 0;
    }
}

/* ========================================================================
   Loading/Progress Notifications
   ======================================================================== */

.aigf-notification.loading .aigf-notification-icon::after {
    content: '';
    width: 12px;
    height: 12px;
    border: 2px solid transparent;
    border-top-color: currentColor;
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

.aigf-notification.loading .aigf-notification-icon {
    background: var(--primary);
    color: var(--text-light1);
}

@keyframes spin {
    to { transform: rotate(360deg); }
}

/* ========================================================================
   Dark Mode & High Contrast Support
   ======================================================================== */

@media (prefers-contrast: high) {
    .aigf-notification {
        border-width: 2px;
        box-shadow: 0 4px 16px rgba(0, 0, 0, 0.5);
    }
    
    .aigf-notification-title,
    .aigf-notification-message {
        color: var(--text-light1);
    }
}

/* ========================================================================
   Reduced Motion Support
   ======================================================================== */

@media (prefers-reduced-motion: reduce) {
    .aigf-notification {
        animation: none;
        transform: translateX(0);
        opacity: 1;
    }
    
    .aigf-notification-close {
        transition: none;
    }
}

/* ========================================================================
   Print Support (Hide notifications)
   ======================================================================== */

@media print {
    .aigf-notification {
        display: none;
    }
}