/* Animations and Effects for Artemis Website */

/* Define gold colors if not already defined in colors.css */
:root {
    --gold-light: var(--secondary-color, #ffd700);
    --gold-dark: var(--secondary-dark, #d4af37);
}

/* Fade In Animation */
@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Slide In Animation */
@keyframes slideIn {
    from {
        opacity: 0;
        transform: translateX(50px);
    }
    to {
        opacity: 1;
        transform: translateX(0);
    }
}

/* Zoom In Animation */
@keyframes zoomIn {
    from {
        opacity: 0;
        transform: scale(0.9);
    }
    to {
        opacity: 1;
        transform: scale(1);
    }
}

/* Glow Animation */
@keyframes glow {
    0% {
        box-shadow: 0 0 5px rgba(212, 168, 79, 0.3);
    }
    50% {
        box-shadow: 0 0 20px rgba(212, 168, 79, 0.6);
    }
    100% {
        box-shadow: 0 0 5px rgba(212, 168, 79, 0.3);
    }
}

/* Pulse Animation */
@keyframes pulse {
    0% {
        transform: scale(1);
    }
    50% {
        transform: scale(1.05);
    }
    100% {
        transform: scale(1);
    }
}

/* Float Animation */
@keyframes float {
    0%, 100% {
        transform: translateY(0);
    }
    50% {
        transform: translateY(-10px);
    }
}

/* Shimmer Animation */
@keyframes shimmer {
    0% {
        background-position: -100% 0;
    }
    100% {
        background-position: 100% 0;
    }
}

/* Scroll-triggered animations */
.animate-on-scroll {
    opacity: 0;
    transition: all 0.8s ease;
}

.animate-on-scroll.fade-in {
    animation: fadeIn 1s ease forwards;
}

.animate-on-scroll.slide-in {
    animation: slideIn 1s ease forwards;
}

.animate-on-scroll.zoom-in {
    animation: zoomIn 1s ease forwards;
}

/* Apply animations when element is visible */
.animate-on-scroll.visible {
    opacity: 1;
}

/* Hover effects for feature boxes */
.feature-box {
    transition: all 0.4s ease;
    overflow: hidden;
}

.feature-box:hover {
    transform: translateY(-15px);
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.12);
}

.feature-box::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 5px;
    background: linear-gradient(90deg, var(--primary-color), var(--secondary-color));
    transform: scaleX(0);
    transform-origin: right;
    transition: transform 0.4s ease;
}

.feature-box:hover::before {
    transform: scaleX(1);
    transform-origin: left;
}

.feature-icon {
    transition: all 0.4s ease;
}

.feature-box:hover .feature-icon {
    transform: scale(1.2);
    color: var(--secondary-color);
}

/* Gallery item hover effects */
.gallery-item {
    overflow: hidden;
    transition: all 0.5s ease;
}

.gallery-item:hover {
    transform: translateY(-10px);
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.2);
}

.gallery-item img {
    transition: transform 0.5s ease;
}

.gallery-item:hover img {
    transform: scale(1.1);
}

.gallery-item::after {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: linear-gradient(to top, rgba(10, 77, 140, 0.6), transparent);
    opacity: 0;
    transition: opacity 0.5s ease;
}

.gallery-item:hover::after {
    opacity: 1;
}

/* Button hover effects */
.btn {
    position: relative;
    overflow: hidden;
    transition: all 0.3s ease;
}

.btn:hover {
    transform: translateY(-3px);
    box-shadow: 0 10px 20px rgba(0, 0, 0, 0.2);
}

.btn::after {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 5px;
    height: 5px;
    background: rgba(255, 255, 255, 0.5);
    opacity: 0;
    border-radius: 100%;
    transform: scale(1, 1) translate(-50%);
    transform-origin: 50% 50%;
}

.btn:hover::after {
    animation: ripple 1s ease-out;
}

@keyframes ripple {
    0% {
        transform: scale(0, 0);
        opacity: 0.5;
    }
    100% {
        transform: scale(20, 20);
        opacity: 0;
    }
}

