/* CLiCKQ8 Premium Dark Theme */

/* Core Variables */
:root {
    /* Backgrounds */
    --bg-body: #050505;
    /* Deepest Black */
    --bg-glass: rgba(20, 20, 23, 0.7);
    /* Translucent Card */
    --bg-glass-hover: rgba(30, 30, 35, 0.8);

    /* Borders & Highlights */
    --border-subtle: rgba(255, 255, 255, 0.08);
    --border-hover: rgba(6, 182, 212, 0.3);
    /* Cyan hint on hover */

    /* Text */
    --text-primary: #ffffff;
    --text-secondary: #9ca3af;
    /* Gray-400 */
    --text-accent: #06b6d4;
    /* Cyan-500 */

    /* Effects */
    --card-shadow: 0 8px 32px rgba(0, 0, 0, 0.4);
    --blur-strength: 16px;
}

/* Base Reset & Typography */
body {
    background-color: var(--bg-body);
    font-family: 'Tajawal', sans-serif;
    color: var(--text-primary);
    overflow-x: hidden;
    margin: 0;
    padding: 0;
    -webkit-font-smoothing: antialiased;
}

/* Premium Glass Card Utility */
.glass-card {
    background-color: var(--bg-glass);
    backdrop-filter: blur(var(--blur-strength));
    -webkit-backdrop-filter: blur(var(--blur-strength));
    border: 1px solid var(--border-subtle);
    border-radius: 24px;
    box-shadow: var(--card-shadow);
    transition: transform 0.3s ease, background-color 0.3s ease, border-color 0.3s ease;
}

.glass-card:hover {
    transform: translateY(-4px);
    background-color: var(--bg-glass-hover);
    border-color: var(--border-hover);
}

/* Primary Action Button (Gradient Pill) */
.btn-primary {
    background: linear-gradient(135deg, #0891b2, #0e7490);
    color: white;
    padding: 12px 32px;
    border-radius: 9999px;
    /* Pill */
    font-weight: bold;
    font-size: 1rem;
    transition: all 0.2s ease;
    border: none;
    cursor: pointer;
    box-shadow: 0 4px 15px rgba(6, 182, 212, 0.3);
    display: inline-flex;
    align-items: center;
    gap: 8px;
}

.btn-primary:hover {
    transform: scale(1.05);
    box-shadow: 0 6px 20px rgba(6, 182, 212, 0.5);
    filter: brightness(1.1);
}

/* Secondary Button (Outline/Glass) */
.btn-secondary {
    background: rgba(255, 255, 255, 0.05);
    color: white;
    padding: 12px 32px;
    border-radius: 9999px;
    font-weight: 500;
    border: 1px solid var(--border-subtle);
    cursor: pointer;
    backdrop-filter: blur(4px);
    transition: all 0.2s ease;
    display: inline-flex;
    align-items: center;
    gap: 8px;
}

.btn-secondary:hover {
    background: rgba(255, 255, 255, 0.1);
    border-color: white;
}

/* Grid & Layout Helpers */
.section-title {
    font-size: 2.5rem;
    font-weight: 800;
    margin-bottom: 1rem;
    background: linear-gradient(to right, #fff, #9ca3af);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
}

/* Auth Modal Styles */
#auth-modal {
    transition: opacity 0.3s ease, visibility 0.3s ease;
    z-index: 9999;
}

#auth-modal.hidden {
    opacity: 0;
    visibility: hidden;
    pointer-events: none;
}

#auth-modal:not(.hidden) {
    opacity: 1;
    visibility: visible;
    pointer-events: auto;
}

/* Auth Tabs */
.auth-tab.active {
    background-color: #06b6d4;
    color: white;
}

.auth-tab:not(.active) {
    background-color: transparent;
    color: var(--text-secondary);
}

/* Utilities */
.text-gradient {
    background: linear-gradient(45deg, #06b6d4, #22d3ee);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
}

/* Scrollbar */
::-webkit-scrollbar {
    width: 8px;
}

::-webkit-scrollbar-track {
    background: #000;
}

::-webkit-scrollbar-thumb {
    background: #333;
    border-radius: 4px;
}

/* Animations */
@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(20px);
    }

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

.animate-fadeIn {
    animation: fadeIn 0.4s ease-out forwards;
}

/* Hide scrollbar but keep functionality */
.scrollbar-hide {
    -ms-overflow-style: none;
    scrollbar-width: none;
}

.scrollbar-hide::-webkit-scrollbar {
    display: none;
}

