/* ===========================
   ADVANCED EFFECTS & ANIMATIONS
   =========================== */

/* Premium Preloader */
.preloader {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-image: url('https://images.unsplash.com/photo-1488646953014-85cb44e25828?w=3840&q=95');
    background-size: cover;
    background-position: center;
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 99999;
    transition: opacity 0.5s ease, visibility 0.5s ease;
}

.preloader::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: linear-gradient(135deg, rgba(10, 24, 40, 0.85) 0%, rgba(26, 58, 82, 0.85) 50%, rgba(45, 90, 123, 0.85) 100%);
    z-index: 0;
}

.preloader > * {
    position: relative;
    z-index: 1;
}

.preloader.fade-out {
    opacity: 0;
    visibility: hidden;
}

.preloader-content {
    text-align: center;
    position: relative;
}

.logo-animation {
    position: relative;
    z-index: 2;
}

.preloader-logo {
    font-family: 'Playfair Display', serif;
    font-size: 4rem;
    font-weight: 800;
    color: var(--white);
    letter-spacing: 8px;
    margin-bottom: 40px;
    animation: logoGlow 2s ease-in-out infinite alternate;
    text-shadow: 0 0 30px rgba(212, 175, 55, 0.5);
}

@keyframes logoGlow {
    0% {
        text-shadow: 0 0 30px rgba(212, 175, 55, 0.5),
                     0 0 60px rgba(212, 175, 55, 0.3);
    }
    100% {
        text-shadow: 0 0 50px rgba(212, 175, 55, 0.8),
                     0 0 100px rgba(212, 175, 55, 0.5);
    }
}

.loading-bar {
    width: 300px;
    height: 4px;
    background: rgba(255, 255, 255, 0.1);
    border-radius: 10px;
    margin: 0 auto 20px;
    overflow: hidden;
    position: relative;
}

.loading-progress {
    height: 100%;
    background: linear-gradient(90deg, var(--secondary-color), var(--accent-color));
    border-radius: 10px;
    animation: loadingProgress 2s ease-in-out infinite;
    box-shadow: 0 0 20px rgba(212, 175, 55, 0.6);
}

@keyframes loadingProgress {
    0% {
        width: 0%;
    }
    50% {
        width: 70%;
    }
    100% {
        width: 100%;
    }
}

.loading-text {
    color: rgba(255, 255, 255, 0.8);
    font-size: 1.1rem;
    font-weight: 300;
    letter-spacing: 2px;
    animation: textPulse 2s ease-in-out infinite;
}

@keyframes textPulse {
    0%, 100% {
        opacity: 0.6;
    }
    50% {
        opacity: 1;
    }
}

.preloader-particles {
    position: absolute;
    width: 100%;
    height: 100%;
    top: 0;
    left: 0;
    pointer-events: none;
}

.particle-dot {
    position: absolute;
    width: 8px;
    height: 8px;
    background: var(--accent-color);
    border-radius: 50%;
    opacity: 0;
    box-shadow: 0 0 20px rgba(212, 175, 55, 0.8);
}

.particle-dot:nth-child(1) {
    top: 20%;
    left: 20%;
    animation: particleFloat 3s ease-in-out infinite;
    animation-delay: 0s;
}

.particle-dot:nth-child(2) {
    top: 30%;
    right: 25%;
    animation: particleFloat 3s ease-in-out infinite;
    animation-delay: 0.6s;
}

.particle-dot:nth-child(3) {
    bottom: 25%;
    left: 30%;
    animation: particleFloat 3s ease-in-out infinite;
    animation-delay: 1.2s;
}

.particle-dot:nth-child(4) {
    bottom: 20%;
    right: 20%;
    animation: particleFloat 3s ease-in-out infinite;
    animation-delay: 1.8s;
}

.particle-dot:nth-child(5) {
    top: 50%;
    left: 50%;
    animation: particleFloat 3s ease-in-out infinite;
    animation-delay: 2.4s;
}

@keyframes particleFloat {
    0%, 100% {
        opacity: 0;
        transform: translateY(0) scale(0);
    }
    50% {
        opacity: 1;
        transform: translateY(-50px) scale(1);
    }
}

