/* ============================================
   CINEMATIC ANIMATIONS & TRANSITIONS
   ============================================ */

/* ============================================
   PRELOADER
   ============================================ */
.preloader {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: linear-gradient(135deg, #1a2b4d 0%, #2a3d5f 100%);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 9999;
    opacity: 1;
    transition: opacity 0.6s ease-out, visibility 0.6s ease-out;
}

.preloader.hidden {
    opacity: 0;
    visibility: hidden;
}

.camera-lens-loader {
    width: 80px;
    height: 80px;
    position: relative;
}

.camera-lens-loader::before {
    content: '';
    position: absolute;
    width: 100%;
    height: 100%;
    border: 4px solid rgba(212, 175, 55, 0.3);
    border-top-color: var(--gold);
    border-radius: 50%;
    animation: rotateLens 1.5s linear infinite;
}

.camera-lens-loader::after {
    content: '📷';
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    font-size: 2.5rem;
    animation: pulse 2s ease-in-out infinite;
}

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

/* ============================================
   PAGE TRANSITION EFFECTS
   ============================================ */
.page-transition {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: #000;
    z-index: 10000;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.4s ease-in-out;
}

.page-transition.active {
    opacity: 1;
    pointer-events: all;
}

.page-transition-blur {
    filter: blur(10px);
    transition: filter 0.4s ease-in-out;
}

/* ============================================
   SECTION FADE & SLIDE REVEAL
   ============================================ */
@keyframes fadeSlideUp {
    from {
        opacity: 0;
        transform: translateY(40px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

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

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

.section-reveal {
    opacity: 0;
    animation: fadeSlideUp 1s cubic-bezier(0.4, 0, 0.2, 1) forwards;
}

.section-reveal-left {
    opacity: 0;
    animation: fadeSlideLeft 1s cubic-bezier(0.4, 0, 0.2, 1) forwards;
}

.section-reveal-right {
    opacity: 0;
    animation: fadeSlideRight 1s cubic-bezier(0.4, 0, 0.2, 1) forwards;
}

/* Staggered animation delays */
.section-reveal:nth-child(1) { animation-delay: 0.1s; }
.section-reveal:nth-child(2) { animation-delay: 0.2s; }
.section-reveal:nth-child(3) { animation-delay: 0.3s; }
.section-reveal:nth-child(4) { animation-delay: 0.4s; }
.section-reveal:nth-child(5) { animation-delay: 0.5s; }

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

.parallax-portfolio {
    will-change: transform;
    transition: transform 0.1s ease-out;
}

.parallax-bg-image {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 120%;
    object-fit: cover;
    will-change: transform;
}

/* ============================================
   ENHANCED FLOATING MEDIA ICONS
   ============================================ */
@keyframes floatCinematic {
    0%, 100% {
        transform: translate(0, 0) rotate(0deg) scale(1);
        opacity: 0.3;
        filter: drop-shadow(0 0 15px rgba(212, 175, 55, 0.5));
    }
    25% {
        transform: translate(30px, -40px) rotate(10deg) scale(1.1);
        opacity: 0.5;
        filter: drop-shadow(0 0 25px rgba(212, 175, 55, 0.7));
    }
    50% {
        transform: translate(-20px, -70px) rotate(-10deg) scale(0.9);
        opacity: 0.4;
        filter: drop-shadow(0 0 20px rgba(212, 175, 55, 0.6));
    }
    75% {
        transform: translate(-35px, -40px) rotate(5deg) scale(1.05);
        opacity: 0.45;
        filter: drop-shadow(0 0 22px rgba(212, 175, 55, 0.65));
    }
}

.floating-icon-cinematic {
    position: absolute;
    font-size: 2.5rem;
    pointer-events: none;
    animation: floatCinematic 25s ease-in-out infinite;
    z-index: 10;
    transition: transform 0.3s ease, opacity 0.3s ease;
    opacity: 0.25;
}

.floating-icons-cinematic {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    overflow: visible;
    pointer-events: none;
    z-index: 10;
}

.floating-icon-cinematic.scroll-fast {
    animation-duration: 15s;
    opacity: 0.5;
}

/* Ensure hero and gallery sections can contain floating icons */
.hero-section,
.gallery-section {
    position: relative;
    overflow: hidden;
}

/* ============================================
   LENS FLARE & LIGHT SWEEP
   ============================================ */
@keyframes lightSweep {
    0% {
        transform: translateX(-100%) skewX(-25deg);
        opacity: 0;
    }
    50% {
        opacity: 0.8;
    }
    100% {
        transform: translateX(200%) skewX(-25deg);
        opacity: 0;
    }
}

.hero-light-sweep {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: linear-gradient(
        90deg,
        transparent 0%,
        rgba(255, 255, 255, 0.4) 50%,
        transparent 100%
    );
    animation: lightSweep 3s ease-in-out infinite;
    pointer-events: none;
    z-index: 2;
}

.hero-lens-flare {
    position: absolute;
    top: 30%;
    right: 20%;
    width: 300px;
    height: 300px;
    background: radial-gradient(
        circle,
        rgba(255, 255, 255, 0.6) 0%,
        rgba(212, 175, 55, 0.4) 30%,
        transparent 70%
    );
    border-radius: 50%;
    pointer-events: none;
    z-index: 2;
    animation: lensFlarePulse 4s ease-in-out infinite;
    filter: blur(30px);
}

@keyframes lensFlarePulse {
    0%, 100% {
        opacity: 0.3;
        transform: translate(-50%, -50%) scale(1) rotate(0deg);
    }
    50% {
        opacity: 0.6;
        transform: translate(-50%, -50%) scale(1.3) rotate(180deg);
    }
}

/* ============================================
   HERO VIDEO ZOOM EFFECT
   ============================================ */
.hero-video-zoom {
    animation: subtleZoomIn 20s ease-in-out infinite;
    transform-origin: center center;
}

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

/* ============================================
   SCROLL-TRIGGERED PHOTO ANIMATIONS
   ============================================ */
@keyframes photoReveal {
    from {
        opacity: 0;
        transform: scale(0.95) translateY(30px);
        filter: blur(5px);
        box-shadow: 0 0 0 rgba(0, 0, 0, 0);
    }
    to {
        opacity: 1;
        transform: scale(1) translateY(0);
        filter: blur(0);
        box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
    }
}

.photo-reveal {
    opacity: 0;
    animation: photoReveal 1.2s cubic-bezier(0.4, 0, 0.2, 1) forwards;
}

.photo-reveal.animated {
    animation-play-state: running;
}

/* ============================================
   HOVER PARALLAX TILT EFFECT
   ============================================ */
.media-card-tilt {
    transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    transform-style: preserve-3d;
    perspective: 1000px;
}

.media-card-tilt:hover {
    transform: perspective(1000px) rotateX(2deg) rotateY(-2deg) scale(1.02);
}

.media-card-tilt:hover img,
.media-card-tilt:hover video {
    transform: translateZ(20px);
}

/* ============================================
   BUTTON & ICON ENHANCEMENTS
   ============================================ */
@keyframes buttonGlow {
    0%, 100% {
        box-shadow: 0 0 10px rgba(212, 175, 55, 0.3);
    }
    50% {
        box-shadow: 0 0 25px rgba(212, 175, 55, 0.6), 0 0 40px rgba(212, 175, 55, 0.4);
    }
}

.btn-cinematic,
.btn-primary,
.btn-nav-cta {
    position: relative;
    overflow: hidden;
    transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1),
                box-shadow 0.3s ease;
}

.btn-cinematic:hover,
.btn-primary:hover,
.btn-nav-cta:hover {
    transform: scale(1.05);
    animation: buttonGlow 2s ease-in-out infinite;
}

/* ============================================
   CLICK RIPPLE EFFECT
   ============================================ */
@keyframes ripple {
    0% {
        transform: scale(0);
        opacity: 0.6;
    }
    100% {
        transform: scale(4);
        opacity: 0;
    }
}

.ripple-effect {
    position: absolute;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.6);
    width: 20px;
    height: 20px;
    transform: scale(0);
    animation: ripple 0.6s ease-out;
    pointer-events: none;
}

/* ============================================
   FLOATING GRADIENT PARTICLES
   ============================================ */
@keyframes floatParticle {
    0%, 100% {
        transform: translateY(0) translateX(0) scale(1);
        opacity: 0.4;
    }
    33% {
        transform: translateY(-30px) translateX(10px) scale(1.2);
        opacity: 0.6;
    }
    66% {
        transform: translateY(-60px) translateX(-15px) scale(0.8);
        opacity: 0.5;
    }
}

@keyframes shimmer {
    0%, 100% {
        opacity: 0.3;
    }
    50% {
        opacity: 1;
    }
}

.gradient-particle {
    position: absolute;
    width: 8px;
    height: 8px;
    background: radial-gradient(circle, rgba(212, 175, 55, 0.8), transparent);
    border-radius: 50%;
    pointer-events: none;
    animation: floatParticle 4s ease-in-out infinite, shimmer 2s ease-in-out infinite;
}

.gradient-particle:nth-child(1) { animation-delay: 0s; }
.gradient-particle:nth-child(2) { animation-delay: 0.5s; }
.gradient-particle:nth-child(3) { animation-delay: 1s; }
.gradient-particle:nth-child(4) { animation-delay: 1.5s; }
.gradient-particle:nth-child(5) { animation-delay: 2s; }

/* ============================================
   SCROLL-TO-TOP CINEMATIC REVEAL
   ============================================ */
@keyframes lensClose {
    0% {
        transform: scale(1) rotate(0deg);
        opacity: 1;
    }
    50% {
        transform: scale(0.8) rotate(180deg);
        opacity: 0.7;
    }
    100% {
        transform: scale(0) rotate(360deg);
        opacity: 0;
    }
}

.scroll-to-top {
    position: fixed;
    bottom: 30px;
    right: 30px;
    width: 50px;
    height: 50px;
    background: linear-gradient(135deg, var(--navy) 0%, var(--navy-light) 100%);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    opacity: 0;
    visibility: hidden;
    transition: all 0.3s ease;
    z-index: 1000;
    box-shadow: 0 5px 20px rgba(0, 0, 0, 0.3);
}

.scroll-to-top.visible {
    opacity: 1;
    visibility: visible;
}

.scroll-to-top:hover {
    transform: scale(1.1);
    box-shadow: 0 8px 30px rgba(212, 175, 55, 0.5);
}

.scroll-to-top::before {
    content: '↑';
    font-size: 1.5rem;
    color: var(--white);
}

.scroll-to-top.clicking {
    animation: lensClose 0.6s ease-out;
}

/* ============================================
   MOTION TRAIL EFFECT
   ============================================ */
@keyframes motionTrail {
    0% {
        opacity: 0.8;
        transform: scale(1);
    }
    100% {
        opacity: 0;
        transform: scale(1.5);
    }
}

.motion-trail {
    position: fixed;
    width: 100px;
    height: 100px;
    border-radius: 50%;
    background: radial-gradient(circle, rgba(212, 175, 55, 0.6), transparent);
    pointer-events: none;
    z-index: 9999;
    animation: motionTrail 0.8s ease-out forwards;
}

/* ============================================
   DIRECTION-BASED ANIMATIONS
   ============================================ */
.slide-from-left {
    animation: fadeSlideLeft 0.8s cubic-bezier(0.4, 0, 0.2, 1);
}

.slide-from-right {
    animation: fadeSlideRight 0.8s cubic-bezier(0.4, 0, 0.2, 1);
}

/* ============================================
   PERFORMANCE OPTIMIZATIONS
   ============================================ */
.cinematic-element {
    will-change: transform, opacity;
    backface-visibility: hidden;
    -webkit-font-smoothing: antialiased;
}

/* ============================================
   MOBILE RESPONSIVE
   ============================================ */
@media (max-width: 768px) {
    .floating-icon-cinematic {
        font-size: 1.5rem;
        opacity: 0.1;
    }
    
    .hero-lens-flare {
        width: 150px;
        height: 150px;
    }
    
    .camera-lens-loader {
        width: 60px;
        height: 60px;
    }
    
    .media-card-tilt:hover {
        transform: none;
    }
    
    /* Reduce animation complexity on mobile */
    .hero-video-zoom {
        animation: none;
    }
}

@media (prefers-reduced-motion: reduce) {
    *,
    *::before,
    *::after {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
    }
}

