/* Preloader and Loading Animation Styles */

/* Main Preloader */
.preloader-loader {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    z-index: 9999;
    transition: opacity 0.5s ease-out, visibility 0.5s ease-out;
}

.preloader-loader.fade-out {
    opacity: 0;
    visibility: hidden;
}

/* Modern Spinner */
.modern-spinner {
    position: relative;
    width: 80px;
    height: 80px;
    margin-bottom: 2rem;
}

.spinner-ring {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    border: 4px solid transparent;
    border-top: 4px solid #ffffff;
    border-radius: 50%;
    animation: modernSpin 1.2s cubic-bezier(0.4, 0, 0.2, 1) infinite;
}

.spinner-ring:nth-child(2) {
    width: 60px;
    height: 60px;
    top: 10px;
    left: 10px;
    border-top-color: rgba(255, 255, 255, 0.7);
    animation-duration: 1.8s;
    animation-direction: reverse;
}

.spinner-ring:nth-child(3) {
    width: 40px;
    height: 40px;
    top: 20px;
    left: 20px;
    border-top-color: rgba(255, 255, 255, 0.4);
    animation-duration: 2.4s;
}

/* Progress Container */
.progress-container {
    width: 200px;
    height: 4px;
    background: rgba(255, 255, 255, 0.2);
    border-radius: 2px;
    overflow: hidden;
    margin-bottom: 1rem;
}

