/* ============================================
   PREMIUM ANIMATIONS & EFFECTS
   Smooth, Sophisticated, Performance-Optimized
   ============================================ */

/* Global Animation Settings */
html {
    scroll-padding-top: 80px;
}

/* ============================================
   ENTRANCE ANIMATIONS
   ============================================ */
@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 scaleIn {
    from {
        opacity: 0;
        transform: scale(0.9);
    }
    to {
        opacity: 1;
        transform: scale(1);
    }
}

/* ============================================
   SCROLL ANIMATIONS
   ============================================ */
@keyframes scrollPulse {
    0%,
    100% {
        opacity: 0.3;
        transform: translateY(0);
    }
    50% {
        opacity: 1;
        transform: translateY(10px);
    }
}

@keyframes lineGrow {
    from {
        width: 0;
    }
    to {
        width: 100%;
    }
}

/* ============================================
   BUTTON HOVER EFFECTS
   ============================================ */
.btn {
    position: relative;
    overflow: hidden;
}

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

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

.btn i {
    transition: transform 0.3s ease;
}

.btn:hover i {
    transform: translateX(5px);
}

/* ============================================
   IMAGE HOVER EFFECTS
   ============================================ */
.heritage-image,
.collection-image,
.process-image-container {
    position: relative;
    overflow: hidden;
}

.heritage-image::after,
.collection-image::after {
    content: "";
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(
        90deg,
        transparent,
        rgba(255, 255, 255, 0.1),
        transparent
    );
    transition: left 0.5s;
}

.heritage-image:hover::after,
.collection-card:hover .collection-image::after {
    left: 100%;
}

/* ============================================
   CARD HOVER EFFECTS
   ============================================ */
.timeline-card,
.collection-card,
.process-step {
    position: relative;
}

.timeline-card::before,
.collection-card::before {
    content: "";
    position: absolute;
    top: 0;
    left: 0;
    width: 0;
    height: 100%;
    background: linear-gradient(90deg, var(--color-accent), transparent);
    opacity: 0.1;
    transition: width 0.4s ease;
}

.timeline-card:hover::before,
.collection-card:hover::before {
    width: 100%;
}

/* ============================================
   STATISTICS COUNTER ANIMATION
   ============================================ */
.stat-number {
    display: inline-block;
    transition: transform 0.3s ease;
}

.stat-item:hover .stat-number {
    transform: scale(1.1);
}

/* ============================================
   NAVIGATION ANIMATIONS
   ============================================ */
.main-nav {
    transform: translateY(0);
    transition:
        transform 0.4s cubic-bezier(0.4, 0, 0.2, 1),
        background 0.4s;
}

.main-nav.hide {
    transform: translateY(-100%);
}

.nav-link {
    display: inline-block;
}

.nav-link:hover {
    animation: linkBounce 0.4s ease;
}

@keyframes linkBounce {
    0%,
    100% {
        transform: translateY(0);
    }
    50% {
        transform: translateY(-3px);
    }
}

/* ============================================
   LANGUAGE SWITCHER ANIMATION
   ============================================ */
.lang-btn {
    position: relative;
}

.lang-btn::after {
    content: "";
    position: absolute;
    bottom: 0;
    left: 50%;
    width: 0;
    height: 2px;
    background: var(--color-accent);
    transform: translateX(-50%);
    transition: width 0.3s ease;
}

.lang-btn.active::after {
    width: 80%;
}

/* ============================================
   MOBILE MENU ANIMATION
   ============================================ */
.nav-toggle {
    position: relative;
}

.nav-toggle span {
    display: block;
    transform-origin: center;
    transition: all 0.3s ease;
}

.nav-toggle.active span:nth-child(1) {
    transform: translateY(8px) rotate(45deg);
}

.nav-toggle.active span:nth-child(2) {
    opacity: 0;
    transform: translateX(-20px);
}

.nav-toggle.active span:nth-child(3) {
    transform: translateY(-8px) rotate(-45deg);
}

/* Navigation link animations only apply on mobile */
@media (max-width: 991px) {
    .nav-link,
    .nav-lang-switcher {
        opacity: 0;
        transform: translateX(-20px);
        transition:
            opacity 0.3s,
            transform 0.3s;
    }

    .nav-menu.active .nav-link,
    .nav-menu.active .nav-lang-switcher {
        opacity: 1;
        transform: translateX(0);
    }

    .nav-menu.active .nav-link:nth-child(1) {
        transition-delay: 0.1s;
    }
    .nav-menu.active .nav-link:nth-child(2) {
        transition-delay: 0.2s;
    }
    .nav-menu.active .nav-link:nth-child(3) {
        transition-delay: 0.3s;
    }
    .nav-menu.active .nav-link:nth-child(4) {
        transition-delay: 0.4s;
    }
    .nav-menu.active .nav-link:nth-child(5) {
        transition-delay: 0.5s;
    }
    .nav-menu.active .nav-cta {
        transition-delay: 0.6s;
    }
}

/* ============================================
   PROCESS STEP ANIMATIONS
   ============================================ */
.process-step {
    opacity: 1;
    transform: translateX(0);
    transition: all 0.6s ease;
}

/* Animate on scroll when in viewport */
.process-step.aos-init {
    opacity: 0;
    transform: translateX(-30px);
}

.process-step.aos-animate {
    opacity: 1;
    transform: translateX(0);
}

.process-step.active {
    background: rgba(192, 192, 192, 0.15);
    border-color: rgba(192, 192, 192, 0.4);
}

.process-step.active .step-number {
    animation: pulse 0.6s ease;
}

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

/* ============================================
   IMAGE FADE TRANSITION
   ============================================ */
#processImage {
    transition:
        opacity 0.4s ease,
        transform 0.4s ease;
}

