/**
 * Immersive Effects CSS
 * Premium visual effects and enhancements for Vanguard Crux
 */

/* Enhanced Hero Section with Particle Canvas */
.hero-section {
    position: relative;
    overflow: hidden;
    background: linear-gradient(135deg, var(--bg-dark) 0%, #0f2444 50%, var(--bg-dark) 100%);
}

.hero-particles-container {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 1;
}

#hero-particles {
    width: 100%;
    height: 100%;
    display: block;
}

.hero-content {
    position: relative;
    z-index: 2;
}

/* Dynamic Background Gradients */
.hero-section::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: 
        radial-gradient(circle at 20% 80%, rgba(100, 255, 218, 0.08) 0%, transparent 50%),
        radial-gradient(circle at 80% 20%, rgba(100, 255, 218, 0.06) 0%, transparent 50%);
    animation: gradientShift 20s ease-in-out infinite;
    z-index: 0;
}

@keyframes gradientShift {
    0%, 100% {
        transform: scale(1) rotate(0deg);
        opacity: 1;
    }
    50% {
        transform: scale(1.1) rotate(180deg);
        opacity: 0.8;
    }
}

/* Enhanced Text Effects */
.hero-title {
    background: linear-gradient(135deg, var(--text-lightest) 0%, var(--accent) 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    text-shadow: 0 0 30px rgba(100, 255, 218, 0.3);
    position: relative;
}

.hero-title::after {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: linear-gradient(90deg, transparent 0%, rgba(100, 255, 218, 0.4) 50%, transparent 100%);
    transform: translateX(-100%);
    animation: shimmer 3s ease-in-out infinite;
}

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

/* Hero Slogan Styling */
.hero-slogan {
    text-shadow: 0 0 30px rgba(100, 255, 218, 0.4);
    position: relative;
}

/* Hero Tagline Styling */
.hero-tagline {
    position: relative;
}

/* Premium Service Cards */
.service-card {
    position: relative;
    background: linear-gradient(135deg, var(--bg-light-navy) 0%, rgba(16, 34, 64, 0.8) 100%);
    border: 1px solid rgba(100, 255, 218, 0.1);
    border-radius: 12px;
    overflow: hidden;
    transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
    cursor: pointer;
}

.service-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(100, 255, 218, 0.1), transparent);
    transition: left 0.6s;
}

.service-card:hover::before {
    left: 100%;
}

.service-card:hover {
    border-color: rgba(100, 255, 218, 0.3);
    box-shadow: 
        0 20px 40px rgba(0, 0, 0, 0.3),
        0 0 40px rgba(100, 255, 218, 0.1);
    transform: translateY(-8px);
}

.service-icon {
    position: relative;
    background: radial-gradient(circle, rgba(100, 255, 218, 0.2) 0%, rgba(100, 255, 218, 0.05) 100%);
    backdrop-filter: blur(10px);
    transition: all 0.4s ease;
}

.service-card:hover .service-icon {
    background: radial-gradient(circle, rgba(100, 255, 218, 0.3) 0%, rgba(100, 255, 218, 0.1) 100%);
    box-shadow: 0 0 30px rgba(100, 255, 218, 0.4);
}

/* Morphing Geometric Shapes */
.geometric-shape {
    position: absolute;
    background: linear-gradient(45deg, rgba(100, 255, 218, 0.1), rgba(100, 255, 218, 0.05));
    transition: all 0.8s cubic-bezier(0.4, 0, 0.2, 1);
}

.geometric-shape.circle {
    border-radius: 50%;
    width: 100px;
    height: 100px;
}

.geometric-shape.square {
    border-radius: 10px;
    width: 80px;
    height: 80px;
}

.geometric-shape:hover {
    transform: rotate(180deg) scale(1.2);
    background: linear-gradient(45deg, rgba(100, 255, 218, 0.2), rgba(100, 255, 218, 0.1));
}

/* Enhanced Button Effects */
.btn-primary {
    position: relative;
    background: transparent;
    border: 2px solid var(--accent);
    color: var(--accent);
    overflow: hidden;
    z-index: 1;
    transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
}

.btn-primary::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, var(--accent), transparent);
    opacity: 0.1;
    transition: left 0.6s;
    z-index: -1;
}

.btn-primary:hover::before {
    left: 100%;
}

.btn-primary:hover {
    background: rgba(100, 255, 218, 0.1);
    box-shadow: 
        0 0 20px rgba(100, 255, 218, 0.4),
        inset 0 0 20px rgba(100, 255, 218, 0.1);
    transform: translateY(-2px);
}

