/* ================================
   ENHANCED ANIMATIONS & EFFECTS
   ISN.BIZ Premium Upgrade
   ================================ */

/* ================================
   KEYFRAME ANIMATIONS
   ================================ */

@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(40px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes fadeInDown {
    from {
        opacity: 0;
        transform: translateY(-40px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes fadeInLeft {
    from {
        opacity: 0;
        transform: translateX(-40px);
    }
    to {
        opacity: 1;
        transform: translateX(0);
    }
}

@keyframes fadeInRight {
    from {
        opacity: 0;
        transform: translateX(40px);
    }
    to {
        opacity: 1;
        transform: translateX(0);
    }
}

@keyframes scaleIn {
    from {
        opacity: 0;
        transform: scale(0.9);
    }
    to {
        opacity: 1;
        transform: scale(1);
    }
}

@keyframes slideInReveal {
    from {
        opacity: 0;
        transform: translateY(60px) rotateX(10deg);
    }
    to {
        opacity: 1;
        transform: translateY(0) rotateX(0);
    }
}

@keyframes glowPulse {
    0%, 100% {
        box-shadow: 0 0 20px rgba(30, 159, 242, 0.3),
                    0 0 40px rgba(30, 159, 242, 0.1);
    }
    50% {
        box-shadow: 0 0 30px rgba(30, 159, 242, 0.5),
                    0 0 60px rgba(30, 159, 242, 0.2);
    }
}

@keyframes gradientShift {
    0%, 100% {
        background-position: 0% 50%;
    }
    50% {
        background-position: 100% 50%;
    }
}

@keyframes floatUp {
    0%, 100% {
        transform: translateY(0);
    }
    50% {
        transform: translateY(-10px);
    }
}

@keyframes scrollBounce {
    0%, 100% {
        transform: translateY(0);
    }
    50% {
        transform: translateY(8px);
    }
}

@keyframes techGrid {
    0% {
        background-position: 0 0;
    }
    100% {
        background-position: 40px 40px;
    }
}

@keyframes numberCount {
    from {
        transform: translateY(20px);
        opacity: 0;
    }
    to {
        transform: translateY(0);
        opacity: 1;
    }
}

@keyframes shimmer {
    0% {
        background-position: -1000px 0;
    }
    100% {
        background-position: 1000px 0;
    }
}

/* ================================
   ENTRANCE ANIMATIONS
   ================================ */

.animate-in {
    animation: fadeInUp 0.8s cubic-bezier(0.16, 1, 0.3, 1) forwards;
    opacity: 0;
}

.animate-in-fast {
    animation: fadeInUp 0.6s cubic-bezier(0.16, 1, 0.3, 1) forwards;
    opacity: 0;
}

.animate-scale {
    animation: scaleIn 0.8s cubic-bezier(0.16, 1, 0.3, 1) forwards;
    opacity: 0;
}

.animate-slide-reveal {
    animation: slideInReveal 1s cubic-bezier(0.16, 1, 0.3, 1) forwards;
    opacity: 0;
}

/* Staggered delays for sequential reveals */
.stagger-1 { animation-delay: 0.1s; }
.stagger-2 { animation-delay: 0.2s; }
.stagger-3 { animation-delay: 0.3s; }
.stagger-4 { animation-delay: 0.4s; }
.stagger-5 { animation-delay: 0.5s; }
.stagger-6 { animation-delay: 0.6s; }
.stagger-7 { animation-delay: 0.7s; }
.stagger-8 { animation-delay: 0.8s; }

/* ================================
   ENHANCED HERO EFFECTS
   ================================ */

.hero {
    position: relative;
    overflow: hidden;
}

.hero::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background:
        linear-gradient(135deg, rgba(30, 159, 242, 0.05) 0%, transparent 50%, rgba(95, 223, 223, 0.05) 100%),
        repeating-linear-gradient(
            0deg,
            transparent,
            transparent 2px,
            rgba(30, 159, 242, 0.03) 2px,
            rgba(30, 159, 242, 0.03) 4px
        );
    animation: techGrid 20s linear infinite;
    pointer-events: none;
    z-index: 1;
}

.hero-background {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: linear-gradient(135deg, #0D1117 0%, #1C1F26 50%, #0D1117 100%);
    background-size: 400% 400%;
    animation: gradientShift 15s ease infinite;
}

.hero-logo-img {
    animation: fadeInDown 1s cubic-bezier(0.16, 1, 0.3, 1) 0.2s both,
               floatUp 3s ease-in-out 1.2s infinite;
    filter: drop-shadow(0 10px 30px rgba(30, 159, 242, 0.3));
}

.hero-title {
    animation: fadeInUp 0.8s cubic-bezier(0.16, 1, 0.3, 1) 0.4s both;
    position: relative;
}

.hero-title::after {
    content: '';
    position: absolute;
    bottom: -10px;
    left: 0;
    width: 100px;
    height: 4px;
    background: linear-gradient(90deg, var(--color-blue), var(--color-cyan));
    animation: fadeInRight 0.6s cubic-bezier(0.16, 1, 0.3, 1) 0.8s both;
}

.hero-subtitle {
    animation: fadeInUp 0.8s cubic-bezier(0.16, 1, 0.3, 1) 0.6s both;
}

.hero-stats {
    animation: fadeInUp 0.8s cubic-bezier(0.16, 1, 0.3, 1) 0.8s both;
}

.stat {
    transition: transform 0.4s cubic-bezier(0.16, 1, 0.3, 1);
}

.stat:hover {
    transform: translateY(-8px) scale(1.05);
}

.stat-number {
    animation: numberCount 0.8s cubic-bezier(0.16, 1, 0.3, 1) both;
    position: relative;
}

.stat-number::after {
    content: '';
    position: absolute;
    bottom: -2px;
    left: 0;
    right: 0;
    height: 2px;
    background: linear-gradient(90deg, var(--color-blue), var(--color-cyan));
    transform: scaleX(0);
    transition: transform 0.6s cubic-bezier(0.16, 1, 0.3, 1);
}

.stat:hover .stat-number::after {
    transform: scaleX(1);
}

.scroll-indicator {
    animation: scrollBounce 2s ease-in-out infinite;
}

/* ================================
   BUTTON ENHANCEMENTS
   ================================ */

.btn {
    position: relative;
    overflow: hidden;
    transition: all 0.4s cubic-bezier(0.16, 1, 0.3, 1);
}

.btn::before {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 0;
    height: 0;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.1);
    transform: translate(-50%, -50%);
    transition: width 0.6s cubic-bezier(0.16, 1, 0.3, 1),
                height 0.6s cubic-bezier(0.16, 1, 0.3, 1);
}

.btn:hover::before {
    width: 300px;
    height: 300px;
}

.btn::after {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(
        90deg,
        transparent,
        rgba(255, 255, 255, 0.2),
        transparent
    );
    transition: left 0.7s;
}

.btn:hover::after {
    left: 100%;
}

.btn-primary {
    animation: glowPulse 3s ease-in-out infinite;
}

.btn:hover {
    transform: translateY(-2px);
    box-shadow:
        0 10px 30px rgba(30, 159, 242, 0.4),
        0 0 0 4px rgba(30, 159, 242, 0.1);
}

.btn:active {
    transform: translateY(0);
}

/* ================================
   CARD INTERACTIONS
   ================================ */

.solution-card,
.portfolio-item,
.credential-card {
    transition: all 0.4s cubic-bezier(0.16, 1, 0.3, 1);
    position: relative;
}

.solution-card::before,
.portfolio-item::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    border: 2px solid var(--color-blue);
    opacity: 0;
    transition: opacity 0.4s cubic-bezier(0.16, 1, 0.3, 1);
    pointer-events: none;
}

.solution-card:hover::before,
.portfolio-item:hover::before {
    opacity: 1;
}

.solution-card:hover,
.portfolio-item:hover {
    transform: translateY(-12px);
    box-shadow:
        0 20px 60px rgba(0, 0, 0, 0.6),
        0 0 0 1px rgba(30, 159, 242, 0.2),
        inset 0 1px 0 rgba(255, 255, 255, 0.05);
}

.solution-icon {
    transition: all 0.6s cubic-bezier(0.16, 1, 0.3, 1);
}

.solution-card:hover .solution-icon {
    transform: scale(1.1) rotate(5deg);
    filter: drop-shadow(0 0 20px rgba(30, 159, 242, 0.5));
}

.solution-icon svg {
    transition: stroke 0.4s cubic-bezier(0.16, 1, 0.3, 1);
}

.solution-card:hover .solution-icon svg {
    stroke: var(--color-cyan);
}

/* ================================
   SCROLL-TRIGGERED ANIMATIONS
   ================================ */

.section {
    opacity: 0;
    transform: translateY(40px);
    transition: opacity 0.8s cubic-bezier(0.16, 1, 0.3, 1),
                transform 0.8s cubic-bezier(0.16, 1, 0.3, 1);
}

.section.visible {
    opacity: 1;
    transform: translateY(0);
}

.section-header {
    opacity: 0;
    transform: translateY(30px);
    transition: opacity 0.8s cubic-bezier(0.16, 1, 0.3, 1) 0.2s,
                transform 0.8s cubic-bezier(0.16, 1, 0.3, 1) 0.2s;
}

.section.visible .section-header {
    opacity: 1;
    transform: translateY(0);
}

/* Stagger child elements */
.solutions-grid .solution-card:nth-child(1) { transition-delay: 0.1s; }
.solutions-grid .solution-card:nth-child(2) { transition-delay: 0.2s; }
.solutions-grid .solution-card:nth-child(3) { transition-delay: 0.3s; }
.solutions-grid .solution-card:nth-child(4) { transition-delay: 0.4s; }

/* ================================
   NAVIGATION ENHANCEMENTS
   ================================ */

.nav {
    transition: all 0.3s cubic-bezier(0.16, 1, 0.3, 1);
}

.nav.scrolled {
    background: rgba(13, 17, 23, 0.95);
    backdrop-filter: blur(20px) saturate(180%);
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.3),
                0 0 1px rgba(30, 159, 242, 0.5);
}

.nav-menu a {
    position: relative;
    transition: color 0.3s cubic-bezier(0.16, 1, 0.3, 1);
}

.nav-menu a::after {
    content: '';
    position: absolute;
    bottom: -4px;
    left: 0;
    width: 0;
    height: 2px;
    background: linear-gradient(90deg, var(--color-blue), var(--color-cyan));
    transition: width 0.4s cubic-bezier(0.16, 1, 0.3, 1);
}

.nav-menu a:hover::after,
.nav-menu a:focus::after {
    width: 100%;
}

.nav-menu a:hover {
    color: var(--color-cyan);
    text-shadow: 0 0 20px rgba(95, 223, 223, 0.5);
}

/* ================================
   ENHANCED BACKGROUNDS
   ================================ */

.hero-background::after {
    content: '';
    position: absolute;
    top: -50%;
    right: -50%;
    width: 100%;
    height: 100%;
    background: radial-gradient(
        circle,
        rgba(30, 159, 242, 0.15) 0%,
        transparent 70%
    );
    animation: floatUp 8s ease-in-out infinite;
    opacity: 0.6;
}

.about {
    position: relative;
}

.about::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 1px;
    background: linear-gradient(
        90deg,
        transparent 0%,
        var(--color-blue) 50%,
        transparent 100%
    );
}

