/* ===================================
   ANIMATIONS.CSS - Outstanding Animations
   =================================== */

/* ===================================
   LOADING SCREEN
   =================================== */
.loading-screen {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: var(--burgundy);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 99999;
    transition: opacity 0.5s ease, visibility 0.5s ease;
}

.loading-screen.hidden {
    opacity: 0;
    visibility: hidden;
}

.loader {
    text-align: center;
}

.loader-icon {
    width: 80px;
    height: 80px;
    animation: pulse 1.5s ease-in-out infinite;
}

/* ===================================
   SCROLL PROGRESS BAR
   =================================== */
.progress-bar {
    position: fixed;
    top: 0;
    left: 0;
    height: 3px;
    background: linear-gradient(90deg, var(--yellow), #ffd333);
    width: 0%;
    z-index: 9999;
    transition: width 0.1s ease;
}

/* ===================================
   SCROLL INDICATOR
   =================================== */
.scroll-indicator {
    position: absolute;
    bottom: 10px;
    left: 50%;
    transform: translateX(-50%);
    z-index: 10;
}

.scroll-indicator span {
    display: block;
    width: 24px;
    height: 40px;
    border: 2px solid var(--yellow);
    border-radius: 20px;
    position: relative;
}

.scroll-indicator span::before {
    content: '';
    position: absolute;
    top: 8px;
    left: 50%;
    width: 4px;
    height: 8px;
    background: var(--yellow);
    border-radius: 2px;
    transform: translateX(-50%);
    animation: scrollDown 2s infinite;
}

/* ===================================
   ENTRANCE ANIMATIONS
   =================================== */
@keyframes fadeIn {
    from {
        opacity: 0;
    }
    to {
        opacity: 1;
    }
}

@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(40px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes fadeInDown {
    from {
        opacity: 0;
        transform: translateY(-40px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

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

@keyframes fadeInRight {
    from {
        opacity: 0;
        transform: translateX(40px);
    }
    to {
        opacity: 1;
        transform: translateX(0);
    }
}

@keyframes zoomIn {
    from {
        opacity: 0;
        transform: scale(0.3);
    }
    to {
        opacity: 1;
        transform: scale(1);
    }
}

@keyframes bounceIn {
    0% {
        opacity: 0;
        transform: scale(0.3);
    }
    50% {
        opacity: 1;
        transform: scale(1.05);
    }
    70% {
        transform: scale(0.9);
    }
    100% {
        transform: scale(1);
    }
}

@keyframes rotateIn {
    from {
        opacity: 0;
        transform: rotate(-200deg) scale(0);
    }
    to {
        opacity: 1;
        transform: rotate(0) scale(1);
    }
}

/* ===================================
   CONTINUOUS ANIMATIONS
   =================================== */
@keyframes float {
    0%, 100% {
        transform: translateY(0px);
    }
    50% {
        transform: translateY(-20px);
    }
}

@keyframes pulse {
    0%, 100% {
        transform: scale(1);
        opacity: 1;
    }
    50% {
        transform: scale(1.1);
        opacity: 0.8;
    }
}

@keyframes rotate {
    from {
        transform: rotate(0deg);
    }
    to {
        transform: rotate(360deg);
    }
}

@keyframes bounce {
    0%, 100% {
        transform: rotate(-45deg) translateY(0);
    }
    50% {
        transform: rotate(-45deg) translateY(-10px);
    }
}

@keyframes scrollDown {
    0% {
        opacity: 0;
        top: 8px;
    }
    50% {
        opacity: 1;
    }
    100% {
        opacity: 0;
        top: 20px;
    }
}

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

@keyframes slideInRight {
    from {
        opacity: 0;
        transform: translateX(100px) translateY(-50%);
    }
    to {
        opacity: 1;
        transform: translateX(0) translateY(-50%);
    }
}

/* ===================================
   BUTTON ANIMATIONS
   =================================== */
.btn-glow {
    position: relative;
    overflow: hidden;
    transition: all 0.3s ease;
}

.btn-glow::before {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 0;
    height: 0;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.3);
    transform: translate(-50%, -50%);
    transition: width 0.6s ease, height 0.6s ease;
}

.btn-glow:hover::before {
    width: 300px;
    height: 300px;
}

.btn-glow:hover {
    transform: translateY(-3px);
    box-shadow: 0 10px 25px rgba(255, 222, 89, 0.5);
}

.btn-glow:active {
    transform: translateY(-1px);
    box-shadow: 0 5px 15px rgba(255, 222, 89, 0.4);
}

/* ===================================
   CARD HOVER EFFECTS
   =================================== */
.card-hover-3d {
    transition: all 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275);
    position: relative;
}

.card-hover-3d:hover {
    transform: translateY(-10px) rotateX(5deg);
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.2);
}

.card-shine {
    position: absolute;
    top: 0;
    left: -100%;
    width: 50%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.3), transparent);
    transition: left 0.5s ease;
}

