/* Premium Modern Animation Effects CSS */

/* Advanced Keyframes */
@keyframes morphIn {
    0% {
        opacity: 0;
        transform: translateY(100px) rotateX(90deg) scale(0.5);
        filter: blur(20px);
    }
    50% {
        opacity: 0.8;
        transform: translateY(20px) rotateX(20deg) scale(0.9);
        filter: blur(5px);
    }
    100% {
        opacity: 1;
        transform: translateY(0) rotateX(0deg) scale(1);
        filter: blur(0px);
    }
}

@keyframes slideInFromVoid {
    0% {
        opacity: 0;
        transform: translateX(-200px) rotateY(-90deg) scale(0.3);
        filter: brightness(0) hue-rotate(180deg);
    }
    60% {
        opacity: 0.7;
        transform: translateX(20px) rotateY(10deg) scale(1.1);
        filter: brightness(1.2) hue-rotate(0deg);
    }
    100% {
        opacity: 1;
        transform: translateX(0) rotateY(0deg) scale(1);
        filter: brightness(1) hue-rotate(0deg);
    }
}

@keyframes explosiveEntry {
    0% {
        opacity: 0;
        transform: scale(0) rotate(180deg);
        filter: brightness(3) saturate(2);
        box-shadow: 0 0 100px rgba(37, 99, 235, 0.8);
    }
    50% {
        opacity: 0.9;
        transform: scale(1.3) rotate(10deg);
        filter: brightness(1.5) saturate(1.5);
        box-shadow: 0 0 50px rgba(37, 99, 235, 0.6);
    }
    100% {
        opacity: 1;
        transform: scale(1) rotate(0deg);
        filter: brightness(1) saturate(1);
        box-shadow: 0 10px 30px rgba(37, 99, 235, 0.3);
    }
}

@keyframes liquidFadeIn {
    0% {
        opacity: 0;
        transform: translateY(60px) skewY(10deg);
        filter: blur(15px) brightness(0.3);
        border-radius: 50px;
    }
    30% {
        opacity: 0.6;
        transform: translateY(10px) skewY(2deg);
        filter: blur(8px) brightness(0.8);
        border-radius: 25px;
    }
    100% {
        opacity: 1;
        transform: translateY(0) skewY(0deg);
        filter: blur(0px) brightness(1);
        border-radius: var(--border-radius);
    }
}

@keyframes magneticPulse {
    0%, 100% {
        transform: scale(1) rotate(0deg);
        box-shadow: 0 5px 15px rgba(37, 99, 235, 0.2);
    }
    25% {
        transform: scale(1.05) rotate(1deg);
        box-shadow: 0 15px 35px rgba(37, 99, 235, 0.4);
    }
    50% {
        transform: scale(1.1) rotate(0deg);
        box-shadow: 0 25px 50px rgba(37, 99, 235, 0.6);
    }
    75% {
        transform: scale(1.05) rotate(-1deg);
        box-shadow: 0 15px 35px rgba(37, 99, 235, 0.4);
    }
}

@keyframes neonGlow {
    0%, 100% {
        text-shadow: 0 0 5px rgba(37, 99, 235, 0.5),
                     0 0 10px rgba(37, 99, 235, 0.5),
                     0 0 15px rgba(37, 99, 235, 0.5);
        color: var(--primary-color);
    }
    50% {
        text-shadow: 0 0 10px rgba(37, 99, 235, 0.8),
                     0 0 20px rgba(37, 99, 235, 0.8),
                     0 0 30px rgba(37, 99, 235, 0.8),
                     0 0 40px rgba(37, 99, 235, 0.8);
        color: #ffffff;
    }
}

@keyframes hologramFlicker {
    0%, 100% { opacity: 1; transform: translateY(0); }
    10% { opacity: 0.8; transform: translateY(-2px); }
    20% { opacity: 1; transform: translateY(0); }
    30% { opacity: 0.9; transform: translateY(-1px); }
    40% { opacity: 1; transform: translateY(0); }
    60% { opacity: 0.95; transform: translateY(-0.5px); }
    80% { opacity: 1; transform: translateY(0); }
}

@keyframes dataStream {
    0% {
        background-position: 0% 0%;
        opacity: 0.3;
    }
    50% {
        background-position: 100% 100%;
        opacity: 0.8;
    }
    100% {
        background-position: 200% 200%;
        opacity: 0.3;
    }
}

/* Page Load with Cinematic Effect */
body {
    animation: none;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    background-attachment: fixed;
}

body.loaded {
    background: var(--bg-light);
    transition: background 2s ease;
}