/* ================================
   TYPOGRAPHY ENHANCEMENTS
   ================================ */

.section-title {
    background: linear-gradient(
        135deg,
        var(--color-white) 0%,
        var(--color-cyan) 100%
    );
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    position: relative;
    display: inline-block;
}

.section-label {
    position: relative;
    display: inline-block;
}

.section-label::before {
    content: '';
    position: absolute;
    left: -20px;
    top: 50%;
    width: 12px;
    height: 2px;
    background: var(--color-blue);
    transform: translateY(-50%);
}

.section-label::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 0;
    width: 100%;
    height: 1px;
    background: linear-gradient(90deg, var(--color-cyan), transparent);
}

/* ================================
   FORM ENHANCEMENTS
   ================================ */

.form-group input,
.form-group textarea,
.form-group select {
    transition: all 0.4s cubic-bezier(0.16, 1, 0.3, 1);
    position: relative;
}

.form-group input:focus,
.form-group textarea:focus,
.form-group select:focus {
    transform: translateY(-2px);
    box-shadow:
        0 8px 24px rgba(30, 159, 242, 0.2),
        0 0 0 3px rgba(30, 159, 242, 0.1),
        inset 0 1px 0 rgba(255, 255, 255, 0.05);
}

.form-group label {
    transition: all 0.3s cubic-bezier(0.16, 1, 0.3, 1);
}

