/* =====================================================
   Modern Animation System - Thy Favour Hotel
   Replicates Search Anyoka sophisticated animations
   ===================================================== */

/* -------------------------------------------------------
   CSS Variables for Animation System
   ------------------------------------------------------- */
:root {
    --animation-primary-color: #2563eb;
    --animation-gold-accent: #e4a853;
    --animation-dark-bg: #222;
    --animation-light-bg: #f8f5f0;
    --animation-text-color: #666;
    --animation-heading-color: #222;
    --animation-white: #fff;
    --animation-transition-fast: 0.3s;
    --animation-transition-medium: 0.6s;
    --animation-transition-slow: 1s;
    --animation-easing-smooth: cubic-bezier(0.4, 0, 0.2, 1);
    --animation-easing-bounce: cubic-bezier(0.68, -0.55, 0.265, 1.55);
}

/* -------------------------------------------------------
   Text Split Animation (text-anime-style-2)
   - Character-by-character reveal with GSAP SplitText
   ------------------------------------------------------- */
.text-anime-style-2 {
    position: relative;
    display: inline-block;
    overflow: hidden;
}

.text-anime-style-2 .char {
    display: inline-block;
    will-change: transform, opacity;
}

.text-anime-style-2 .word {
    display: inline-block;
    white-space: nowrap;
}

/* Initial state for animation - characters start offset */
.text-anime-style-2:not(.animated) .char {
    opacity: 0;
    transform: translateX(20px);
}

/* -------------------------------------------------------
   Image Reveal Animation (.reveal)
   - Dual-layer sliding reveal effect
   ------------------------------------------------------- */
.image-anime {
    position: relative;
    overflow: hidden;
}

.image-anime.reveal {
    visibility: hidden;
    position: relative;
}

.image-anime.reveal img {
    height: 100%;
    width: 100%;
    object-fit: cover;
    transform-origin: center;
}

/* Reveal overlay element */
.image-anime.reveal::after {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: var(--animation-primary-color);
    transform: translateX(-100%);
    z-index: 2;
}

.image-anime.reveal.revealed::after {
    transform: translateX(100%);
    transition: transform 1s cubic-bezier(0.77, 0, 0.175, 1);
}

/* -------------------------------------------------------
   WOW.js Animation Enhancements
   - fadeInUp with staggered delays
   ------------------------------------------------------- */
.wow {
    visibility: hidden;
}

.wow.animated {
    visibility: visible;
}

/* fadeInUp Animation */
@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translate3d(0, 40px, 0);
    }
    to {
        opacity: 1;
        transform: translate3d(0, 0, 0);
    }
}

.fadeInUp {
    animation-name: fadeInUp;
    animation-duration: 0.8s;
    animation-fill-mode: both;
}

/* Staggered delay classes */
.wow[data-wow-delay="0.2s"] {
    animation-delay: 0.2s;
}

.wow[data-wow-delay="0.4s"] {
    animation-delay: 0.4s;
}

.wow[data-wow-delay="0.6s"] {
    animation-delay: 0.6s;
}

.wow[data-wow-delay="0.8s"] {
    animation-delay: 0.8s;
}

.wow[data-wow-delay="1s"] {
    animation-delay: 1s;
}

/* -------------------------------------------------------
   Custom Magic Cursor Styles
   - Smooth-following cursor with multiple states
   ------------------------------------------------------- */
.cb-cursor {
    position: fixed;
    top: 0;
    left: 0;
    z-index: 99999;
    contain: layout style size;
    pointer-events: none;
    transition: opacity 0.3s, color 0.4s;
    will-change: transform;
}

.cb-cursor::before {
    content: '';
    position: absolute;
    top: -24px;
    left: -24px;
    display: block;
    width: 48px;
    height: 48px;
    transform: scale(0.2);
    background: var(--animation-primary-color);
    border-radius: 50%;
    transition: transform 0.2s ease-in-out, opacity 0.2s ease-in-out;
}

.cb-cursor.-pointer::before {
    transform: scale(0.15);
    background: var(--animation-gold-accent);
}

.cb-cursor.-opaque::before {
    transform: scale(1.2);
    opacity: 0.5;
    background: var(--animation-dark-bg);
}

.cb-cursor.-text {
    mix-blend-mode: normal;
}

.cb-cursor.-text::before {
    transform: scale(0);
    opacity: 0;
}

.cb-cursor-text {
    position: absolute;
    top: -18px;
    left: -18px;
    width: 36px;
    height: 36px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 10px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 1px;
    color: var(--animation-white);
    opacity: 0;
    transform: scale(0);
    transition: opacity 0.3s, transform 0.3s;
    pointer-events: none;
}