@media (max-width: 768px) {
    .preloader-logo {
        font-size: 2.5rem;
        letter-spacing: 4px;
    }

    .loading-bar {
        width: 250px;
    }

    .loading-text {
        font-size: 0.9rem;
    }
}

/* Video/Image Fallback - Ensure images display properly */
video,
img.video-fallback,
img.destination-image-bg,
img.grid-video,
img.showcase-video,
img.explorer-bg-video,
img.package-video,
img.feature-bg-video,
img.immersive-video {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
    background: transparent !important;
}

/* Hero section - ensure clean display */
.hero,
.hero-video-container,
.video-showcase-container,
.destination-image,
.video-item,
.explorer-video-bg,
.feature-video-container,
.immersive-video-wrapper {
    background: transparent !important;
    overflow: hidden;
}

/* Hide custom cursor */
.cursor-follow {
    display: none !important;
}

/* Hide particles for performance */
.particles-bg {
    display: none !important;
}

/* Glassmorphism Effect */
.glass-effect {
    background: rgba(255, 255, 255, 0.1);
    backdrop-filter: blur(20px) saturate(180%);
    -webkit-backdrop-filter: blur(20px) saturate(180%);
    border: 1px solid rgba(255, 255, 255, 0.2);
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.1);
}

.glass-dark {
    background: rgba(10, 24, 40, 0.7);
    backdrop-filter: blur(20px) saturate(180%);
    -webkit-backdrop-filter: blur(20px) saturate(180%);
    border: 1px solid rgba(255, 255, 255, 0.1);
}

/* Parallax Video Gallery */
.parallax-gallery {
    padding: 120px 0;
    background-image: url('https://images.unsplash.com/photo-1476514525535-07fb3b4ae5f1?w=3840&q=95');
    background-size: cover;
    background-position: center;
    background-attachment: fixed;
    position: relative;
    overflow: hidden;
}

.parallax-gallery::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: linear-gradient(135deg, rgba(10, 24, 40, 0.85) 0%, rgba(26, 58, 82, 0.85) 100%);
    z-index: 0;
}

.parallax-gallery > * {
    position: relative;
    z-index: 1;
}

.gallery-header {
    text-align: center;
    margin-bottom: 80px;
    padding: 0 20px;
}

.gallery-header .section-tag,
.gallery-header .section-title,
.gallery-header .section-subtitle {
    color: var(--white);
}

.video-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(400px, 1fr));
    gap: 30px;
    padding: 0 40px;
    max-width: 1600px;
    margin: 0 auto;
}

.video-item {
    position: relative;
    height: 450px;
    border-radius: 20px;
    overflow: hidden;
    cursor: pointer;
    transform-style: preserve-3d;
    transition: all 0.6s cubic-bezier(0.23, 1, 0.32, 1);
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
}

.video-item.large-video {
    grid-column: span 2;
    height: 550px;
}

.video-item:hover {
    transform: translateY(-15px) scale(1.02);
    box-shadow: 0 30px 80px rgba(0, 0, 0, 0.5);
}

.grid-video {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.6s ease;
}

.video-item:hover .grid-video {
    transform: scale(1.1);
}

.video-item-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: linear-gradient(180deg, transparent 0%, rgba(10, 24, 40, 0.9) 100%);
    display: flex;
    align-items: flex-end;
    padding: 40px;
    opacity: 0;
    transition: opacity 0.4s ease;
}

.video-item:hover .video-item-overlay {
    opacity: 1;
}

.video-item-content h3 {
    color: var(--white);
    font-size: 2rem;
    margin-bottom: 10px;
    transform: translateY(20px);
    transition: transform 0.4s ease 0.1s;
}

.video-item:hover .video-item-content h3 {
    transform: translateY(0);
}

.video-item-content p {
    color: rgba(255, 255, 255, 0.8);
    font-size: 1rem;
    margin-bottom: 20px;
    transform: translateY(20px);
    transition: transform 0.4s ease 0.15s;
}

.video-item:hover .video-item-content p {
    transform: translateY(0);
}