.form-group input:focus + label,
.form-group textarea:focus + label {
    color: var(--color-cyan);
    transform: translateY(-2px);
}

/* ================================
   SCROLL PROGRESS INDICATOR
   ================================ */

.scroll-progress {
    position: fixed;
    top: 0;
    left: 0;
    width: 0%;
    height: 3px;
    background: linear-gradient(90deg, var(--color-blue), var(--color-cyan));
    z-index: 9999;
    transition: width 0.1s linear;
    box-shadow: 0 0 10px rgba(30, 159, 242, 0.5);
}

/* ================================
   PARALLAX EFFECTS
   ================================ */

.parallax {
    transform: translateZ(0);
    will-change: transform;
}

/* ================================
   HOVER LIFT EFFECTS
   ================================ */

.lift-on-hover {
    transition: all 0.4s cubic-bezier(0.16, 1, 0.3, 1);
}

.lift-on-hover:hover {
    transform: translateY(-8px);
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.4);
}

/* ================================
   GLOW EFFECTS
   ================================ */

.glow {
    position: relative;
}

.glow::before {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 100%;
    height: 100%;
    background: radial-gradient(
        circle,
        rgba(30, 159, 242, 0.3) 0%,
        transparent 70%
    );
    transform: translate(-50%, -50%);
    opacity: 0;
    transition: opacity 0.4s;
    pointer-events: none;
}

