/**
 * GC Pixel Studio - Design Upgrades
 * Premium visual enhancements
 */

/* ============================================
   1. PRELOADER / PAGE TRANSITIONS
   ============================================ */

.preloader {
    position: fixed;
    inset: 0;
    background: var(--color-bg-dark);
    z-index: 99999;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-direction: column;
    transition: opacity 0.5s ease, visibility 0.5s ease;
}

.preloader.loaded {
    opacity: 0;
    visibility: hidden;
    pointer-events: none;
}

.preloader-logo {
    width: 80px;
    height: 80px;
    animation: preloaderPulse 1.5s ease-in-out infinite;
}

.preloader-spinner {
    width: 50px;
    height: 50px;
    border: 3px solid rgba(0, 245, 160, 0.1);
    border-top-color: var(--color-primary);
    border-radius: 50%;
    animation: spin 1s linear infinite;
    margin-top: 1.5rem;
}

.preloader-text {
    margin-top: 1rem;
    font-size: 0.9rem;
    color: var(--color-text-secondary);
    letter-spacing: 0.1em;
    text-transform: uppercase;
}

@keyframes preloaderPulse {
    0%, 100% { transform: scale(1); opacity: 1; }
    50% { transform: scale(1.1); opacity: 0.8; }
}

@keyframes spin {
    to { transform: rotate(360deg); }
}

/* Page transition overlay */
.page-transition {
    position: fixed;
    inset: 0;
    background: var(--color-bg-dark);
    z-index: 99998;
    transform: translateY(100%);
    pointer-events: none;
}

.page-transition.active {
    animation: pageSlideIn 0.5s ease forwards;
}

@keyframes pageSlideIn {
    0% { transform: translateY(100%); }
    50% { transform: translateY(0); }
    100% { transform: translateY(-100%); }
}

/* ============================================
   2. MICRO-INTERACTIONS
   ============================================ */

/* Button Ripple Effect */
.btn, .button, [type="submit"] {
    position: relative;
    overflow: hidden;
}

.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;
    }
}

/* Card Tilt Effect */
.tilt-card {
    transform-style: preserve-3d;
    transition: transform 0.3s ease;
}

.tilt-card:hover {
    transform: perspective(1000px) rotateX(var(--tilt-x, 0deg)) rotateY(var(--tilt-y, 0deg));
}

.tilt-card .tilt-content {
    transform: translateZ(30px);
}

/* Icon Bounce on Hover */
.icon-bounce:hover i,
.icon-bounce:hover svg {
    animation: iconBounce 0.5s ease;
}

@keyframes iconBounce {
    0%, 100% { transform: translateY(0); }
    25% { transform: translateY(-8px); }
    50% { transform: translateY(0); }
    75% { transform: translateY(-4px); }
}

/* Icon Spin on Hover */
.icon-spin:hover i,
.icon-spin:hover svg {
    animation: iconSpin 0.5s ease;
}

@keyframes iconSpin {
    from { transform: rotate(0deg); }
    to { transform: rotate(360deg); }
}

/* Glow Effect */
.glow-effect {
    transition: box-shadow 0.3s ease;
}

.glow-effect:hover {
    box-shadow: 0 0 30px rgba(0, 245, 160, 0.3), 0 0 60px rgba(0, 245, 160, 0.1);
}

/* Float Animation */
.float-animation {
    animation: float 6s ease-in-out infinite;
}

@keyframes float {
    0%, 100% { transform: translateY(0px); }
    50% { transform: translateY(-20px); }
}

/* Shake on Hover */
.shake-hover:hover {
    animation: shake 0.5s ease;
}

@keyframes shake {
    0%, 100% { transform: translateX(0); }
    20%, 60% { transform: translateX(-5px); }
    40%, 80% { transform: translateX(5px); }
}

/* Focus Ring Animation */
input:focus, textarea:focus, select:focus {
    animation: focusRing 0.3s ease;
}

@keyframes focusRing {
    0% { box-shadow: 0 0 0 0 rgba(0, 245, 160, 0.4); }
    100% { box-shadow: 0 0 0 4px rgba(0, 245, 160, 0.1); }
}