/* Loading Screen */
.premium-loader {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: linear-gradient(45deg, #1e3c72, #2a5298, #667eea);
    background-size: 400% 400%;
    animation: dataStream 3s ease-in-out infinite;
    z-index: 10000;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-direction: column;
}

.premium-loader.fade-out {
    animation: complexFadeOut 1.5s ease-out forwards;
}

@keyframes complexFadeOut {
    0% {
        opacity: 1;
        transform: scale(1);
        filter: blur(0px);
    }
    50% {
        opacity: 0.5;
        transform: scale(1.1);
        filter: blur(5px);
    }
    100% {
        opacity: 0;
        transform: scale(1.5);
        filter: blur(20px);
        visibility: hidden;
    }
}

.loader-content {
    text-align: center;
    color: white;
}

.loader-spinner {
    width: 80px;
    height: 80px;
    border: 3px solid rgba(255,255,255,0.3);
    border-radius: 50%;
    border-top: 3px solid #ffffff;
    animation: spinComplex 1s ease-in-out infinite;
    margin-bottom: 20px;
}

@keyframes spinComplex {
    0% { transform: rotate(0deg) scale(1); }
    50% { transform: rotate(180deg) scale(1.1); box-shadow: 0 0 20px rgba(255,255,255,0.5); }
    100% { transform: rotate(360deg) scale(1); }
}

.loader-text {
    font-size: 1.2rem;
    font-weight: 600;
    animation: neonGlow 2s ease-in-out infinite;
}

/* Header with Futuristic Effect */
.main-header {
    background: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(10px);
    border-bottom: 1px solid rgba(255, 255, 255, 0.2);
    animation: slideInFromVoid 1.5s ease-out 0.5s both;
    transition: all 0.5s cubic-bezier(0.4, 0, 0.2, 1);
    z-index: 1000;
    position: relative;
}

.main-header.scrolled {
    background: rgba(255, 255, 255, 0.98);
    backdrop-filter: blur(15px);
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.1);
    transform: translateY(0);
}

/* Fix navigation links */
.main-nav {
    position: relative;
    z-index: 1001;
}

.main-nav ul {
    position: relative;
    z-index: 1002;
}

.main-nav ul li {
    position: relative;
    z-index: 1003;
}

.main-nav ul li a {
    position: relative;
    z-index: 1004;
    display: block;
    padding: 10px 15px;
    cursor: pointer;
    pointer-events: auto;
}

/* Mobile menu fixes */
.mobile-menu {
    background-color: rgba(255, 255, 255, 0.98);
    backdrop-filter: blur(15px);
    z-index: 1005;
}

.mobile-menu ul li a {
    position: relative;
    z-index: 1006;
    cursor: pointer;
    pointer-events: auto;
}

/* Hero Section - Cyberpunk Style */
.hero {
    background: url('https://novintek.com/assets/images/novintek-banner.svg'),
                linear-gradient(135deg, rgba(30, 60, 114, 0.3), rgba(42, 82, 152, 0.2), rgba(102, 126, 234, 0.1)),
                url('data:image/svg+xml,<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 100 100"><defs><pattern id="grid" width="10" height="10" patternUnits="userSpaceOnUse"><path d="M 10 0 L 0 0 0 10" fill="none" stroke="rgba(255,255,255,0.05)" stroke-width="0.5"/></pattern></defs><rect width="100" height="100" fill="url(%23grid)"/></svg>');
    background-size: contain, cover, 50px 50px;
    background-position: center, center, center;
    background-repeat: no-repeat, no-repeat, repeat;
    position: relative;
    overflow: hidden;
}

.hero::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: linear-gradient(45deg, transparent 0%, rgba(102, 126, 234, 0.05) 50%, transparent 100%);
    animation: dataStream 8s linear infinite;
    pointer-events: none;
    z-index: 1;
}

/* Hero Content Positioning */
.hero .container {
    display: flex;
    justify-content: flex-end;
    align-items: center;
    position: relative;
    z-index: 2;
}

.hero-content {
    animation: morphIn 2s cubic-bezier(0.25, 0.46, 0.45, 0.94) 1s both;
    position: relative;
    z-index: 3;
    max-width: 500px;
    text-align: left;
    margin-right: 50px;
    background: rgba(255, 255, 255, 0.05);
    backdrop-filter: blur(10px);
    padding: 30px;
    border-radius: var(--border-radius);
    border: 1px solid rgba(255, 255, 255, 0.1);
}

