/* ==============================================
   Notification Toast System - Modern Design
   ============================================== */

/* Container positioning */
.notification-container {
    position: fixed;
    z-index: 99999;
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
    max-width: 420px;
    width: 100%;
    pointer-events: none;
    padding: 1rem;
}

/* Position variants */
.notification-container--top-right {
    top: 0;
    right: 0;
    align-items: flex-end;
}

.notification-container--top-left {
    top: 0;
    left: 0;
    align-items: flex-start;
}

.notification-container--bottom-right {
    bottom: 0;
    right: 0;
    align-items: flex-end;
}

.notification-container--bottom-left {
    bottom: 0;
    left: 0;
    align-items: flex-start;
}

.notification-container--top-center {
    top: 0;
    left: 50%;
    transform: translateX(-50%);
    align-items: center;
}

.notification-container--bottom-center {
    bottom: 0;
    left: 50%;
    transform: translateX(-50%);
    align-items: center;
}

/* Notification card */
.notification {
    position: relative;
    display: flex;
    align-items: flex-start;
    gap: 1rem;
    padding: 1rem 1.25rem;
    background: #ffffff;
    border-radius: 12px;
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.12),
                0 4px 8px rgba(0, 0, 0, 0.08);
    border-left: 4px solid transparent;
    pointer-events: auto;
    min-width: 320px;
    max-width: 100%;
    animation: slideInRight 0.4s cubic-bezier(0.68, -0.55, 0.265, 1.55);
    transition: all 0.3s ease;
    backdrop-filter: blur(10px);
    overflow: hidden;
}

.notification::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 4px;
    opacity: 0.15;
    transition: opacity 0.3s ease;
}

.notification:hover {
    transform: translateY(-2px);
    box-shadow: 0 12px 32px rgba(0, 0, 0, 0.15),
                0 6px 12px rgba(0, 0, 0, 0.1);
}

.notification:hover::before {
    opacity: 0.25;
}

/* Type variants */
.notification--success {
    border-left-color: #10b981;
}

