/* Animations CSS for Tongue Tonic website
 * These animations provide subtle section transitions and hover effects
 * across all pages of the website.
 * 
 * Enhanced with advanced page load animations and product-specific effects
 */

/* Fade-in animation for sections */
@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Slide-in from left animation */
@keyframes slideInLeft {
    from {
        opacity: 0;
        transform: translateX(-30px);
    }
    to {
        opacity: 1;
        transform: translateX(0);
    }
}

/* Slide-in from right animation */
@keyframes slideInRight {
    from {
        opacity: 0;
        transform: translateX(30px);
    }
    to {
        opacity: 1;
        transform: translateX(0);
    }
}

/* Scale-in animation */
@keyframes scaleIn {
    from {
        opacity: 0;
        transform: scale(0.95);
    }
    to {
        opacity: 1;
        transform: scale(1);
    }
}

/* Color pulse animation */
@keyframes colorPulse {
    0% {
        box-shadow: 0 0 0 0 rgba(0, 255, 255, 0.4);
    }
    70% {
        box-shadow: 0 0 0 15px rgba(0, 255, 255, 0);
    }
    100% {
        box-shadow: 0 0 0 0 rgba(0, 255, 255, 0);
    }
}

/* Apply animations to sections */
.animate-fade-in {
    animation: fadeIn 0.8s ease-out forwards;
    opacity: 0;
}

.animate-slide-left {
    animation: slideInLeft 0.8s ease-out forwards;
    opacity: 0;
}

.animate-slide-right {
    animation: slideInRight 0.8s ease-out forwards;
    opacity: 0;
}

.animate-scale-in {
    animation: scaleIn 0.8s ease-out forwards;
    opacity: 0;
}

/* Animation delays for staggered effects */
.delay-100 {
    animation-delay: 0.1s;
}

.delay-200 {
    animation-delay: 0.2s;
}

.delay-300 {
    animation-delay: 0.3s;
}

.delay-400 {
    animation-delay: 0.4s;
}

.delay-500 {
    animation-delay: 0.5s;
}

