/* Product Animations CSS - Hiệu ứng cho trang sản phẩm */

/* ===== HIỆU ỨNG CHO BỘ LỌC ===== */

/* Hiệu ứng cho tiêu đề bộ lọc */
.filter-title {
    position: relative;
    display: inline-block;
    padding-bottom: 8px;
    margin-bottom: 12px;
    font-weight: 600;
    color: #333;
}

.filter-title i {
    transition: all 0.3s ease;
}

.filter-section:hover .filter-title i {
    transform: scale(1.2);
}

.filter-title::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 0;
    width: 40px;
    height: 2px;
    background-color: #9E8A78;
    transition: width 0.3s ease;
}

.filter-section:hover .filter-title::after {
    width: 60px;
}

/* Hiệu ứng cho các mục trong bộ lọc */
.filter-section {
    transition: all 0.3s ease;
    border-radius: 8px;
    padding: 15px;
    margin-bottom: 20px;
    border-bottom: 1px solid #f0f0f0;
}

.filter-section:hover {
    background-color: rgba(158, 138, 120, 0.05);
    transform: translateY(-2px);
}

/* Hiệu ứng cho icon trong form-check-label */
.form-check-label i {
    transition: all 0.3s ease;
}

.form-check:hover .form-check-label i {
    transform: scale(1.2);
}

/* Hiệu ứng cho nút xóa bộ lọc */
#clearAllFilters {
    position: relative;
    overflow: hidden;
    transition: all 0.3s ease;
}

#clearAllFilters::before {
    content: '';
    position: absolute;
    bottom: 0;
    left: 0;
    width: 0;
    height: 1px;
    background-color: #9E8A78;
    transition: width 0.3s ease;
}

#clearAllFilters:hover::before {
    width: 100%;
}

/* Hiệu ứng cho input tìm kiếm */
.filter-section .input-group {
    transition: all 0.3s ease;
    border-radius: 8px;
    overflow: hidden;
}

.filter-section .input-group:focus-within {
    box-shadow: 0 0 0 3px rgba(158, 138, 120, 0.1);
    transform: translateY(-2px);
}

.filter-section .form-control:focus {
    border-color: #9E8A78;
}

/* Hiệu ứng cho active filters */
.active-filters {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-top: 15px;
}

.active-filter-tag {
    display: inline-flex;
    align-items: center;
    background-color: rgba(158, 138, 120, 0.1);
    color: #9E8A78;
    border-radius: 20px;
    padding: 5px 12px;
    font-size: 0.85rem;
    transition: all 0.3s ease;
    animation: fadeInRight 0.5s ease;
}

.active-filter-tag:hover {
    background-color: rgba(158, 138, 120, 0.2);
}

.active-filter-tag .remove-filter {
    margin-left: 5px;
    cursor: pointer;
    transition: all 0.3s ease;
}

.active-filter-tag .remove-filter:hover {
    transform: rotate(90deg);
}

/* ===== HIỆU ỨNG CHO GRID SẢN PHẨM ===== */

/* Hiệu ứng xuất hiện cho các mục sản phẩm */
.product-item {
    opacity: 0;
    transform: translateY(20px);
    animation: fadeInUp 0.6s ease forwards;
}

/* Thêm độ trễ cho từng mục */
.product-item:nth-child(1) { animation-delay: 0.1s; }
.product-item:nth-child(2) { animation-delay: 0.2s; }
.product-item:nth-child(3) { animation-delay: 0.3s; }
.product-item:nth-child(4) { animation-delay: 0.4s; }
.product-item:nth-child(5) { animation-delay: 0.5s; }
.product-item:nth-child(6) { animation-delay: 0.6s; }
.product-item:nth-child(7) { animation-delay: 0.7s; }
.product-item:nth-child(8) { animation-delay: 0.8s; }
.product-item:nth-child(9) { animation-delay: 0.9s; }

/* Cải thiện hiệu ứng hover cho thẻ sản phẩm */
.product-card {
    transition: all 0.4s cubic-bezier(0.165, 0.84, 0.44, 1);
    box-shadow: 0 4px 10px rgba(0, 0, 0, 0.05);
    border: none;
    overflow: hidden;
    height: 100%;
    position: relative;
    z-index: 1;
}

.product-card:hover {
    transform: translateY(-8px) scale(1.01);
    box-shadow: 0 15px 30px rgba(0, 0, 0, 0.1);
    z-index: 2;
}

/* Hiệu ứng cho hình ảnh sản phẩm */
.card-img-container {
    overflow: hidden;
    position: relative;
}