.notification--success::before {
    background: linear-gradient(90deg, #10b981, #34d399);
}

.notification--warning {
    border-left-color: #f59e0b;
}

.notification--warning::before {
    background: linear-gradient(90deg, #f59e0b, #fbbf24);
}

.notification--error {
    border-left-color: #ef4444;
}

.notification--error::before {
    background: linear-gradient(90deg, #ef4444, #f87171);
}

.notification--info {
    border-left-color: #3b82f6;
}

.notification--info::before {
    background: linear-gradient(90deg, #3b82f6, #60a5fa);
}

/* Icon styling */
.notification__icon {
    flex-shrink: 0;
    width: 24px;
    height: 24px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    font-size: 14px;
    margin-top: 2px;
}

.notification--success .notification__icon {
    background: rgba(16, 185, 129, 0.1);
    color: #10b981;
}

.notification--warning .notification__icon {
    background: rgba(245, 158, 11, 0.1);
    color: #f59e0b;
}

.notification--error .notification__icon {
    background: rgba(239, 68, 68, 0.1);
    color: #ef4444;
}

.notification--info .notification__icon {
    background: rgba(59, 130, 246, 0.1);
    color: #3b82f6;
}

/* Content */
.notification__content {
    flex: 1;
    min-width: 0;
    padding-right: 1.5rem;
}

.notification__title {
    margin: 0 0 0.25rem 0;
    font-size: 0.9375rem;
    font-weight: 600;
    color: #1f2937;
    line-height: 1.4;
}

.notification__message {
    margin: 0;
    font-size: 0.875rem;
    color: #6b7280;
    line-height: 1.5;
    word-wrap: break-word;
}

/* Close button */
.notification__close {
    position: absolute;
    top: 0.75rem;
    right: 0.75rem;
    padding: 0.25rem;
    background: none;
    border: none;
    color: #9ca3af;
    cursor: pointer;
    border-radius: 6px;
    transition: all 0.2s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    width: 24px;
    height: 24px;
}

.notification__close:hover {
    background: rgba(0, 0, 0, 0.05);
    color: #4b5563;
}

.notification__close:active {
    transform: scale(0.95);
}

.notification__close i {
    font-size: 12px;
}

/* Progress bar (optional) */
.notification__progress {
    position: absolute;
    bottom: 0;
    left: 0;
    height: 3px;
    background: currentColor;
    opacity: 0.3;
    animation: notificationProgress linear forwards;
}

.notification--success .notification__progress {
    color: #10b981;
}

.notification--warning .notification__progress {
    color: #f59e0b;
}

.notification--error .notification__progress {
    color: #ef4444;
}

.notification--info .notification__progress {
    color: #3b82f6;
}

/* Animations */
@keyframes slideInRight {
    from {
        transform: translateX(120%);
        opacity: 0;
    }
    to {
        transform: translateX(0);
        opacity: 1;
    }
}

@keyframes slideOutRight {
    from {
        transform: translateX(0) scale(1);
        opacity: 1;
    }
    to {
        transform: translateX(120%) scale(0.9);
        opacity: 0;
    }
}

@keyframes notificationProgress {
    from {
        width: 100%;
    }
    to {
        width: 0%;
    }
}

.notification--removing {
    animation: slideOutRight 0.3s cubic-bezier(0.68, -0.55, 0.265, 1.55) forwards;
}

/* Left position animations */
.notification-container--top-left .notification,
.notification-container--bottom-left .notification {
    animation: slideInLeft 0.4s cubic-bezier(0.68, -0.55, 0.265, 1.55);
}

@keyframes slideInLeft {
    from {
        transform: translateX(-120%);
        opacity: 0;
    }
    to {
        transform: translateX(0);
        opacity: 1;
    }
}

.notification-container--top-left .notification--removing,
.notification-container--bottom-left .notification--removing {
    animation: slideOutLeft 0.3s cubic-bezier(0.68, -0.55, 0.265, 1.55) forwards;
}

@keyframes slideOutLeft {
    from {
        transform: translateX(0) scale(1);
        opacity: 1;
    }
    to {
        transform: translateX(-120%) scale(0.9);
        opacity: 0;
    }
}

/* Center position animations */
.notification-container--top-center .notification,
.notification-container--bottom-center .notification {
    animation: slideInDown 0.4s cubic-bezier(0.68, -0.55, 0.265, 1.55);
}

@keyframes slideInDown {
    from {
        transform: translateY(-120%);
        opacity: 0;
    }
    to {
        transform: translateY(0);
        opacity: 1;
    }
}

.notification-container--top-center .notification--removing {
    animation: slideOutUp 0.3s cubic-bezier(0.68, -0.55, 0.265, 1.55) forwards;
}

@keyframes slideOutUp {
    from {
        transform: translateY(0) scale(1);
        opacity: 1;
    }
    to {
        transform: translateY(-120%) scale(0.9);
        opacity: 0;
    }
}

.notification-container--bottom-center .notification--removing {
    animation: slideOutDown 0.3s cubic-bezier(0.68, -0.55, 0.265, 1.55) forwards;
}

@keyframes slideOutDown {
    from {
        transform: translateY(0) scale(1);
        opacity: 1;
    }
    to {
        transform: translateY(120%) scale(0.9);
        opacity: 0;
    }
}

/* Responsive */
@media (max-width: 768px) {
    .notification-container {
        max-width: 100%;
        padding: 0.75rem;
    }

    .notification {
        min-width: 280px;
        padding: 0.875rem 1rem;
    }

    .notification__title {
        font-size: 0.875rem;
    }

    .notification__message {
        font-size: 0.8125rem;
    }
}

@media (max-width: 480px) {
    .notification {
        min-width: auto;
    }
}

/* Dark mode support */
@media (prefers-color-scheme: dark) {
    .notification {
        background: #1f2937;
        box-shadow: 0 8px 24px rgba(0, 0, 0, 0.3),
                    0 4px 8px rgba(0, 0, 0, 0.2);
    }

    .notification__title {
        color: #f9fafb;
    }

    .notification__message {
        color: #d1d5db;
    }

    .notification__close {
        color: #9ca3af;
    }

    .notification__close:hover {
        background: rgba(255, 255, 255, 0.1);
        color: #f3f4f6;
    }
}

/* Accessibility */
@media (prefers-reduced-motion: reduce) {
    .notification,
    .notification--removing {
        animation: none;
        transition: none;
    }

    .notification:hover {
        transform: none;
    }
}

/* High contrast mode */
@media (prefers-contrast: high) {
    .notification {
        border: 2px solid;
    }

    .notification--success {
        border-color: #10b981;
    }

    .notification--warning {
        border-color: #f59e0b;
    }

    .notification--error {
        border-color: #ef4444;
    }

    .notification--info {
        border-color: #3b82f6;
    }
}