/* =====================================================
   UA Web Studio - Premium Visual Effects
   Advanced Animations & Spectacular Design
   ===================================================== */

/* =====================================================
   Noise/Grain Texture Overlay
   ===================================================== */
body::before {
    content: '';
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    z-index: 9999;
    opacity: 0.03;
    background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 400 400' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='noiseFilter'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.9' numOctaves='4' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23noiseFilter)'/%3E%3C/svg%3E");
}

/* =====================================================
   Animated Background Grid
   ===================================================== */
.hero::after {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-image:
        linear-gradient(rgba(94, 90, 255, 0.03) 1px, transparent 1px),
        linear-gradient(90deg, rgba(94, 90, 255, 0.03) 1px, transparent 1px);
    background-size: 50px 50px;
    z-index: 1;
    animation: gridMove 20s linear infinite;
    mask-image: radial-gradient(ellipse at center, black 30%, transparent 70%);
    -webkit-mask-image: radial-gradient(ellipse at center, black 30%, transparent 70%);
}

@keyframes gridMove {
    0% {
        transform: translate(0, 0);
    }

    100% {
        transform: translate(50px, 50px);
    }
}

/* =====================================================
   Enhanced Glassmorphism
   ===================================================== */
.glass {
    background: rgba(17, 17, 24, 0.6);
    backdrop-filter: blur(20px) saturate(180%);
    -webkit-backdrop-filter: blur(20px) saturate(180%);
    border: 1px solid rgba(255, 255, 255, 0.08);
}

.header {
    background: rgba(0, 0, 0, 0.6) !important;
    backdrop-filter: blur(30px) saturate(200%) !important;
    -webkit-backdrop-filter: blur(30px) saturate(200%) !important;
}

/* Language Selector - Fix for z-index issues */
.header .language-selector {
    position: relative;
    z-index: 10000;
}

.header .lang-dropdown {
    position: absolute;
    top: calc(100% + 10px);
    right: 0;
    min-width: 180px;
    background: rgba(12, 12, 15, 0.98);
    backdrop-filter: blur(40px);
    -webkit-backdrop-filter: blur(40px);
    border: 1px solid rgba(94, 90, 255, 0.3);
    border-radius: 12px;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.8);
    opacity: 0;
    visibility: hidden;
    transform: translateY(-8px);
    transition: all 0.3s ease;
    z-index: 10001;
}

.header .lang-dropdown.active {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
}

/* =====================================================
   Animated Gradient Borders
   ===================================================== */
.pricing-card,
.social-card,
.portfolio-card {
    position: relative;
    background: var(--bg-card);
}

.pricing-card::after,
.social-card::after,
.portfolio-card::after {
    content: '';
    position: absolute;
    top: -1px;
    left: -1px;
    right: -1px;
    bottom: -1px;
    background: linear-gradient(45deg,
            transparent 0%,
            transparent 40%,
            rgba(94, 90, 255, 0.5) 50%,
            transparent 60%,
            transparent 100%);
    background-size: 400% 400%;
    border-radius: inherit;
    z-index: -1;
    opacity: 0;
    transition: opacity 0.5s ease;
    animation: borderGlow 3s linear infinite;
}

.pricing-card:hover::after,
.social-card:hover::after,
.portfolio-card:hover::after {
    opacity: 1;
}

@keyframes borderGlow {
    0% {
        background-position: 0% 50%;
    }

    50% {
        background-position: 100% 50%;
    }

    100% {
        background-position: 0% 50%;
    }
}

/* =====================================================
   Enhanced Buttons with Glow
   ===================================================== */
.btn-primary {
    position: relative;
    overflow: hidden;
    z-index: 1;
}

.btn-primary::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg,
            transparent,
            rgba(255, 255, 255, 0.3),
            transparent);
    transition: left 0.5s ease;
    z-index: -1;
}

.btn-primary:hover::before {
    left: 100%;
}

