/**
 * Notification Bar Component
 * Custom notification bar with enable/disable support
 * @version 1.0.0
 * @date 2025-12-17
 */

/* ============================================
   Notification Bar Container
   ============================================ */
.notification-bar {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    z-index: var(--z-toast, 10080);
    display: flex;
    flex-direction: column;
    gap: 0;
    pointer-events: none;
    transition: opacity 0.2s ease, visibility 0.2s ease, transform 0.2s ease;
}

.notification-bar.notification-bar-over-modal {
    z-index: calc(var(--z-toast, 10080) + 10);
}

.notification-bar.bottom {
    top: auto;
    bottom: 0;
}

.notification-bar.top-right {
    top: 20px;
    right: 20px;
    left: auto;
    width: min(420px, calc(100vw - 32px));
    gap: 12px;
}

.notification-bar.bottom-right {
    top: auto;
    bottom: 20px;
    right: 20px;
    left: auto;
    width: min(420px, calc(100vw - 32px));
    gap: 12px;
}

/* ============================================
   Notification Item
   ============================================ */
.notification-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px 20px;
    margin: 0;
    background: linear-gradient(135deg, #1e293b 0%, #0f172a 100%);
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
    color: #f1f5f9;
    font-size: 0.9rem;
    transform: translateY(-100%);
    opacity: 0;
    transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1),
                opacity 0.3s ease;
    pointer-events: auto;
}

.notification-bar.top-right .notification-item,
.notification-bar.bottom-right .notification-item {
    margin: 0;
    border: 1px solid rgba(255, 255, 255, 0.12);
    border-radius: 14px;
    box-shadow: 0 18px 48px rgba(15, 23, 42, 0.28);
    transform: translateX(110%);
}

.notification-bar.bottom .notification-item {
    transform: translateY(100%);
    border-bottom: none;
    border-top: 1px solid rgba(255, 255, 255, 0.1);
}

.notification-bar.bottom-right .notification-item {
    transform: translateX(110%);
}

.notification-item.show {
    transform: translateY(0);
    opacity: 1;
}

.notification-bar.top-right .notification-item.show,
.notification-bar.bottom-right .notification-item.show {
    transform: translateX(0);
    opacity: 1;
}

/* ============================================
   Notification Types
   ============================================ */
