/**
 * WebRise Demo Effects CSS v2.0
 * Scroll-Reveal · Parallax · Tilt · Lightbox · Marquee · Animations
 */

/* ═══════════════════════════════════════════════════════════════════════════
   1. SCROLL REVEAL ANIMATIONS
   ═══════════════════════════════════════════════════════════════════════════ */

/* Base state for all reveal elements */
[data-reveal] {
  opacity: 0;
  will-change: transform, opacity;
  transition: opacity 0.8s cubic-bezier(0.16, 1, 0.3, 1),
              transform 0.8s cubic-bezier(0.16, 1, 0.3, 1);
}

/* Reveal types */
[data-reveal="up"]    { transform: translate3d(0, 50px, 0); }
[data-reveal="down"]  { transform: translate3d(0, -50px, 0); }
[data-reveal="left"]  { transform: translate3d(60px, 0, 0); }
[data-reveal="right"] { transform: translate3d(-60px, 0, 0); }
[data-reveal="scale"] { transform: scale(0.9); }
[data-reveal="fade"]  { transform: none; }
[data-reveal="flip"]  { transform: perspective(800px) rotateY(15deg); }

/* Revealed state */
[data-reveal].revealed {
  opacity: 1;
  transform: translate3d(0, 0, 0) scale(1) rotateY(0deg);
}

/* ═══════════════════════════════════════════════════════════════════════════
   2. PARALLAX
   ═══════════════════════════════════════════════════════════════════════════ */
[data-parallax] {
  will-change: transform;
}

.wr-parallax-hero {
  position: relative;
  overflow: hidden;
}

.wr-parallax-hero > [data-parallax] {
  position: absolute;
  inset: -20% 0;
  background-size: cover;
  background-position: center;
}

/* ═══════════════════════════════════════════════════════════════════════════
   3. TILT GLARE
   ═══════════════════════════════════════════════════════════════════════════ */
.wr-tilt-glare {
  position: absolute;
  inset: 0;
  pointer-events: none;
  z-index: 2;
  border-radius: inherit;
  transition: background 0.3s;
}

[data-tilt] {
  will-change: transform;
  transition: transform 0.15s ease-out;
}

/* ═══════════════════════════════════════════════════════════════════════════
   4. LIGHTBOX
   ═══════════════════════════════════════════════════════════════════════════ */
.wr-lightbox-overlay {
  position: fixed;
  inset: 0;
  z-index: 99999;
  background: rgba(0, 0, 0, 0.92);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.35s ease;
}
.wr-lightbox-overlay.active {
  opacity: 1;
  pointer-events: auto;
}
.wr-lightbox-img {
  max-width: 90vw;
  max-height: 85vh;
  border-radius: 8px;
  box-shadow: 0 30px 80px rgba(0, 0, 0, 0.5);
  transform: scale(0.95);
  transition: transform 0.4s cubic-bezier(0.16, 1, 0.3, 1);
}
.wr-lightbox-overlay.active .wr-lightbox-img {
  transform: scale(1);
}
.wr-lightbox-close {
  position: absolute;
  top: 20px;
  right: 24px;
  background: none;
  border: none;
  color: #fff;
  font-size: 36px;
  cursor: pointer;
  opacity: 0.7;
  transition: opacity 0.2s;
  z-index: 3;
}
.wr-lightbox-close:hover { opacity: 1; }
.wr-lightbox-prev,
.wr-lightbox-next {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  background: rgba(255,255,255,0.1);
  backdrop-filter: blur(10px);
  border: 1px solid rgba(255,255,255,0.15);
  color: #fff;
  font-size: 28px;
  width: 50px;
  height: 50px;
  border-radius: 50%;
  cursor: pointer;
  transition: all 0.2s;
  display: flex;
  align-items: center;
  justify-content: center;
}
.wr-lightbox-prev { left: 20px; }
.wr-lightbox-next { right: 20px; }
.wr-lightbox-prev:hover,
.wr-lightbox-next:hover {
  background: rgba(255,255,255,0.2);
  transform: translateY(-50%) scale(1.1);
}

/* ═══════════════════════════════════════════════════════════════════════════
   5. MARQUEE / TICKER
   ═══════════════════════════════════════════════════════════════════════════ */
[data-marquee] {
  overflow: hidden;
  white-space: nowrap;
}
[data-marquee-track] {
  display: inline-flex;
  animation: wrMarquee 40s linear infinite;
  will-change: transform;
}
[data-marquee]:hover [data-marquee-track] {
  animation-play-state: paused;
}

@keyframes wrMarquee {
  0%   { transform: translate3d(0, 0, 0); }
  100% { transform: translate3d(-50%, 0, 0); }
}

/* ═══════════════════════════════════════════════════════════════════════════
   6. HORIZONTAL SCROLL GALLERY
   ═══════════════════════════════════════════════════════════════════════════ */
[data-hscroll-track] {
  display: flex;
  gap: 16px;
  overflow-x: auto;
  scroll-snap-type: x mandatory;
  -webkit-overflow-scrolling: touch;
  scrollbar-width: none;
  cursor: grab;
  padding-bottom: 8px;
}
[data-hscroll-track]::-webkit-scrollbar { display: none; }
[data-hscroll-track].dragging { cursor: grabbing; }
[data-hscroll-track] > * {
  flex: 0 0 auto;
  scroll-snap-align: start;
}

