/* 通知系统CSS */

/* 通知容器 */
.notifications-container {
    position: fixed;
    z-index: 9999;
    display: flex;
    flex-direction: column;
    gap: 10px;
    max-height: calc(100vh - 40px);
    overflow-y: auto;
    width: min(85vw, 380px);
    box-sizing: border-box;
    overflow: visible;
    will-change: transform;
    padding-right: 0;
    scrollbar-width: none;
    -ms-overflow-style: none;
    top: clamp(1rem, 3vw, 1.5rem);
    right: clamp(1rem, 3vw, 1.5rem);
}

/* 通知容器位置变体 */
.notifications-container.top-left {
    top: clamp(1rem, 3vw, 1.5rem);
    left: clamp(1rem, 3vw, 1.5rem);
    right: auto;
}

.notifications-container.bottom-left {
    bottom: clamp(1rem, 3vw, 1.5rem);
    left: clamp(1rem, 3vw, 1.5rem);
    top: auto;
    right: auto;
}

.notifications-container.bottom-right {
    bottom: clamp(1rem, 3vw, 1.5rem);
    right: clamp(1rem, 3vw, 1.5rem);
    top: auto;
}

.notifications-container.center {
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    right: auto;
    bottom: auto;
}

/* 隐藏滚动条 */
.notifications-container::-webkit-scrollbar {
    display: none;
}

/* 通知样式 */
.notification {
    width: 100%;
    background: rgba(10, 15, 28, 0.8);
    backdrop-filter: blur(10px);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 8px;
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.3);
    padding: clamp(1rem, 3vw, 1.5rem);
    display: flex;
    align-items: flex-start;
    opacity: 0;
    transition: all 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275);
    color: #f8fafc;
    position: relative;
    box-sizing: border-box;
    min-width: 100%;
    max-width: 100%;
    flex-shrink: 0;
    will-change: transform, opacity;
    backface-visibility: hidden;
    transform: translateZ(0);
    overflow: hidden;
    touch-action: pan-y;
    user-select: none;
}

/* 发光效果 */
.notification {
    box-shadow: 0 0 0 2px #ffffff, 0 0 0 5px rgba(23, 112, 246, 0.7);
    transition: box-shadow 0.3s ease;
}

/* 关闭按钮位置 */
.notifications-container.top-left .close-btn,
.notifications-container.bottom-left .close-btn {
    left: clamp(0.8rem, 2.5vw, 1rem);
    right: auto;
}

/* 各种动画类型 */
.notification.slide {
    transform: translateX(400px);
}

.notifications-container.top-left .notification.slide,
.notifications-container.bottom-left .notification.slide {
    transform: translateX(-400px);
}

.notifications-container.center .notification.slide {
    transform: translateY(-50px) scale(0.9);
}

.notification.slide.show {
    transform: translateX(0);
    opacity: 1;
}

.notifications-container.center .notification.slide.show {
    transform: translateY(0) scale(1);
    opacity: 1;
}

.notification.slide-down {
    transform: translateY(-100px);
}

.notifications-container.bottom-left .notification.slide-down,
.notifications-container.bottom-right .notification.slide-down {
    transform: translateY(100px);
}

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

.notification.scale {
    transform: scale(0.8);
}

.notification.scale.show {
    transform: scale(1);
    opacity: 1;
}

.notification.top-right {
    transform: translate(100px, -100px) rotate(15deg);
    transform-origin: top right;
}

.notifications-container.top-left .notification.top-right {
    transform: translate(-100px, -100px) rotate(-15deg);
    transform-origin: top left;
}

.notification.top-right.show {
    transform: translate(0, 0) rotate(0);
    opacity: 1;
}

.notification.slide-up {
    transform: translateY(100px);
}

.notifications-container.top-left .notification.slide-up,
.notifications-container.top-right .notification.slide-up {
    transform: translateY(-100px);
}

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

/* 通知内部元素 */
.notification-icon {
    width: clamp(2.5rem, 6vw, 3rem);
    height: clamp(2.5rem, 6vw, 3rem);
    border-radius: 50%;
    background: var(--notification-color);
    display: flex;
    justify-content: center;
    align-items: center;
    margin-right: clamp(0.8rem, 2.5vw, 1rem);
    flex-shrink: 0;
}