.btn-primary::after {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 0;
    height: 0;
    background: rgba(255, 255, 255, 0.2);
    border-radius: 50%;
    transform: translate(-50%, -50%);
    transition: width 0.6s ease, height 0.6s ease;
    z-index: -1;
}

.btn-primary:active::after {
    width: 300px;
    height: 300px;
}

/* Glowing button effect */
.btn-primary {
    animation: buttonPulse 3s ease-in-out infinite;
}

@keyframes buttonPulse {

    0%,
    100% {
        box-shadow: 0 4px 20px rgba(94, 90, 255, 0.3),
            0 0 0 0 rgba(94, 90, 255, 0.4);
    }

    50% {
        box-shadow: 0 8px 30px rgba(94, 90, 255, 0.5),
            0 0 30px 5px rgba(94, 90, 255, 0.2);
    }
}

/* =====================================================
   Floating Elements Animation
   ===================================================== */
.floating {
    animation: floating 6s ease-in-out infinite;
}

@keyframes floating {

    0%,
    100% {
        transform: translateY(0px);
    }

    50% {
        transform: translateY(-20px);
    }
}

.floating-slow {
    animation: floating 8s ease-in-out infinite;
}

.floating-fast {
    animation: floating 4s ease-in-out infinite;
}

/* =====================================================
   Text Shimmer Effect
   ===================================================== */
.shimmer-text {
    background: linear-gradient(90deg,
            var(--text-primary) 0%,
            var(--accent-purple-light) 25%,
            var(--text-primary) 50%,
            var(--accent-purple-light) 75%,
            var(--text-primary) 100%);
    background-size: 200% 100%;
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    animation: shimmer 3s linear infinite;
}

@keyframes shimmer {
    0% {
        background-position: 200% 0;
    }

    100% {
        background-position: -200% 0;
    }
}

/* =====================================================
   Enhanced Hero Title
   ===================================================== */
.hero-title {
    position: relative;
    animation: titleFloat 6s ease-in-out infinite, titleGlow 3s ease-in-out infinite alternate;
}

@keyframes titleFloat {

    0%,
    100% {
        transform: translateY(0) scale(1);
    }

    50% {
        transform: translateY(-10px) scale(1.01);
    }
}

.hero-title::before {
    content: 'UA Web Studio';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    z-index: -1;
    background: var(--accent-gradient);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    filter: blur(30px);
    opacity: 0.7;
    animation: titleGlowPulse 3s ease-in-out infinite alternate;
}

@keyframes titleGlowPulse {
    0% {
        opacity: 0.5;
        filter: blur(30px);
    }

    100% {
        opacity: 0.8;
        filter: blur(40px);
    }
}

/* =====================================================
   Card 3D Hover Effect
   ===================================================== */
.pricing-card,
.social-card,
.portfolio-card {
    transform-style: preserve-3d;
    perspective: 1000px;
}

.pricing-card:hover,
.social-card:hover,
.portfolio-card:hover {
    transform: translateY(-10px) rotateX(2deg) rotateY(-2deg);
}

/* =====================================================
   Glowing Orbs Enhancement
   ===================================================== */
.orb {
    animation-timing-function: cubic-bezier(0.4, 0, 0.2, 1);
}

.orb-1 {
    filter: blur(80px);
    opacity: 0.6;
    background: radial-gradient(circle, var(--accent-purple-light) 0%, var(--accent-purple) 50%, transparent 70%);
}

