/* ===================================
   ENHANCED ANIMATIONS & UI/UX
   =================================== */

/* Improved Typography & Readability */
body {
    line-height: 2.0;
}

p {
    max-width: 800px;
    line-height: 2.0;
    letter-spacing: 0.3px;
}

.section-subtitle {
    max-width: 700px;
    margin-left: auto;
    margin-right: auto;
    line-height: 1.8;
}

/* Scroll Progress Bar */
.scroll-progress {
    position: fixed;
    top: 0;
    left: 0;
    width: 0%;
    height: 4px;
    background: linear-gradient(90deg, var(--primary-cyan), var(--primary-purple));
    z-index: 10000;
    transition: width 0.1s ease-out;
    pointer-events: none;
    /* Don't block clicks */
}

/* Section Dividers */
.section-divider {
    width: 100px;
    height: 3px;
    background: var(--gradient-primary);
    margin: 2rem auto;
    border-radius: 10px;
    animation: dividerGlow 2s ease-in-out infinite;
}

@keyframes dividerGlow {

    0%,
    100% {
        box-shadow: 0 0 10px var(--primary-cyan);
    }

    50% {
        box-shadow: 0 0 20px var(--primary-purple);
    }
}

/* Card Tilt Effect */
.tilt-card {
    transform-style: preserve-3d;
    transition: transform 0.3s ease;
}

.tilt-card:hover {
    transform: perspective(1000px) rotateX(var(--rotate-x, 0deg)) rotateY(var(--rotate-y, 0deg)) scale3d(1.05, 1.05, 1.05);
}

/* Shine Effect on Hover */
.shine-effect {
    position: relative;
    overflow: hidden;
}

.shine-effect::before {
    content: '';
    position: absolute;
    top: -50%;
    left: -50%;
    width: 200%;
    height: 200%;
    background: linear-gradient(45deg,
            transparent 30%,
            rgba(255, 255, 255, 0.1) 50%,
            transparent 70%);
    transform: translateX(-100%) translateY(-100%) rotate(45deg);
    transition: transform 0.6s ease;
}

.shine-effect:hover::before {
    transform: translateX(100%) translateY(100%) rotate(45deg);
}

/* Ripple Effect */
.ripple {
    position: relative;
    overflow: hidden;
}

.ripple::after {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 0;
    height: 0;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.3);
    transform: translate(-50%, -50%);
    transition: width 0.6s, height 0.6s;
}

.ripple:active::after {
    width: 300px;
    height: 300px;
}

/* Staggered Fade In */
.stagger-fade-in {
    opacity: 0;
    transform: translateY(30px);
    animation: fadeInUp 0.6s ease forwards;
}

.stagger-fade-in:nth-child(1) {
    animation-delay: 0.1s;
}

.stagger-fade-in:nth-child(2) {
    animation-delay: 0.2s;
}

.stagger-fade-in:nth-child(3) {
    animation-delay: 0.3s;
}

.stagger-fade-in:nth-child(4) {
    animation-delay: 0.4s;
}

.stagger-fade-in:nth-child(5) {
    animation-delay: 0.5s;
}

.stagger-fade-in:nth-child(6) {
    animation-delay: 0.6s;
}