.hero-content h1 {
    background: linear-gradient(45deg, #fff, #e0e7ff, #3b82f6);
    background-clip: text;
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-size: 200% 200%;
    animation: dataStream 3s ease-in-out infinite, hologramFlicker 4s ease-in-out infinite;
    font-weight: 800;
    text-shadow: 0 0 30px rgba(59, 130, 246, 0.5);
}

.hero-content p {
    color: rgba(255, 255, 255, 0.9);
    animation: liquidFadeIn 1.8s ease-out 1.5s both;
    text-shadow: 0 2px 10px rgba(0, 0, 0, 0.3);
}

.hero-buttons {
    animation: explosiveEntry 1.5s cubic-bezier(0.68, -0.55, 0.265, 1.55) 2s both;
}

.hero-buttons .btn {
    position: relative;
    overflow: hidden;
    backdrop-filter: blur(10px);
    transition: all 0.4s cubic-bezier(0.25, 0.46, 0.45, 0.94);
}

.hero-buttons .btn::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255,255,255,0.4), transparent);
    transition: left 0.8s ease;
}

.hero-buttons .btn:hover::before {
    left: 100%;
}

.hero-buttons .btn:hover {
    transform: translateY(-5px) scale(1.05);
    box-shadow: 0 20px 40px rgba(37, 99, 235, 0.4);
}

/* Services Section - Matrix Style */
.services {
    position: relative;
    background: linear-gradient(135deg, #f8fafc 0%, #e2e8f0 100%);
}

.services::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-image: radial-gradient(circle at 25% 25%, rgba(37, 99, 235, 0.1) 0%, transparent 50%),
                      radial-gradient(circle at 75% 75%, rgba(139, 92, 246, 0.1) 0%, transparent 50%);
    pointer-events: none;
}

.services .section-header {
    animation: morphIn 1.2s ease-out both;
}

.services .section-header h2 {
    background: linear-gradient(45deg, #1e40af, #3b82f6, #8b5cf6);
    background-clip: text;
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    animation: neonGlow 3s ease-in-out infinite;
}

.service-card {
    animation: explosiveEntry 1s ease-out both;
    backdrop-filter: blur(20px);
    background: rgba(255, 255, 255, 0.8);
    border: 1px solid rgba(255, 255, 255, 0.3);
    transition: all 0.6s cubic-bezier(0.25, 0.46, 0.45, 0.94);
    position: relative;
    overflow: hidden;
}

.service-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: linear-gradient(45deg, rgba(37, 99, 235, 0.1), rgba(139, 92, 246, 0.1));
    opacity: 0;
    transition: opacity 0.6s ease;
}

.service-card:hover::before {
    opacity: 1;
}

.service-card:nth-child(1) { animation-delay: 0.2s; }
.service-card:nth-child(2) { animation-delay: 0.4s; }
.service-card:nth-child(3) { animation-delay: 0.6s; }
.service-card:nth-child(4) { animation-delay: 0.8s; }

.service-card:hover {
    transform: translateY(-20px) rotateY(10deg) scale(1.05);
    box-shadow: 0 30px 60px rgba(37, 99, 235, 0.3);
    backdrop-filter: blur(30px);
}