/* Product fade-in animation */
@keyframes productFadeIn {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.fade-in-product {
    opacity: 0;
    animation: productFadeIn 0.8s ease-out forwards;
}

/* Intersection Observer for scroll-based animations */
.reveal {
    opacity: 0;
    transform: translateY(30px);
    transition: all 0.8s ease;
}

.reveal.active {
    opacity: 1;
    transform: translateY(0);
}

/* Scroll Animation Classes */
.scroll-fade-in {
    opacity: 0;
    transform: translateY(30px);
    transition: opacity 0.8s ease, transform 0.8s ease;
}

.scroll-fade-in.visible {
    opacity: 1;
    transform: translateY(0);
}

.scroll-fade-in-left {
    opacity: 0;
    transform: translateX(-30px);
    transition: opacity 0.8s ease, transform 0.8s ease;
}

.scroll-fade-in-left.visible {
    opacity: 1;
    transform: translateX(0);
}

.scroll-fade-in-right {
    opacity: 0;
    transform: translateX(30px);
    transition: opacity 0.8s ease, transform 0.8s ease;
}

.scroll-fade-in-right.visible {
    opacity: 1;
    transform: translateX(0);
}

/* Make sure sections without JS still show */
@media (prefers-reduced-motion: reduce) {
    .reveal, .scroll-fade-in, .scroll-fade-in-left, .scroll-fade-in-right {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Hover animations */
.hover-lift {
    transition: transform 0.3s ease, box-shadow 0.3s ease;
}

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

.hover-glow {
    transition: box-shadow 0.3s ease;
}

.hover-glow:hover {
    box-shadow: 0 0 15px rgba(0, 255, 255, 0.5);
}

.hover-pulse {
    animation: colorPulse 2s infinite;
}

/* Button animations */
.button {
    transition: all 0.3s ease;
    position: relative;
    overflow: hidden;
}

.button::after {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(
        90deg,
        rgba(255, 255, 255, 0) 0%,
        rgba(255, 255, 255, 0.2) 50%,
        rgba(255, 255, 255, 0) 100%
    );
    transition: left 0.6s ease;
}

.button:hover::after {
    left: 100%;
}

/* NEW PRODUCT PAGE LOADING ANIMATIONS */
@keyframes pageReveal {
    0% {
        opacity: 0;
        transform: translateY(10px);
    }
    100% {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes productFloat {
    0% {
        transform: translateY(0px);
    }
    50% {
        transform: translateY(-10px);
    }
    100% {
        transform: translateY(0px);
    }
}

@keyframes glowPulse {
    0% {
        text-shadow: 0 0 5px rgba(255, 255, 255, 0.1);
    }
    50% {
        text-shadow: 0 0 15px rgba(255, 255, 255, 0.4);
    }
    100% {
        text-shadow: 0 0 5px rgba(255, 255, 255, 0.1);
    }
}

/* Energy product specific animations */
@keyframes energyGlow {
    0% {
        text-shadow: 0 0 5px rgba(255, 215, 0, 0.1);
    }
    50% {
        text-shadow: 0 0 20px rgba(255, 215, 0, 0.5);
    }
    100% {
        text-shadow: 0 0 5px rgba(255, 215, 0, 0.1);
    }
}

/* Relax product specific animations */
@keyframes relaxGlow {
    0% {
        text-shadow: 0 0 5px rgba(76, 165, 255, 0.1);
    }
    50% {
        text-shadow: 0 0 20px rgba(76, 165, 255, 0.5);
    }
    100% {
        text-shadow: 0 0 5px rgba(76, 165, 255, 0.1);
    }
}

/* Euphoria product specific animations */
@keyframes euphoriaGlow {
    0% {
        text-shadow: 0 0 5px rgba(162, 86, 229, 0.1);
    }
    50% {
        text-shadow: 0 0 20px rgba(162, 86, 229, 0.5);
    }
    100% {
        text-shadow: 0 0 5px rgba(162, 86, 229, 0.1);
    }
}

/* Socialize product specific animations */
@keyframes socializeGlow {
    0% {
        text-shadow: 0 0 5px rgba(255, 122, 69, 0.1);
    }
    50% {
        text-shadow: 0 0 20px rgba(255, 122, 69, 0.5);
    }
    100% {
        text-shadow: 0 0 5px rgba(255, 122, 69, 0.1);
    }
}

/* Apply product glow animations */
.energy-highlight {
    animation: energyGlow 3s infinite;
}

.relax-highlight {
    animation: relaxGlow 3s infinite;
}

.euphoria-highlight {
    animation: euphoriaGlow 3s infinite;
}

.social-highlight {
    animation: socializeGlow 3s infinite;
}

/* Product bottle floating effect */
.product-image-container img {
    animation: productFloat 6s ease-in-out infinite;
}

/* Staggered Page Load Animations */
.page-fade-in {
    animation: pageReveal 0.8s ease-out forwards;
    opacity: 0;
}

/* Shop page staggered product grid animations */
.product-grid-item {
    opacity: 0;
    transform: translateY(20px);
    transition: all 0.6s ease;
}

.product-grid-item.loaded {
    opacity: 1;
    transform: translateY(0);
}

/* Blog list animation */
.blog-card {
    opacity: 0;
    transform: translateY(30px);
    transition: all 0.5s cubic-bezier(0.4, 0, 0.2, 1);
}

.blog-card.loaded {
    opacity: 1;
    transform: translateY(0);
}

/* Product hero highlight */
@keyframes heroHighlight {
    0% {
        background-position: 0% 50%;
    }
    50% {
        background-position: 100% 50%;
    }
    100% {
        background-position: 0% 50%;
    }
}

/* Footer animations */
@keyframes footerLinkFloat {
    0% {
        transform: translateY(0);
    }
    50% {
        transform: translateY(-3px);
    }
    100% {
        transform: translateY(0);
    }
}

.footer-list-item {
    transition: transform 0.3s ease;
    opacity: 0;
    transform: translateY(10px);
    transition: opacity 0.5s ease, transform 0.5s ease;
}

.footer-list-item.visible {
    opacity: 1;
    transform: translateY(0);
}

.footer-list-item:hover {
    transform: translateX(5px);
}

.footer-list-item a {
    position: relative;
}

.footer-list-item a::after {
    content: '';
    position: absolute;
    bottom: -2px;
    left: 0;
    width: 0;
    height: 1px;
    background-color: #00FFFF;
    transition: width 0.3s ease;
}

.footer-list-item a:hover::after {
    width: 100%;
}

/* Secondary footer animations */
.discount-section, .affiliate-section {
    position: relative;
    overflow: hidden;
}

.discount-section::before, .affiliate-section::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 200%;
    height: 100%;
    background: linear-gradient(90deg, 
        rgba(255,255,255,0) 0%, 
        rgba(255,255,255,0.1) 50%, 
        rgba(255,255,255,0) 100%);
    animation: secondaryHighlight 8s ease-in-out infinite;
    pointer-events: none;
}

@keyframes secondaryHighlight {
    0% { left: -100%; }
    100% { left: 100%; }
}

.discount-button, .affiliate-button {
    position: relative;
    overflow: hidden;
}

.discount-button::after, .affiliate-button::after {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, 
        rgba(255,255,255,0) 0%, 
        rgba(255,255,255,0.2) 50%, 
        rgba(255,255,255,0) 100%);
    transition: left 0.6s ease;
}

.discount-button:hover::after, .affiliate-button:hover::after {
    left: 100%;
}

.product-hero::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: linear-gradient(120deg, rgba(0,0,0,0) 0%, rgba(255,255,255,0.03) 50%, rgba(0,0,0,0) 100%);
    background-size: 200% 200%;
    animation: heroHighlight 15s ease infinite;
    pointer-events: none;
}

/* Product Glow Effects for Homepage */
.product-card {
    position: relative;
    overflow: visible;
}

.product-card .product-image {
    position: relative;
    z-index: 10; /* Higher z-index to appear above the glow */
    transition: transform 0.5s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

.product-card:hover .product-image {
    transform: translateY(-15px);
}

/* Product cards positioning */
.product-card {
    position: relative;
}

/* Glow effects for homepage products */
.product-glow {
    position: absolute;
    top: 30%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 300px;
    height: 300px;
    border-radius: 50%;
    z-index: 1;
    filter: blur(35px);
    pointer-events: none;
    opacity: 0.7;
    transition: opacity 0.3s ease;
}

.product-card:hover .product-glow {
    opacity: 1;
}

/* Energy product glow (yellow) */
.product-glow.yellow {
    background: radial-gradient(circle, rgba(255, 204, 0, 0.7) 0%, rgba(255, 204, 0, 0) 65%);
}

/* Relax product glow (blue) */
.product-glow.blue {
    background: radial-gradient(circle, rgba(76, 165, 255, 0.7) 0%, rgba(76, 165, 255, 0) 65%);
}

/* Euphoria product glow (purple) */
.product-glow.purple {
    background: radial-gradient(circle, rgba(162, 86, 229, 0.7) 0%, rgba(162, 86, 229, 0) 65%);
}

/* Socialize product glow (orange) */
.product-glow.orange {
    background: radial-gradient(circle, rgba(255, 122, 69, 0.7) 0%, rgba(255, 122, 69, 0) 65%);
}

/* Shop page product glow effects */
.product-row {
    position: relative;
}

.product-row-image {
    position: relative;
}

.product-row .product-glow {
    top: 50%;
    left: 50%;
    width: 200px;
    height: 200px;
}