/**
 * TurboFan Pro Theme - Enhancement Styles
 * Includes: Skeleton screens, lazy loading, mobile improvements, interactions, language suggestion
 */

/* ========== Skeleton Loading ========== */
.product-grid.skeleton-loading .product-card {
    display: none;
}

.product-grid.skeleton-loading .product-card-skeleton {
    display: block;
}

.product-card-skeleton {
    background: #fff;
    border-radius: 8px;
    overflow: hidden;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.1);
    transition: all 0.3s ease;
}

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

.skeleton-content {
    padding: 20px;
}

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

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

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

/* ========== Enhanced Lazy Loading ========== */
.product-image img {
    opacity: 0;
    transition: opacity 0.3s ease;
}

.product-image img.loaded {
    opacity: 1;
}

/* ========== Mobile Category Filter Toggle ========== */
.mobile-category-toggle {
    display: none;
    width: 100%;
    padding: 15px 20px;
    background: #1a1a2e;
    color: #FFCE00;
    border: none;
    border-radius: 8px;
    font-size: 16px;
    font-weight: 600;
    cursor: pointer;
    margin-bottom: 10px;
    transition: all 0.3s ease;
    align-items: center;
    justify-content: center;
    gap: 10px;
}

.mobile-category-toggle i {
    transition: transform 0.3s ease;
}

@media (max-width: 768px) {
    .mobile-category-toggle {
        display: flex;
    }

    .product-category-sidebar {
        max-height: 0;
        overflow: hidden;
        transition: max-height 0.4s ease;
    }

    .product-category-sidebar.mobile-open {
        max-height: 100vh;
    }
}

/* ========== Product Card Interactions ========== */
.product-card {
    transition: all 0.3s ease;
    position: relative;
    overflow: hidden;
}

.product-card:hover {
    transform: translateY(-8px);
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.15);
}

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

.product-image img {
    transition: transform 0.4s ease;
}

/* Quick View Button */
.quick-view-btn {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%) scale(0);
    width: 60px;
    height: 60px;
    background: rgba(255, 206, 0, 0.9);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.3s ease;
    z-index: 2;
    opacity: 0;
}

.quick-view-btn i {
    font-size: 24px;
    color: #1a1a2e;
}

.product-card:hover .quick-view-btn {
    transform: translate(-50%, -50%) scale(1);
    opacity: 1;
}

.quick-view-btn:hover {
    background: #FFCE00;
    transform: translate(-50%, -50%) scale(1.1) !important;
}

/* ========== Category Filter Transitions ========== */
.category-filter-link {
    transition: all 0.3s ease;
    position: relative;
    overflow: hidden;
}

.category-filter-link::before {
    content: '';
    position: absolute;
    left: 0;
    top: 0;
    height: 100%;
    width: 4px;
    background: #FFCE00;
    transform: scaleY(0);
    transition: transform 0.3s ease;
}

.category-filter-link:hover::before,
.category-filter-link.active::before {
    transform: scaleY(1);
}

.category-filter-link:hover {
    background: rgba(255, 206, 0, 0.1);
}

/* Active state animation */
.category-filter-link.active {
    animation: activePulse 0.5s ease;
}

@keyframes activePulse {
    0% {
        transform: scale(1);
    }
    50% {
        transform: scale(1.02);
    }
    100% {
        transform: scale(1);
    }
}

/* ========== Touch Optimizations for Mobile ========== */
@media (max-width: 768px) {
    .category-filter-link,
    .product-card a,
    .filter-btn {
        min-height: 44px;
        display: flex;
        align-items: center;
    }

    .category-filter-link {
        padding: 12px 15px !important;
    }

    /* Larger touch targets for filter buttons */
    .filter-button-group button {
        min-height: 44px;
        padding: 12px 16px;
    }

    /* Improved mobile product grid */
    .product-grid {
        grid-template-columns: repeat(2, 1fr) !important;
        gap: 15px !important;
    }

    .product-card {
        margin-bottom: 0;
    }

    .product-title {
        font-size: 14px !important;
    }

    .product-subtitle {
        font-size: 12px !important;
    }

    /* Touch feedback */
    .category-filter-link:active {
        background: rgba(255, 206, 0, 0.2) !important;
    }
}

/* ========== Language Suggestion Popup ========== */
.language-suggestion {
    position: fixed;
    bottom: 20px;
    right: 20px;
    background: #1a1a2e;
    border: 2px solid #FFCE00;
    border-radius: 12px;
    padding: 20px;
    z-index: 10000;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.3);
    animation: slideInRight 0.5s ease;
    max-width: 300px;
}

@keyframes slideInRight {
    from {
        transform: translateX(100%);
        opacity: 0;
    }
    to {
        transform: translateX(0);
        opacity: 1;
    }
}

.suggestion-content {
    display: flex;
    flex-direction: column;
    gap: 15px;
    align-items: center;
    text-align: center;
}

.suggestion-content span {
    color: #fff;
    font-size: 16px;
    font-weight: 600;
}

.suggestion-content button {
    padding: 10px 20px;
    border: none;
    border-radius: 6px;
    cursor: pointer;
    font-weight: 600;
    transition: all 0.3s ease;
    width: 100%;
}

.btn-switch {
    background: #FFCE00;
    color: #1a1a2e;
}

.btn-switch:hover {
    background: #FFD700;
    transform: translateY(-2px);
}

.btn-cancel {
    background: transparent;
    color: #fff;
    border: 1px solid rgba(255, 255, 255, 0.3) !important;
}

.btn-cancel:hover {
    background: rgba(255, 255, 255, 0.1);
}

@media (max-width: 768px) {
    .language-suggestion {
        left: 20px;
        right: 20px;
        bottom: 20px;
        max-width: none;
    }
}

/* ========== Improved Responsive Design ========== */
@media (max-width: 768px) {
    /* Product layout improvements */
    .product-layout {
        flex-direction: column;
        gap: 20px;
    }

    .product-category-sidebar {
        width: 100% !important;
        max-height: none;
    }

    .product-main-content {
        width: 100% !important;
    }

    /* Better spacing for mobile */
    .product-page {
        padding: 15px !important;
    }

    .page-header {
        margin-bottom: 20px !important;
    }

    .page-title {
        font-size: 28px !important;
    }

    /* Filter section improvements */
    .product-filter-section {
        flex-direction: column;
        gap: 15px;
    }

    .filter-group {
        width: 100%;
    }

    .filter-button-group {
        flex-wrap: wrap;
    }

    .filter-button-group button {
        flex: 1 1 calc(50% - 5px);
        min-width: 120px;
    }

    /* Pagination improvements */
    .pagination-nav {
        flex-wrap: wrap;
        gap: 10px;
    }

    .pagination-nav a,
    .pagination-nav span {
        min-width: 40px;
        min-height: 40px;
        display: flex;
        align-items: center;
        justify-content: center;
    }
}

/* ========== Loading Progress Indicator ========== */
.loading-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(26, 26, 46, 0.8);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 99999;
    opacity: 0;
    visibility: hidden;
    transition: all 0.3s ease;
}

.loading-overlay.active {
    opacity: 1;
    visibility: visible;
}

.loading-spinner {
    width: 60px;
    height: 60px;
    border: 4px solid rgba(255, 206, 0, 0.2);
    border-top-color: #FFCE00;
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

@keyframes spin {
    to {
        transform: rotate(360deg);
    }
}
