/* CLiCKQ8 Original Dark OLED Theme */

/* Core Variables */
:root {
    /* Backgrounds */
    --bg-body: #050505;
    /* Deep black for OLED */
    --bg-glass: rgba(15, 15, 15, 0.7);
    /* Translucent dark card */
    --bg-glass-hover: rgba(25, 25, 25, 0.9);

    /* Borders & Highlights */
    --border-subtle: rgba(255, 255, 255, 0.05);
    /* Very subtle border */
    --border-hover: rgba(0, 229, 255, 0.3);
    /* Cyan hint on hover */

    /* Text */
    --text-primary: #ffffff;
    /* Primary white text */
    --text-secondary: #a0aec0;
    /* Subdued gray text */
    --text-accent: #00e5ff;
    /* Cyan accent */

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

/* Base Reset & Typography */
body {
    background-color: var(--bg-body);
    /* Subtle animated gradient background with blobs */
    background-image:
        radial-gradient(ellipse at top left, rgba(0, 229, 255, 0.15) 0%, transparent 40%),
        radial-gradient(ellipse at bottom right, rgba(138, 43, 226, 0.15) 0%, transparent 40%),
        radial-gradient(ellipse at 50% 50%, rgba(0, 229, 255, 0.05) 0%, transparent 60%);
    background-attachment: fixed;
    animation: backgroundBreathing 15s ease-in-out infinite alternate;
    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: inset 0 0 10px rgba(255, 255, 255, 0.02), var(--card-shadow);
    transition: all 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275);
    position: relative;
    overflow: hidden;
}

.glass-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: -150%;
    width: 150%;
    height: 100%;
    background: linear-gradient(120deg,
            transparent,
            rgba(255, 255, 255, 0.05),
            transparent);
    transform: skewX(-20deg);
    transition: 0.6s ease;
    pointer-events: none;
    z-index: 5;
}

.glass-card:hover::before {
    left: 150%;
}

.glass-card:hover {
    transform: translateY(-8px) scale(1.02);
    background-color: var(--bg-glass-hover);
    border-color: rgba(0, 229, 255, 0.4);
    box-shadow: 0 25px 50px -12px rgba(0, 229, 255, 0.15), inset 0 0 20px rgba(0, 229, 255, 0.05);
}

/* Primary Action Button (Gradient Pill with Shimmer) */
.btn-primary {
    background: linear-gradient(135deg, #00b8d4, #00838f);
    color: white;
    padding: 12px 32px;
    border-radius: 9999px;
    font-weight: bold;
    font-size: 1rem;
    transition: all 0.3s ease;
    border: 1px solid rgba(255, 255, 255, 0.1);
    cursor: pointer;
    box-shadow: 0 4px 15px rgba(0, 229, 255, 0.3);
    display: inline-flex;
    align-items: center;
    gap: 8px;
    position: relative;
    overflow: hidden;
}

.btn-primary::after {
    content: '';
    position: absolute;
    top: -50%;
    left: -50%;
    width: 200%;
    height: 200%;
    background: linear-gradient(45deg,
            transparent 45%,
            rgba(255, 255, 255, 0.2) 50%,
            transparent 55%);
    transform: rotate(45deg) translate(-100%, -100%);
    transition: transform 0.6s ease;
}

.btn-primary:hover::after {
    transform: rotate(45deg) translate(100%, 100%);
}

.btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 25px rgba(0, 229, 255, 0.5);
    filter: brightness(1.1);
}

/* Secondary Button (Outline/Glass) */
.btn-secondary {
    background: rgba(255, 255, 255, 0.05);
    color: var(--text-primary);
    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: rgba(255, 255, 255, 0.2);
}

/* Grid & Layout Helpers */
.section-title {
    font-size: 2.5rem;
    font-weight: 800;
    margin-bottom: 1rem;
    color: var(--text-primary);
}

/* 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(10px);
    }

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

.animate-fadeIn {
    animation: fadeIn 0.5s cubic-bezier(0.16, 1, 0.3, 1) forwards;
}

/* Background Animations */
@keyframes backgroundBreathing {
    0% {
        background-position: 0% 50%;
    }

    50% {
        background-position: 100% 50%;
    }

    100% {
        background-position: 0% 50%;
    }
}

@keyframes bannerShine {
    0% {
        transform: translateX(100%);
    }

    100% {
        transform: translateX(-100%);
    }
}

@keyframes pulse-cyan {

    0%,
    100% {
        opacity: 1;
    }

    50% {
        opacity: .5;
    }
}

@keyframes float {

    0%,
    100% {
        transform: translateY(0);
    }

    50% {
        transform: translateY(-15px);
    }
}

.float-animation {
    animation: float 6s ease-in-out infinite;
}

.float-animation-delayed {
    animation: float 6s ease-in-out infinite;
    animation-delay: 3s;
}

/* Scroll Reveal Classes */
.reveal {
    opacity: 0;
    transform: translateY(40px);
    transition: all 0.8s cubic-bezier(0.5, 0, 0, 1);
}

.reveal.active {
    opacity: 1;
    transform: translateY(0);
}

.reveal-left {
    opacity: 0;
    transform: translateX(-50px);
    transition: all 0.8s cubic-bezier(0.5, 0, 0, 1);
}

.reveal-left.active {
    opacity: 1;
    transform: translateX(0);
}

.reveal-right {
    opacity: 0;
    transform: translateX(50px);
    transition: all 0.8s cubic-bezier(0.5, 0, 0, 1);
}

.reveal-right.active {
    opacity: 1;
    transform: translateX(0);
}

.reveal-scale {
    opacity: 0;
    transform: scale(0.9);
    transition: all 0.6s cubic-bezier(0.5, 0, 0, 1);
}

.reveal-scale.active {
    opacity: 1;
    transform: scale(1);
}

/* 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
   ============================================ */

/* Mobile Side Drawer Transitions and Tweaks */
.mobile-drawer-link {
    transform-origin: right;
}

.mobile-drawer-link:active {
    transform: scale(0.98);
}

.mobile-drawer-link i {
    transition: transform 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

.mobile-drawer-link:hover i {
    transform: scale(1.2) rotate(-5deg);
}

/* 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;
    }
}