/**
 * Purchase Notification Styles
 */

/* Container for all notifications */
#purchase-notification-container {
    position: fixed;
    bottom: 20px;
    left: 20px;
    z-index: 9999;
    pointer-events: none;
    max-width: 280px; /* Giảm từ 320px */
}

/* Individual notification */
.purchase-notification {
    background: rgba(255, 255, 255, 0.98);
    border-radius: 10px;
    box-shadow: 0 6px 20px rgba(0, 0, 0, 0.25), 0 0 20px rgba(67, 160, 71, 0.15);
    width: 260px; /* Giảm từ 300px */
    max-width: 90vw;
    margin-top: 10px;
    overflow: hidden;
    transform: translateX(-110%); /* Xuất hiện từ bên trái */
    opacity: 0;
    transition: transform 0.5s cubic-bezier(0.175, 0.885, 0.32, 1.275), opacity 0.4s ease;
    pointer-events: auto;
    border-left: 4px solid #43a047;
    position: relative;
    animation: pulse 2s infinite;
}

@keyframes pulse {
    0% {
        box-shadow: 0 6px 16px rgba(0, 0, 0, 0.2), 0 0 0 rgba(67, 160, 71, 0.2);
    }
    50% {
        box-shadow: 0 6px 16px rgba(0, 0, 0, 0.2), 0 0 20px rgba(67, 160, 71, 0.4);
    }
    100% {
        box-shadow: 0 6px 16px rgba(0, 0, 0, 0.2), 0 0 0 rgba(67, 160, 71, 0.2);
    }
}

/* Animation for showing notification */
.purchase-notification.visible {
    transform: translateX(0);
    opacity: 1;
}

/* Animation for hiding notification */
.purchase-notification.hiding {
    transform: translateX(110%); /* Trượt sang phải để ẩn */
    opacity: 0;
}

/* Close button */
.purchase-notification-close {
    position: absolute;
    top: 6px;
    right: 6px;
    width: 18px;
    height: 18px;
    line-height: 18px;
    text-align: center;
    cursor: pointer;
    font-size: 14px;
    color: #999;
    border-radius: 50%;
    background: rgba(0, 0, 0, 0.05);
    z-index: 2;
    transition: all 0.2s ease;
}

.purchase-notification-close:hover {
    background: rgba(0, 0, 0, 0.1);
    color: #666;
    transform: scale(1.1);
}

/* Content wrapper */
.purchase-notification-content {
    display: flex;
    padding: 12px; /* Giảm từ 14px */
    cursor: pointer;
    transition: background-color 0.2s ease;
    align-items: center; /* Căn giữa các phần tử theo chiều dọc */
}

.purchase-notification-content:hover {
    background-color: rgba(67, 160, 71, 0.05);
}

/* Product image */
.purchase-notification-image {
    width: 70px; /* Tăng từ 64px */
    height: 70px; /* Tăng từ 64px */
    flex-shrink: 0;
    margin-right: 10px; /* Giảm từ 14px */
    border-radius: 8px;
    overflow: hidden;
    background-color: #f5f5f5;
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.15);
    border: 1px solid rgba(0, 0, 0, 0.05);
}

.purchase-notification-image img {
    width: 100%;
    height: 100%;
    
    object-position: center;
    transition: transform 0.3s ease;
}

.purchase-notification:hover .purchase-notification-image img {
    transform: scale(1.1);
}

/* Information section */
.purchase-notification-info {
    flex-grow: 1;
    min-width: 0;
    padding-top: 0; /* Giảm từ 2px */
    max-width: 160px; /* Thêm giới hạn chiều rộng */
}

/* Title with username */
.purchase-notification-title {
    font-size: 12px; /* Giảm từ 13px */
    color: #666;
    margin-bottom: 3px; /* Giảm từ 5px */
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    display: flex;
    align-items: center;
    gap: 4px;
}

.purchase-user {
    font-weight: 600;
    color: #43a047;
    position: relative;
    display: inline-block;
    max-width: 110px; /* Giới hạn chiều rộng tên người dùng */
    overflow: hidden;
    text-overflow: ellipsis;
}

.purchase-user:after {
    content: '';
    position: absolute;
    bottom: -1px; /* Giảm từ -2px */
    left: 0;
    width: 100%;
    height: 1px; /* Giảm từ 2px */
    background-color: #43a047;
    transform: scaleX(0);
    transition: transform 0.3s ease;
    transform-origin: left;
}

.purchase-notification:hover .purchase-user:after {
    transform: scaleX(1);
}

/* Product name */
.purchase-notification-product {
    font-size: 12px; /* Giảm từ 14px */
    font-weight: 600;
    color: #333;
    margin-bottom: 3px; /* Giảm từ 5px */
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

/* Time */
.purchase-notification-time {
    font-size: 11px; /* Giảm từ 12px */
    color: #999;
    font-style: italic;
}

/* Hover effect */
.purchase-notification:hover {
    box-shadow: 0 8px 20px rgba(0, 0, 0, 0.25), 0 0 20px rgba(67, 160, 71, 0.3);
}

/* Mobile styles */
@media (max-width: 768px) {
    #purchase-notification-container {
        bottom: 15px;
        left: 15px;
    }
    
    .purchase-notification {
        width: 250px; /* Giảm từ 280px */
    }
    
    .purchase-notification-image {
        width: 60px;
        height: 60px;
    }
    
    .purchase-notification-title,
    .purchase-notification-product {
        font-size: 12px;
    }
    
    .purchase-notification-time {
        font-size: 10px;
    }
}

/* Small mobile styles */
@media (max-width: 480px) {
    #purchase-notification-container {
        bottom: 10px;
        left: 10px;
    }
    
    .purchase-notification {
        width: 240px; /* Giảm từ 260px */
    }
    
    .purchase-notification-content {
        padding: 10px; /* Giảm từ 12px */
    }
    
    .purchase-notification-image {
        width: 55px; /* Tăng từ 50px */
        height: 55px; /* Tăng từ 50px */
        margin-right: 8px; /* Giảm từ 12px */
    }
    
    .purchase-notification-title,
    .purchase-notification-product {
        font-size: 11px; /* Giảm từ 12px */
        margin-bottom: 3px; /* Giảm từ 4px */
    }
    
    .purchase-notification-time {
        font-size: 9px; /* Giảm từ 10px */
    }
} 