.notification-item.info {
    background: linear-gradient(135deg, #1e40af 0%, #1e3a8a 100%);
    border-color: rgba(96, 165, 250, 0.3);
}

.notification-item.success {
    background: linear-gradient(135deg, #166534 0%, #14532d 100%);
    border-color: rgba(52, 211, 153, 0.3);
}

.notification-item.warning {
    background: linear-gradient(135deg, #92400e 0%, #78350f 100%);
    border-color: rgba(251, 191, 36, 0.3);
}

.notification-item.error {
    background: linear-gradient(135deg, #991b1b 0%, #7f1d1d 100%);
    border-color: rgba(248, 113, 113, 0.3);
}

/* ============================================
   Notification Icon
   ============================================ */
.notification-icon {
    flex-shrink: 0;
    width: 20px;
    height: 20px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.notification-icon svg {
    width: 18px;
    height: 18px;
    fill: currentColor;
}

.notification-item.info .notification-icon {
    color: #60a5fa;
}

.notification-item.success .notification-icon {
    color: #34d399;
}

.notification-item.warning .notification-icon {
    color: #fbbf24;
}

.notification-item.error .notification-icon {
    color: #f87171;
}

/* ============================================
   Notification Content
   ============================================ */
.notification-content {
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.notification-title {
    font-weight: 600;
    font-size: 0.9rem;
}

.notification-message {
    font-size: 0.85rem;
    opacity: 0.9;
}

/* ============================================
   Notification Actions
   ============================================ */
.notification-actions {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-left: auto;
}

.notification-action-btn {
    padding: 6px 12px;
    border: 1px solid rgba(255, 255, 255, 0.2);
    border-radius: 6px;
    background: rgba(255, 255, 255, 0.1);
    color: inherit;
    font-size: 0.8rem;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s ease;
}

.notification-action-btn:hover {
    background: rgba(255, 255, 255, 0.2);
    border-color: rgba(255, 255, 255, 0.3);
}

.notification-action-btn.primary {
    background: rgba(59, 130, 246, 0.3);
    border-color: rgba(59, 130, 246, 0.5);
}

.notification-action-btn.primary:hover {
    background: rgba(59, 130, 246, 0.5);
}

/* ============================================
   Close Button
   ============================================ */
.notification-close {
    flex-shrink: 0;
    width: 28px;
    height: 28px;
    display: flex;
    align-items: center;
    justify-content: center;
    border: none;
    border-radius: 6px;
    background: transparent;
    color: rgba(255, 255, 255, 0.6);
    cursor: pointer;
    transition: all 0.2s ease;
}

.notification-close:hover {
    background: rgba(255, 255, 255, 0.1);
    color: rgba(255, 255, 255, 0.9);
}

.notification-close svg {
    width: 16px;
    height: 16px;
}

/* ============================================
   Progress Bar (for auto-dismiss)
   ============================================ */
.notification-progress {
    position: absolute;
    bottom: 0;
    left: 0;
    height: 3px;
    background: rgba(255, 255, 255, 0.3);
    border-radius: 0 0 0 4px;
    transition: width linear;
}

.notification-item.info .notification-progress {
    background: #60a5fa;
}

.notification-item.success .notification-progress {
    background: #34d399;
}

.notification-item.warning .notification-progress {
    background: #fbbf24;
}

.notification-item.error .notification-progress {
    background: #f87171;
}

/* ============================================
   Light Theme Override
   ============================================ */
[data-theme="light"] .notification-item,
:root:not([data-theme="dark"]) .notification-item {
    background: linear-gradient(135deg, #f8fafc 0%, #f1f5f9 100%);
    color: #1e293b;
    border-color: rgba(0, 0, 0, 0.1);
    box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1);
}

[data-theme="light"] .notification-bar.top-right .notification-item,
:root:not([data-theme="dark"]) .notification-bar.top-right .notification-item,
[data-theme="light"] .notification-bar.bottom-right .notification-item,
:root:not([data-theme="dark"]) .notification-bar.bottom-right .notification-item {
    box-shadow: 0 18px 48px rgba(15, 23, 42, 0.14);
}

[data-theme="light"] .notification-item.info,
:root:not([data-theme="dark"]) .notification-item.info {
    background: linear-gradient(135deg, #eff6ff 0%, #dbeafe 100%);
    border-color: rgba(59, 130, 246, 0.2);
}

[data-theme="light"] .notification-item.success,
:root:not([data-theme="dark"]) .notification-item.success {
    background: linear-gradient(135deg, #f0fdf4 0%, #dcfce7 100%);
    border-color: rgba(34, 197, 94, 0.2);
}

[data-theme="light"] .notification-item.warning,
:root:not([data-theme="dark"]) .notification-item.warning {
    background: linear-gradient(135deg, #fffbeb 0%, #fef3c7 100%);
    border-color: rgba(245, 158, 11, 0.2);
}

[data-theme="light"] .notification-item.error,
:root:not([data-theme="dark"]) .notification-item.error {
    background: linear-gradient(135deg, #fef2f2 0%, #fee2e2 100%);
    border-color: rgba(239, 68, 68, 0.2);
}

[data-theme="light"] .notification-close,
:root:not([data-theme="dark"]) .notification-close {
    color: rgba(0, 0, 0, 0.4);
}

[data-theme="light"] .notification-close:hover,
:root:not([data-theme="dark"]) .notification-close:hover {
    background: rgba(0, 0, 0, 0.05);
    color: rgba(0, 0, 0, 0.7);
}

[data-theme="light"] .notification-action-btn,
:root:not([data-theme="dark"]) .notification-action-btn {
    border-color: rgba(0, 0, 0, 0.15);
    background: rgba(0, 0, 0, 0.05);
}

[data-theme="light"] .notification-action-btn:hover,
:root:not([data-theme="dark"]) .notification-action-btn:hover {
    background: rgba(0, 0, 0, 0.1);
}

/* ============================================
   Responsive
   ============================================ */
@media (max-width: 768px) {
    .notification-item {
        padding: 10px 16px;
    }

    .notification-bar.top-right,
    .notification-bar.bottom-right {
        top: 12px;
        right: 12px;
        bottom: auto;
        width: calc(100vw - 24px);
    }

    .notification-bar.bottom-right {
        top: auto;
        bottom: 12px;
    }

    .notification-title {
        font-size: 0.85rem;
    }

    .notification-message {
        font-size: 0.8rem;
    }

    .notification-actions {
        flex-wrap: wrap;
    }
}

/* ============================================
   Animations
   ============================================ */
@keyframes notificationSlideIn {
    from {
        transform: translateY(-100%);
        opacity: 0;
    }
    to {
        transform: translateY(0);
        opacity: 1;
    }
}

@keyframes notificationSlideOut {
    from {
        transform: translateY(0);
        opacity: 1;
    }
    to {
        transform: translateY(-100%);
        opacity: 0;
    }
}

@keyframes notificationSlideOutRight {
    from {
        transform: translateX(0);
        opacity: 1;
    }
    to {
        transform: translateX(110%);
        opacity: 0;
    }
}

.notification-item.animate-in {
    animation: notificationSlideIn 0.3s cubic-bezier(0.4, 0, 0.2, 1) forwards;
}

.notification-item.animate-out {
    animation: notificationSlideOut 0.3s cubic-bezier(0.4, 0, 0.2, 1) forwards;
}

.notification-bar.top-right .notification-item.animate-out,
.notification-bar.bottom-right .notification-item.animate-out {
    animation-name: notificationSlideOutRight;
}