/* ═══════════════════════════════════════════════════════════════════════════
   7. TEXT SPLIT
   ═══════════════════════════════════════════════════════════════════════════ */
.wr-split-word,
.wr-split-char {
  display: inline-block;
}
.wr-split-word > span,
.wr-split-char {
  display: inline-block;
  animation: wrSplitIn 0.6s cubic-bezier(0.16, 1, 0.3, 1) both;
  animation-delay: calc(var(--i) * 0.05s);
}

@keyframes wrSplitIn {
  from { opacity: 0; transform: translateY(40px) rotateX(-20deg); }
  to   { opacity: 1; transform: translateY(0) rotateX(0deg); }
}

/* ═══════════════════════════════════════════════════════════════════════════
   8. NAVBAR
   ═══════════════════════════════════════════════════════════════════════════ */
[data-navbar] {
  transition: all 0.35s cubic-bezier(0.16, 1, 0.3, 1);
}
[data-navbar].scrolled {
  background: rgba(10, 10, 10, 0.85) !important;
  backdrop-filter: blur(20px) saturate(1.5);
  -webkit-backdrop-filter: blur(20px) saturate(1.5);
  box-shadow: 0 1px 30px rgba(0, 0, 0, 0.3);
}
[data-navbar].hidden {
  transform: translateY(-100%);
  pointer-events: none;
}

/* ═══════════════════════════════════════════════════════════════════════════
   9. COMMON KEYFRAMES
   ═══════════════════════════════════════════════════════════════════════════ */
@keyframes wrFadeUp {
  from { opacity: 0; transform: translateY(20px); }
  to   { opacity: 1; transform: translateY(0); }
}

@keyframes wrFadeIn {
  from { opacity: 0; }
  to   { opacity: 1; }
}

@keyframes wrScaleIn {
  from { opacity: 0; transform: scale(0.9); }
  to   { opacity: 1; transform: scale(1); }
}

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

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

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

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

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

@keyframes wrGradientShift {
  0%, 100% { background-position: 0% 50%; }
  50%      { background-position: 100% 50%; }
}

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

@keyframes wrBorderGlow {
  0%, 100% { border-color: rgba(179, 227, 30, 0.3); }
  50%      { border-color: rgba(179, 227, 30, 0.8); }
}

/* ═══════════════════════════════════════════════════════════════════════════
   10. GLASSMORPHISM UTILITY
   ═══════════════════════════════════════════════════════════════════════════ */
.wr-glass {
  background: rgba(255, 255, 255, 0.06);
  backdrop-filter: blur(20px) saturate(1.4);
  -webkit-backdrop-filter: blur(20px) saturate(1.4);
  border: 1px solid rgba(255, 255, 255, 0.1);
}

.wr-glass-dark {
  background: rgba(0, 0, 0, 0.4);
  backdrop-filter: blur(30px) saturate(1.5);
  -webkit-backdrop-filter: blur(30px) saturate(1.5);
  border: 1px solid rgba(255, 255, 255, 0.08);
}

/* ═══════════════════════════════════════════════════════════════════════════
   11. GRADIENT TEXT
   ═══════════════════════════════════════════════════════════════════════════ */
.wr-gradient-text {
  background: linear-gradient(135deg, var(--accent, #b3e31e), var(--accent2, #7dd956));
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.wr-gradient-text-animated {
  background: linear-gradient(90deg, var(--accent, #b3e31e), var(--accent2, #7dd956), var(--accent, #b3e31e));
  background-size: 200% auto;
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  animation: wrGradientShift 3s ease infinite;
}

/* ═══════════════════════════════════════════════════════════════════════════
   12. MAGNETIC BUTTON STYLE
   ═══════════════════════════════════════════════════════════════════════════ */
[data-magnetic] {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  will-change: transform;
  transition: transform 0.15s ease-out;
}

/* ═══════════════════════════════════════════════════════════════════════════
   13. SCROLL PROGRESS INDICATOR
   ═══════════════════════════════════════════════════════════════════════════ */
.wr-scroll-progress {
  position: fixed;
  top: 0;
  left: 0;
  width: 0%;
  height: 3px;
  background: linear-gradient(90deg, var(--accent, #b3e31e), var(--accent2, #7dd956));
  z-index: 100000;
  transition: width 0.1s linear;
}

/* ═══════════════════════════════════════════════════════════════════════════
   14. REDUCED MOTION
   ═══════════════════════════════════════════════════════════════════════════ */
@media (prefers-reduced-motion: reduce) {
  [data-reveal] {
    opacity: 1 !important;
    transform: none !important;
    transition: none !important;
  }
  [data-marquee-track] {
    animation: none !important;
  }
  .wr-split-word > span,
  .wr-split-char {
    animation: none !important;
    opacity: 1 !important;
    transform: none !important;
  }
  [data-parallax] {
    transform: none !important;
  }
}

/* ═══════════════════════════════════════════════════════════════════════════
   15. MOBILE ADJUSTMENTS
   ═══════════════════════════════════════════════════════════════════════════ */
@media (max-width: 768px) {
  [data-reveal="left"],
  [data-reveal="right"] {
    transform: translate3d(0, 30px, 0);
  }

  .wr-lightbox-prev,
  .wr-lightbox-next {
    width: 40px;
    height: 40px;
    font-size: 22px;
  }
  .wr-lightbox-prev { left: 10px; }
  .wr-lightbox-next { right: 10px; }
}
