/* ==========================================================================
   Common Animations and Effects for Product Pages
   ========================================================================== */

/* ==========================================================================
   1. Loading and Initial Effects
   ========================================================================== */

/* Loading Overlay */
.loading-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: #000;
    z-index: 9999;
    display: flex;
    justify-content: center;
    align-items: center;
    transition: opacity 0.5s ease-out;
}

.loading-spinner {
    width: 50px;
    height: 50px;
    border: 3px solid transparent;
    border-top-color: red;
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

/* Scroll Progress Bar */
.scroll-progress {
    position: fixed;
    top: 0;
    left: 0;
    width: 0%;
    height: 3px;
    background: linear-gradient(to right, #ff0000, #ff3333);
    z-index: 1001;
    transition: width 0.2s ease-out;
}

/* Background Container */
.background-container {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 0;
    background-size: cover;
    background-position: center;
    background-repeat: no-repeat;
    background-attachment: fixed;
    opacity: 0.5;
    transition: opacity 0.5s ease-out;
}

.background-container::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: linear-gradient(
        to bottom,
        rgba(0, 0, 0, 0.4),
        rgba(0, 0, 0, 0.2),
        rgba(0, 0, 0, 0.4)
    );
    z-index: 0;
}

/* ==========================================================================
   2. Text Animations
   ========================================================================== */

/* Glowing Text Effect */
.glow-text {
    text-shadow: 0 0 10px rgba(255, 0, 0, 0.5);
    animation: glowPulse 3s ease-in-out infinite;
}

@keyframes glowPulse {
    0%, 100% { 
        text-shadow: 0 0 10px rgba(255, 0, 0, 0.5);
        transform: scale(1);
    }
    50% { 
        text-shadow: 0 0 30px rgba(255, 0, 0, 1), 0 0 50px rgba(255, 0, 0, 0.5);
        transform: scale(1.05);
    }
}

/* Typing Text Animation */
.typing-text {
    overflow: hidden;
    border-right: 2px solid red;
    white-space: nowrap;
    margin: 0 auto;
    animation: typing 3.5s steps(40, end), blink-caret 0.75s step-end infinite;
}

@keyframes typing {
    from { width: 0 }
    to { width: 100% }
}

@keyframes blink-caret {
    from, to { border-color: transparent }
    50% { border-color: red }
}

/* ==========================================================================
   3. Entry Animations
   ========================================================================== */

/* Fade In */
.fade-in {
    animation: fadeIn 0.8s ease-out;
}

@keyframes fadeIn {
    from { 
        opacity: 0;
        transform: translateY(20px);
    }
    to { 
        opacity: 1;
        transform: translateY(0);
    }
}

/* Slide In Left */
.slide-in-left {
    animation: slideInLeft 0.8s ease-out;
}

@keyframes slideInLeft {
    from {
        opacity: 0;
        transform: translateX(-100px);
    }
    to {
        opacity: 1;
        transform: translateX(0);
    }
}

/* Slide In Right */
.slide-in-right {
    animation: slideInRight 0.8s ease-out;
}

@keyframes slideInRight {
    from {
        opacity: 0;
        transform: translateX(100px);
    }
    to {
        opacity: 1;
        transform: translateX(0);
    }
}

/* Zoom In */
.zoom-in {
    animation: zoomIn 0.8s ease-out;
}

@keyframes zoomIn {
    from {
        opacity: 0;
        transform: scale(0.8);
    }
    to {
        opacity: 1;
        transform: scale(1);
    }
}

/* Bounce */
.bounce {
    animation: bounce 2s infinite;
}

@keyframes bounce {
    0%, 20%, 50%, 80%, 100% {
        transform: translateY(0);
    }
    40% {
        transform: translateY(-8px);
    }
    60% {
        transform: translateY(-4px);
    }
}

/* ==========================================================================
   4. Interactive Effects
   ========================================================================== */

/* Float Effect for Product Images */
.float-effect {
    animation: float 3s ease-in-out infinite;
    filter: drop-shadow(0 0 30px rgba(255, 0, 0, 0.4));
    will-change: transform;
}

@keyframes float {
    0% { transform: translateY(0); }
    50% { transform: translateY(-20px); }
    100% { transform: translateY(0); }
}

/* Tilt Effect */
.tilt-effect {
    transform-style: preserve-3d;
    perspective: 1000px;
    transition: transform 0.5s ease;
}

/* Ripple Effect for Buttons */
.ripple {
    position: relative;
    overflow: hidden;
}

.ripple:after {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 0;
    height: 0;
    background: rgba(255, 255, 255, 0.4);
    border-radius: 50%;
    transform: translate(-50%, -50%);
    transition: width 0.6s ease-out, height 0.6s ease-out;
    opacity: 0;
}

.ripple:active:after {
    width: 300px;
    height: 300px;
    opacity: 1;
    transition: 0s;
}

/* Gradient Border Animation */
.gradient-border {
    position: relative;
    background: rgba(0, 0, 0, 0.5);
    border-radius: 10px;
    z-index: 1;
}

.gradient-border::before {
    content: '';
    position: absolute;
    top: -2px;
    left: -2px;
    right: -2px;
    bottom: -2px;
    background: linear-gradient(45deg, #ff0000, #ff6b6b, #ff0000);
    z-index: -1;
    border-radius: 12px;
    animation: gradientBorder 3s linear infinite;
}

@keyframes gradientBorder {
    0% { background-position: 0% 50%; }
    50% { background-position: 100% 50%; }
    100% { background-position: 0% 50%; }
}

/* List Item Hover Effects */
.gradient-border li {
    transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
    position: relative;
    overflow: hidden;
}

.gradient-border li:hover {
    transform: translateX(30px) scale(1.05);
    background: rgba(0, 0, 0, 0.8);
    border-left: 5px solid red;
    box-shadow: 0 0 30px rgba(255, 0, 0, 0.3);
}

.gradient-border li::after {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255, 0, 0, 0.2), transparent);
    transition: 0.5s;
}