.btn-play {
    background: var(--accent-color);
    color: var(--primary-color);
    border: none;
    padding: 12px 30px;
    border-radius: 50px;
    font-weight: 600;
    cursor: pointer;
    font-size: 0.95rem;
    transform: translateY(20px);
    transition: all 0.4s ease 0.2s;
    display: inline-flex;
    align-items: center;
    gap: 8px;
}

.video-item:hover .btn-play {
    transform: translateY(0);
}

.btn-play:hover {
    background: var(--white);
    transform: translateY(0) scale(1.05);
}

/* Luxury Masonry Gallery */
.luxury-gallery {
    padding: 120px 0;
    background: var(--bg-cream);
}

.masonry-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(350px, 1fr));
    grid-auto-rows: 300px;
    gap: 20px;
    margin-top: 60px;
}

.masonry-item {
    position: relative;
    border-radius: 15px;
    overflow: hidden;
    cursor: pointer;
    transition: all 0.5s cubic-bezier(0.4, 0, 0.2, 1);
}

.masonry-item.tall {
    grid-row: span 2;
}

.masonry-item.wide {
    grid-column: span 2;
}

.masonry-item img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.7s cubic-bezier(0.4, 0, 0.2, 1);
}

.masonry-item:hover {
    transform: translateY(-10px);
    box-shadow: var(--shadow-xl);
    z-index: 10;
}

.masonry-item:hover img {
    transform: scale(1.15);
}

.masonry-overlay {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    padding: 30px;
    background: linear-gradient(180deg, transparent 0%, rgba(10, 24, 40, 0.95) 100%);
    transform: translateY(100%);
    transition: transform 0.5s cubic-bezier(0.4, 0, 0.2, 1);
}

.masonry-item:hover .masonry-overlay {
    transform: translateY(0);
}

.masonry-overlay h3 {
    color: var(--white);
    font-size: 1.8rem;
    margin-bottom: 8px;
}

.masonry-overlay p {
    color: var(--accent-color);
    font-size: 1rem;
    font-weight: 500;
}

/* Interactive Destination Explorer */
.destination-explorer {
    position: relative;
    padding: 120px 0;
    overflow: hidden;
}

.explorer-video-bg {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 0;
}

.explorer-bg-video {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.explorer-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: linear-gradient(135deg, rgba(10, 24, 40, 0.75) 0%, rgba(26, 58, 82, 0.70) 100%);
}

.destination-explorer .container {
    position: relative;
    z-index: 2;
}

.explorer-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 30px;
    margin-top: 60px;
}

.explorer-card {
    position: relative;
    height: 350px;
    border-radius: 20px;
    overflow: hidden;
    cursor: pointer;
    transform: perspective(1000px) rotateY(0deg);
    transition: all 0.6s cubic-bezier(0.23, 1, 0.32, 1);
    box-shadow: 0 15px 40px rgba(0, 0, 0, 0.4);
}

.explorer-card:hover {
    transform: perspective(1000px) rotateY(5deg) translateY(-20px);
    box-shadow: 0 30px 70px rgba(0, 0, 0, 0.6);
}

.explorer-card:nth-child(even):hover {
    transform: perspective(1000px) rotateY(-5deg) translateY(-20px);
}

.explorer-image {
    width: 100%;
    height: 100%;
}

.explorer-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.6s ease;
}

.explorer-card:hover .explorer-image img {
    transform: scale(1.2);
}

.explorer-content {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    padding: 30px;
    background: linear-gradient(180deg, transparent 0%, rgba(10, 24, 40, 0.95) 100%);
}

.explorer-content h3 {
    color: var(--white);
    font-size: 2rem;
    margin-bottom: 8px;
}

.destination-count {
    color: var(--accent-color);
    font-size: 1rem;
    font-weight: 600;
}

/* Premium Features with 3D Cards */
.premium-features {
    padding: 120px 0;
    background-image: url('https://images.unsplash.com/photo-1469854523086-cc02fe5d8800?w=3840&q=95');
    background-size: cover;
    background-position: center;
    background-attachment: fixed;
    position: relative;
}