.notification-icon svg {
    width: clamp(1rem, 3vw, 1.4rem);
    height: clamp(1rem, 3vw, 1.4rem);
    fill: white;
}

.notification-content {
    flex: 1;
    padding-right: 10px;
    min-width: 0;
    overflow-wrap: break-word;
    word-break: break-word;
    hyphens: auto;
}

.notification-title {
    font-weight: 600;
    color: #f8fafc;
    margin-bottom: clamp(0.3rem, 1vw, 0.5rem);
    font-size: clamp(1rem, 2.5vw, 1.2rem);
    word-wrap: break-word;
    line-height: 1.3;
}

.notification-message {
    color: #cbd5e1;
    font-size: clamp(0.8rem, 2.2vw, 0.95rem);
    line-height: 1.4;
    word-wrap: break-word;
}

.close-btn {
    position: absolute;
    top: clamp(0.8rem, 2.5vw, 1rem);
    right: clamp(0.8rem, 2.5vw, 1rem);
    width: clamp(1.5rem, 4vw, 2rem);
    height: clamp(1.5rem, 4vw, 2rem);
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.1);
    border: none;
    display: flex;
    justify-content: center;
    align-items: center;
    cursor: pointer;
    transition: all 0.2s ease;
    color: #94a3b8;
    flex-shrink: 0;
    touch-action: manipulation;
}

.close-btn:hover {
    background: rgba(255, 255, 255, 0.2);
    color: #f8fafc;
    transform: scale(1.1);
}

.close-btn svg {
    width: clamp(0.8rem, 2.5vw, 1.2rem);
    height: clamp(0.8rem, 2.5vw, 1.2rem);
}

/* 进度条 */
.progress-bar {
    position: absolute;
    bottom: 0;
    left: 0;
    height: 4px;
    background: var(--notification-color);
    width: 100%;
    border-radius: 0;
    transform-origin: left;
    will-change: transform;
    backface-visibility: hidden;
}

.progress-bar.animate {
    animation: progress var(--duration, 3s) linear forwards;
}

@keyframes progress {
    from { transform: scaleX(1); }
    to { transform: scaleX(0); }
}

/* 队列信息 */
.notification-queue {
    position: fixed;
    bottom: 20px;
    left: 20px;
    background: rgba(15, 23, 42, 0.7);
    backdrop-filter: blur(10px);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 8px;
    padding: 12px 16px;
    color: #f8fafc;
    font-size: 14px;
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.3);
    z-index: 999;
}

/* 交互按钮 */
.interactive-buttons {
    display: flex;
    justify-content: center;
    gap: 10px;
    margin-top: 15px;
    flex-wrap: wrap;
}

.interactive-btn {
    background: rgba(255, 255, 255, 0.1);
    color: #f8fafc;
    border: 1px solid rgba(255, 255, 255, 0.2);
    padding: 8px 16px;
    border-radius: 4px;
    cursor: pointer;
    transition: all 0.2s ease;
    font-size: 0.85rem;
    font-weight: 500;
}

.interactive-btn:hover {
    background: rgba(255, 255, 255, 0.2);
    transform: translateY(-1px);
}

.interactive-btn.primary {
    background: #165DFF;
    border-color: #165DFF;
}

.interactive-btn.primary:hover {
    background: rgba(22, 93, 255, 0.8);
}

/* 滑动指示器 */
.swipe-indicator {
    position: absolute;
    bottom: 5px;
    left: 50%;
    transform: translateX(-50%);
    width: 30px;
    height: 4px;
    background: rgba(255, 255, 255, 0.3);
    border-radius: 2px;
    opacity: 0;
    transition: opacity 0.3s ease;
}

.notification:hover .swipe-indicator {
    opacity: 1;
}

@media (hover: none) {
    .swipe-indicator {
        opacity: 1;
    }
}

/* 移动端优化 */
@media (max-width: 768px) {
    .notifications-container {
        width: calc(100vw - 20px);
        right: 10px;
        left: 10px;
    }
    
    .notifications-container.top-left,
    .notifications-container.bottom-left {
        width: calc(100vw - 20px);
        right: 10px;
        left: 10px;
    }
    
    .notifications-container.center {
        width: calc(100vw - 40px);
    }
    
    .notification-queue {
        left: 10px;
        right: 10px;
        bottom: 10px;
    }
}