/* ==========================================
   CSS Variables - Qiyoune Brand Colors
   ========================================== */
:root {
    /* Brand Colors */
    --bg-primary: #1C1C1C;
    --bg-secondary: #2A2A2A;
    --text-primary: #FFFFFF;
    --accent-primary: #00C28E;
    --accent-hover: #00A876;

    /* Glassmorphism */
    --glass-bg: rgba(255, 255, 255, 0.1);
    --glass-border: rgba(255, 255, 255, 0.2);

    /* Shadows */
    --glow-shadow: 0 10px 30px rgba(0, 194, 142, 0.3);
    --card-shadow: 0 4px 20px rgba(0, 0, 0, 0.3);

    /* Spacing */
    --spacing-xs: 8px;
    --spacing-sm: 12px;
    --spacing-md: 16px;
    --spacing-lg: 24px;
    --spacing-xl: 32px;

    /* Border Radius */
    --radius-sm: 12px;
    --radius-md: 16px;
    --radius-lg: 20px;
    --radius-full: 9999px;
}

/* ==========================================
   Reset & Base Styles
   ========================================== */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, Cantarell, 'Helvetica Neue', sans-serif;
    background: var(--bg-primary);
    background-image: linear-gradient(135deg, #1C1C1C 0%, #2A2A2A 100%);
    color: var(--text-primary);
    line-height: 1.6;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    min-height: 100vh;
    overflow-x: hidden;
}

/* ==========================================
   Container
   ========================================== */
.container {
    max-width: 680px;
    margin: 0 auto;
    padding: var(--spacing-xl) var(--spacing-md);
    padding-bottom: 100px;
}

/* ==========================================
   Profile Section
   ========================================== */
.profile-section {
    text-align: center;
    margin-bottom: var(--spacing-xl);
    animation: fadeInDown 0.6s ease-out;
}

.profile-image-wrapper {
    margin-bottom: var(--spacing-md);
    animation: scaleIn 0.6s ease-out 0.2s backwards;
}

.profile-image {
    width: 120px;
    height: 120px;
    border-radius: var(--radius-full);
    border: 4px solid var(--accent-primary);
    box-shadow: var(--glow-shadow);
    object-fit: cover;
    transition: transform 0.3s ease;
}

.profile-image:hover {
    transform: scale(1.05);
}

.profile-name {
    font-size: 32px;
    font-weight: 700;
    margin-bottom: var(--spacing-xs);
    background: linear-gradient(45deg, var(--text-primary), var(--accent-primary));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    animation: fadeIn 0.6s ease-out 0.3s backwards;
}

.profile-bio {
    font-size: 16px;
    color: rgba(255, 255, 255, 0.7);
    animation: fadeIn 0.6s ease-out 0.4s backwards;
}

/* ==========================================
   Search Bar
   ========================================== */
.search-container {
    position: relative;
    margin-bottom: var(--spacing-lg);
    animation: fadeIn 0.6s ease-out 0.5s backwards;
}

.search-icon {
    position: absolute;
    left: var(--spacing-md);
    top: 50%;
    transform: translateY(-50%);
    color: rgba(255, 255, 255, 0.5);
    pointer-events: none;
    z-index: 10;
    /* Amélioration de la netteté du SVG */
    shape-rendering: geometricPrecision;
    image-rendering: -webkit-optimize-contrast;
    image-rendering: crisp-edges;
}

.search-input {
    width: 100%;
    padding: 14px var(--spacing-md) 14px 48px;
    background: var(--glass-bg);
    border: 1px solid var(--glass-border);
    border-radius: var(--radius-md);
    color: var(--text-primary);
    font-size: 16px;
    outline: none;
    transition: all 0.3s ease;
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
}

.search-input::placeholder {
    color: rgba(255, 255, 255, 0.5);
}

.search-input:focus {
    border-color: var(--accent-primary);
    box-shadow: 0 0 0 3px rgba(0, 194, 142, 0.15);
}

/* ==========================================
   Products Grid
   ========================================== */
.products-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
    gap: var(--spacing-md);
    margin-bottom: var(--spacing-lg);
}