.orb-2 {
    filter: blur(70px);
    opacity: 0.5;
    background: radial-gradient(circle, #7B78FF 0%, var(--accent-purple-light) 50%, transparent 70%);
}

.orb-3 {
    filter: blur(90px);
    opacity: 0.4;
    background: radial-gradient(circle, var(--accent-purple) 0%, var(--accent-purple-dark) 50%, transparent 70%);
}

/* Add 4th and 5th orbs via CSS */
.hero {
    position: relative;
}

.hero .orb-4 {
    position: absolute;
    width: 200px;
    height: 200px;
    border-radius: 50%;
    background: radial-gradient(circle, #9896FF 0%, transparent 70%);
    filter: blur(60px);
    opacity: 0.4;
    top: 40%;
    right: 20%;
    z-index: 0;
    animation: orbFloat4 22s ease-in-out infinite;
}

.hero .orb-5 {
    position: absolute;
    width: 180px;
    height: 180px;
    border-radius: 50%;
    background: radial-gradient(circle, #5E5AFF 0%, transparent 70%);
    filter: blur(50px);
    opacity: 0.35;
    bottom: 30%;
    left: 15%;
    z-index: 0;
    animation: orbFloat5 28s ease-in-out infinite;
}

@keyframes orbFloat4 {

    0%,
    100% {
        transform: translate(0, 0) scale(1);
        opacity: 0.4;
    }

    25% {
        transform: translate(-30px, 50px) scale(1.15);
        opacity: 0.5;
    }

    50% {
        transform: translate(40px, -20px) scale(0.85);
        opacity: 0.3;
    }

    75% {
        transform: translate(-20px, -40px) scale(1.1);
        opacity: 0.45;
    }
}

@keyframes orbFloat5 {

    0%,
    100% {
        transform: translate(0, 0) scale(1);
        opacity: 0.35;
    }

    33% {
        transform: translate(50px, 30px) scale(1.2);
        opacity: 0.45;
    }

    66% {
        transform: translate(-40px, -50px) scale(0.9);
        opacity: 0.25;
    }
}

/* =====================================================
   Section Dividers with Gradient
   ===================================================== */
.section::before {
    content: '';
    position: absolute;
    top: 0;
    left: 50%;
    transform: translateX(-50%);
    width: 200px;
    height: 1px;
    background: linear-gradient(90deg, transparent, var(--accent-purple-light), transparent);
}

/* =====================================================
   Scroll-triggered Glow Lines
   ===================================================== */
.glow-line {
    height: 2px;
    background: linear-gradient(90deg,
            transparent 0%,
            var(--accent-purple) 20%,
            var(--accent-purple-light) 50%,
            var(--accent-purple) 80%,
            transparent 100%);
    margin: var(--spacing-2xl) auto;
    max-width: 300px;
    animation: glowLinePulse 2s ease-in-out infinite;
}

@keyframes glowLinePulse {

    0%,
    100% {
        opacity: 0.5;
        box-shadow: 0 0 10px var(--accent-purple-glow);
    }

    50% {
        opacity: 1;
        box-shadow: 0 0 20px var(--accent-purple-glow), 0 0 40px var(--accent-purple-glow);
    }
}

/* =====================================================
   Enhanced Card Shine Effect
   ===================================================== */
.pricing-card,
.social-card,
.portfolio-card {
    overflow: hidden;
}

.pricing-card .card-shine,
.social-card .card-shine,
.portfolio-card .card-shine {
    position: absolute;
    top: -50%;
    left: -50%;
    width: 200%;
    height: 200%;
    background: linear-gradient(45deg,
            transparent 40%,
            rgba(255, 255, 255, 0.03) 45%,
            rgba(255, 255, 255, 0.05) 50%,
            rgba(255, 255, 255, 0.03) 55%,
            transparent 60%);
    transform: rotate(45deg) translateY(-100%);
    transition: transform 0.8s ease;
    pointer-events: none;
}

.pricing-card:hover .card-shine,
.social-card:hover .card-shine,
.portfolio-card:hover .card-shine {
    transform: rotate(45deg) translateY(100%);
}

/* =====================================================
   Animated Icons
   ===================================================== */
.social-logo {
    transition: all 0.3s ease;
}

.social-card:hover .social-logo {
    transform: scale(1.1) rotate(-5deg);
    filter: drop-shadow(0 0 15px var(--accent-purple-glow));
}

/* =====================================================
   Pricing Badge Pulse
   ===================================================== */
.pricing-badge {
    animation: badgePulse 2s ease-in-out infinite;
}

@keyframes badgePulse {

    0%,
    100% {
        box-shadow: 0 0 0 0 rgba(94, 90, 255, 0.4);
    }

    50% {
        box-shadow: 0 0 0 8px rgba(94, 90, 255, 0);
    }
}

/* =====================================================
   Enhanced Scroll Reveal Animations
   ===================================================== */
.reveal {
    opacity: 0;
    transform: translateY(50px);
    transition: all 1s cubic-bezier(0.4, 0, 0.2, 1);
}

.reveal.active {
    opacity: 1;
    transform: translateY(0);
}

.reveal-left {
    opacity: 0;
    transform: translateX(-80px) rotate(-2deg);
    transition: all 1s cubic-bezier(0.4, 0, 0.2, 1);
}

.reveal-left.active {
    opacity: 1;
    transform: translateX(0) rotate(0);
}

.reveal-right {
    opacity: 0;
    transform: translateX(80px) rotate(2deg);
    transition: all 1s cubic-bezier(0.4, 0, 0.2, 1);
}

.reveal-right.active {
    opacity: 1;
    transform: translateX(0) rotate(0);
}

.reveal-scale {
    opacity: 0;
    transform: scale(0.8);
    transition: all 1s cubic-bezier(0.4, 0, 0.2, 1);
}

.reveal-scale.active {
    opacity: 1;
    transform: scale(1);
}

/* Staggered delays */
.stagger-1 {
    transition-delay: 0.1s;
}

.stagger-2 {
    transition-delay: 0.25s;
}

.stagger-3 {
    transition-delay: 0.4s;
}

.stagger-4 {
    transition-delay: 0.55s;
}

.stagger-5 {
    transition-delay: 0.7s;
}

/* =====================================================
   Hover Glow Effect for Text
   ===================================================== */
.section-title {
    transition: all 0.3s ease;
}

.section-title:hover {
    filter: drop-shadow(0 0 20px var(--accent-purple-glow));
}

/* =====================================================
   CTA Section Enhancement
   ===================================================== */
.cta-section {
    position: relative;
}

.cta-section::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background:
        radial-gradient(ellipse at 20% 50%, rgba(94, 90, 255, 0.15) 0%, transparent 50%),
        radial-gradient(ellipse at 80% 50%, rgba(94, 90, 255, 0.1) 0%, transparent 50%);
    z-index: 0;
    animation: ctaGlow 8s ease-in-out infinite alternate;
}

@keyframes ctaGlow {
    0% {
        opacity: 0.5;
    }

    100% {
        opacity: 1;
    }
}

/* =====================================================
   Portfolio Card Enhancement
   ===================================================== */
.portfolio-image {
    position: relative;
    overflow: hidden;
}

.portfolio-image::after {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: linear-gradient(135deg,
            transparent 0%,
            rgba(94, 90, 255, 0.3) 50%,
            transparent 100%);
    opacity: 0;
    transition: opacity 0.5s ease;
}

.portfolio-card:hover .portfolio-image::after {
    opacity: 1;
    animation: portfolioShine 1.5s ease-in-out;
}

@keyframes portfolioShine {
    0% {
        transform: translateX(-100%) rotate(45deg);
    }

    100% {
        transform: translateX(100%) rotate(45deg);
    }
}

/* =====================================================
   Testimonials Enhancement
   ===================================================== */
.testimonials-placeholder {
    position: relative;
    overflow: hidden;
    background: linear-gradient(135deg, var(--bg-card) 0%, rgba(94, 90, 255, 0.1) 100%);
}

.testimonials-placeholder::before {
    content: '';
    position: absolute;
    top: -2px;
    left: -2px;
    right: -2px;
    bottom: -2px;
    background: linear-gradient(45deg, var(--accent-purple), var(--accent-purple-light), var(--accent-purple));
    border-radius: inherit;
    z-index: -1;
    opacity: 0.3;
    animation: testimonialBorder 4s linear infinite;
    background-size: 200% 200%;
}

@keyframes testimonialBorder {
    0% {
        background-position: 0% 50%;
    }

    50% {
        background-position: 100% 50%;
    }

    100% {
        background-position: 0% 50%;
    }
}

/* =====================================================
   Footer Enhancement
   ===================================================== */
.footer {
    position: relative;
    overflow: hidden;
}

.footer::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 1px;
    background: linear-gradient(90deg,
            transparent 0%,
            var(--accent-purple) 20%,
            var(--accent-purple-light) 50%,
            var(--accent-purple) 80%,
            transparent 100%);
    animation: footerLine 3s linear infinite;
    background-size: 200% 100%;
}

@keyframes footerLine {
    0% {
        background-position: 200% 0;
    }

    100% {
        background-position: -200% 0;
    }
}

.footer-credit span {
    position: relative;
}

.footer-credit span::after {
    content: '';
    position: absolute;
    bottom: -2px;
    left: 0;
    right: 0;
    height: 1px;
    background: var(--accent-gradient);
    transform: scaleX(0);
    transition: transform 0.3s ease;
}

.footer-credit:hover span::after {
    transform: scaleX(1);
}

/* =====================================================
   Mouse Trail Effect (CSS only)
   ===================================================== */
.cursor-glow {
    position: fixed;
    width: 300px;
    height: 300px;
    background: radial-gradient(circle, rgba(94, 90, 255, 0.15) 0%, transparent 70%);
    border-radius: 50%;
    pointer-events: none;
    z-index: 9998;
    transform: translate(-50%, -50%);
    transition: opacity 0.3s ease;
}

/* =====================================================
   Page Header Enhancement
   ===================================================== */
.page-header {
    position: relative;
}

.page-header::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 50%;
    transform: translateX(-50%);
    width: 100px;
    height: 3px;
    background: var(--accent-gradient);
    border-radius: 3px;
    box-shadow: 0 0 20px var(--accent-purple-glow);
}

