/* ================================================================
   TOAST NOTIFICATIONS SYSTEM
   Responsive, Accessible, Modern Notifications
   ================================================================ */

/* ================================================================
   1. NOTIFICATION CONTAINER
   ================================================================ */

#notification-container {
    position: fixed;
    bottom: 24px;
    right: 24px;
    display: flex;
    flex-direction: column;
    gap: 12px;
    z-index: 2000;
    pointer-events: none;
    max-width: 400px;
}

/* ================================================================
   2. NOTIFICATION TOAST BASE STYLES
   ================================================================ */

.notification {
    display: flex;
    flex-direction: column;
    gap: 12px;
    padding: 16px 20px;
    background: var(--bg-primary);
    border-radius: 12px;
    border-left: 4px solid;
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.15);
    min-width: 300px;
    max-width: 400px;
    pointer-events: auto;
    animation: slideIn 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    word-wrap: break-word;
}

@keyframes slideIn {
    from {
        transform: translateX(400px);
        opacity: 0;
    }
    to {
        transform: translateX(0);
        opacity: 1;
    }
}

.notification.exiting {
    animation: slideOut 0.3s cubic-bezier(0.4, 0, 0.2, 1) forwards;
}

@keyframes slideOut {
    from {
        transform: translateX(0);
        opacity: 1;
    }
    to {
        transform: translateX(400px);
        opacity: 0;
    }
}

/* ================================================================
   3. NOTIFICATION TYPES
   ================================================================ */

/* SUCCESS NOTIFICATION */
.notification-success {
    border-left-color: #10b981;
    background: linear-gradient(135deg, rgba(16, 185, 129, 0.05) 0%, rgba(16, 185, 129, 0.02) 100%);
}

.notification-success .notification-icon {
    color: #10b981;
    font-size: 20px;
}

.notification-success .notification-content p {
    color: #059669;
    font-weight: 500;
}

/* INFO NOTIFICATION */
.notification-info {
    border-left-color: #3b82f6;
    background: linear-gradient(135deg, rgba(59, 130, 246, 0.05) 0%, rgba(59, 130, 246, 0.02) 100%);
}

.notification-info .notification-icon {
    color: #3b82f6;
    font-size: 20px;
}

.notification-info .notification-content p {
    color: #1e40af;
    font-weight: 500;
}

/* WARNING NOTIFICATION */
.notification-warning {
    border-left-color: #f59e0b;
    background: linear-gradient(135deg, rgba(245, 158, 11, 0.05) 0%, rgba(245, 158, 11, 0.02) 100%);
}

.notification-warning .notification-icon {
    color: #f59e0b;
    font-size: 20px;
}

.notification-warning .notification-content p {
    color: #b45309;
    font-weight: 500;
}

/* ERROR NOTIFICATION */
.notification-error {
    border-left-color: #ef4444;
    background: linear-gradient(135deg, rgba(239, 68, 68, 0.05) 0%, rgba(239, 68, 68, 0.02) 100%);
}

.notification-error .notification-icon {
    color: #ef4444;
    font-size: 20px;
}

.notification-error .notification-content p {
    color: #dc2626;
    font-weight: 500;
}

/* ================================================================
   4. NOTIFICATION CONTENT
   ================================================================ */

.notification-content {
    display: flex;
    gap: 12px;
    align-items: flex-start;
}

.notification-icon {
    flex-shrink: 0;
    width: 24px;
    height: 24px;
    display: flex;
    align-items: center;
    justify-content: center;
    line-height: 1;
}

.notification-text {
    flex: 1;
}

.notification-text p {
    margin: 0;
    font-size: 14px;
    line-height: 1.5;
    color: var(--text-primary);
}

.notification-text .notification-title {
    display: block;
    font-weight: 600;
    margin-bottom: 2px;
}

.notification-text .notification-description {
    display: block;
    font-size: 12px;
    opacity: 0.8;
    margin-top: 4px;
}

/* ================================================================
   5. NOTIFICATION ACTIONS
   ================================================================ */

.notification-actions {
    display: flex;
    gap: 8px;
    align-items: center;
    margin-left: 36px;
}