.card-img-container::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: linear-gradient(to bottom, rgba(0,0,0,0) 0%, rgba(0,0,0,0.4) 100%);
    opacity: 0;
    transition: opacity 0.4s ease;
    z-index: 1;
}

.product-card:hover .card-img-container::before {
    opacity: 1;
}

.card-img-top {
    transition: transform 0.7s cubic-bezier(0.165, 0.84, 0.44, 1);
}

.product-card:hover .card-img-top {
    transform: scale(1.08);
}

/* Hiệu ứng cho trạng thái sản phẩm */
.product-status {
    position: absolute;
    top: 10px;
    right: 10px;
    z-index: 2;
    transition: all 0.3s ease;
}

.product-status span {
    padding: 5px 10px;
    border-radius: 4px;
    font-size: 0.8rem;
    font-weight: 500;
    transition: all 0.3s ease;
}

.product-card:hover .product-status {
    transform: translateY(-5px);
}

.in-stock {
    background-color: rgba(25, 135, 84, 0.8);
    color: white;
}

.product-card:hover .in-stock {
    background-color: rgba(25, 135, 84, 1);
    box-shadow: 0 5px 15px rgba(25, 135, 84, 0.3);
}

.out-of-stock {
    background-color: rgba(220, 53, 69, 0.8);
    color: white;
}

.product-card:hover .out-of-stock {
    background-color: rgba(220, 53, 69, 1);
    box-shadow: 0 5px 15px rgba(220, 53, 69, 0.3);
}

/* Hiệu ứng cho danh mục sản phẩm */
.product-category .badge {
    transition: all 0.3s ease;
    background-color: #f8f9fa;
    color: #6c757d;
    border: 1px solid #e9ecef;
}

.product-card:hover .product-category .badge {
    background-color: rgba(158, 138, 120, 0.1) !important;
    color: #9E8A78 !important;
    border-color: #9E8A78 !important;
}

/* Hiệu ứng cho tiêu đề sản phẩm */
.product-card .card-title {
    position: relative;
    display: inline-block;
    transition: all 0.3s ease;
    font-weight: 600;
    margin-bottom: 10px;
    font-size: 1.1rem;
}

.product-card:hover .card-title {
    color: #9E8A78;
}

.product-card .card-title::after {
    content: '';
    position: absolute;
    bottom: -2px;
    left: 0;
    width: 0;
    height: 2px;
    background-color: #9E8A78;
    transition: width 0.3s ease;
}

.product-card:hover .card-title::after {
    width: 100%;
}

/* Hiệu ứng cho mô tả sản phẩm */
.product-card .card-text {
    color: #6c757d;
    font-size: 0.9rem;
    margin-bottom: 0;
    transition: all 0.3s ease;
}

.product-card:hover .card-text {
    color: #495057;
}

/* Hiệu ứng cho giá sản phẩm */
.product-card .price {
    transition: all 0.3s ease;
    font-size: 1.1rem;
}

.product-card:hover .price {
    transform: scale(1.05);
}

.price-icon {
    transition: all 0.3s ease;
}

.product-card:hover .price-icon {
    transform: rotate(-20deg);
}

/* Hiệu ứng cho nút chi tiết */
.product-card .btn-outline-primary {
    border-radius: 4px;
    padding: 5px 12px;
    font-size: 0.85rem;
    transition: all 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

.product-card .btn-outline-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 5px 15px rgba(158, 138, 120, 0.3);
}

/* Hiệu ứng cho icon trong nút */
.btn-icon-animate {
    transition: all 0.3s ease;
}

.product-card .btn-outline-primary:hover .btn-icon-animate {
    transform: translateX(3px);
}

/* Badge "Mới" và "Bán chạy" */
.product-badge {
    position: absolute;
    top: 10px;
    left: 10px;
    z-index: 2;
    padding: 5px 10px;
    border-radius: 4px;
    font-size: 0.8rem;
    font-weight: 500;
    transition: all 0.3s ease;
}

.badge-new {
    background-color: #9E8A78;
    color: white;
}

.product-card:hover .badge-new {
    transform: translateY(-5px) rotate(-5deg);
    box-shadow: 0 5px 15px rgba(158, 138, 120, 0.3);
}

.badge-bestseller {
    background-color: #dc3545;
    color: white;
}

.product-card:hover .badge-bestseller {
    transform: translateY(-5px) rotate(-5deg);
    box-shadow: 0 5px 15px rgba(220, 53, 69, 0.3);
}

/* ===== HIỆU ỨNG LOADING ===== */

/* Hiệu ứng loading */
.loading-indicator {
    display: none;
    position: fixed;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    background-color: rgba(255, 255, 255, 0.9);
    padding: 20px;
    border-radius: 10px;
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.1);
    z-index: 1000;
    text-align: center;
    transition: all 0.3s ease;
}