.gradient-border li:hover::after {
    left: 100%;
}

/* WhatsApp Float Button */
.whatsapp-float {
    position: fixed;
    bottom: 40px;
    right: 40px;
    background-color: #25d366;
    color: white;
    border-radius: 50px;
    text-align: center;
    font-size: 16px;
    box-shadow: 2px 2px 3px rgba(0,0,0,0.25);
    z-index: 1000;
    display: flex;
    align-items: center;
    padding: 15px 25px;
    text-decoration: none;
    transform: scale(1);
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.whatsapp-float:hover {
    transform: scale(1.1) translateY(-5px);
    background-color: #128C7E;
    color: white;
    box-shadow: 0 10px 20px rgba(0,0,0,0.3);
}

/* ==========================================================================
   5. Scroll-based Effects
   ========================================================================== */

/* Header Show/Hide */
header.transparent {
    transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
}

/* Product Image Container Effects */
.product-image-container {
    perspective: 1500px;
    margin: 20px;
    position: relative;
    transform-style: preserve-3d;
}

.product-image-container::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: radial-gradient(circle at center, rgba(255,0,0,0.2) 0%, transparent 70%);
    filter: blur(20px);
    animation: pulsingGlow 2s ease-in-out infinite;
    z-index: -1;
}

@keyframes pulsingGlow {
    0%, 100% { opacity: 0.3; transform: scale(0.8); }
    50% { opacity: 0.8; transform: scale(1.2); }
}

/* ==========================================================================
   6. Media Queries
   ========================================================================== */

@media (max-width: 768px) {
    .whatsapp-float {
        bottom: 20px;
        right: 20px;
        padding: 10px 20px;
    }

    .gradient-border li:hover {
        transform: translateX(10px) scale(1.02);
    }
} 