/* Parallax effect for hero section */
.hero {
    position: relative;
    overflow: hidden;
    background-attachment: fixed;
    background-position: center;
    background-repeat: no-repeat;
    background-size: cover;
}

.hero-parallax {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-image: url('../images/15.jpg');
    background-size: cover;
    background-position: center;
    transform: translateZ(-1px) scale(2);
    z-index: -1;
}

/* Shimmer effect for headings - improved for clarity */
.shimmer-text {
    position: relative;
    display: inline-block;
    background: linear-gradient(
        to right,
        var(--secondary-color) 0%,
        var(--secondary-dark) 20%, 
        var(--secondary-color) 40%,
        var(--secondary-dark) 60%,
        var(--secondary-color) 80%,
        var(--secondary-color) 100%
    );
    background-size: 200% auto;
    color: transparent;
    background-clip: text;
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    animation: shimmerAnimation 3s linear infinite;
    /* Reduced shadow blur for better clarity */
    text-shadow: 0 2px 8px rgba(0, 0, 0, 0.3);
    font-weight: 800;
    /* Improve rendering */
    transform: translateZ(0);
    backface-visibility: hidden;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

@keyframes shimmerAnimation {
    to {
        background-position: 200% center;
    }
}

/* Enhanced shimmer with lighter shadow for better clarity */
.dark-bg .shimmer-text,
.hero .shimmer-text,
.calculator-section .shimmer-text {
    text-shadow: 0 2px 10px rgba(0, 0, 0, 0.3), 0 0 3px rgba(212, 168, 79, 0.2);
    /* Add slight white outline for better legibility */
    filter: drop-shadow(0 0 1px rgba(255, 255, 255, 0.5));
}

.shimmer-text::after {
    display: none !important;
    content: none !important;
    animation: none !important;
    opacity: 0 !important;
    visibility: hidden !important;
}

/* Intersection Observer for scroll animations - Modified to be visible from start */
.js-scroll {
    opacity: 1; /* Changed from 0 to 1 to make visible from start */
    /* Removed transition for immediate visibility */
}

/* Remove the need for scrolled class */
.js-scroll.scrolled {
    opacity: 1;
}

/* Apply animations immediately without scroll */
.fade-in {
    opacity: 0;
    animation: fadeIn 1.2s cubic-bezier(0.22, 1, 0.36, 1) forwards;
}

.fade-in.delay-1 {
    animation-delay: 0.3s; /* Slight delay for staggered effect */
}

.fade-in.delay-2 {
    animation-delay: 0.6s;
}

.fade-in.delay-3 {
    animation-delay: 0.9s;
}

.slide-in-right {
    opacity: 0;
    animation: slideIn 1.2s cubic-bezier(0.22, 1, 0.36, 1) forwards;
}

.slide-in-left {
    opacity: 0;
    animation: slideInLeft 1.2s cubic-bezier(0.22, 1, 0.36, 1) forwards;
}

/* We keep the scrolled classes for backward compatibility but they don't change behavior */
.scrolled.fade-in {
    /* Animation already applied by .fade-in above */
}

.scrolled.slide-in-right {
    /* Animation already applied by .slide-in-right above */
}

.scrolled.slide-in-left {
    /* Animation already applied by .slide-in-left above */
}

@keyframes slideInLeft {
    from {
        opacity: 0;
        transform: translateX(-50px);
    }
    to {
        opacity: 1;
        transform: translateX(0);
    }
}

/* Floating elements */
.floating {
    animation: float 6s ease-in-out infinite;
}

/* Highlight effect for text */
.highlight-text {
    position: relative;
    display: inline-block;
}

.highlight-text::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 0;
    width: 100%;
    height: 30%;
    background-color: rgba(212, 168, 79, 0.3);
    z-index: -1;
    transform: scaleX(0);
    transform-origin: bottom right;
    transition: transform 0.5s ease;
}

.highlight-text:hover::after {
    transform: scaleX(1);
    transform-origin: bottom left;
}

/* Particle background */
#particles-js {
    position: absolute;
    width: 100%;
    height: 100%;
    top: 0;
    left: 0;
    z-index: -1;
}