.progress-bar {
    height: 100%;
    background: linear-gradient(90deg, #ffffff, rgba(255, 255, 255, 0.8), #ffffff);
    border-radius: 2px;
    animation: modernProgress 2s ease-in-out infinite;
    transform: translateX(-100%);
}

/* Loading Dots */
.loading-dots {
    display: flex;
    gap: 8px;
    margin-top: 1rem;
}

.dot {
    width: 8px;
    height: 8px;
    background: #ffffff;
    border-radius: 50%;
    animation: dotPulse 1.4s ease-in-out infinite both;
}

.dot:nth-child(1) { animation-delay: -0.32s; }
.dot:nth-child(2) { animation-delay: -0.16s; }
.dot:nth-child(3) { animation-delay: 0s; }

/* Preloader Text */
.preloader-loader h2 {
    color: #ffffff;
    font-size: 1.5rem;
    font-weight: 600;
    margin-bottom: 0.5rem;
    text-align: center;
    animation: logoEntrance 1s ease-out;
}

.preloader-loader p {
    color: rgba(255, 255, 255, 0.8);
    font-size: 0.875rem;
    text-align: center;
    animation: logoEntrance 1s ease-out 0.2s both;
}

/* Keyframe Animations */
@keyframes backgroundPulse {
    0%, 100% {
        background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    }
    50% {
        background: linear-gradient(135deg, #764ba2 0%, #667eea 100%);
    }
}

@keyframes logoEntrance {
    0% {
        opacity: 0;
        transform: translateY(20px);
    }
    100% {
        opacity: 1;
        transform: translateY(0);
    }
}

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

@keyframes modernProgress {
    0% {
        transform: translateX(-100%);
    }
    50% {
        transform: translateX(0%);
    }
    100% {
        transform: translateX(100%);
    }
}

@keyframes dotPulse {
    0%, 80%, 100% {
        transform: scale(0);
        opacity: 0.5;
    }
    40% {
        transform: scale(1);
        opacity: 1;
    }
}

/* Responsive Adjustments */
@media (max-width: 640px) {
    .modern-spinner {
        width: 60px;
        height: 60px;
    }
    
    .spinner-ring:nth-child(2) {
        width: 45px;
        height: 45px;
        top: 7.5px;
        left: 7.5px;
    }
    
    .spinner-ring:nth-child(3) {
        width: 30px;
        height: 30px;
        top: 15px;
        left: 15px;
    }
    
    .progress-container {
        width: 150px;
    }
    
    .preloader-loader h2 {
        font-size: 1.25rem;
    }
    
    .preloader-loader p {
        font-size: 0.75rem;
    }
}

/* Shimmer Effects */
.shimmer {
    background: #f6f7f8;
    background-image: linear-gradient(
        to right,
        #f6f7f8 0%,
        #edeef1 20%,
        #f6f7f8 40%,
        #f6f7f8 100%
    );
    background-repeat: no-repeat;
    background-size: 800px 100%;
    animation: shimmer 1.5s infinite linear;
}

.dark .shimmer {
    background: #1f2937;
    background-image: linear-gradient(
        to right,
        #1f2937 0%,
        #374151 20%,
        #1f2937 40%,
        #1f2937 100%
    );
}

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

/* Product Shimmer */
.product-shimmer {
    background: linear-gradient(90deg, #f0f0f0 25%, #e0e0e0 50%, #f0f0f0 75%);
    background-size: 200% 100%;
    animation: shimmer 1.5s infinite;
    border-radius: 0.5rem;
}

.dark .product-shimmer {
    background: linear-gradient(90deg, #374151 25%, #4b5563 50%, #374151 75%);
    background-size: 200% 100%;
}

/* Shimmer Lines */
.shimmer-line {
    background: linear-gradient(90deg, #f0f0f0 25%, #e0e0e0 50%, #f0f0f0 75%);
    background-size: 200% 100%;
    animation: shimmer 1.5s infinite;
    border-radius: 0.25rem;
    height: 1rem;
    margin-bottom: 0.5rem;
}

.dark .shimmer-line {
    background: linear-gradient(90deg, #374151 25%, #4b5563 50%, #374151 75%);
    background-size: 200% 100%;
}

.shimmer-line:last-child {
    margin-bottom: 0;
}

.shimmer-line.short {
    width: 60%;
}

.shimmer-line.medium {
    width: 80%;
}

.shimmer-line.long {
    width: 100%;
}

/* Featured Product Card Styles */
.featured-product-card {
    background: #ffffff;
    border-radius: 12px;
    box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -1px rgba(0, 0, 0, 0.06);
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    overflow: hidden;
    position: relative;
}

.featured-product-card:hover {
    transform: translateY(-4px);
    box-shadow: 0 20px 25px -5px rgba(0, 0, 0, 0.1), 0 10px 10px -5px rgba(0, 0, 0, 0.04);
}

.dark .featured-product-card {
    background: #1f2937;
    border: 1px solid #374151;
}

/* Product Image Container */
.product-image-container {
    position: relative;
    width: 100%;
    height: 200px;
    overflow: hidden;
    background: #f9fafb;
}

.dark .product-image-container {
    background: #111827;
}

.product-image {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

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

/* Quick Action Buttons */
.quick-actions {
    position: absolute;
    top: 12px;
    right: 12px;
    display: flex;
    flex-direction: column;
    gap: 8px;
    opacity: 0;
    transform: translateX(20px);
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.featured-product-card:hover .quick-actions {
    opacity: 1;
    transform: translateX(0);
}

.quick-action-btn {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.9);
    backdrop-filter: blur(10px);
    border: none;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}

.quick-action-btn:hover {
    background: #ffffff;
    transform: scale(1.1);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
}

.quick-action-btn.active {
    background: #ef4444;
    color: #ffffff;
}

.quick-action-btn .material-icons {
    font-size: 18px;
    color: #6b7280;
}

.quick-action-btn.active .material-icons {
    color: #ffffff;
}

/* Product Info Section */
.product-info {
    padding: 16px;
}

.product-category {
    font-size: 12px;
    font-weight: 500;
    color: #6b7280;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    margin-bottom: 4px;
}

.dark .product-category {
    color: #9ca3af;
}

.product-name {
    font-size: 16px;
    font-weight: 600;
    color: #111827;
    margin-bottom: 4px;
    line-height: 1.4;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.dark .product-name {
    color: #f9fafb;
}

.product-vendor {
    font-size: 13px;
    color: #6b7280;
    margin-bottom: 8px;
}

.dark .product-vendor {
    color: #9ca3af;
}

.product-description {
    font-size: 14px;
    color: #4b5563;
    line-height: 1.5;
    margin-bottom: 12px;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.dark .product-description {
    color: #d1d5db;
}

/* Price Section */
.price-section {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 16px;
}

.price-container {
    display: flex;
    align-items: center;
    gap: 8px;
}

.current-price {
    font-size: 18px;
    font-weight: 700;
    color: #ef4444;
}

.original-price {
    font-size: 14px;
    color: #9ca3af;
    text-decoration: line-through;
}

.discount-badge {
    background: #ef4444;
    color: #ffffff;
    font-size: 11px;
    font-weight: 600;
    padding: 2px 6px;
    border-radius: 4px;
    text-transform: uppercase;
}

.availability-badge {
    font-size: 11px;
    font-weight: 500;
    padding: 4px 8px;
    border-radius: 12px;
    text-transform: uppercase;
}

.availability-badge.in-stock {
    background: #d1fae5;
    color: #065f46;
}

.availability-badge.out-of-stock {
    background: #fee2e2;
    color: #991b1b;
}

.dark .availability-badge.in-stock {
    background: #064e3b;
    color: #6ee7b7;
}

.dark .availability-badge.out-of-stock {
    background: #7f1d1d;
    color: #fca5a5;
}