.cb-cursor.-text .cb-cursor-text {
    opacity: 1;
    transform: scale(1);
}

.cb-cursor.-active::before {
    transform: scale(0.1);
}

.cb-cursor.-hidden {
    opacity: 0;
}

/* Hide custom cursor on touch devices */
@media (hover: none) and (pointer: coarse) {
    .cb-cursor {
        display: none !important;
    }
}

/* -------------------------------------------------------
   Scrolling Ticker Animation
   - Continuous horizontal scrolling text
   ------------------------------------------------------- */
.scrolling-ticker-box {
    position: relative;
    overflow: hidden;
    white-space: nowrap;
}

.scrolling-content {
    display: inline-flex;
    animation: scroll-ticker 30s linear infinite;
    will-change: transform;
}

.scrolling-content:hover {
    animation-play-state: paused;
}

@keyframes scroll-ticker {
    0% {
        transform: translateX(0);
    }
    100% {
        transform: translateX(-50%);
    }
}

.scrolling-content span {
    display: inline-flex;
    align-items: center;
    padding: 0 50px;
    font-size: 20px;
    font-weight: 500;
    letter-spacing: 2px;
    text-transform: uppercase;
}

.scrolling-content span img,
.scrolling-content span svg {
    width: 24px;
    height: 24px;
    margin-right: 15px;
}

/* -------------------------------------------------------
   Enhanced Preloader System
   ------------------------------------------------------- */
.preloader {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: var(--animation-white);
    z-index: 999999;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: opacity 0.6s ease-out, visibility 0.6s ease-out;
}

.preloader.loaded {
    opacity: 0;
    visibility: hidden;
    pointer-events: none;
}

.loading-container {
    position: relative;
    text-align: center;
}

.loading {
    width: 60px;
    height: 60px;
    border: 3px solid rgba(170, 132, 83, 0.2);
    border-top-color: var(--animation-primary-color);
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

#loading-icon {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
}

#loading-icon img {
    max-width: 100px;
    max-height: 100px;
}

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

/* -------------------------------------------------------
   Slider/Carousel Enhancements
   - Swiper.js styling and transitions
   ------------------------------------------------------- */
.hero-slider-layout {
    position: relative;
    overflow: hidden;
}

.hero-slider-layout .swiper-slide {
    overflow: hidden;
}

.hero-slider-layout .swiper-slide img {
    transition: transform 6s ease;
}

.hero-slider-layout .swiper-slide-active img {
    transform: scale(1.1);
}

.hero-pagination {
    position: absolute;
    bottom: 30px;
    left: 50%;
    transform: translateX(-50%);
    z-index: 10;
    display: flex;
    gap: 10px;
}

.hero-pagination .swiper-pagination-bullet {
    width: 12px;
    height: 12px;
    background: rgba(255, 255, 255, 0.5);
    opacity: 1;
    transition: all 0.3s ease;
}

.hero-pagination .swiper-pagination-bullet-active {
    background: var(--animation-primary-color);
    transform: scale(1.2);
}

/* Testimonial Slider */
.testimonial-slider {
    position: relative;
}

.testimonial-btn-prev,
.testimonial-btn-next {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    width: 50px;
    height: 50px;
    border: 1px solid rgba(255, 255, 255, 0.3);
    border-radius: 50%;
    background: transparent;
    color: var(--animation-white);
    cursor: pointer;
    transition: all 0.3s ease;
    z-index: 10;
    display: flex;
    align-items: center;
    justify-content: center;
}

.testimonial-btn-prev:hover,
.testimonial-btn-next:hover {
    background: var(--animation-primary-color);
    border-color: var(--animation-primary-color);
}

.testimonial-btn-prev {
    left: -80px;
}

.testimonial-btn-next {
    right: -80px;
}

/* -------------------------------------------------------
   Section Animation Enhancements
   ------------------------------------------------------- */
.section-subtitle,
.section-title {
    position: relative;
}

.animate-box {
    opacity: 0;
    transform: translateY(30px);
    transition: opacity 0.6s ease-out, transform 0.6s ease-out;
}

.animate-box.animated {
    opacity: 1;
    transform: translateY(0);
}

/* -------------------------------------------------------
   Parallax Effect Styles
   ------------------------------------------------------- */
.parallax-section {
    position: relative;
    overflow: hidden;
    background-attachment: fixed;
    background-position: center;
    background-repeat: no-repeat;
    background-size: cover;
}

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

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

