/**
 * 实时通知系统样式
 */

/* WebSocket连接状态指示器 */
.ws-status {
    display: inline-block;
    width: 10px;
    height: 10px;
    border-radius: 50%;
    margin-left: 10px;
    position: relative;
    animation: pulse 2s infinite;
}

.ws-status-connected {
    background-color: #52c41a;
    box-shadow: 0 0 0 0 rgba(82, 196, 26, 0.7);
}

.ws-status-disconnected {
    background-color: #ff4d4f;
    box-shadow: 0 0 0 0 rgba(255, 77, 79, 0.7);
    animation: none;
}

@keyframes pulse {
    0% {
        box-shadow: 0 0 0 0 rgba(82, 196, 26, 0.7);
    }
    70% {
        box-shadow: 0 0 0 10px rgba(82, 196, 26, 0);
    }
    100% {
        box-shadow: 0 0 0 0 rgba(82, 196, 26, 0);
    }
}

/* Toast通知样式 */
.toast {
    min-width: 250px;
    max-width: 400px;
    padding: 15px 20px;
    margin-bottom: 10px;
    border-radius: 8px;
    background: white;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
    font-size: 14px;
    line-height: 1.5;
    opacity: 0;
    transform: translateX(100%);
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    gap: 10px;
}

.toast-show {
    opacity: 1;
    transform: translateX(0);
}

.toast-success {
    border-left: 4px solid #52c41a;
    background: #f6ffed;
    color: #135200;
}

.toast-error {
    border-left: 4px solid #ff4d4f;
    background: #fff1f0;
    color: #cf1322;
}

.toast-warning {
    border-left: 4px solid #fa8c16;
    background: #fff7e6;
    color: #ad4e00;
}

.toast-info {
    border-left: 4px solid #1890ff;
    background: #e6f7ff;
    color: #003a8c;
}

/* 徽章动画 */
.badge-pulse {
    animation: badgePulse 1s ease-in-out;
}

@keyframes badgePulse {
    0%, 100% {
        transform: scale(1);
    }
    50% {
        transform: scale(1.2);
    }
}

/* 订单通知卡片样式 */
.notification-card {
    background: white;
    border-radius: 8px;
    padding: 15px;
    margin-bottom: 10px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
    border-left: 4px solid #1890ff;
    transition: all 0.3s ease;
    cursor: pointer;
}

.notification-card:hover {
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.15);
    transform: translateY(-2px);
}

.notification-card-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 8px;
}

.notification-card-title {
    font-weight: 600;
    font-size: 15px;
    color: #262626;
}

.notification-card-time {
    font-size: 12px;
    color: #8c8c8c;
}

.notification-card-body {
    font-size: 14px;
    color: #595959;
    line-height: 1.6;
}

.notification-card-footer {
    margin-top: 10px;
    padding-top: 10px;
    border-top: 1px solid #f0f0f0;
    display: flex;
    gap: 10px;
}

.notification-btn {
    padding: 5px 12px;
    border: none;
    border-radius: 4px;
    font-size: 13px;
    cursor: pointer;
    transition: all 0.2s ease;
}

.notification-btn-primary {
    background: #1890ff;
    color: white;
}

.notification-btn-primary:hover {
    background: #40a9ff;
}

.notification-btn-secondary {
    background: #f0f0f0;
    color: #595959;
}

.notification-btn-secondary:hover {
    background: #d9d9d9;
}

/* 通知面板样式 */
.notification-panel {
    position: fixed;
    top: 60px;
    right: 20px;
    width: 380px;
    max-height: 600px;
    background: white;
    border-radius: 8px;
    box-shadow: 0 6px 20px rgba(0, 0, 0, 0.15);
    z-index: 9998;
    display: none;
    flex-direction: column;
}

.notification-panel.show {
    display: flex;
}

.notification-panel-header {
    padding: 15px 20px;
    border-bottom: 1px solid #f0f0f0;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.notification-panel-title {
    font-weight: 600;
    font-size: 16px;
    color: #262626;
}

.notification-panel-close {
    background: none;
    border: none;
    font-size: 20px;
    color: #8c8c8c;
    cursor: pointer;
    padding: 0;
    width: 24px;
    height: 24px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 4px;
    transition: all 0.2s ease;
}

.notification-panel-close:hover {
    background: #f0f0f0;
    color: #262626;
}

.notification-panel-body {
    flex: 1;
    overflow-y: auto;
    padding: 10px;
}

.notification-panel-footer {
    padding: 12px 20px;
    border-top: 1px solid #f0f0f0;
    text-align: center;
}