/* ============================================
   3. ENHANCED NAVIGATION
   ============================================ */

/* Glassmorphism Header */
.header.scrolled {
    background: rgba(10, 10, 15, 0.85);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border-bottom: 1px solid rgba(255, 255, 255, 0.05);
    box-shadow: 0 4px 30px rgba(0, 0, 0, 0.3);
}

/* Active Nav Link Indicator */
.nav-link::after {
    content: '';
    position: absolute;
    bottom: 2px;
    left: 0.5rem;
    right: 0.5rem;
    height: 2px;
    background: var(--color-primary);
    transform: scaleX(0);
    transform-origin: center;
    transition: transform 0.3s ease;
}

.nav-link:hover::after {
    transform: scaleX(1);
}

.nav-link.active::after {
    transform: scaleX(1);
    background: var(--gradient-primary);
}

/* Mobile Menu Animation */
.mobile-menu {
    transform: translateX(100%);
    transition: transform 0.4s cubic-bezier(0.4, 0, 0.2, 1);
}

.mobile-menu.open {
    transform: translateX(0);
}

.mobile-menu .nav-item {
    opacity: 0;
    transform: translateX(50px);
}

.mobile-menu.open .nav-item {
    animation: slideInRight 0.4s ease forwards;
}

.mobile-menu.open .nav-item:nth-child(1) { animation-delay: 0.1s; }
.mobile-menu.open .nav-item:nth-child(2) { animation-delay: 0.15s; }
.mobile-menu.open .nav-item:nth-child(3) { animation-delay: 0.2s; }
.mobile-menu.open .nav-item:nth-child(4) { animation-delay: 0.25s; }
.mobile-menu.open .nav-item:nth-child(5) { animation-delay: 0.3s; }
.mobile-menu.open .nav-item:nth-child(6) { animation-delay: 0.35s; }

@keyframes slideInRight {
    to {
        opacity: 1;
        transform: translateX(0);
    }
}

/* ============================================
   4. SECTION DIVIDERS
   ============================================ */

.section-divider {
    position: absolute;
    left: 0;
    width: 100%;
    overflow: hidden;
    line-height: 0;
}

.section-divider.top {
    top: 0;
    transform: rotate(180deg);
}

.section-divider.bottom {
    bottom: 0;
}

.section-divider svg {
    position: relative;
    display: block;
    width: calc(100% + 1.3px);
    height: 80px;
}

.section-divider .shape-fill {
    fill: var(--color-bg-darker);
}

/* Wave Divider */
.wave-divider {
    position: absolute;
    bottom: 0;
    left: 0;
    width: 100%;
    overflow: hidden;
    line-height: 0;
}

.wave-divider svg {
    position: relative;
    display: block;
    width: calc(140% + 1.3px);
    height: 100px;
    animation: waveMove 15s linear infinite;
}

@keyframes waveMove {
    0% { transform: translateX(0); }
    100% { transform: translateX(-40%); }
}

/* Gradient Mesh Background */
.gradient-mesh {
    background: 
        radial-gradient(at 40% 20%, rgba(0, 245, 160, 0.1) 0px, transparent 50%),
        radial-gradient(at 80% 0%, rgba(0, 217, 245, 0.1) 0px, transparent 50%),
        radial-gradient(at 0% 50%, rgba(99, 102, 241, 0.1) 0px, transparent 50%),
        radial-gradient(at 80% 50%, rgba(244, 114, 182, 0.05) 0px, transparent 50%),
        radial-gradient(at 0% 100%, rgba(0, 245, 160, 0.1) 0px, transparent 50%);
}

/* Animated Gradient Border */
.gradient-border {
    position: relative;
    background: var(--color-bg-card);
    border-radius: var(--radius-lg);
}