/* Toast Notifications */
.toast-container {
    position: fixed;
    bottom: 24px;
    left: 50%;
    transform: translateX(-50%);
    z-index: 9999;
    display: flex;
    flex-direction: column;
    gap: 8px;
    pointer-events: none;
}

.toast {
    background: rgba(34, 197, 94, 0.95);
    backdrop-filter: blur(10px);
    color: white;
    padding: 12px 24px;
    border-radius: 12px;
    font-weight: 600;
    font-size: 14px;
    display: flex;
    align-items: center;
    gap: 10px;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.3);
    animation: toastSlide 0.3s ease-out;
    pointer-events: auto;
}

.toast.toast-error {
    background: rgba(239, 68, 68, 0.95);
}

.toast.toast-info {
    background: rgba(6, 182, 212, 0.95);
}

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

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

.toast.toast-exit {
    animation: toastExit 0.3s ease-in forwards;
}

@keyframes toastExit {
    from {
        opacity: 1;
        transform: translateY(0);
    }

    to {
        opacity: 0;
        transform: translateY(-20px);
    }
}

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

/* Categories - Mobile Fix */
@media (max-width: 768px) {

    /* Performance: reduce expensive visual effects on mobile */
    .glass-card {
        backdrop-filter: none !important;
        -webkit-backdrop-filter: none !important;
        background-color: rgba(20, 20, 23, 0.92) !important;
        box-shadow: 0 6px 18px rgba(0, 0, 0, 0.25) !important;
        transition: none !important;
    }

    .glass-card:hover {
        transform: none !important;
    }

    .btn-primary:hover,
    .btn-secondary:hover {
        transform: none !important;
        filter: none !important;
    }

    .animate-fadeIn {
        animation: none !important;
    }

    .toast {
        backdrop-filter: none !important;
    }

    /* Tailwind arbitrary blur classes used in the page backgrounds */
    .blur-\[60px\],
    .blur-\[100px\],
    .blur-\[120px\] {
        filter: blur(30px) !important;
    }

    #lang-toggle-btn {
        backdrop-filter: none !important;
    }

    /* Categories horizontal scroll - RTL */
    .categories-container {
        display: flex !important;
        flex-wrap: nowrap !important;
        overflow-x: auto !important;
        gap: 8px !important;
        padding: 0 16px !important;
        -webkit-overflow-scrolling: touch;
        position: relative;
        /* RTL: Categories start from right, scroll left to see more */
    }

    /* Fade effect to show more content */
    .categories-wrapper {
        position: relative;
    }

    .categories-wrapper::after {
        content: '';
        position: absolute;
        left: 0;
        top: 0;
        bottom: 0;
        width: 40px;
        background: linear-gradient(to right, transparent, rgba(5, 5, 5, 0.8));
        pointer-events: none;
    }

    .categories-container button {
        flex-shrink: 0 !important;
        padding: 8px 16px !important;
        font-size: 12px !important;
        white-space: nowrap !important;
    }

    /* Products Grid - 2 columns on mobile */
    .products-grid,
    #products-grid {
        display: grid !important;
        grid-template-columns: repeat(2, 1fr) !important;
        gap: 12px !important;
        padding: 0 12px !important;
    }

    /* Product Card - Smaller on mobile */
    .product-card,
    .glass-card {
        border-radius: 16px !important;
    }

    .product-card img {
        height: 100px !important;
        object-fit: contain !important;
    }

    .product-card h3 {
        font-size: 12px !important;
        line-height: 1.3 !important;
    }

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

    .product-card button {
        padding: 8px 12px !important;
        font-size: 11px !important;
    }

    /* Section titles */
    .section-title {
        font-size: 1.5rem !important;
        text-align: center !important;
    }

    /* Subtitle under section title */
    .text-gray-400 {
        text-align: center !important;
        display: block;
        width: 100%;
    }

    /* Header adjustments */
    header {
        padding: 12px 16px !important;
    }

    /* Hero section */
    .hero-section h1 {
        font-size: 1.8rem !important;
    }

    .hero-section p {
        font-size: 14px !important;
    }

    /* Container padding */
    .container {
        padding-left: 12px !important;
        padding-right: 12px !important;
    }
}

/* Extra small phones */
@media (max-width: 380px) {

    .products-grid,
    #products-grid {
        grid-template-columns: repeat(2, 1fr) !important;
        gap: 8px !important;
    }

    .product-card img {
        height: 80px !important;
    }

    .product-card h3 {
        font-size: 11px !important;
    }

    .categories-container button {
        padding: 6px 12px !important;
        font-size: 11px !important;
    }
}