.page-title {
    position: relative;
    display: inline-block;
}

.page-title::before {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 120%;
    height: 120%;
    background: radial-gradient(ellipse at center, rgba(94, 90, 255, 0.2) 0%, transparent 70%);
    z-index: -1;
    animation: pageTitleGlow 4s ease-in-out infinite alternate;
}

@keyframes pageTitleGlow {
    0% {
        opacity: 0.3;
        transform: translate(-50%, -50%) scale(1);
    }

    100% {
        opacity: 0.6;
        transform: translate(-50%, -50%) scale(1.1);
    }
}

/* =====================================================
   Enhanced Loading Animation
   ===================================================== */
.loading {
    background: radial-gradient(ellipse at center, #0a0a0f 0%, #000000 100%);
}

.loading::before {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 200px;
    height: 200px;
    background: radial-gradient(circle, rgba(94, 90, 255, 0.3) 0%, transparent 70%);
    border-radius: 50%;
    animation: loadingGlow 2s ease-in-out infinite;
}

@keyframes loadingGlow {

    0%,
    100% {
        opacity: 0.5;
        transform: translate(-50%, -50%) scale(1);
    }

    50% {
        opacity: 1;
        transform: translate(-50%, -50%) scale(1.5);
    }
}

.loading-spinner {
    position: relative;
    z-index: 1;
}

.loading-spinner::after {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 70px;
    height: 70px;
    border: 2px solid transparent;
    border-top-color: var(--accent-purple);
    border-radius: 50%;
    animation: spin 1.5s linear infinite reverse;
}

/* =====================================================
   Accessibility - Respect reduced motion
   ===================================================== */
@media (prefers-reduced-motion: reduce) {

    *,
    *::before,
    *::after {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
    }

    .orb,
    .orb-4,
    .orb-5 {
        animation: none !important;
    }

    .hero-title::before {
        display: none;
    }
}