.hover-scale {
    transition: transform 0.3s ease;
}

.hover-scale:hover {
    transform: scale(1.05);
}

.hover-rotate {
    transition: transform 0.3s ease;
}

.hover-rotate:hover {
    transform: rotate(5deg);
}

/* Image hover effect */
.hover-zoom {
    overflow: hidden;
}

.hover-zoom img {
    transition: transform 0.5s ease;
}

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

/* -------------------------------------------------------
   Button Animation Styles
   ------------------------------------------------------- */
.butn-light,
.butn-dark {
    position: relative;
    overflow: hidden;
    transition: all 0.3s ease;
}

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

.butn-light:hover::before,
.butn-dark:hover::before {
    width: 300px;
    height: 300px;
}

/* -------------------------------------------------------
   Navbar Animation Enhancements
   ------------------------------------------------------- */
.navbar {
    transition: all 0.4s ease;
}

.navbar .nav-link {
    position: relative;
}

.navbar .nav-link::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 50%;
    width: 0;
    height: 1px;
    background: var(--animation-primary-color);
    transition: all 0.3s ease;
    transform: translateX(-50%);
}

.navbar .nav-link:hover::after {
    width: 100%;
}

/* -------------------------------------------------------
   Card Animation Styles
   ------------------------------------------------------- */
.card-hover-effect {
    transition: all 0.4s ease;
}

.card-hover-effect:hover {
    transform: translateY(-10px);
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.15);
}

.card-hover-effect .card-overlay {
    position: absolute;
    bottom: 0;
    left: 0;
    width: 100%;
    padding: 20px;
    background: linear-gradient(to top, rgba(0, 0, 0, 0.8), transparent);
    transform: translateY(100%);
    transition: transform 0.4s ease;
}

.card-hover-effect:hover .card-overlay {
    transform: translateY(0);
}

/* -------------------------------------------------------
   Scroll Progress Indicator
   ------------------------------------------------------- */
.progress-wrap {
    position: fixed;
    right: 30px;
    bottom: 30px;
    height: 46px;
    width: 46px;
    cursor: pointer;
    display: block;
    border-radius: 50px;
    box-shadow: inset 0 0 0 2px rgba(170, 132, 83, 0.2);
    z-index: 10000;
    opacity: 0;
    visibility: hidden;
    transform: translateY(15px);
    transition: all 0.3s ease;
}

.progress-wrap.active-progress {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
}

.progress-wrap::after {
    position: absolute;
    font-family: 'Themify';
    content: '\e648';
    text-align: center;
    line-height: 46px;
    font-size: 12px;
    color: var(--animation-primary-color);
    left: 0;
    top: 0;
    height: 46px;
    width: 46px;
    cursor: pointer;
    display: block;
    z-index: 1;
    transition: all 0.3s ease;
}

.progress-wrap:hover::after {
    color: var(--animation-gold-accent);
    transform: translateY(-2px);
}

.progress-wrap svg path {
    fill: none;
}

.progress-wrap svg.progress-circle path {
    stroke: var(--animation-primary-color);
    stroke-width: 4;
    box-sizing: border-box;
    transition: all 0.3s ease;
}

/* -------------------------------------------------------
   Accessibility - Reduced Motion
   ------------------------------------------------------- */
@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;
    }
    
    .wow {
        visibility: visible;
        opacity: 1;
        animation: none !important;
    }
    
    .cb-cursor {
        display: none !important;
    }
    
    .scrolling-content {
        animation: none;
    }
    
    .text-anime-style-2 .char {
        opacity: 1;
        transform: none;
    }
}

/* -------------------------------------------------------
   Loading States
   ------------------------------------------------------- */
.skeleton-loader {
    background: linear-gradient(90deg, #f0f0f0 25%, #e0e0e0 50%, #f0f0f0 75%);
    background-size: 200% 100%;
    animation: skeleton-loading 1.5s infinite;
}

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

/* -------------------------------------------------------
   Responsive Adjustments
   ------------------------------------------------------- */
@media (max-width: 991px) {
    .testimonial-btn-prev,
    .testimonial-btn-next {
        display: none;
    }
    
    .hero-pagination {
        bottom: 20px;
    }
    
    .scrolling-content span {
        padding: 0 30px;
        font-size: 16px;
    }
}

@media (max-width: 767px) {
    .text-anime-style-2 {
        font-size: 0.9em;
    }
    
    .scrolling-content {
        animation-duration: 20s;
    }
}