.premium-features::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: linear-gradient(180deg, rgba(250, 248, 245, 0.92) 0%, rgba(240, 237, 230, 0.92) 100%);
    z-index: 0;
}

.premium-features > * {
    position: relative;
    z-index: 1;
}

.features-showcase {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 40px;
    margin-top: 60px;
}

.feature-card-3d {
    position: relative;
    height: 400px;
    border-radius: 25px;
    overflow: hidden;
    transform-style: preserve-3d;
    transition: all 0.6s cubic-bezier(0.23, 1, 0.32, 1);
    cursor: pointer;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.15);
}

.feature-card-3d:hover {
    transform: translateY(-20px) scale(1.03);
    box-shadow: 0 40px 90px rgba(0, 0, 0, 0.25);
}

.feature-video-container {
    position: absolute;
    width: 100%;
    height: 100%;
    top: 0;
    left: 0;
}

.feature-bg-video {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.feature-glass-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: linear-gradient(135deg, rgba(10, 24, 40, 0.6) 0%, rgba(26, 58, 82, 0.7) 100%);
    backdrop-filter: blur(5px);
}

.feature-content-3d {
    position: relative;
    z-index: 2;
    height: 100%;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    padding: 40px;
    text-align: center;
}

.feature-icon-3d {
    font-size: 4rem;
    margin-bottom: 20px;
    filter: drop-shadow(0 10px 20px rgba(0, 0, 0, 0.3));
    transition: transform 0.4s ease;
}

.feature-card-3d:hover .feature-icon-3d {
    transform: scale(1.2) rotateY(360deg);
}

.feature-content-3d h3 {
    color: var(--white);
    font-size: 1.8rem;
    margin-bottom: 15px;
}

.feature-content-3d p {
    color: rgba(255, 255, 255, 0.9);
    font-size: 1.05rem;
    line-height: 1.6;
}

/* Immersive 360 Experience */
.immersive-360 {
    padding: 100px 0;
    background-image: url('https://images.unsplash.com/photo-1540541338287-41700207dee6?w=3840&q=95');
    background-size: cover;
    background-position: center;
    background-attachment: fixed;
    position: relative;
    overflow: hidden;
}

.immersive-360::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: linear-gradient(135deg, rgba(10, 24, 40, 0.88) 0%, rgba(26, 58, 82, 0.88) 100%);
    z-index: 0;
}

.immersive-360 > * {
    position: relative;
    z-index: 1;
}

.immersive-container {
    max-width: 1400px;
    margin: 0 auto;
    padding: 0 20px;
}

.immersive-video-wrapper {
    position: relative;
    width: 100%;
    height: 600px;
    border-radius: 30px;
    overflow: hidden;
    box-shadow: 0 30px 100px rgba(0, 0, 0, 0.5);
    margin-bottom: 50px;
}

.immersive-video {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.3s ease;
}

.immersive-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: radial-gradient(circle at center, transparent 40%, rgba(10, 24, 40, 0.3) 100%);
    pointer-events: none;
}

.immersive-controls {
    text-align: center;
    padding: 40px;
    background: rgba(255, 255, 255, 0.05);
    backdrop-filter: blur(10px);
    border-radius: 20px;
    border: 1px solid rgba(255, 255, 255, 0.1);
}

.immersive-controls h2 {
    color: var(--white);
    font-size: 2.5rem;
    margin-bottom: 15px;
}

.immersive-controls p {
    color: rgba(255, 255, 255, 0.8);
    font-size: 1.2rem;
    margin-bottom: 40px;
}

.control-buttons {
    display: flex;
    gap: 15px;
    justify-content: center;
    flex-wrap: wrap;
}

.control-btn {
    background: rgba(255, 255, 255, 0.1);
    backdrop-filter: blur(10px);
    border: 2px solid rgba(255, 255, 255, 0.2);
    color: var(--white);
    padding: 15px 30px;
    border-radius: 50px;
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    gap: 10px;
}

.control-btn span {
    font-size: 1.5rem;
}

.control-btn:hover,
.control-btn.active {
    background: var(--accent-color);
    border-color: var(--accent-color);
    color: var(--primary-color);
    transform: translateY(-3px);
    box-shadow: 0 10px 30px rgba(212, 175, 55, 0.4);
}