#processImage.fade-out {
    opacity: 0;
    transform: scale(0.98);
}

#processImage.fade-in {
    opacity: 1;
    transform: scale(1);
}

/* ============================================
   FOOTER SOCIAL ICONS
   ============================================ */
.footer-social a {
    position: relative;
}

.footer-social a::before {
    content: "";
    position: absolute;
    inset: -4px;
    border-radius: 50%;
    background: linear-gradient(
        135deg,
        var(--color-accent),
        var(--color-accent-light)
    );
    opacity: 0;
    transition: opacity 0.3s;
}

.footer-social a:hover::before {
    opacity: 0.3;
}

.footer-social a i {
    position: relative;
    z-index: 1;
}

/* ============================================
   COLLECTION OVERLAY ANIMATION
   ============================================ */
.collection-overlay {
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
}

.collection-btn {
    transform: translateY(20px);
    transition:
        transform 0.4s ease,
        background 0.3s,
        color 0.3s;
}

.collection-card:hover .collection-btn {
    transform: translateY(0);
}

/* ============================================
   CONTACT ICONS ANIMATION
   ============================================ */
.contact-icon {
    position: relative;
}

.contact-icon::after {
    content: "";
    position: absolute;
    inset: -6px;
    border-radius: var(--radius-sm);
    background: linear-gradient(135deg, var(--color-accent), transparent);
    opacity: 0;
    transition: opacity 0.3s;
}

.contact-item:hover .contact-icon::after {
    opacity: 0.2;
}

.contact-icon i {
    position: relative;
    z-index: 1;
    transition: transform 0.3s;
}

.contact-item:hover .contact-icon i {
    transform: scale(1.1);
}

/* ============================================
   TIMELINE ICON ANIMATION
   ============================================ */
.timeline-icon {
    position: relative;
}

.timeline-icon::before {
    content: "";
    position: absolute;
    inset: -4px;
    border-radius: var(--radius-sm);
    background: linear-gradient(135deg, var(--color-accent), transparent);
    opacity: 0;
    transition:
        opacity 0.3s,
        transform 0.3s;
    transform: rotate(0deg);
}

.timeline-card:hover .timeline-icon::before {
    opacity: 0.3;
    transform: rotate(180deg);
}

.timeline-icon i {
    position: relative;
    z-index: 1;
    transition: transform 0.3s;
}

.timeline-card:hover .timeline-icon i {
    transform: scale(1.1);
}

/* ============================================
   HERITAGE ACCENT ANIMATION
   ============================================ */
.heritage-accent {
    animation: float 6s ease-in-out infinite;
}

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

/* ============================================
   SMOOTH SCROLL INDICATOR
   ============================================ */
.hero-scroll {
    opacity: 1;
    animation: fadeInUp 1s ease 1s forwards;
}

/* ============================================
   PAGE LOAD ANIMATION
   ============================================ */
/* Removed body fade-in to prevent flash of invisible content */
/* Body is now visible immediately on load */

/* ============================================
   PERFORMANCE OPTIMIZATIONS
   ============================================ */
.hero-video,
.heritage-image img,
.collection-image img,
.process-image-container img {
    will-change: transform;
}

.btn,
.nav-link,
.collection-card,
.timeline-card,
.process-step {
    will-change: transform;
}

/* Remove will-change after animation */
.loaded * {
    will-change: auto;
}

/* ============================================
   TEXT GRADIENT ANIMATION
   ============================================ */
@keyframes gradientShift {
    0% {
        background-position: 0% 50%;
    }
    50% {
        background-position: 100% 50%;
    }
    100% {
        background-position: 0% 50%;
    }
}

.hero-title .accent,
.section-title .accent {
    background-size: 200% 200%;
    animation: gradientShift 3s ease infinite;
}

/* ============================================
   LOADING STATE
   ============================================ */
.loading {
    opacity: 0;
    transform: translateY(20px);
}

.loaded {
    opacity: 1;
    transform: translateY(0);
    transition:
        opacity 0.6s ease,
        transform 0.6s ease;
}

/* ============================================
   INTERSECTION OBSERVER ANIMATIONS
   ============================================ */
.fade-in-section {
    opacity: 0;
    transform: translateY(40px);
    transition:
        opacity 0.8s ease,
        transform 0.8s ease;
}

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

/* ============================================
   PARALLAX EFFECTS
   ============================================ */
.parallax {
    transition: transform 0.1s ease-out;
}

/* ============================================
   IMAGE REVEAL ANIMATION
   ============================================ */
.image-reveal {
    opacity: 0;
    transform: scale(1.1);
    transition:
        opacity 0.8s ease,
        transform 0.8s ease;
}

.image-revealed {
    opacity: 1 !important;
    transform: scale(1) !important;
}

/* Images already in viewport should be visible immediately */
.heritage-image img,
.collection-image img {
    opacity: 1;
    transform: scale(1);
}

/* ============================================
   SCROLL TO TOP BUTTON ANIMATIONS
   ============================================ */
.scroll-to-top:hover i {
    animation: arrowBounce 0.6s ease infinite;
}

@keyframes arrowBounce {
    0%,
    100% {
        transform: translateY(0);
    }
    50% {
        transform: translateY(-4px);
    }
}

/* Pulse animation when button first appears */
.scroll-to-top.visible {
    animation: fadeInUp 0.4s ease;
}

@keyframes fadeInUp {
    0% {
        opacity: 0;
        transform: translateY(20px);
    }
    100% {
        opacity: 1;
        transform: translateY(0);
    }
}

/* ============================================
   BACKDROP BLUR SUPPORT
   ============================================ */
@supports not (backdrop-filter: blur(20px)) {
    .main-nav.scrolled,
    .language-toggle {
        background: rgba(22, 22, 28, 0.98);
    }
}