.glow:hover::before {
    opacity: 1;
}

/* ================================
   TEXT SHIMMER EFFECT
   ================================ */

.shimmer {
    background: linear-gradient(
        90deg,
        var(--color-white) 0%,
        var(--color-cyan) 50%,
        var(--color-white) 100%
    );
    background-size: 200% 100%;
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    animation: shimmer 3s linear infinite;
}

/* ================================
   GRID OVERLAY EFFECT
   ================================ */

.grid-overlay {
    position: relative;
}

.grid-overlay::after {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-image:
        linear-gradient(rgba(30, 159, 242, 0.03) 1px, transparent 1px),
        linear-gradient(90deg, rgba(30, 159, 242, 0.03) 1px, transparent 1px);
    background-size: 20px 20px;
    pointer-events: none;
    opacity: 0;
    transition: opacity 0.4s;
}

.grid-overlay:hover::after {
    opacity: 1;
}

/* ================================
   REDUCE MOTION SUPPORT
   ================================ */

@media (prefers-reduced-motion: reduce) {
    *,
    *::before,
    *::after {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
    }

    .scroll-progress {
        transition: none;
    }
}

/* ================================
   PERFORMANCE OPTIMIZATIONS
   ================================ */

.hero-logo-img,
.btn,
.solution-card,
.portfolio-item {
    will-change: transform;
}

.animate-in,
.animate-scale,
.animate-slide-reveal {
    will-change: opacity, transform;
}