.gradient-border::before {
    content: '';
    position: absolute;
    inset: -2px;
    background: linear-gradient(90deg, #00F5A0, #00D9F5, #6366F1, #F472B6, #00F5A0);
    background-size: 400% 400%;
    border-radius: calc(var(--radius-lg) + 2px);
    z-index: -1;
    animation: gradientRotate 8s linear infinite;
    opacity: 0;
    transition: opacity 0.3s ease;
}

.gradient-border:hover::before {
    opacity: 1;
}

@keyframes gradientRotate {
    0% { background-position: 0% 50%; }
    50% { background-position: 100% 50%; }
    100% { background-position: 0% 50%; }
}

/* ============================================
   5. TESTIMONIALS CAROUSEL
   ============================================ */

.testimonials-carousel {
    position: relative;
    overflow: hidden;
}

.testimonials-track {
    display: flex;
    transition: transform 0.5s cubic-bezier(0.4, 0, 0.2, 1);
}

.testimonial-slide {
    flex: 0 0 100%;
    padding: 0 1rem;
}

.carousel-dots {
    display: flex;
    justify-content: center;
    gap: 0.5rem;
    margin-top: 2rem;
}

.carousel-dot {
    width: 10px;
    height: 10px;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.2);
    border: none;
    cursor: pointer;
    transition: all 0.3s ease;
}

.carousel-dot.active {
    background: var(--color-primary);
    transform: scale(1.2);
}

.carousel-dot:hover {
    background: rgba(0, 245, 160, 0.5);
}

/* Carousel Navigation Arrows */
.carousel-arrow {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    width: 50px;
    height: 50px;
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.3s ease;
    z-index: 10;
}

.carousel-arrow:hover {
    background: var(--color-primary);
    border-color: var(--color-primary);
    color: var(--color-bg-dark);
}

.carousel-arrow.prev { left: -25px; }
.carousel-arrow.next { right: -25px; }

/* Client Logos Marquee */
.logos-marquee {
    overflow: hidden;
    position: relative;
}

.logos-marquee::before,
.logos-marquee::after {
    content: '';
    position: absolute;
    top: 0;
    width: 150px;
    height: 100%;
    z-index: 2;
}

.logos-marquee::before {
    left: 0;
    background: linear-gradient(to right, var(--color-bg-dark), transparent);
}

.logos-marquee::after {
    right: 0;
    background: linear-gradient(to left, var(--color-bg-dark), transparent);
}

.logos-track {
    display: flex;
    animation: marquee 30s linear infinite;
}

.logos-track:hover {
    animation-play-state: paused;
}

@keyframes marquee {
    0% { transform: translateX(0); }
    100% { transform: translateX(-50%); }
}

/* Logos Section */
.logos-section {
    padding: 2rem 0;
    background: var(--color-bg-darker);
    border-top: 1px solid rgba(255, 255, 255, 0.03);
    border-bottom: 1px solid rgba(255, 255, 255, 0.03);
}

.logo-item {
    padding: 0 3rem;
    font-size: 1.1rem;
    font-weight: 500;
    color: var(--color-text-muted);
    white-space: nowrap;
    opacity: 0.6;
    transition: opacity 0.3s ease;
}

.logo-item:hover {
    opacity: 1;
}

/* ============================================
   6. ENHANCED FOOTER
   ============================================ */

/* Animated Social Icons */
.social-icon {
    position: relative;
    width: 44px;
    height: 44px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(255, 255, 255, 0.1);
    transition: all 0.3s ease;
    overflow: hidden;
}

.social-icon::before {
    content: '';
    position: absolute;
    inset: 0;
    background: var(--gradient-primary);
    opacity: 0;
    transition: opacity 0.3s ease;
}

.social-icon i {
    position: relative;
    z-index: 1;
    transition: transform 0.3s ease, color 0.3s ease;
}

.social-icon:hover {
    border-color: transparent;
    transform: translateY(-5px);
}

.social-icon:hover::before {
    opacity: 1;
}

.social-icon:hover i {
    color: var(--color-bg-dark);
    transform: scale(1.1);
}

/* Newsletter Success Animation */
.newsletter-success {
    animation: successPop 0.5s ease;
}

@keyframes successPop {
    0% { transform: scale(0.8); opacity: 0; }
    50% { transform: scale(1.1); }
    100% { transform: scale(1); opacity: 1; }
}