@keyframes fadeInUp {
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Parallax Layers */
.parallax-layer {
    transition: transform 0.3s cubic-bezier(0.25, 0.46, 0.45, 0.94);
}

.parallax-slow {
    transform: translateY(var(--parallax-y-slow, 0px));
}

.parallax-medium {
    transform: translateY(var(--parallax-y-medium, 0px));
}

.parallax-fast {
    transform: translateY(var(--parallax-y-fast, 0px));
}

/* Floating Animation */
.float-animation {
    animation: float 6s ease-in-out infinite;
}

@keyframes float {

    0%,
    100% {
        transform: translateY(0px);
    }

    50% {
        transform: translateY(-20px);
    }
}

/* Pulse Glow */
.pulse-glow {
    animation: pulseGlow 2s ease-in-out infinite;
}

@keyframes pulseGlow {

    0%,
    100% {
        box-shadow: 0 0 20px rgba(0, 243, 255, 0.3);
    }

    50% {
        box-shadow: 0 0 40px rgba(180, 0, 255, 0.5);
    }
}

/* Scale In Animation */
.scale-in {
    opacity: 0;
    transform: scale(0.8);
    animation: scaleIn 0.5s ease forwards;
}

@keyframes scaleIn {
    to {
        opacity: 1;
        transform: scale(1);
    }
}

/* Slide In from Left */
.slide-in-left {
    opacity: 0;
    transform: translateX(-50px);
    animation: slideInLeft 0.6s ease forwards;
}

@keyframes slideInLeft {
    to {
        opacity: 1;
        transform: translateX(0);
    }
}

/* Slide In from Right */
.slide-in-right {
    opacity: 0;
    transform: translateX(50px);
    animation: slideInRight 0.6s ease forwards;
}

@keyframes slideInRight {
    to {
        opacity: 1;
        transform: translateX(0);
    }
}

/* Typewriter Effect */
.typewriter {
    overflow: hidden;
    border-right: 3px solid var(--primary-cyan);
    white-space: nowrap;
    animation: typing 3.5s steps(40, end), blink 0.75s step-end infinite;
}

@keyframes typing {
    from {
        width: 0;
    }

    to {
        width: 100%;
    }
}

@keyframes blink {
    50% {
        border-color: transparent;
    }
}

/* Magnetic Button Effect */
.magnetic-btn {
    transition: transform 0.3s cubic-bezier(0.25, 0.46, 0.45, 0.94);
}

/* Spotlight Effect */
.spotlight {
    position: fixed;
    width: 300px;
    height: 300px;
    border-radius: 50%;
    background: radial-gradient(circle, rgba(0, 243, 255, 0.15) 0%, transparent 70%);
    pointer-events: none;
    transform: translate(-50%, -50%);
    z-index: 9999;
    transition: opacity 0.3s ease;
}

/* Particle Trail */
.particle {
    position: fixed;
    width: 4px;
    height: 4px;
    background: var(--primary-cyan);
    border-radius: 50%;
    pointer-events: none;
    opacity: 0;
    animation: particleFade 1s ease-out forwards;
}

@keyframes particleFade {
    0% {
        opacity: 1;
        transform: scale(1);
    }

    100% {
        opacity: 0;
        transform: scale(0);
    }
}

/* Gradient Mesh Background */
.gradient-mesh {
    position: absolute;
    width: 100%;
    height: 100%;
    background:
        radial-gradient(circle at 20% 50%, rgba(0, 243, 255, 0.1) 0%, transparent 50%),
        radial-gradient(circle at 80% 80%, rgba(180, 0, 255, 0.1) 0%, transparent 50%),
        radial-gradient(circle at 40% 20%, rgba(0, 243, 255, 0.05) 0%, transparent 50%);
    animation: meshMove 20s ease-in-out infinite;
    pointer-events: none;
}

@keyframes meshMove {

    0%,
    100% {
        transform: translate(0, 0) scale(1);
    }

    33% {
        transform: translate(20px, -20px) scale(1.1);
    }

    66% {
        transform: translate(-20px, 20px) scale(0.9);
    }
}

/* Form Input Enhancements */
.form-group {
    position: relative;
}

.form-group input:focus,
.form-group textarea:focus,
.form-group select:focus {
    border-color: var(--primary-cyan);
    box-shadow: 0 0 20px rgba(0, 243, 255, 0.3);
    transform: translateY(-2px);
}

/* Loading Spinner */
.loading-spinner {
    width: 40px;
    height: 40px;
    border: 4px solid rgba(0, 243, 255, 0.1);
    border-top-color: var(--primary-cyan);
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

@keyframes spin {
    to {
        transform: rotate(360deg);
    }
}

/* Success Checkmark */
.checkmark {
    width: 60px;
    height: 60px;
    border-radius: 50%;
    display: block;
    stroke-width: 3;
    stroke: var(--primary-cyan);
    stroke-miterlimit: 10;
    box-shadow: inset 0 0 0 var(--primary-cyan);
    animation: checkmarkFill 0.4s ease-in-out 0.4s forwards, checkmarkScale 0.3s ease-in-out 0.9s both;
}

.checkmark-circle {
    stroke-dasharray: 166;
    stroke-dashoffset: 166;
    stroke-width: 3;
    stroke-miterlimit: 10;
    stroke: var(--primary-cyan);
    fill: none;
    animation: checkmarkStroke 0.6s cubic-bezier(0.65, 0, 0.45, 1) forwards;
}

.checkmark-check {
    transform-origin: 50% 50%;
    stroke-dasharray: 48;
    stroke-dashoffset: 48;
    animation: checkmarkStroke 0.3s cubic-bezier(0.65, 0, 0.45, 1) 0.8s forwards;
}

@keyframes checkmarkStroke {
    100% {
        stroke-dashoffset: 0;
    }
}

@keyframes checkmarkScale {

    0%,
    100% {
        transform: none;
    }

    50% {
        transform: scale3d(1.1, 1.1, 1);
    }
}

@keyframes checkmarkFill {
    100% {
        box-shadow: inset 0 0 0 30px var(--primary-cyan);
    }
}

/* Icon Bounce */
.icon-bounce {
    animation: iconBounce 0.5s ease;
}

@keyframes iconBounce {

    0%,
    100% {
        transform: translateY(0);
    }

    50% {
        transform: translateY(-10px);
    }
}

/* Depth Shadows */
.depth-shadow-sm {
    box-shadow:
        0 2px 4px rgba(0, 0, 0, 0.1),
        0 4px 8px rgba(0, 243, 255, 0.1);
}

.depth-shadow-md {
    box-shadow:
        0 4px 8px rgba(0, 0, 0, 0.15),
        0 8px 16px rgba(0, 243, 255, 0.15);
}

.depth-shadow-lg {
    box-shadow:
        0 8px 16px rgba(0, 0, 0, 0.2),
        0 16px 32px rgba(180, 0, 255, 0.2);
}

/* Scroll Reveal Classes */
.scroll-reveal {
    opacity: 0;
    transform: translateY(50px);
    transition: opacity 0.8s ease, transform 0.8s ease;
}

.scroll-reveal.revealed {
    opacity: 1;
    transform: translateY(0);
}

/* Zoom on Scroll */
.zoom-on-scroll {
    transform: scale(0.95);
    transition: transform 0.6s ease;
}

.zoom-on-scroll.zoomed {
    transform: scale(1);
}

/* Performance Optimizations */
.will-animate {
    will-change: transform, opacity;
}

/* Responsive Adjustments */
@media (max-width: 968px) {
    .parallax-layer {
        transform: none !important;
    }

    .tilt-card:hover {
        transform: scale(1.05);
    }
}

@media (prefers-reduced-motion: reduce) {

    *,
    *::before,
    *::after {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
    }

    .parallax-layer,
    .tilt-card {
        transform: none !important;
    }
}