.card-hover-3d:hover .card-shine {
    left: 100%;
}

.card-hover-lift {
    transition: all 0.3s ease;
}

.card-hover-lift:hover {
    transform: translateY(-10px);
    box-shadow: 0 15px 35px rgba(0, 0, 0, 0.15);
}

/* ===================================
   PRODUCT OVERLAY EFFECT
   =================================== */
.product-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(79, 5, 6, 0.9);
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    transition: opacity 0.4s ease;
}

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

.view-details {
    color: var(--yellow);
    font-weight: 700;
    font-size: 16px;
    letter-spacing: 1px;
    transform: translateY(20px);
    transition: transform 0.4s ease;
}

.product-card:hover .view-details {
    transform: translateY(0);
}

/* ===================================
   PARALLAX EFFECTS
   =================================== */
.parallax-element {
    transition: transform 0.5s cubic-bezier(0.25, 0.46, 0.45, 0.94);
}

/* ===================================
   HERO BACKGROUND ANIMATION
   =================================== */
.hero-background-animation {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: radial-gradient(circle at 50% 50%, rgba(255, 222, 89, 0.05) 0%, transparent 50%);
    animation: pulseBackground 8s ease-in-out infinite;
    pointer-events: none;
}

@keyframes pulseBackground {
    0%, 100% {
        transform: scale(1);
        opacity: 0.3;
    }
    50% {
        transform: scale(1.1);
        opacity: 0.5;
    }
}

/* ===================================
   MAP PIN PULSE ANIMATION
   =================================== */
.pulse-animation::before {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 100%;
    height: 100%;
    border: 2px solid var(--yellow);
    border-radius: 50%;
    animation: pulsePing 2s cubic-bezier(0, 0, 0.2, 1) infinite;
}

@keyframes pulsePing {
    0% {
        transform: translate(-50%, -50%) scale(1);
        opacity: 1;
    }
    100% {
        transform: translate(-50%, -50%) scale(2.5);
        opacity: 0;
    }
}

.pin-tooltip {
    position: absolute;
    bottom: 100%;
    left: 50%;
    transform: translateX(-50%) translateY(-10px);
    background: var(--burgundy);
    color: var(--yellow);
    padding: 8px 15px;
    border-radius: 5px;
    font-size: 12px;
    font-weight: 600;
    white-space: nowrap;
    opacity: 0;
    pointer-events: none;
    transition: all 0.3s ease;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.2);
}

.pin-tooltip::after {
    content: '';
    position: absolute;
    top: 100%;
    left: 50%;
    transform: translateX(-50%);
    border: 6px solid transparent;
    border-top-color: var(--burgundy);
}

.map-pin:hover .pin-tooltip {
    opacity: 1;
    transform: translateX(-50%) translateY(-20px);
}

/* ===================================
   SCROLL REVEAL ANIMATIONS
   =================================== */
/* Prevent flashing on scroll - elements stay visible */
[data-animate] {
    opacity: 1 !important; /* Always visible to prevent flash */
    transition: transform 0.6s ease, opacity 0.6s ease;
}

/* When animated class is added, just do subtle transform */
[data-animate].animated {
    animation: none; /* Disable animations to prevent flashing */
}

[data-animate="fadeIn"].animated {
    animation-name: fadeIn;
}

[data-animate="fadeInUp"].animated {
    animation-name: fadeInUp;
}

[data-animate="fadeInDown"].animated {
    animation-name: fadeInDown;
}

