/* ===== CUSTOM CURSOR ===== */
* {
    cursor: none !important;
    /* Hide default cursor */
}

a,
button,
input,
textarea,
select {
    cursor: none !important;
}

.custom-cursor {
    width: 8px;
    height: 8px;
    background: var(--gold, #4a7dff);
    border-radius: 50%;
    position: fixed;
    top: 0;
    left: 0;
    pointer-events: none;
    z-index: 99999;
    transform: translate(-50%, -50%);
    transition: width 0.2s, height 0.2s, background-color 0.2s;
}

.custom-cursor-follower {
    width: 40px;
    height: 40px;
    border: 1px solid rgba(74, 125, 255, 0.5);
    border-radius: 50%;
    position: fixed;
    top: 0;
    left: 0;
    pointer-events: none;
    z-index: 99998;
    transform: translate(-50%, -50%);
    transition: width 0.3s, height 0.3s, border-color 0.3s, transform 0.1s ease-out;
}

/* Hover effects for cursor */
.cursor-hover .custom-cursor {
    width: 60px;
    height: 60px;
    background: rgba(74, 125, 255, 0.2);
    /* mix-blend-mode: difference; */
}

.cursor-hover .custom-cursor-follower {
    width: 60px;
    height: 60px;
    border-color: transparent;
}

.cursor-text-hover .custom-cursor {
    width: 3px;
    height: 24px;
    border-radius: 2px;
}

/* ===== PRELOADER ===== */
.preloader {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: var(--indigo-deep, #040a14);
    z-index: 999999;
    display: flex;
    justify-content: center;
    align-items: center;
    transition: opacity 0.8s ease-in-out, visibility 0.8s;
}

.preloader.hidden {
    opacity: 0;
    visibility: hidden;
}

.preloader-content {
    text-align: center;
}

.preloader-logo {
    font-size: 32px;
    font-weight: 900;
    color: var(--white, #fff);
    letter-spacing: 6px;
    margin-bottom: 20px;
    animation: pulseLogo 2s infinite ease-in-out alternate;
}

@keyframes pulseLogo {
    0% {
        transform: scale(0.95);
        opacity: 0.7;
    }

    100% {
        transform: scale(1.05);
        opacity: 1;
        text-shadow: 0 0 20px rgba(74, 125, 255, 0.6);
    }
}

.preloader-bar {
    width: 200px;
    height: 2px;
    background: rgba(255, 255, 255, 0.1);
    border-radius: 2px;
    overflow: hidden;
    margin: 0 auto;
}

.preloader-progress {
    width: 0%;
    height: 100%;
    background: var(--gold, #4a7dff);
    box-shadow: 0 0 10px var(--gold, #4a7dff);
}

/* ===== SCROLL PROGRESS ===== */
.scroll-progress-container {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 3px;
    background: transparent;
    z-index: 9999;
    pointer-events: none;
}

.scroll-progress-bar {
    height: 100%;
    width: 0%;
    background: var(--gradient-gold, linear-gradient(135deg, #4a7dff, #6b9aff));
    box-shadow: 0 0 10px rgba(74, 125, 255, 0.5);
    border-radius: 0 2px 2px 0;
}

/* ===== FLOATING CHAT ===== */
.floating-chat {
    position: fixed;
    bottom: 30px;
    right: 30px;
    width: 60px;
    height: 60px;
    background: var(--gradient-gold, linear-gradient(135deg, #4a7dff, #6b9aff));
    color: #fff;
    border-radius: 50%;
    display: flex;
    justify-content: center;
    align-items: center;
    box-shadow: 0 5px 20px rgba(74, 125, 255, 0.4);
    z-index: 999;
    transition: transform 0.3s, box-shadow 0.3s;
}

.floating-chat:hover {
    transform: translateY(-5px) scale(1.05);
    box-shadow: 0 10px 25px rgba(74, 125, 255, 0.6);
}

.floating-chat svg {
    width: 32px;
    height: 32px;
    fill: #fff;
}

/* ===== THEME TOGGLE ===== */
.theme-toggle {
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(255, 255, 255, 0.1);
    color: var(--white);
    width: 40px;
    height: 40px;
    border-radius: 50%;
    display: flex;
    justify-content: center;
    align-items: center;
    cursor: none;
    margin-left: 15px;
    transition: all 0.3s;
    font-size: 18px;
}

.theme-toggle:hover {
    background: rgba(255, 255, 255, 0.1);
}

body.light-theme .theme-toggle {
    color: #333;
    border-color: rgba(0, 0, 0, 0.1);
}

/* ===== MAGNETIC BUTTONS ===== */
.magnetic-btn {
    transition: transform 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

/* ===== NOISE BACKGROUND ===== */
.noise-bg {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    pointer-events: none;
    z-index: 9990;
    opacity: 0.015;
    background-image: url('data:image/svg+xml,%3Csvg viewBox="0 0 200 200" xmlns="http://www.w3.org/2000/svg"%3E%3Cfilter id="noiseFilter"%3E%3CfeTurbulence type="fractalNoise" baseFrequency="0.65" numOctaves="3" stitchTiles="stitch"/%3E%3C/filter%3E%3Crect width="100%25" height="100%25" filter="url(%23noiseFilter)"/%3E%3C/svg%3E');
}

body.light-theme .noise-bg {
    opacity: 0.02;
}

/* ===== HERO TEXT REVEAL ===== */
.reveal-text {
    opacity: 0;
    transform: translateY(20px);
}

/* ===== SWIPER CUSTOMIZATION ===== */
.swiper-container {
    width: 100%;
    padding-bottom: 50px;
    overflow: hidden;
}

.swiper-pagination-bullet {
    background: var(--text-muted);
    opacity: 0.5;
}

.swiper-pagination-bullet-active {
    background: var(--gold);
    opacity: 1;
}

/* Hide GSAP elements initially to avoid FOUC */
.invisible-until-scroll {
    visibility: hidden;
}

/* Card Glow Tracking */
.glow-card {
    position: relative;
}

.glow-card::before {
    content: '';
    position: absolute;
    top: var(--y, 50%);
    left: var(--x, 50%);
    width: 300px;
    height: 300px;
    background: radial-gradient(circle closest-side, rgba(74, 125, 255, 0.15), transparent);
    transform: translate(-50%, -50%);
    pointer-events: none;
    opacity: 0;
    transition: opacity 0.3s;
    z-index: 0;
}

.glow-card:hover::before {
    opacity: 1;
}

.glow-card>* {
    position: relative;
    z-index: 1;
}
/* ===== ADDITIONAL POLISH ===== */
/* Cursor Expansion */
.custom-cursor.expand {
    width: 60px;
    height: 60px;
    background: rgba(255, 255, 255, 0.9);
    mix-blend-mode: normal;
}
.custom-cursor.expand::after {
    content: attr(data-text);
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    color: #000;
    font-size: 11px;
    font-weight: 800;
    letter-spacing: 1px;
}
.custom-cursor-follower.expand {
    width: 0;
    height: 0;
    opacity: 0;
}

/* 3D Tilt */
.tilt-card {
    transition: transform 0.1s ease;
    transform-style: preserve-3d;
}




/* ===== TIKTOK PHONE MOCKUP ===== */
.tiktok-section {
  padding: 80px 0;
  background: var(--indigo-deep);
  overflow: hidden;
}
.tiktok-swiper {
  width: 100%;
  padding-top: 40px;
  padding-bottom: 60px;
}
.tiktok-slide {
  display: flex;
  justify-content: center;
  align-items: center;
  transition: transform 0.4s;
}
.tiktok-slide:hover {
  transform: translateY(-10px);
}
.phone-mockup {
  position: relative;
  width: 280px;
  height: 580px;
  background: #000;
  border-radius: 40px;
  border: 12px solid #1a1a1c;
  box-shadow: 0 20px 50px rgba(0,0,0,0.5), inset 0 0 0 2px rgba(255,255,255,0.1);
  overflow: hidden;
  margin: 0 auto;
}
.phone-notch {
  position: absolute;
  top: 0;
  left: 50%;
  transform: translateX(-50%);
  width: 120px;
  height: 25px;
  background: #1a1a1c;
  border-bottom-left-radius: 16px;
  border-bottom-right-radius: 16px;
  z-index: 10;
}
.phone-notch::before {
  content: '';
  position: absolute;
  top: 6px;
  left: 50%;
  transform: translateX(-50%);
  width: 40px;
  height: 6px;
  background: #333;
  border-radius: 10px;
}
.phone-notch::after {
  content: '';
  position: absolute;
  top: 6px;
  right: 25px;
  width: 8px;
  height: 8px;
  background: #0a0a0a;
  border-radius: 50%;
  box-shadow: inset 0 0 2px rgba(255,255,255,0.2);
}
.phone-screen {
  width: 100%;
  height: 100%;
  background: #111;
  position: relative;
  overflow: hidden;
}

/* TikTok Embed adjustments to fit mockup */
.phone-screen iframe {
  width: 100% !important;
  height: 100% !important;
  border: none;
  border-radius: 0;
}
.phone-screen blockquote.tiktok-embed {
  margin: 0 !important;
  padding: 0 !important;
  width: 100% !important;
  height: 100% !important;
  border: none !important;
  border-radius: 0 !important;
  background: transparent !important;
}
.tiktok-brand-logo {
  position: absolute;
  bottom: -45px;
  left: 50%;
  transform: translateX(-50%);
  font-size: 14px;
  font-weight: 700;
  color: var(--gold);
  letter-spacing: 1px;
  white-space: nowrap;
}


/* ===== MOBILE OPTIMIZATION ===== */

/* 1. Prevent Horizontal Scrolling Firmly */
html, body {
  overflow-x: hidden !important;
  width: 100%;
  position: relative;
}

/* 2. Disable Custom Cursor on Touch Devices */
@media (pointer: coarse), (max-width: 1024px) {
  .custom-cursor, 
  .custom-cursor-follower {
    display: none !important;
  }
  * {
    cursor: auto !important;
  }
  a, button, input, textarea, select {
    cursor: pointer !important;
  }
}

/* 3. Optimize Mobile Paddings and Sizes */
@media (max-width: 768px) {
  /* Reduce excessive padding */
  .content-section {
    padding: 60px 0 !important;
  }
  .page-hero {
    padding: 100px 0 50px !important;
  }
  .hero {
    padding: 90px 0 50px !important;
  }
  
  /* Scale down TikTok Phone Mockup for tiny screens */
  .phone-mockup {
    transform: scale(0.9);
    transform-origin: top center;
    margin-bottom: -50px; /* offset the scale space */
  }
  
  /* Adjust titles so they don't break boundaries */
  .section-title, .page-hero-title, .hero-title {
    word-wrap: break-word;
    word-break: break-word;
    hyphens: auto;
  }
  
  /* Ensure grids don't overflow */
  .container {
    padding-left: 20px !important;
    padding-right: 20px !important;
  }
  
  /* Make sure Swiper arrows/dots fit */
  .tiktok-swiper {
    padding-bottom: 40px !important;
  }
}

@media (max-width: 380px) {
  /* Extra tiny screens (e.g., iPhone SE) */
  .phone-mockup {
    transform: scale(0.85);
    margin-bottom: -80px;
  }
}

/* 4. Fix Hover Sticking on Touch */
@media (hover: none) {
  /* Elements that have transform on hover shouldn't stay transformed on mobile tap */
  .card:active, 
  .team-card:active, 
  .case-card:active, 
  .pricing-card:active, 
  .glow-card:active,
  .quick-card:active,
  .contact-card:active,
  .btn:active, 
  .btn-primary:active, 
  .btn-secondary:active,
  .social-link:active,
  .tiktok-slide:active {
    transform: scale(0.98) !important;
  }
  
  /* Remove specific hover states for touch */
  .glow-card::before {
    display: none !important;
  }
  
  .tilt-card {
    transform: none !important;
  }
}


/* EXTRA MOBILE OPTIMIZATIONS */
@media (max-width: 500px) {
  .section-title {
    font-size: 28px !important;
  }
  .page-hero-title {
    font-size: 32px !important;
  }
  .content-section {
    padding: 40px 15px !important;
  }
  .hero-title {
    font-size: 28px !important;
  }
  .hero-desc {
    font-size: 15px !important;
  }
  .header {
    padding: 10px 15px !important;
  }
  .header .logo span {
    font-size: 16px !important;
  }
  .header .logo img {
    height: 28px !important;
  }
  #theme-toggle {
    margin-right: 5px;
  }
  .faq-question {
    font-size: 14px !important;
  }
  .pricing-price {
    font-size: 32px !important;
  }
  /* Fix TikTok mockups size for mobile to ensure they fit without scrollbars */
  .phone-mockup {
    transform: scale(0.85);
    transform-origin: top center;
    margin-bottom: -50px;
  }
}


/* FURTHER MOBILE OPTIMIZATIONS FOR BLOCKS */
@media (max-width: 768px) {
  .feature-visual {
    max-height: 200px !important;
    aspect-ratio: auto !important;
    font-size: 50px !important;
  }
  .case-visual {
    max-height: 250px !important;
    aspect-ratio: auto !important;
  }
  .page-hero {
    padding-top: 100px !important;
    padding-bottom: 40px !important;
  }
  .content-section, .partner-cases {
    padding: 50px 15px !important;
  }
  .feature-content h3 {
    font-size: 24px !important;
  }
  .logo-grid-item {
    padding: 20px 15px !important;
  }
  .become-partner {
    padding: 60px 15px !important;
  }
  .partner-case {
    gap: 30px !important;
    margin-bottom: 60px !important;
    padding-bottom: 60px !important;
  }
  /* Fix sticky header overlap more robustly */
  .header {
    background: rgba(10,15,36,0.98) !important;
  }
  /* Remove tap highlight styling to prevent ugly grey boxes on touch */
  * {
    -webkit-tap-highlight-color: transparent !important;
  }
  /* Force text colors to be clear just in case */
  .page-hero-title, .section-title {
    color: #ffffff !important;
  }
  p {
    color: rgba(255, 255, 255, 0.8) !important;
  }
}
