/* Extra custom gradients for landing page specific needs */
.text-gradient {
    background: linear-gradient(90deg, #D1D1D1, #888888);
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
}

.bg-grid {
    background-size: 40px 40px;
    background-image: 
        linear-gradient(to right, rgba(255, 255, 255, 0.03) 1px, transparent 1px),
        linear-gradient(to bottom, rgba(255, 255, 255, 0.03) 1px, transparent 1px);
}

@keyframes sway {
    0%, 100% { transform: translateX(-5px); }
    50% { transform: translateX(5px); }
}
.gold-leaf-hover:hover::after {
    left: 100%;
}

/* ========================================================
   LANDING PAGE CONSTRAINTS (MOBILE FIX)
   ======================================================== */
body.landing-page, html.landing-page {
    overflow-x: hidden !important;
    max-width: 100vw !important;
    width: 100% !important;
}

/* ========================================================
   RELIABLE INTERSECTION OBSERVER ANIMATIONS
   ======================================================== */
.fade-section {
    transition: all 0.7s cubic-bezier(0.16, 1, 0.3, 1);
}

@media (min-width: 1024px) {
    .fade-hidden {
        opacity: 0;
        transform: translateY(40px);
    }
    
    .fade-visible {
        opacity: 1;
        transform: translateY(0);
    }
}

/* ========================================================
   PERFORMANCE MODE (PHASE 10)
   ======================================================== */
/* Reduced Motion Failsafe */
@media (prefers-reduced-motion: reduce) {
    * {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
        scroll-behavior: auto !important;
    }
    .fade-section,
    .fade-hidden,
    .fade-visible {
        transition: none !important;
        transform: none !important;
        opacity: 1 !important;
    }
    /* Disable heavy blurs for low-end devices */
    .modal-overlay, .glass-panel, .obsidian-glass, .glass-card, #payment-modal > div, #checkout-confidence-overlay > div {
        backdrop-filter: none !important;
        -webkit-backdrop-filter: none !important;
        background-color: #0A0A0A !important;
    }
}

/* ========================================================
   THAI CYBERPUNK AESTHETICS (Phase 5)
   ======================================================== */

/* 1. Cyber-Krajang Background (ลายพื้นหลังเรขาคณิตไทยไซเบอร์) */
.bg-thai-grid {
    background-size: 60px 60px;
    background-image: 
        linear-gradient(to right, rgba(212, 175, 55, 0.04) 1px, transparent 1px),
        linear-gradient(to bottom, rgba(212, 175, 55, 0.04) 1px, transparent 1px),
        linear-gradient(45deg, rgba(212, 175, 55, 0.02) 25%, transparent 25%, transparent 75%, rgba(212, 175, 55, 0.02) 75%, rgba(212, 175, 55, 0.02)),
        linear-gradient(-45deg, rgba(212, 175, 55, 0.02) 25%, transparent 25%, transparent 75%, rgba(212, 175, 55, 0.02) 75%, rgba(212, 175, 55, 0.02));
    background-position: 0 0, 0 0, 30px 30px, 30px 30px;
}

/* 2. Tech-Yomum Borders (กรอบย่อมุมไซเบอร์ 1px Gold) */
.thai-cyber-border {
    position: relative;
    background: rgba(10, 10, 10, 0.7);
    border: 1px solid rgba(212, 175, 55, 0.15);
    transition: all 0.4s cubic-bezier(0.16, 1, 0.3, 1);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
}
.thai-cyber-border::before,
.thai-cyber-border::after {
    content: '';
    position: absolute;
    width: 15px;
    height: 15px;
    border: 1px solid #D4AF37;
    transition: all 0.4s ease;
    pointer-events: none;
    opacity: 0.7;
}
.thai-cyber-border::before {
    top: -1px; left: -1px;
    border-right: none;
    border-bottom: none;
}
.thai-cyber-border::after {
    bottom: -1px; right: -1px;
    border-left: none;
    border-top: none;
}
.thai-cyber-border:hover {
    border-color: rgba(212, 175, 55, 0.4);
    box-shadow: inset 0 0 20px rgba(212, 175, 55, 0.05), 0 5px 30px rgba(0, 0, 0, 0.8);
}
.thai-cyber-border:hover::before {
    width: 25px; height: 25px;
    opacity: 1;
    box-shadow: -2px -2px 12px rgba(212, 175, 55, 0.4);
}
.thai-cyber-border:hover::after {
    width: 25px; height: 25px;
    opacity: 1;
    box-shadow: 2px 2px 12px rgba(212, 175, 55, 0.4);
}

/* 3. Gold Leaf Glow (เอฟเฟกต์ประกายทองคำเปลว) */
.gold-leaf-hover {
    position: relative;
    overflow: hidden;
    transition: all 0.3s ease;
}
.gold-leaf-hover::before {
    content: '';
    position: absolute;
    top: 0; left: -100%;
    width: 50%; height: 100%;
    background: linear-gradient(to right, transparent, rgba(255, 230, 100, 0.3), transparent);
    transform: skewX(-25deg);
    transition: all 0.7s ease;
    z-index: 1;
}
.gold-leaf-hover:hover::before {
    animation: gold-sweep 1.5s infinite;
}
@keyframes gold-sweep {
    0% { left: -100%; }
    100% { left: 200%; }
}

/* Phase 4B: Mobile Performance Tuning */
@media (max-width: 767px) {
    /* Reduce backdrop blur intensity on mobile */
    .thai-cyber-border, .glass-panel, .backdrop-blur-sm, .backdrop-blur-md, .backdrop-blur-lg {
        backdrop-filter: blur(2px) !important;
        -webkit-backdrop-filter: blur(2px) !important;
    }
    
    /* Reduce GPU-heavy layered shadows */
    .shadow-\[0_0_15px_rgba\(212\,175\,55\,0\.2\)\] {
        box-shadow: 0 0 5px rgba(212,175,55,0.1) !important;
    }
    .shadow-\[0_10px_30px_rgba\(0\,0\,0\,0\.5\)\] {
        box-shadow: 0 5px 15px rgba(0,0,0,0.5) !important;
    }

    /* Slow down animations */
    .animate-pulse {
        animation-duration: 4s !important;
    }
    .animate-ping {
        animation-duration: 3s !important;
    }
}

/* Optimize Mobile Hero Loading */
.bg-hero-image {
    background-image: url('../assets/header-mobile.webp');
    background-size: cover;
    background-position: center bottom;
    background-attachment: fixed;
}

@media (min-width: 1024px) {
    .bg-hero-image {
        background-image: url('../assets/header.webp');
    }
}