/* Animated Gradient Background */
@keyframes gradientShift {
    0% {
        background-position: 0% 50%;
    }
    50% {
        background-position: 100% 50%;
    }
    100% {
        background-position: 0% 50%;
    }
}

.animated-gradient {
    background: linear-gradient(270deg, #0a1828, #1a3a52, #2d5a7b, #c9a961);
    background-size: 400% 400%;
    animation: gradientShift 15s ease infinite;
}

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

.float-animation {
    animation: float 6s ease-in-out infinite;
}

/* Pulse Glow Effect */
@keyframes pulseGlow {
    0%, 100% {
        box-shadow: 0 0 20px rgba(212, 175, 55, 0.4);
    }
    50% {
        box-shadow: 0 0 40px rgba(212, 175, 55, 0.8);
    }
}

.pulse-glow {
    animation: pulseGlow 3s ease-in-out infinite;
}

/* 3D Tilt Effect (JavaScript Enhanced) */
[data-tilt] {
    transform-style: preserve-3d;
}

/* Parallax Effect for Images */
[data-parallax] {
    transition: transform 0.3s ease-out;
    will-change: transform;
}

/* Responsive Design */
@media (max-width: 1200px) {
    .video-grid {
        grid-template-columns: repeat(auto-fit, minmax(350px, 1fr));
    }

    .video-item.large-video {
        grid-column: span 1;
        height: 450px;
    }
}

@media (max-width: 768px) {
    .video-grid,
    .explorer-grid,
    .features-showcase {
        grid-template-columns: 1fr;
        padding: 0 20px;
    }

    .video-item {
        height: 350px;
    }

    .masonry-grid {
        grid-template-columns: 1fr;
        grid-auto-rows: 250px;
    }

    .masonry-item.tall,
    .masonry-item.wide {
        grid-column: span 1;
        grid-row: span 1;
    }

    .immersive-video-wrapper {
        height: 400px;
    }

    .control-buttons {
        gap: 10px;
    }

    .control-btn {
        padding: 12px 20px;
        font-size: 0.9rem;
    }
}

/* Smooth Scroll Reveal */
.reveal {
    opacity: 0;
    transform: translateY(50px);
    transition: all 0.8s cubic-bezier(0.23, 1, 0.32, 1);
}

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

/* Shimmer Effect for Loading */
@keyframes shimmer {
    0% {
        background-position: -1000px 0;
    }
    100% {
        background-position: 1000px 0;
    }
}

.shimmer {
    background: linear-gradient(90deg, #f0f0f0 25%, #e0e0e0 50%, #f0f0f0 75%);
    background-size: 1000px 100%;
    animation: shimmer 2s infinite;
}

/* Custom Cursor Enhancement */
.cursor-follow {
    pointer-events: none;
    position: fixed;
    width: 20px;
    height: 20px;
    border-radius: 50%;
    background: var(--accent-color);
    mix-blend-mode: difference;
    z-index: 9999;
    transition: transform 0.2s ease, opacity 0.2s ease;
    opacity: 0;
}

.cursor-follow.active {
    opacity: 0.8;
    transform: scale(2);
}

/* Particle Background */
.particles-bg {
    position: absolute;
    width: 100%;
    height: 100%;
    top: 0;
    left: 0;
    overflow: hidden;
    pointer-events: none;
}

.particle {
    position: absolute;
    background: rgba(212, 175, 55, 0.3);
    border-radius: 50%;
    animation: floatParticle 20s infinite;
}

@keyframes floatParticle {
    0% {
        transform: translateY(100vh) translateX(0) scale(0);
        opacity: 0;
    }
    10% {
        opacity: 1;
    }
    90% {
        opacity: 1;
    }
    100% {
        transform: translateY(-100vh) translateX(100px) scale(1);
        opacity: 0;
    }
}

/* Premium Loading Spinner */
.loading-spinner {
    width: 60px;
    height: 60px;
    border: 4px solid rgba(212, 175, 55, 0.2);
    border-top-color: var(--accent-color);
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

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