.notification-actions button {
    padding: 6px 12px;
    font-size: 12px;
    font-weight: 500;
    border: none;
    border-radius: 6px;
    cursor: pointer;
    background: transparent;
    color: var(--text-primary);
    transition: all 0.2s ease;
    white-space: nowrap;
}

.notification-actions button:hover {
    background: rgba(0, 0, 0, 0.05);
}

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

/* Action button variants */
.notification-actions .action-primary {
    background: var(--color-primary-light);
    color: white;
}

.notification-actions .action-primary:hover {
    opacity: 0.9;
    box-shadow: 0 2px 8px rgba(102, 126, 234, 0.3);
}

.notification-actions .action-secondary {
    background: var(--bg-secondary);
    color: var(--text-primary);
}

.notification-actions .action-secondary:hover {
    background: var(--border-color);
}

.notification-close {
    background: none;
    border: none;
    color: var(--text-secondary);
    cursor: pointer;
    font-size: 16px;
    padding: 4px 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: color 0.2s ease;
}

.notification-close:hover {
    color: var(--text-primary);
}

/* ================================================================
   6. NOTIFICATION PROGRESS BAR
   ================================================================ */

.notification-progress {
    width: 100%;
    height: 3px;
    background: rgba(0, 0, 0, 0.1);
    border-radius: 2px;
    overflow: hidden;
    margin-top: 8px;
}

.notification-progress-bar {
    height: 100%;
    background: var(--color-primary-gradient);
    animation: progressBar linear forwards;
}

@keyframes progressBar {
    from {
        width: 100%;
    }
    to {
        width: 0%;
    }
}

/* ================================================================
   7. STACKED NOTIFICATIONS
   ================================================================ */

.notification:nth-child(1) {
    z-index: 2005;
}

.notification:nth-child(2) {
    z-index: 2004;
    transform: translateY(12px);
    opacity: 0.9;
}

.notification:nth-child(3) {
    z-index: 2003;
    transform: translateY(24px);
    opacity: 0.8;
    display: none;
}

.notification:nth-child(n+4) {
    display: none;
}

/* ================================================================
   8. RESPONSIVE DESIGN
   ================================================================ */

@media (max-width: 768px) {
    #notification-container {
        bottom: 16px;
        right: 16px;
        left: 16px;
        max-width: none;
    }
    
    .notification {
        min-width: auto;
        max-width: 100%;
    }
}

@media (max-width: 480px) {
    #notification-container {
        bottom: 12px;
        right: 12px;
        left: 12px;
        gap: 8px;
    }
    
    .notification {
        padding: 12px 16px;
        min-width: auto;
    }
    
    .notification-actions {
        margin-left: 0;
        flex-direction: column;
    }
    
    .notification-actions button {
        width: 100%;
    }
}

/* ================================================================
   9. ACCESSIBILITY
   ================================================================ */

@media (prefers-reduced-motion: reduce) {
    .notification,
    .notification.exiting {
        animation: none;
        transform: none;
    }
    
    .notification-progress-bar {
        animation: none;
    }
}

/* High contrast mode */
@media (prefers-contrast: more) {
    .notification {
        border-left-width: 6px;
        box-shadow: 0 0 0 2px var(--text-primary);
    }
}

/* Dark theme adjustments */
body.dark-theme {
    --notification-shadow: 0 8px 24px rgba(0, 0, 0, 0.4);
}

body.dark-theme .notification-success {
    background: linear-gradient(135deg, rgba(16, 185, 129, 0.1) 0%, rgba(16, 185, 129, 0.05) 100%);
}

body.dark-theme .notification-info {
    background: linear-gradient(135deg, rgba(59, 130, 246, 0.1) 0%, rgba(59, 130, 246, 0.05) 100%);
}

body.dark-theme .notification-warning {
    background: linear-gradient(135deg, rgba(245, 158, 11, 0.1) 0%, rgba(245, 158, 11, 0.05) 100%);
}

body.dark-theme .notification-error {
    background: linear-gradient(135deg, rgba(239, 68, 68, 0.1) 0%, rgba(239, 68, 68, 0.05) 100%);
}

body.dark-theme .notification-actions button:hover {
    background: rgba(255, 255, 255, 0.1);
}

body.dark-theme .notification-actions .action-secondary:hover {
    background: rgba(255, 255, 255, 0.15);
}