@media (max-width: 640px) {
    .products-grid {
        grid-template-columns: 1fr;
    }
}

/* ==========================================
   Product Card
   ========================================== */
.product-card {
    background: var(--glass-bg);
    border: 1px solid var(--glass-border);
    border-radius: var(--radius-lg);
    padding: var(--spacing-md);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    transition: all 0.3s ease;
    animation: fadeInUp 0.5s ease-out backwards;
    box-shadow: var(--card-shadow);
}

.product-card:hover {
    transform: translateY(-4px);
    border-color: var(--accent-primary);
    box-shadow: var(--glow-shadow);
}

.product-image-wrapper {
    position: relative;
    width: 100%;
    padding-top: 100%;
    margin-bottom: var(--spacing-sm);
    border-radius: var(--radius-md);
    overflow: hidden;
    background: var(--bg-secondary);
}

.product-image {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.3s ease;
    loading: lazy;
}

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

.product-title {
    font-size: 18px;
    font-weight: 600;
    margin-bottom: var(--spacing-xs);
    color: var(--text-primary);
    line-height: 1.4;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.product-price {
    font-size: 24px;
    font-weight: 700;
    color: var(--accent-primary);
    margin-bottom: var(--spacing-md);
}

.product-button {
    width: 100%;
    padding: 14px var(--spacing-md);
    background: linear-gradient(45deg, var(--accent-primary), var(--accent-hover));
    border: none;
    border-radius: var(--radius-md);
    color: var(--text-primary);
    font-size: 16px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    text-decoration: none;
    display: block;
    text-align: center;
    box-shadow: 0 4px 15px rgba(0, 194, 142, 0.2);
}

.product-button:hover {
    transform: translateY(-2px);
    box-shadow: var(--glow-shadow);
}

.product-button:active {
    transform: translateY(0);
}

/* ==========================================
   No Results
   ========================================== */
.no-results {
    text-align: center;
    padding: var(--spacing-xl) var(--spacing-md);
    color: rgba(255, 255, 255, 0.6);
}

.no-results svg {
    margin-bottom: var(--spacing-md);
    color: var(--accent-primary);
}

.no-results h2 {
    font-size: 24px;
    margin-bottom: var(--spacing-sm);
    color: var(--text-primary);
}

.no-results p {
    font-size: 16px;
}

/* ==========================================
   Footer
   ========================================== */
.footer {
    text-align: center;
    padding: var(--spacing-lg) var(--spacing-md);
    color: rgba(255, 255, 255, 0.5);
    font-size: 14px;
}

/* ==========================================
   Loader
   ========================================== */
.loader {
    position: fixed;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 50px;
    height: 50px;
    border: 3px solid rgba(0, 194, 142, 0.2);
    border-top-color: var(--accent-primary);
    border-radius: 50%;
    animation: spin 1s linear infinite;
    z-index: 9999;
}

.loader.hidden {
    opacity: 0;
    visibility: hidden;
}

/* ==========================================
   Animations
   ========================================== */
@keyframes fadeIn {
    from {
        opacity: 0;
    }

    to {
        opacity: 1;
    }
}

@keyframes fadeInDown {
    from {
        opacity: 0;
        transform: translateY(-20px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

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

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes scaleIn {
    from {
        opacity: 0;
        transform: scale(0.8);
    }

    to {
        opacity: 1;
        transform: scale(1);
    }
}

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

/* ==========================================
   Responsive Design
   ========================================== */
@media (max-width: 480px) {
    .container {
        padding: var(--spacing-lg) var(--spacing-sm);
    }

    .profile-name {
        font-size: 28px;
    }

    .product-title {
        font-size: 16px;
    }

    .product-price {
        font-size: 20px;
    }
}

/* ==========================================
   Performance Optimizations
   ========================================== */
/* Use GPU acceleration for smooth animations */
.product-card,
.product-image,
.product-button,
.profile-image {
    will-change: transform;
}

/* Reduce motion for users who prefer it */
@media (prefers-reduced-motion: reduce) {

    *,
    *::before,
    *::after {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
    }
}