/**
 * TPM Notifications Styles
 * 通知系统样式
 */

.tpm-notification-container {
    position: fixed;
    top: 20px;
    right: 20px;
    z-index: 999999;
    max-width: 400px;
    width: 100%;
    pointer-events: none;
}

.tpm-notification {
    background: #fff;
    border-radius: 8px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
    margin-bottom: 10px;
    padding: 16px;
    pointer-events: auto;
    display: flex;
    align-items: flex-start;
    animation: tpmSlideIn 0.3s ease-out;
    position: relative;
    overflow: hidden;
}

.tpm-notification.removing {
    animation: tpmSlideOut 0.3s ease-in forwards;
}

@keyframes tpmSlideIn {
    from {
        transform: translateX(100%);
        opacity: 0;
    }
    to {
        transform: translateX(0);
        opacity: 1;
    }
}

@keyframes tpmSlideOut {
    from {
        transform: translateX(0);
        opacity: 1;
    }
    to {
        transform: translateX(100%);
        opacity: 0;
    }
}

/* 通知类型样式 */
.tpm-notification-success {
    border-left: 4px solid #00B42A;
}

.tpm-notification-success .tpm-notification-icon {
    color: #00B42A;
    background: rgba(0, 180, 42, 0.1);
}

.tpm-notification-error {
    border-left: 4px solid #F53F3F;
}

.tpm-notification-error .tpm-notification-icon {
    color: #F53F3F;
    background: rgba(245, 63, 63, 0.1);
}

.tpm-notification-warning {
    border-left: 4px solid #FF7D00;
}

.tpm-notification-warning .tpm-notification-icon {
    color: #FF7D00;
    background: rgba(255, 125, 0, 0.1);
}

.tpm-notification-info {
    border-left: 4px solid #165DFF;
}

.tpm-notification-info .tpm-notification-icon {
    color: #165DFF;
    background: rgba(22, 93, 255, 0.1);
}

/* 通知图标 */
.tpm-notification-icon {
    width: 24px;
    height: 24px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: bold;
    font-size: 14px;
    flex-shrink: 0;
    margin-right: 12px;
}

/* 通知内容 */
.tpm-notification-content {
    flex: 1;
    min-width: 0;
}

.tpm-notification-title {
    font-weight: 600;
    font-size: 14px;
    color: #333;
    margin-bottom: 4px;
    display: none;
}

.tpm-notification.has-title .tpm-notification-title {
    display: block;
}

.tpm-notification-message {
    font-size: 13px;
    color: #666;
    line-height: 1.5;
    word-wrap: break-word;
}

/* 关闭按钮 */
.tpm-notification-close {
    position: absolute;
    top: 8px;
    right: 8px;
    width: 20px;
    height: 20px;
    border: none;
    background: transparent;
    cursor: pointer;
    color: #999;
    font-size: 18px;
    line-height: 1;
    padding: 0;
    border-radius: 4px;
    transition: all 0.2s ease;
    display: flex;
    align-items: center;
    justify-content: center;
}

.tpm-notification-close:hover {
    background: rgba(0, 0, 0, 0.05);
    color: #333;
}

/* 进度条 */
.tpm-notification-progress {
    position: absolute;
    bottom: 0;
    left: 0;
    height: 3px;
    background: currentColor;
    width: 100%;
    transform-origin: left;
    opacity: 0.2;
}

.tpm-notification-success .tpm-notification-progress {
    color: #00B42A;
}

.tpm-notification-error .tpm-notification-progress {
    color: #F53F3F;
}

.tpm-notification-warning .tpm-notification-progress {
    color: #FF7D00;
}

.tpm-notification-info .tpm-notification-progress {
    color: #165DFF;
}

.tpm-notification.progress .tpm-notification-progress {
    animation: tpmProgress linear forwards;
}

@keyframes tpmProgress {
    from {
        transform: scaleX(1);
    }
    to {
        transform: scaleX(0);
    }
}

/* 响应式设计 */
@media (max-width: 768px) {
    .tpm-notification-container {
        top: 10px;
        right: 10px;
        left: 10px;
        max-width: none;
    }

    .tpm-notification {
        margin-bottom: 8px;
        padding: 12px;
    }

    .tpm-notification-message {
        font-size: 12px;
    }
}

/* 暗色主题支持 */
@media (prefers-color-scheme: dark) {
    .tpm-notification {
        background: #2d2d2d;
        box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3);
    }

    .tpm-notification-title {
        color: #e5e5e5;
    }

    .tpm-notification-message {
        color: #b3b3b3;
    }

    .tpm-notification-close:hover {
        background: rgba(255, 255, 255, 0.1);
        color: #e5e5e5;
    }
}

/* 加载状态 */
.tpm-notification-loading {
    position: relative;
    pointer-events: none;
}

.tpm-notification-loading::after {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(255, 255, 255, 0.8);
    display: flex;
    align-items: center;
    justify-content: center;
}

.tpm-notification-loading::before {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 20px;
    height: 20px;
    border: 2px solid #f3f3f3;
    border-top: 2px solid #165DFF;
    border-radius: 50%;
    animation: tpmSpin 1s linear infinite;
    z-index: 1;
}

@keyframes tpmSpin {
    0% { transform: translate(-50%, -50%) rotate(0deg); }
    100% { transform: translate(-50%, -50%) rotate(360deg); }
}

/* 可点击的通知 */
.tpm-notification-clickable {
    cursor: pointer;
    transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.tpm-notification-clickable:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 16px rgba(0, 0, 0, 0.2);
}

/* 堆叠样式 */
.tpm-notification-container.stacked .tpm-notification {
    transform: scale(0.95);
    opacity: 0.8;
    transition: all 0.3s ease;
}

.tpm-notification-container.stacked .tpm-notification:hover {
    transform: scale(1);
    opacity: 1;
}