.loading-indicator.active {
    display: block;
    animation: fadeIn 0.3s ease;
}

.loading-indicator .spinner {
    width: 40px;
    height: 40px;
    margin: 0 auto 10px;
    border: 4px solid rgba(158, 138, 120, 0.1);
    border-radius: 50%;
    border-top: 4px solid #9E8A78;
    animation: spin 1s linear infinite;
}

/* Skeleton loading */
.skeleton-product {
    background-color: #fff;
    border-radius: 8px;
    overflow: hidden;
    box-shadow: 0 4px 10px rgba(0, 0, 0, 0.05);
    margin-bottom: 20px;
    height: 350px;
    position: relative;
}

.skeleton-image {
    width: 100%;
    height: 180px;
    background: linear-gradient(90deg, #f0f0f0 25%, #e0e0e0 50%, #f0f0f0 75%);
    background-size: 200% 100%;
    animation: shimmer 1.5s infinite;
}

.skeleton-content {
    padding: 15px;
}

.skeleton-badge {
    width: 60px;
    height: 20px;
    background: linear-gradient(90deg, #f0f0f0 25%, #e0e0e0 50%, #f0f0f0 75%);
    background-size: 200% 100%;
    animation: shimmer 1.5s infinite;
    margin-bottom: 15px;
    border-radius: 4px;
}

.skeleton-title {
    width: 80%;
    height: 20px;
    background: linear-gradient(90deg, #f0f0f0 25%, #e0e0e0 50%, #f0f0f0 75%);
    background-size: 200% 100%;
    animation: shimmer 1.5s infinite;
    margin-bottom: 15px;
    border-radius: 4px;
}

.skeleton-text {
    width: 90%;
    height: 10px;
    background: linear-gradient(90deg, #f0f0f0 25%, #e0e0e0 50%, #f0f0f0 75%);
    background-size: 200% 100%;
    animation: shimmer 1.5s infinite;
    margin-bottom: 10px;
    border-radius: 4px;
}

.skeleton-text:last-of-type {
    width: 60%;
    margin-bottom: 20px;
}

.skeleton-footer {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0 15px 15px;
}

.skeleton-price {
    width: 30%;
    height: 15px;
    background: linear-gradient(90deg, #f0f0f0 25%, #e0e0e0 50%, #f0f0f0 75%);
    background-size: 200% 100%;
    animation: shimmer 1.5s infinite;
    border-radius: 4px;
}

.skeleton-button {
    width: 30%;
    height: 30px;
    background: linear-gradient(90deg, #f0f0f0 25%, #e0e0e0 50%, #f0f0f0 75%);
    background-size: 200% 100%;
    animation: shimmer 1.5s infinite;
    border-radius: 4px;
}

/* ===== EMPTY STATE STYLES ===== */

.empty-state {
    animation: fadeIn 0.5s ease;
    transition: all 0.3s ease;
    border-radius: 10px;
    border: 1px dashed rgba(158, 138, 120, 0.3);
    background-color: rgba(158, 138, 120, 0.05);
}

.empty-state:hover {
    transform: translateY(-5px);
    box-shadow: 0 10px 20px rgba(0, 0, 0, 0.05);
}

.empty-icon {
    color: #9E8A78;
    animation: pulse 2s infinite;
}

.empty-state .btn-outline-primary {
    color: #9E8A78;
    border-color: #9E8A78;
    transition: all 0.3s ease;
}

.empty-state .btn-outline-primary:hover {
    background-color: #9E8A78;
    color: white;
    transform: translateY(-3px);
    box-shadow: 0 5px 15px rgba(158, 138, 120, 0.3);
}

/* ===== KEYFRAMES ANIMATIONS ===== */

@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes fadeInRight {
    from {
        opacity: 0;
        transform: translateX(-20px);
    }
    to {
        opacity: 1;
        transform: translateX(0);
    }
}

@keyframes fadeIn {
    from {
        opacity: 0;
    }
    to {
        opacity: 1;
    }
}

@keyframes spin {
    0% {
        transform: rotate(0deg);
    }
    100% {
        transform: rotate(360deg);
    }
}

@keyframes shimmer {
    0% {
        background-position: -200% 0;
    }
    100% {
        background-position: 200% 0;
    }
}

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

/* ===== RESPONSIVE STYLES ===== */

@media (max-width: 768px) {
    .product-item {
        animation-delay: 0.1s !important;
    }
    
    .product-card:hover {
        transform: translateY(-5px) scale(1.01);
    }
    
    .filter-section {
        padding: 10px;
    }
}