.notification-panel-clear {
    background: none;
    border: none;
    color: #1890ff;
    font-size: 14px;
    cursor: pointer;
    padding: 0;
}

.notification-panel-clear:hover {
    color: #40a9ff;
    text-decoration: underline;
}

/* 空状态 */
.notification-empty {
    text-align: center;
    padding: 40px 20px;
    color: #8c8c8c;
}

.notification-empty i {
    font-size: 48px;
    margin-bottom: 10px;
    display: block;
}

/* 持久化订单通知弹窗 */
.persistent-notification-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.7);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 99999;
    opacity: 0;
    transition: opacity 0.3s ease;
}

.persistent-notification-overlay.show {
    opacity: 1;
}

.persistent-notification-card {
    background: white;
    border-radius: 12px;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.3);
    max-width: 500px;
    width: 90%;
    animation: slideDown 0.3s ease;
}

@keyframes slideDown {
    from {
        transform: translateY(-50px);
        opacity: 0;
    }
    to {
        transform: translateY(0);
        opacity: 1;
    }
}

.persistent-notification-header {
    padding: 24px;
    border-bottom: 2px solid #ffa940;
    background: linear-gradient(135deg, #fff7e6 0%, #fffbe6 100%);
    border-radius: 12px 12px 0 0;
    display: flex;
    align-items: center;
    gap: 16px;
}

.persistent-notification-icon {
    font-size: 48px;
    animation: pulse 2s infinite;
}

@keyframes pulse {
    0%, 100% {
        transform: scale(1);
    }
    50% {
        transform: scale(1.1);
    }
}

.persistent-notification-header h3 {
    margin: 0;
    font-size: 22px;
    color: #d46b08;
    font-weight: 600;
}

.persistent-notification-body {
    padding: 24px;
}

.order-info {
    background: #f5f5f5;
    border-radius: 8px;
    padding: 16px;
    margin-bottom: 20px;
}

.order-info-row {
    display: flex;
    justify-content: space-between;
    padding: 8px 0;
    border-bottom: 1px solid #e0e0e0;
}

.order-info-row:last-child {
    border-bottom: none;
}

.order-info-row .label {
    color: #666;
    font-weight: 500;
}

.order-info-row .value {
    color: #262626;
    font-weight: 600;
}

.order-info-row .value.highlight {
    color: #ff4d4f;
    font-size: 20px;
}

.important-notice {
    background: #fff1f0;
    border: 2px solid #ff4d4f;
    border-radius: 8px;
    padding: 16px;
    display: flex;
    gap: 12px;
    align-items: flex-start;
}

.notice-icon {
    font-size: 32px;
    flex-shrink: 0;
    animation: ring 2s infinite;
}

@keyframes ring {
    0%, 100% {
        transform: rotate(0deg);
    }
    10%, 30% {
        transform: rotate(-10deg);
    }
    20%, 40% {
        transform: rotate(10deg);
    }
    50% {
        transform: rotate(0deg);
    }
}

.notice-text {
    line-height: 1.8;
    color: #262626;
}

.notice-text strong {
    color: #cf1322;
    font-size: 16px;
}

.persistent-notification-footer {
    padding: 20px 24px;
    border-top: 1px solid #f0f0f0;
    display: flex;
    gap: 12px;
    justify-content: flex-end;
}

.btn-view-order,
.btn-close-notification {
    padding: 10px 24px;
    border: none;
    border-radius: 6px;
    font-size: 15px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.3s ease;
}

.btn-view-order {
    background: #1890ff;
    color: white;
}

.btn-view-order:hover {
    background: #40a9ff;
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(24, 144, 255, 0.4);
}

.btn-close-notification {
    background: #f0f0f0;
    color: #595959;
}

.btn-close-notification:hover {
    background: #d9d9d9;
}

/* 响应式设计 */
@media (max-width: 768px) {
    .notification-panel {
        width: calc(100vw - 40px);
        max-width: 380px;
    }
    
    .toast {
        min-width: 200px;
        max-width: calc(100vw - 40px);
    }
    
    .persistent-notification-card {
        width: 95%;
        max-width: none;
    }
    
    .persistent-notification-header {
        padding: 20px;
    }
    
    .persistent-notification-icon {
        font-size: 36px;
    }
    
    .persistent-notification-header h3 {
        font-size: 18px;
    }
    
    .persistent-notification-footer {
        flex-direction: column;
    }
    
    .btn-view-order,
    .btn-close-notification {
        width: 100%;
    }
}