/* Back to Top with Progress */
.back-to-top {
    position: fixed;
    bottom: 30px;
    left: 30px;
    width: 50px;
    height: 50px;
    border-radius: 50%;
    background: var(--color-bg-card);
    border: 2px solid rgba(255, 255, 255, 0.1);
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    opacity: 0;
    visibility: hidden;
    transform: translateY(20px);
    transition: all 0.3s ease;
    z-index: 1000;
}

.back-to-top.visible {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
}

.back-to-top:hover {
    background: var(--color-primary);
    border-color: var(--color-primary);
}

.back-to-top:hover i {
    color: var(--color-bg-dark);
}

.back-to-top svg.progress-ring {
    position: absolute;
    transform: rotate(-90deg);
}

.back-to-top .progress-ring__circle {
    transition: stroke-dashoffset 0.1s;
    stroke: var(--color-primary);
}

/* ============================================
   7. DARK/LIGHT MODE
   ============================================ */

.theme-toggle {
    position: fixed;
    top: 50%;
    right: 0;
    transform: translateY(-50%);
    background: var(--color-bg-card);
    border: 1px solid var(--color-border);
    border-right: none;
    border-radius: var(--radius-md) 0 0 var(--radius-md);
    padding: 0.75rem;
    cursor: pointer;
    z-index: 1000;
    transition: all 0.3s ease;
}

.theme-toggle:hover {
    padding-right: 1.5rem;
    background: rgba(0, 245, 160, 0.1);
}

.theme-toggle i {
    font-size: 1.25rem;
    transition: transform 0.3s ease;
}

.theme-toggle:hover i {
    transform: rotate(180deg);
}

/* Light Mode Variables */
[data-theme="light"] {
    --color-bg-dark: #f8fafc;
    --color-bg-darker: #f1f5f9;
    --color-bg-card: #ffffff;
    --color-text: #0f172a;
    --color-text-secondary: #475569;
    --color-text-muted: #94a3b8;
    --color-border: rgba(0, 0, 0, 0.1);
    --color-border-hover: rgba(0, 0, 0, 0.2);
}

[data-theme="light"] .header.scrolled {
    background: rgba(255, 255, 255, 0.9);
}

[data-theme="light"] .preloader {
    background: #f8fafc;
}

/* Theme transition */
* {
    transition: background-color 0.3s ease, border-color 0.3s ease, color 0.3s ease;
}

/* ============================================
   8. PARTICLE EFFECTS
   ============================================ */

#particles-container {
    position: absolute;
    inset: 0;
    overflow: hidden;
    pointer-events: none;
    z-index: 0;
}

.particle {
    position: absolute;
    width: 4px;
    height: 4px;
    background: rgba(0, 245, 160, 0.3);
    border-radius: 50%;
    animation: particleFloat 20s infinite;
}

@keyframes particleFloat {
    0%, 100% {
        transform: translate(0, 0) scale(1);
        opacity: 0;
    }
    10% {
        opacity: 1;
    }
    90% {
        opacity: 1;
    }
    100% {
        transform: translate(var(--tx), var(--ty)) scale(0);
        opacity: 0;
    }
}

/* Connection Lines */
.particle-connections {
    position: absolute;
    inset: 0;
    pointer-events: none;
}

.particle-connections line {
    stroke: rgba(0, 245, 160, 0.1);
    stroke-width: 1;
}

/* ============================================
   9. PERFORMANCE & ACCESSIBILITY
   ============================================ */

/* Lazy Load Images */
img[data-src] {
    opacity: 0;
    transition: opacity 0.5s ease;
}

img[data-src].loaded {
    opacity: 1;
}