/* Section Wave Transitions */
.section-wave {
    position: absolute;
    top: -1px;
    left: 0;
    width: 100%;
    height: 100px;
    overflow: hidden;
    z-index: 1;
}

.section-wave svg {
    width: calc(100% + 1.3px);
    height: 100%;
}

.section-wave path {
    fill: var(--accent);
    opacity: 0.1;
    animation: waveAnimation 8s ease-in-out infinite;
    transform-origin: center;
}

@keyframes waveAnimation {
    0%, 100% {
        transform: scaleX(1) translateY(0);
        opacity: 0.1;
    }
    25% {
        transform: scaleX(1.02) translateY(-2px);
        opacity: 0.15;
    }
    50% {
        transform: scaleX(0.98) translateY(2px);
        opacity: 0.08;
    }
    75% {
        transform: scaleX(1.01) translateY(-1px);
        opacity: 0.12;
    }
}

/* Alternative wave animation for different sections */
#solutions .section-wave path {
    animation: waveAnimation2 6s ease-in-out infinite;
}

@keyframes waveAnimation2 {
    0%, 100% {
        transform: scaleY(1) skewX(0deg);
        opacity: 0.1;
    }
    33% {
        transform: scaleY(1.1) skewX(1deg);
        opacity: 0.15;
    }
    66% {
        transform: scaleY(0.9) skewX(-1deg);
        opacity: 0.08;
    }
}

/* Parallax Background Elements */
.parallax-element {
    position: absolute;
    background: radial-gradient(circle, rgba(100, 255, 218, 0.08) 0%, transparent 70%);
    border-radius: 50%;
    z-index: -1;
    animation: float 8s ease-in-out infinite;
}

.parallax-element.large {
    width: 300px;
    height: 300px;
    top: 10%;
    right: 5%;
    animation-delay: 0s;
}

.parallax-element.medium {
    width: 200px;
    height: 200px;
    top: 60%;
    left: 10%;
    animation-delay: -2s;
}

.parallax-element.small {
    width: 150px;
    height: 150px;
    top: 80%;
    right: 20%;
    animation-delay: -4s;
}

@keyframes float {
    0%, 100% {
        transform: translateY(0px) rotate(0deg);
        opacity: 0.6;
    }
    50% {
        transform: translateY(-20px) rotate(180deg);
        opacity: 0.8;
    }
}

/* Enhanced Form Styling */
input, textarea {
    background: rgba(16, 34, 64, 0.6);
    border: 1px solid rgba(100, 255, 218, 0.2);
    border-radius: 8px;
    color: var(--text-light);
    padding: 16px;
    transition: all 0.3s ease;
    backdrop-filter: blur(10px);
}

input:focus, textarea:focus {
    outline: none;
    border-color: var(--accent);
    box-shadow: 
        0 0 0 2px rgba(100, 255, 218, 0.2),
        0 0 20px rgba(100, 255, 218, 0.1);
    background: rgba(16, 34, 64, 0.8);
}

input::placeholder, textarea::placeholder {
    color: rgba(205, 214, 246, 0.6);
}

/* Enhanced Footer */
footer {
    position: relative;
    background: linear-gradient(135deg, var(--bg-dark) 0%, #051426 100%);
    border-top: 1px solid rgba(100, 255, 218, 0.1);
}

footer::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 1px;
    background: linear-gradient(90deg, transparent, var(--accent), transparent);
    opacity: 0.5;
}

/* Loading Animation for Particle System */
.particles-loading {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    z-index: 2;
}

.particles-loading::before {
    content: '';
    width: 40px;
    height: 40px;
    border: 3px solid rgba(100, 255, 218, 0.3);
    border-top: 3px solid var(--accent);
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

/* Responsive Adjustments */
@media (max-width: 768px) {
    .hero-title::after {
        display: none;
    }
    
    .parallax-element {
        display: none;
    }
    
    .service-card:hover {
        transform: translateY(-4px);
    }
    
    .geometric-shape:hover {
        transform: rotate(90deg) scale(1.1);
    }
}

/* Reduced Motion Support */
@media (prefers-reduced-motion: reduce) {
    *,
    *::before,
    *::after {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
    }
    
    .hero-title::after,
    .parallax-element,
    .section-wave {
        display: none;
    }
    
    .service-card:hover {
        transform: none;
    }
}

/* High Contrast Mode Support */
@media (prefers-contrast: high) {
    .service-card {
        border-width: 2px;
        border-color: var(--accent);
    }
    
    .btn-primary {
        border-width: 3px;
    }
}