/* ==========================================================================
   ZENBIL CHIFFON - PRO ANIMATIONS & VISUAL EFFECTS
   ========================================================================== */

/* SMOOTH SCROLL */
html { scroll-behavior: smooth; }

/* CUSTOM SCROLLBAR */
::-webkit-scrollbar { width: 8px; }
::-webkit-scrollbar-track { background: var(--bg-color); }
::-webkit-scrollbar-thumb { background: linear-gradient(180deg, var(--primary-color), var(--primary-hover)); border-radius: 10px; }
::-webkit-scrollbar-thumb:hover { background: var(--primary-hover); }

/* PAGE LOAD CURTAIN */
.page-curtain {
    position: fixed; top: 0; left: 0; width: 100%; height: 100%;
    background: linear-gradient(135deg, #111 0%, #1a1a2e 50%, #111 100%);
    z-index: 99999; display: flex; align-items: center; justify-content: center;
    transition: opacity 0.6s ease, visibility 0.6s ease;
}
.page-curtain.hide { opacity: 0; visibility: hidden; pointer-events: none; }
.curtain-logo {
    width: 80px; height: 80px; border-radius: 12px;
    animation: curtainPulse 1s ease-in-out infinite alternate;
}
@keyframes curtainPulse {
    from { transform: scale(0.9); opacity: 0.7; }
    to { transform: scale(1.1); opacity: 1; }
}

/* GLASSMORPHISM HEADER */
header {
    background: rgba(255, 255, 255, 0.75) !important;
    backdrop-filter: blur(20px) saturate(180%);
    -webkit-backdrop-filter: blur(20px) saturate(180%);
    border-bottom: 1px solid rgba(234, 229, 217, 0.5) !important;
}
[data-theme="dark"] header {
    background: rgba(18, 22, 32, 0.8) !important;
    border-bottom: 1px solid rgba(42, 53, 83, 0.5) !important;
}

/* ========== SCROLL REVEAL SYSTEM ========== */
.reveal {
    opacity: 0;
    transform: translateY(40px);
    transition: opacity 0.8s cubic-bezier(0.16, 1, 0.3, 1), transform 0.8s cubic-bezier(0.16, 1, 0.3, 1);
}
.reveal.visible { opacity: 1; transform: translateY(0); }

.reveal-left {
    opacity: 0; transform: translateX(-60px);
    transition: opacity 0.8s cubic-bezier(0.16, 1, 0.3, 1), transform 0.8s cubic-bezier(0.16, 1, 0.3, 1);
}
.reveal-left.visible { opacity: 1; transform: translateX(0); }

.reveal-right {
    opacity: 0; transform: translateX(60px);
    transition: opacity 0.8s cubic-bezier(0.16, 1, 0.3, 1), transform 0.8s cubic-bezier(0.16, 1, 0.3, 1);
}
.reveal-right.visible { opacity: 1; transform: translateX(0); }

.reveal-scale {
    opacity: 0; transform: scale(0.85);
    transition: opacity 0.8s cubic-bezier(0.16, 1, 0.3, 1), transform 0.8s cubic-bezier(0.16, 1, 0.3, 1);
}
.reveal-scale.visible { opacity: 1; transform: scale(1); }

/* STAGGERED CHILDREN */
.stagger-children > * { opacity: 0; transform: translateY(30px); transition: opacity 0.6s ease, transform 0.6s ease; }
.stagger-children.visible > *:nth-child(1) { transition-delay: 0.05s; }
.stagger-children.visible > *:nth-child(2) { transition-delay: 0.12s; }
.stagger-children.visible > *:nth-child(3) { transition-delay: 0.19s; }
.stagger-children.visible > *:nth-child(4) { transition-delay: 0.26s; }
.stagger-children.visible > *:nth-child(5) { transition-delay: 0.33s; }
.stagger-children.visible > *:nth-child(6) { transition-delay: 0.40s; }
.stagger-children.visible > *:nth-child(7) { transition-delay: 0.47s; }
.stagger-children.visible > *:nth-child(8) { transition-delay: 0.54s; }
.stagger-children.visible > *:nth-child(9) { transition-delay: 0.61s; }
.stagger-children.visible > *:nth-child(10) { transition-delay: 0.68s; }
.stagger-children.visible > *:nth-child(11) { transition-delay: 0.75s; }
.stagger-children.visible > *:nth-child(12) { transition-delay: 0.82s; }
.stagger-children.visible > * { opacity: 0; transform: translateY(30px); }
.stagger-children.visible > * { opacity: 1; transform: translateY(0); }

/* ========== GOLD SHIMMER ON TITLES ========== */
.shimmer-text {
    background: linear-gradient(90deg, var(--text-color) 0%, var(--primary-color) 25%, #F3E5AB 50%, var(--primary-color) 75%, var(--text-color) 100%);
    background-size: 200% auto;
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    animation: shimmerSweep 4s linear infinite;
}
@keyframes shimmerSweep {
    0% { background-position: -200% center; }
    100% { background-position: 200% center; }
}

/* ========== NAV LINK ANIMATED UNDERLINE ========== */
.nav-links li a {
    position: relative;
    padding-bottom: 4px;
}
.nav-links li a::after {
    content: '';
    position: absolute; bottom: 0; left: 0;
    width: 0; height: 2px;
    background: var(--primary-color);
    transition: width 0.3s cubic-bezier(0.25, 0.8, 0.25, 1);
}
.nav-links li a:hover::after { width: 100%; }

/* ========== PRODUCT CARD PRO EFFECTS ========== */
.product-card {
    perspective: 800px;
    transform-style: preserve-3d;
    transition: transform 0.5s cubic-bezier(0.25, 0.8, 0.25, 1), box-shadow 0.5s ease, border-color 0.5s ease !important;
    position: relative;
    overflow: hidden;
}
.product-card::before {
    content: '';
    position: absolute; top: -2px; left: -2px; right: -2px; bottom: -2px;
    background: linear-gradient(45deg, transparent 30%, var(--primary-color) 50%, transparent 70%);
    background-size: 300% 300%;
    z-index: -1; border-radius: var(--radius);
    opacity: 0; transition: opacity 0.5s ease;
}
.product-card:hover::before {
    opacity: 1;
    animation: borderGlow 2s linear infinite;
}
@keyframes borderGlow {
    0% { background-position: 0% 50%; }
    50% { background-position: 100% 50%; }
    100% { background-position: 0% 50%; }
}
.product-card:hover {
    transform: translateY(-10px) scale(1.02) !important;
    box-shadow: 0 20px 50px rgba(197, 160, 89, 0.2) !important;
}

/* ========== BUTTON RIPPLE EFFECT ========== */
.btn, .btn-telegram, .btn-bighabesha, .filter-btn {
    position: relative;
    overflow: hidden;
}
.btn .ripple, .btn-telegram .ripple, .btn-bighabesha .ripple, .filter-btn .ripple {
    position: absolute;
    border-radius: 50%;
    background: rgba(255,255,255,0.4);
    transform: scale(0);
    animation: rippleEffect 0.6s linear;
    pointer-events: none;
}
@keyframes rippleEffect {
    to { transform: scale(4); opacity: 0; }
}

/* ========== TESTIMONIAL GLOW ========== */
.testimonial-card {
    transition: transform 0.4s ease, box-shadow 0.4s ease, border-color 0.4s ease !important;
}
.testimonial-card:hover {
    transform: translateY(-8px) !important;
    box-shadow: 0 10px 40px rgba(197, 160, 89, 0.15), 0 0 20px rgba(197, 160, 89, 0.08) !important;
    border-color: var(--primary-color) !important;
}

/* ========== HERO PARTICLES CANVAS ========== */
#hero-particles {
    position: absolute; top: 0; left: 0; width: 100%; height: 100%;
    z-index: 1; pointer-events: none;
}

/* ========== TRUST BADGES / STATS ========== */
.trust-section {
    padding: 60px 20px;
    background: linear-gradient(135deg, rgba(197,160,89,0.05) 0%, transparent 50%, rgba(197,160,89,0.05) 100%);
    border-top: 1px solid var(--border-color);
    border-bottom: 1px solid var(--border-color);
}
.trust-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 30px; text-align: center;
}
.trust-item { padding: 30px 15px; }
.trust-icon {
    font-size: 2.5rem;
    color: var(--primary-color);
    margin-bottom: 15px;
    display: inline-block;
    animation: floatIcon 3s ease-in-out infinite;
}
.trust-icon:nth-child(1) { animation-delay: 0s; }
@keyframes floatIcon {
    0%, 100% { transform: translateY(0); }
    50% { transform: translateY(-8px); }
}
.trust-number {
    font-family: var(--font-heading);
    font-size: 2.8rem; font-weight: 700;
    color: var(--primary-color);
    margin-bottom: 5px;
}
.trust-label {
    font-size: 0.95rem; color: var(--light-text);
    text-transform: uppercase; letter-spacing: 1.5px; font-weight: 600;
}

