/* ═══════════════════════════════════════════════════════════════════════════
   ULTRA SPECTACULAR ENHANCEMENTS
   GSAP + Barba.js + Custom Cursor + Preloader + Dark Mode + More
   ═══════════════════════════════════════════════════════════════════════════ */

/* ═══════════════════════════════════════════════════════════════════════════
   1. PRELOADER - Creative Ministry-Themed Loading Animation
   ═══════════════════════════════════════════════════════════════════════════ */

.preloader {
    position: fixed;
    inset: 0;
    background: #000;
    z-index: 99999;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    transition: opacity 0.8s ease, visibility 0.8s ease;
}

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

.preloader-logo {
    width: 120px;
    height: 120px;
    border-radius: 50%;
    border: 3px solid rgba(255, 255, 255, 0.2);
    animation: preloaderPulse 2s ease-in-out infinite, preloaderGlow 3s ease-in-out infinite;
    box-shadow: 0 0 60px rgba(255, 255, 255, 0.3);
}

.preloader-ring {
    position: absolute;
    width: 160px;
    height: 160px;
    border: 2px solid transparent;
    border-top-color: #fff;
    border-radius: 50%;
    animation: preloaderSpin 1.2s linear infinite;
}

.preloader-ring:nth-child(2) {
    width: 180px;
    height: 180px;
    border-top-color: rgba(255, 255, 255, 0.5);
    animation-duration: 1.8s;
    animation-direction: reverse;
}

.preloader-ring:nth-child(3) {
    width: 200px;
    height: 200px;
    border-top-color: rgba(255, 255, 255, 0.3);
    animation-duration: 2.4s;
}

.preloader-text {
    margin-top: 3rem;
    font-family: 'Montserrat', sans-serif;
    font-size: 0.75rem;
    font-weight: 600;
    letter-spacing: 0.4em;
    text-transform: uppercase;
    color: rgba(255, 255, 255, 0.7);
    animation: preloaderFade 1.5s ease-in-out infinite;
}

.preloader-progress {
    width: 200px;
    height: 2px;
    background: rgba(255, 255, 255, 0.1);
    margin-top: 1.5rem;
    border-radius: 2px;
    overflow: hidden;
}