[data-animate="fadeInLeft"].animated {
    animation-name: fadeInLeft;
}

[data-animate="fadeInRight"].animated {
    animation-name: fadeInRight;
}

[data-animate="zoomIn"].animated {
    animation-name: zoomIn;
}

[data-animate="bounceIn"].animated {
    animation-name: bounceIn;
}

[data-animate="rotateIn"].animated {
    animation-name: rotateIn;
}

/* Animation delays */
[data-delay="0.1"].animated { animation-delay: 0.1s; }
[data-delay="0.2"].animated { animation-delay: 0.2s; }
[data-delay="0.3"].animated { animation-delay: 0.3s; }
[data-delay="0.4"].animated { animation-delay: 0.4s; }
[data-delay="0.5"].animated { animation-delay: 0.5s; }
[data-delay="0.6"].animated { animation-delay: 0.6s; }
[data-delay="0.7"].animated { animation-delay: 0.7s; }
[data-delay="0.8"].animated { animation-delay: 0.8s; }

/* ===================================
   MAGNETIC HOVER EFFECT (for buttons)
   =================================== */
.btn-primary,
.btn-secondary {
    transition: all 0.3s cubic-bezier(0.25, 0.46, 0.45, 0.94);
}

/* ===================================
   TEXT GRADIENT ANIMATION
   =================================== */
.hero-title {
    background: linear-gradient(45deg, var(--yellow), #ffd333, var(--yellow));
    background-size: 200% 200%;
    -webkit-background-clip: text;
    background-clip: text;
    animation: gradientShift 5s ease infinite;
}

@keyframes gradientShift {
    0%, 100% {
        background-position: 0% 50%;
    }
    50% {
        background-position: 100% 50%;
    }
}

/* ===================================
   STAGGER ANIMATION FOR LISTS
   =================================== */
.nav-menu li {
    animation-fill-mode: both;
}

/* ===================================
   SMOOTH TRANSITIONS
   =================================== */
* {
    transition-property: transform, opacity, background-color, color, box-shadow;
}

/* ===================================
   REDUCE MOTION FOR ACCESSIBILITY
   =================================== */
@media (prefers-reduced-motion: reduce) {
    *,
    *::before,
    *::after {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
        scroll-behavior: auto !important;
    }
    
    .parallax-element {
        transform: none !important;
    }
    
    .hero-background-animation {
        animation: none !important;
    }
}

/* ===================================
   IMAGE LOADING ANIMATION
   =================================== */
/* Images load cleanly without background shimmer */
img {
    transition: opacity 0.3s ease;
    background: transparent; /* No shimmer background */
}

img.loaded {
    opacity: 1;
}

@keyframes shimmer {
    0% {
        background-position: -200% 0;
    }
    100% {
        background-position: 200% 0;
    }
}

/* ===================================
   SECTION REVEAL EFFECTS
   =================================== */
section {
    position: relative;
}

section::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 0;
    height: 2px;
    background: var(--yellow);
    transition: width 1s ease;
}

section.in-view::before {
    width: 100px;
}

/* ===================================
   ENHANCED SLIDER BUTTONS
   =================================== */
.slider-btn {
    transition: all 0.3s cubic-bezier(0.68, -0.55, 0.265, 1.55);
}

.slider-btn:hover {
    transform: scale(1.1);
    box-shadow: 0 8px 20px rgba(255, 222, 89, 0.4);
}

.slider-btn:active {
    transform: scale(0.95);
}

/* ===================================
   LINK HOVER EFFECTS
   =================================== */
.email-link {
    position: relative;
    display: inline-block;
}

.email-link::after {
    content: '';
    position: absolute;
    width: 100%;
    height: 2px;
    bottom: -2px;
    left: 0;
    background: var(--yellow);
    transform: scaleX(0);
    transform-origin: right;
    transition: transform 0.3s ease;
}

.email-link:hover::after {
    transform: scaleX(1);
    transform-origin: left;
}

/* ===================================
   QUALITY BADGE ROTATION
   =================================== */
.quality-badge img,
.quality-badge-large img {
    animation: rotate 20s linear infinite;
}

.quality-badge:hover img,
.quality-badge-large:hover img {
    animation-play-state: paused;
}