/* Blur-up placeholder */
.img-placeholder {
    background: linear-gradient(90deg, #1a1a2e 25%, #2a2a4e 50%, #1a1a2e 75%);
    background-size: 200% 100%;
    animation: shimmer 1.5s infinite;
}

@keyframes shimmer {
    0% { background-position: 200% 0; }
    100% { background-position: -200% 0; }
}

/* Reduced Motion */
@media (prefers-reduced-motion: reduce) {
    *,
    *::before,
    *::after {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
    }
    
    .preloader {
        display: none !important;
    }
}

/* Skeleton Loading */
.skeleton {
    background: linear-gradient(90deg, 
        var(--color-bg-card) 25%, 
        rgba(255, 255, 255, 0.05) 50%, 
        var(--color-bg-card) 75%);
    background-size: 200% 100%;
    animation: shimmer 1.5s infinite;
    border-radius: var(--radius-md);
}

.skeleton-text {
    height: 1em;
    margin-bottom: 0.5em;
}

.skeleton-title {
    height: 1.5em;
    width: 60%;
    margin-bottom: 1em;
}

.skeleton-image {
    aspect-ratio: 16/9;
}

/* ============================================
   10. ADDITIONAL EFFECTS
   ============================================ */

/* Text Gradient Animation */
.animated-gradient-text {
    background: linear-gradient(90deg, #00F5A0, #00D9F5, #6366F1, #F472B6, #00F5A0);
    background-size: 200% auto;
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    animation: gradientText 5s linear infinite;
}

@keyframes gradientText {
    0% { background-position: 0% center; }
    100% { background-position: 200% center; }
}

/* Morphing Blob */
.morphing-blob {
    position: absolute;
    width: 500px;
    height: 500px;
    background: linear-gradient(45deg, rgba(0, 245, 160, 0.1), rgba(0, 217, 245, 0.1));
    border-radius: 60% 40% 30% 70% / 60% 30% 70% 40%;
    animation: morphBlob 15s ease-in-out infinite;
    filter: blur(40px);
    pointer-events: none;
}

@keyframes morphBlob {
    0%, 100% { border-radius: 60% 40% 30% 70% / 60% 30% 70% 40%; }
    25% { border-radius: 30% 60% 70% 40% / 50% 60% 30% 60%; }
    50% { border-radius: 50% 60% 30% 60% / 30% 60% 70% 40%; }
    75% { border-radius: 60% 40% 60% 30% / 70% 30% 50% 60%; }
}

/* Glitch Effect */
.glitch-text {
    position: relative;
}

.glitch-text::before,
.glitch-text::after {
    content: attr(data-text);
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
}

.glitch-text::before {
    animation: glitch-1 0.5s infinite;
    color: #00F5A0;
    z-index: -1;
}

.glitch-text::after {
    animation: glitch-2 0.5s infinite;
    color: #F472B6;
    z-index: -2;
}

@keyframes glitch-1 {
    0%, 100% { clip-path: inset(0 0 0 0); transform: translate(0); }
    20% { clip-path: inset(20% 0 60% 0); transform: translate(-2px, 2px); }
    40% { clip-path: inset(40% 0 40% 0); transform: translate(2px, -2px); }
    60% { clip-path: inset(60% 0 20% 0); transform: translate(-2px, 2px); }
    80% { clip-path: inset(80% 0 0 0); transform: translate(2px, -2px); }
}

@keyframes glitch-2 {
    0%, 100% { clip-path: inset(0 0 0 0); transform: translate(0); }
    20% { clip-path: inset(60% 0 20% 0); transform: translate(2px, -2px); }
    40% { clip-path: inset(20% 0 60% 0); transform: translate(-2px, 2px); }
    60% { clip-path: inset(80% 0 0 0); transform: translate(2px, -2px); }
    80% { clip-path: inset(40% 0 40% 0); transform: translate(-2px, 2px); }
}

/* Spotlight Effect */
.spotlight {
    position: relative;
    overflow: hidden;
}

.spotlight::before {
    content: '';
    position: absolute;
    top: var(--mouse-y, 50%);
    left: var(--mouse-x, 50%);
    width: 400px;
    height: 400px;
    background: radial-gradient(circle, rgba(0, 245, 160, 0.15) 0%, transparent 70%);
    transform: translate(-50%, -50%);
    pointer-events: none;
    opacity: 0;
    transition: opacity 0.3s ease;
}

.spotlight:hover::before {
    opacity: 1;
}

/* Magnetic Button */
.magnetic-btn {
    transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

/* Number Counter Animation */
.counter {
    display: inline-block;
}

.counter.counting {
    animation: counterPulse 0.1s ease;
}

@keyframes counterPulse {
    0%, 100% { transform: scale(1); }
    50% { transform: scale(1.05); }
}