.service-icon {
    animation: magneticPulse 3s ease-in-out infinite;
    background: linear-gradient(45deg, #3b82f6, #8b5cf6);
    transition: all 0.6s cubic-bezier(0.25, 0.46, 0.45, 0.94);
}

.service-card:hover .service-icon {
    animation-play-state: paused;
    transform: scale(1.2) rotateY(360deg);
    background: linear-gradient(45deg, #1e40af, #7c3aed);
    box-shadow: 0 15px 30px rgba(37, 99, 235, 0.5);
}

/* About Section - Holographic */
.about-section {
    background: linear-gradient(135deg, rgba(255, 255, 255, 0.9), rgba(248, 250, 252, 0.9));
    position: relative;
}

.about-content {
    animation: slideInFromVoid 1.5s ease-out 0.3s both;
}

.about-image {
    animation: liquidFadeIn 1.5s ease-out 0.6s both;
    position: relative;
}

.about-image::before {
    content: '';
    position: absolute;
    top: -10px;
    left: -10px;
    right: -10px;
    bottom: -10px;
    background: linear-gradient(45deg, #3b82f6, #8b5cf6, #3b82f6);
    background-size: 400% 400%;
    animation: dataStream 4s ease-in-out infinite;
    border-radius: var(--border-radius);
    z-index: -1;
}

.about-image img {
    transition: all 0.8s cubic-bezier(0.25, 0.46, 0.45, 0.94);
    filter: brightness(1) contrast(1.1);
}

.about-image:hover img {
    transform: scale(1.05) rotateY(5deg);
    filter: brightness(1.1) contrast(1.2) saturate(1.1);
}

/* Projects Showcase - Futuristic Grid */
.projects-showcase {
    background: linear-gradient(135deg, #0f172a 0%, #1e293b 50%, #334155 100%);
    color: white;
    position: relative;
    overflow: hidden;
}

.projects-showcase::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-image: 
        linear-gradient(rgba(59, 130, 246, 0.1) 1px, transparent 1px),
        linear-gradient(90deg, rgba(59, 130, 246, 0.1) 1px, transparent 1px);
    background-size: 50px 50px;
    animation: dataStream 10s linear infinite;
}

.projects-showcase .section-header h2 {
    color: white;
    animation: neonGlow 4s ease-in-out infinite;
}

.project-card {
    animation: morphIn 1.2s ease-out both;
    background: rgba(255, 255, 255, 0.1);
    backdrop-filter: blur(20px);
    border: 1px solid rgba(255, 255, 255, 0.2);
    transition: all 0.8s cubic-bezier(0.25, 0.46, 0.45, 0.94);
    position: relative;
    overflow: hidden;
}

.project-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: linear-gradient(45deg, rgba(59, 130, 246, 0.2), rgba(139, 92, 246, 0.2));
    opacity: 0;
    transition: all 0.6s ease;
}

.project-card:hover::before {
    opacity: 1;
}

.project-card:nth-child(1) { animation-delay: 0.2s; }
.project-card:nth-child(2) { animation-delay: 0.4s; }
.project-card:nth-child(3) { animation-delay: 0.6s; }

.project-card:hover {
    transform: translateY(-30px) rotateX(10deg) rotateY(5deg) scale(1.02);
    box-shadow: 0 40px 80px rgba(59, 130, 246, 0.4);
}

.project-image img {
    transition: all 0.8s cubic-bezier(0.25, 0.46, 0.45, 0.94);
    filter: brightness(0.9) contrast(1.1);
}

.project-card:hover .project-image img {
    transform: scale(1.1) rotateZ(2deg);
    filter: brightness(1.1) contrast(1.2) saturate(1.3);
}

.project-tech span {
    background: linear-gradient(45deg, rgba(59, 130, 246, 0.8), rgba(139, 92, 246, 0.8));
    color: white;
    transition: all 0.4s ease;
    animation: hologramFlicker 5s ease-in-out infinite;
}

.project-card:hover .project-tech span {
    transform: translateY(-3px) scale(1.05);
    box-shadow: 0 5px 15px rgba(59, 130, 246, 0.5);
}

/* CTA Section - Energy Field */
.cta-section {
    background: linear-gradient(45deg, #667eea 0%, #764ba2 100%);
    position: relative;
    overflow: hidden;
}

.cta-section::before {
    content: '';
    position: absolute;
    top: -50%;
    left: -50%;
    width: 200%;
    height: 200%;
    background: radial-gradient(circle, rgba(255,255,255,0.1) 0%, transparent 70%);
    animation: magneticPulse 6s ease-in-out infinite;
}

.cta-section h2 {
    animation: neonGlow 3s ease-in-out infinite;
    position: relative;
    z-index: 2;
}

.cta-section .btn {
    background: linear-gradient(45deg, rgba(255,255,255,0.2), rgba(255,255,255,0.4));
    backdrop-filter: blur(20px);
    border: 2px solid rgba(255,255,255,0.3);
    color: white;
    position: relative;
    z-index: 2;
    transition: all 0.6s cubic-bezier(0.25, 0.46, 0.45, 0.94);
}

.cta-section .btn:hover {
    transform: scale(1.1) translateY(-5px);
    background: linear-gradient(45deg, rgba(255,255,255,0.4), rgba(255,255,255,0.6));
    box-shadow: 0 20px 40px rgba(255,255,255,0.3);
}

/* Responsive adjustments for hero */
@media (max-width: 992px) {
    .hero {
        background-size: cover, cover, 30px 30px;
        background-position: center, center, center;
    }
    
    .hero .container {
        flex-direction: column;
        justify-content: center;
        text-align: center;
    }
    
    .hero-content {
        margin-right: 0;
        margin-bottom: 30px;
        max-width: 100%;
        text-align: center;
    }
}

@media (max-width: 768px) {
    .hero {
        background-size: contain, cover, 25px 25px;
        min-height: 80vh;
    }
    
    .hero-content {
        padding: 20px;
        margin: 0 20px;
    }
    
    .hero-content h1 {
        font-size: 2.5rem;
    }
}

@media (max-width: 576px) {
    .hero {
        background-size: contain, cover, 20px 20px;
        min-height: 70vh;
    }
    
    .hero-content h1 {
        font-size: 2rem;
    }
    
    .hero-content {
        padding: 15px;
        margin: 0 15px;
    }
}

/* Accessibility - Respect reduced motion */
@media (prefers-reduced-motion: reduce) {
    * {
        animation-duration: 0.3s !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.3s !important;
    }
    
    .hero::before,
    .projects-showcase::before {
        animation: none !important;
    }
}