/* ========== BACK TO TOP BUTTON ========== */
.back-to-top {
    position: fixed; bottom: 30px; right: 100px;
    width: 48px; height: 48px; border-radius: 50%;
    background: var(--primary-color);
    color: #fff; border: none; cursor: pointer;
    font-size: 1.2rem;
    box-shadow: 0 4px 15px rgba(197, 160, 89, 0.4);
    opacity: 0; visibility: hidden;
    transform: translateY(20px);
    transition: all 0.4s cubic-bezier(0.25, 0.8, 0.25, 1);
    z-index: 999;
    display: flex; align-items: center; justify-content: center;
}
.back-to-top.show { opacity: 1; visibility: visible; transform: translateY(0); }
.back-to-top:hover { transform: translateY(-4px) scale(1.1); background: var(--primary-hover); }

/* ========== ANIMATED GRADIENT BG (Login/Auth Pages) ========== */
.animated-gradient-bg {
    background: linear-gradient(-45deg, var(--bg-color), #f5e6d3, var(--bg-color), #e8d5b7);
    background-size: 400% 400%;
    animation: gradientShift 15s ease infinite;
}
[data-theme="dark"] .animated-gradient-bg {
    background: linear-gradient(-45deg, #121620, #1a2235, #0f1218, #1e2a40);
    background-size: 400% 400%;
    animation: gradientShift 15s ease infinite;
}
@keyframes gradientShift {
    0% { background-position: 0% 50%; }
    50% { background-position: 100% 50%; }
    100% { background-position: 0% 50%; }
}

/* FLOATING AUTH CONTAINER */
.float-anim {
    animation: floatContainer 6s ease-in-out infinite;
}
@keyframes floatContainer {
    0%, 100% { transform: translateY(0px); }
    50% { transform: translateY(-10px); }
}

/* ========== PAGE HEADER PARALLAX ========== */
.page-header {
    position: relative;
    overflow: hidden;
    background: linear-gradient(135deg, #0a0a0a 0%, #1a1a2e 50%, #111 100%) !important;
}
.page-header::after {
    content: '';
    position: absolute; top: 0; left: 0; width: 100%; height: 100%;
    background: radial-gradient(circle at 50% 50%, rgba(197,160,89,0.1) 0%, transparent 70%);
    pointer-events: none;
}
.page-header h1 {
    position: relative; z-index: 2;
    text-shadow: 0 0 30px rgba(197,160,89,0.3), 2px 2px 10px rgba(0,0,0,0.5) !important;
}

/* ========== SKELETON LOADER ========== */
.skeleton {
    background: linear-gradient(90deg, var(--border-color) 25%, rgba(197,160,89,0.1) 50%, var(--border-color) 75%);
    background-size: 200% 100%;
    animation: skeletonShimmer 1.5s infinite;
    border-radius: 8px;
}
@keyframes skeletonShimmer {
    0% { background-position: 200% 0; }
    100% { background-position: -200% 0; }
}

/* ========== ENHANCED FOOTER ANIMATIONS ========== */
.pro-footer .footer-col { 
    opacity: 0; transform: translateY(20px);
    transition: opacity 0.6s ease, transform 0.6s ease;
}
.pro-footer.visible .footer-col:nth-child(1) { transition-delay: 0.1s; opacity: 1; transform: translateY(0); }
.pro-footer.visible .footer-col:nth-child(2) { transition-delay: 0.25s; opacity: 1; transform: translateY(0); }
.pro-footer.visible .footer-col:nth-child(3) { transition-delay: 0.4s; opacity: 1; transform: translateY(0); }

/* ========== HERO TYPEWRITER CURSOR ========== */
.typewriter-cursor {
    display: inline-block;
    width: 3px; height: 1em;
    background: var(--primary-color);
    margin-left: 4px;
    animation: blink 0.8s step-end infinite;
    vertical-align: text-bottom;
}
@keyframes blink {
    0%, 100% { opacity: 1; }
    50% { opacity: 0; }
}

/* ========== VALUE CARD HOVER (About Page) ========== */
.value-card {
    transition: transform 0.4s ease, box-shadow 0.4s ease, border-color 0.4s ease !important;
}
.value-card:hover {
    transform: translateY(-8px) !important;
    box-shadow: 0 15px 40px rgba(197,160,89,0.12) !important;
    border-color: var(--primary-color) !important;
}
.value-card i {
    transition: transform 0.4s ease;
}
.value-card:hover i {
    transform: scale(1.15) rotate(-5deg);
}

/* ========== INFO ITEM HOVER (Contact Page) ========== */
.info-item {
    transition: transform 0.3s ease;
}
.info-item:hover {
    transform: translateX(8px);
}
.info-icon {
    transition: transform 0.4s ease, box-shadow 0.4s ease !important;
}
.info-item:hover .info-icon {
    transform: scale(1.1);
    box-shadow: 0 5px 20px rgba(197,160,89,0.25) !important;
}

/* ========== MOBILE ADJUSTMENTS ========== */
@media (max-width: 768px) {
    /* Back to top - mobile friendly position & size */
    .back-to-top { right: 16px; bottom: 16px; width: 44px; height: 44px; font-size: 1rem; }

    /* Trust badges - 2 column grid, smaller text */
    .trust-section { padding: 40px 15px; }
    .trust-grid { grid-template-columns: repeat(2, 1fr); gap: 15px; }
    .trust-item { padding: 20px 10px; }
    .trust-number { font-size: 1.8rem; }
    .trust-label { font-size: 0.75rem; letter-spacing: 1px; }
    .trust-icon { font-size: 2rem; }

    /* Softer reveal animations on mobile (less distance) */
    .reveal { transform: translateY(20px); }
    .reveal-left, .reveal-right { transform: translateY(20px); }

    /* Disable float animation on mobile - can cause dizziness */
    .float-anim { animation: none !important; }

    /* Hero buttons - stack vertically on mobile */
    .hero-buttons {
        flex-direction: column !important;
        align-items: center !important;
        gap: 12px !important;
    }
    .hero-buttons .btn {
        width: 80% !important;
        max-width: 280px;
        padding: 14px 20px !important;
        font-size: 0.85rem !important;
    }

    /* Disable 3D perspective/tilt on touch (handled in JS too) */
    .product-card {
        perspective: none !important;
        transform-style: flat !important;
    }
    .product-card:hover {
        transform: translateY(-5px) !important;
    }

    /* Smaller shimmer effect */
    .shimmer-text { animation-duration: 5s; }

    /* Page header - smaller padding */
    .page-header { padding: 60px 15px !important; }
    .page-header h1 { font-size: 2rem !important; }

    /* Touch-friendly filter buttons */
    .filter-btn {
        min-height: 44px;
        min-width: 44px;
        display: inline-flex;
        align-items: center;
        justify-content: center;
    }

    /* Auth container - no floating, proper margins */
    .bighabesha-auth-container {
        margin: 15px 10px !important;
    }

    /* Reduce particle canvas opacity for battery savings (handled in JS) */
    #hero-particles { opacity: 0.6; }

    /* Nav underline - not needed on mobile menu */
    .nav-links li a::after { display: none; }

    /* Testimonials - single column */
    .testimonials-grid {
        grid-template-columns: 1fr !important;
        gap: 20px !important;
    }

    /* Footer columns - full width stack */
    .footer-grid {
        grid-template-columns: 1fr !important;
        gap: 30px !important;
        text-align: center;
    }
    .footer-socials { justify-content: center; }
    .contact-info li { justify-content: center; }
}

/* Extra small phones (iPhone SE, etc.) */
@media (max-width: 375px) {
    .hero-section h1, .hero h1 { font-size: 1.8rem !important; }
    .hero-section p, .hero p { font-size: 1rem !important; }
    .trust-number { font-size: 1.5rem; }
    .trust-label { font-size: 0.7rem; }
    .section-title { font-size: 1.8rem !important; }
    .hero-buttons .btn { width: 90% !important; }
}

/* ========== ACCESSIBILITY: Reduced Motion ========== */
@media (prefers-reduced-motion: reduce) {
    *, *::before, *::after {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
    }
    .shimmer-text {
        animation: none !important;
        -webkit-text-fill-color: var(--primary-color);
    }
    .float-anim { animation: none !important; }
    .trust-icon { animation: none !important; }
    .page-curtain { display: none !important; }
    #hero-particles { display: none !important; }
}

/* ========== TOUCH DEVICE OPTIMIZATIONS ========== */
@media (hover: none) and (pointer: coarse) {
    /* Disable hover-dependent animations on touch */
    .product-card:hover { transform: none !important; }
    .product-card::before { display: none; }
    .testimonial-card:hover { transform: none !important; }
    .value-card:hover { transform: none !important; }
    .info-item:hover { transform: none !important; }
    .info-item:hover .info-icon { transform: none !important; }
    
    /* Active states instead of hover for touch */
    .product-card:active { transform: scale(0.98) !important; }
    .btn:active, .btn-telegram:active, .filter-btn:active {
        transform: scale(0.96) !important;
    }
    .testimonial-card:active {
        border-color: var(--primary-color) !important;
    }

    /* Ensure tap targets are at least 44x44px (Apple HIG) */
    .btn, .btn-telegram, .btn-bighabesha, .filter-btn {
        min-height: 44px;
    }
    .footer-socials a {
        width: 44px; height: 44px;
    }
    .theme-toggle, .mobile-menu-btn {
        min-width: 44px; min-height: 44px;
    }
}