.preloader-progress-bar {
    height: 100%;
    background: linear-gradient(90deg, #fff, rgba(255, 255, 255, 0.5));
    width: 0%;
    transition: width 0.3s ease;
    border-radius: 2px;
}

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

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

@keyframes preloaderGlow {
    0%, 100% { box-shadow: 0 0 40px rgba(255, 255, 255, 0.2); }
    50% { box-shadow: 0 0 80px rgba(255, 255, 255, 0.5); }
}

@keyframes preloaderFade {
    0%, 100% { opacity: 0.5; }
    50% { opacity: 1; }
}

/* ═══════════════════════════════════════════════════════════════════════════
   2. CUSTOM CURSOR - With Trail and Magnetic Effects
   ═══════════════════════════════════════════════════════════════════════════ */

.cursor-dot {
    position: fixed;
    width: 8px;
    height: 8px;
    background: #fff;
    border-radius: 50%;
    pointer-events: none;
    z-index: 100000;
    transform: translate(-50%, -50%);
    transition: transform 0.1s ease, background 0.2s ease;
    mix-blend-mode: difference;
}

.cursor-outline {
    position: fixed;
    width: 40px;
    height: 40px;
    border: 2px solid rgba(255, 255, 255, 0.5);
    border-radius: 50%;
    pointer-events: none;
    z-index: 99999;
    transform: translate(-50%, -50%);
    transition: all 0.15s ease;
    mix-blend-mode: difference;
}

.cursor-dot.hover {
    transform: translate(-50%, -50%) scale(2);
    background: #fff;
}

.cursor-outline.hover {
    width: 60px;
    height: 60px;
    border-color: #fff;
    background: rgba(255, 255, 255, 0.1);
}

.cursor-outline.clicking {
    transform: translate(-50%, -50%) scale(0.8);
}

/* Hide cursor on touch devices */
@media (hover: none) and (pointer: coarse) {
    .cursor-dot, .cursor-outline { display: none; }
}

/* Magnetic button wrapper */
.magnetic-wrap {
    display: inline-block;
    position: relative;
}

/* ═══════════════════════════════════════════════════════════════════════════
   3. SCROLL PROGRESS INDICATOR
   ═══════════════════════════════════════════════════════════════════════════ */

.scroll-progress {
    position: fixed;
    top: 0;
    left: 0;
    width: 0%;
    height: 3px;
    background: linear-gradient(90deg, #fff 0%, rgba(255, 255, 255, 0.5) 50%, #fff 100%);
    background-size: 200% 100%;
    animation: progressShimmer 2s linear infinite;
    z-index: 10001;
    box-shadow: 0 0 10px rgba(255, 255, 255, 0.5);
}

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

/* ═══════════════════════════════════════════════════════════════════════════
   4. DARK MODE TOGGLE
   ═══════════════════════════════════════════════════════════════════════════ */

.theme-toggle {
    position: fixed;
    bottom: 2rem;
    right: 2rem;
    width: 50px;
    height: 50px;
    border-radius: 50%;
    border: 2px solid rgba(255, 255, 255, 0.3);
    background: rgba(0, 0, 0, 0.5);
    backdrop-filter: blur(10px);
    cursor: pointer;
    z-index: 9999;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.4s cubic-bezier(0.68, -0.55, 0.265, 1.55);
    overflow: hidden;
}

.theme-toggle:hover {
    transform: scale(1.1) rotate(15deg);
    border-color: #fff;
    box-shadow: 0 0 30px rgba(255, 255, 255, 0.3);
}

.theme-toggle-icon {
    position: relative;
    width: 24px;
    height: 24px;
}

.theme-toggle .sun,
.theme-toggle .moon {
    position: absolute;
    inset: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.2rem;
    transition: all 0.4s ease;
}

.theme-toggle .sun {
    opacity: 1;
    transform: rotate(0deg) scale(1);
}

.theme-toggle .moon {
    opacity: 0;
    transform: rotate(-90deg) scale(0.5);
}

/* Light mode styles */
[data-theme="light"] {
    --black: #f5f5f5;
    --white: #1a1a1a;
    --white-dim: rgba(26, 26, 26, 0.7);
    --purple-deep: #f0f0f0;
    --purple-dark: #e5e5e5;
}

[data-theme="light"] .theme-toggle .sun {
    opacity: 0;
    transform: rotate(90deg) scale(0.5);
}

[data-theme="light"] .theme-toggle .moon {
    opacity: 1;
    transform: rotate(0deg) scale(1);
}

[data-theme="light"] .bg-gradient {
    background: radial-gradient(ellipse at 20% 20%, #ddd 0%, transparent 50%),
                radial-gradient(ellipse at 80% 80%, rgba(200, 200, 200, 0.3) 0%, transparent 50%),
                radial-gradient(ellipse at 50% 50%, #eee 0%, #f5f5f5 100%);
}

/* ═══════════════════════════════════════════════════════════════════════════
   5. NOISE TEXTURE OVERLAY
   ═══════════════════════════════════════════════════════════════════════════ */

.noise-overlay {
    position: fixed;
    inset: 0;
    pointer-events: none;
    z-index: 9998;
    opacity: 0.03;
    background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 256 256' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='noise'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.9' numOctaves='4' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23noise)'/%3E%3C/svg%3E");
    background-repeat: repeat;
}

/* ═══════════════════════════════════════════════════════════════════════════
   6. PAGE TRANSITIONS (Barba.js)
   ═══════════════════════════════════════════════════════════════════════════ */

.page-transition {
    position: fixed;
    inset: 0;
    z-index: 99998;
    pointer-events: none;
}

.page-transition-layer {
    position: absolute;
    inset: 0;
    background: #000;
    transform: translateY(100%);
}

.page-transition-layer:nth-child(2) {
    background: #111;
}

.page-transition-layer:nth-child(3) {
    background: #222;
}

/* ═══════════════════════════════════════════════════════════════════════════
   7. GSAP TEXT REVEAL ANIMATIONS
   ═══════════════════════════════════════════════════════════════════════════ */

.split-text .char {
    display: inline-block;
    opacity: 0;
    transform: translateY(50px) rotate(5deg);
}

.split-text .word {
    display: inline-block;
    overflow: hidden;
}

.text-reveal {
    clip-path: polygon(0 0, 100% 0, 100% 100%, 0 100%);
}

/* ═══════════════════════════════════════════════════════════════════════════
   8. PARALLAX ELEMENTS
   ═══════════════════════════════════════════════════════════════════════════ */

[data-speed] {
    will-change: transform;
}

/* ═══════════════════════════════════════════════════════════════════════════
   9. COUNTER ANIMATION STYLES
   ═══════════════════════════════════════════════════════════════════════════ */

.counter {
    font-variant-numeric: tabular-nums;
}

/* ═══════════════════════════════════════════════════════════════════════════
   10. MAGNETIC BUTTON HOVER EFFECT
   ═══════════════════════════════════════════════════════════════════════════ */

.btn, .nav-btn, .givelify-btn {
    position: relative;
    overflow: visible;
}

/* ═══════════════════════════════════════════════════════════════════════════
   11. IMAGE REVEAL ANIMATIONS
   ═══════════════════════════════════════════════════════════════════════════ */

.img-reveal {
    position: relative;
    overflow: hidden;
}

.img-reveal::after {
    content: '';
    position: absolute;
    inset: 0;
    background: #000;
    transform-origin: left;
}

.img-reveal img {
    transform: scale(1.3);
    transition: transform 1.2s cubic-bezier(0.16, 1, 0.3, 1);
}

.img-reveal.revealed img {
    transform: scale(1);
}

/* ═══════════════════════════════════════════════════════════════════════════
   12. SMOOTH SCROLLING ENHANCEMENTS (Lenis)
   ═══════════════════════════════════════════════════════════════════════════ */

html.lenis {
    height: auto;
}

.lenis.lenis-smooth {
    scroll-behavior: auto;
}

.lenis.lenis-smooth [data-lenis-prevent] {
    overscroll-behavior: contain;
}

/* ═══════════════════════════════════════════════════════════════════════════
   13. HORIZONTAL SCROLL SECTION
   ═══════════════════════════════════════════════════════════════════════════ */

.horizontal-scroll-wrapper {
    overflow: hidden;
}

.horizontal-scroll-container {
    display: flex;
    flex-wrap: nowrap;
    width: fit-content;
}

.horizontal-scroll-panel {
    width: 100vw;
    min-width: 100vw;
    height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

/* ═══════════════════════════════════════════════════════════════════════════
   14. STAGGER ANIMATION CLASSES
   ═══════════════════════════════════════════════════════════════════════════ */

.stagger-item {
    opacity: 0;
    transform: translateY(40px);
}

.stagger-item.animated {
    opacity: 1;
    transform: translateY(0);
}

/* ═══════════════════════════════════════════════════════════════════════════
   15. GLITCH TEXT EFFECT (Optional Hover)
   ═══════════════════════════════════════════════════════════════════════════ */

.glitch-text {
    position: relative;
}

.glitch-text:hover {
    animation: glitch 0.3s ease-in-out;
}

@keyframes glitch {
    0%, 100% { transform: translate(0); }
    20% { transform: translate(-2px, 2px); }
    40% { transform: translate(-2px, -2px); }
    60% { transform: translate(2px, 2px); }
    80% { transform: translate(2px, -2px); }
}

/* ═══════════════════════════════════════════════════════════════════════════
   16. FLOATING ACTION ELEMENTS
   ═══════════════════════════════════════════════════════════════════════════ */

.float-up {
    animation: floatUp 3s ease-in-out infinite;
}

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

/* ═══════════════════════════════════════════════════════════════════════════
   17. REDUCED MOTION SUPPORT
   ═══════════════════════════════════════════════════════════════════════════ */

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

    .preloader { display: none; }
    .cursor-dot, .cursor-outline { display: none; }
    .noise-overlay { display: none; }
    .float-img, .particle, .lens-flare { display: none !important; }
}

/* ═══════════════════════════════════════════════════════════════════════════
   18. RESPONSIVE ADJUSTMENTS
   ═══════════════════════════════════════════════════════════════════════════ */

@media (max-width: 768px) {
    .cursor-dot, .cursor-outline {
        display: none;
    }

    .theme-toggle {
        bottom: 1rem;
        right: 1rem;
        width: 44px;
        height: 44px;
    }

    .preloader-logo {
        width: 80px;
        height: 80px;
    }

    .preloader-ring {
        width: 120px;
        height: 120px;
    }

    .preloader-ring:nth-child(2) {
        width: 140px;
        height: 140px;
    }

    .preloader-ring:nth-child(3) {
        width: 160px;
        height: 160px;
    }
}
