/* ============================================================
   styles-ux.css – Interactive Joy, Micro-Animations & Polish
   Loaded AFTER styles.min.css + styles-extra.css
   ============================================================ */

/* ---- CSS Custom Properties for UX layer ---- */
:root {
    --ux-glow-color: rgba(216, 30, 42, 0.35);
    --ux-ripple-color: rgba(216, 30, 42, 0.22);
    --ux-transition-spring: cubic-bezier(0.22, 1, 0.36, 1);
    --ux-transition-bounce: cubic-bezier(0.34, 1.56, 0.64, 1);
    --ux-card-glow: radial-gradient(600px circle at var(--glow-x, 50%) var(--glow-y, 50%), rgba(216, 30, 42, 0.08), transparent 40%);
    --ux-confetti-1: #d81e2a;
    --ux-confetti-2: #1f7a38;
    --ux-confetti-3: #f59e0b;
    --ux-confetti-4: #3b82f6;
    --ux-confetti-5: #a855f7;
}

[data-theme="dark"] {
    --ux-glow-color: rgba(255, 127, 137, 0.3);
    --ux-ripple-color: rgba(255, 127, 137, 0.18);
    --ux-card-glow: radial-gradient(600px circle at var(--glow-x, 50%) var(--glow-y, 50%), rgba(255, 127, 137, 0.1), transparent 40%);
}

/* ============================================================
   1. ENHANCED SCROLL PROGRESS BAR
   ============================================================ */
.scroll-progress {
    background: transparent !important;
    height: 3px !important;
    z-index: 9999 !important;
}

.scroll-progress::after {
    content: '';
    position: absolute;
    inset: 0;
    background: linear-gradient(90deg, #d81e2a, #f59e0b, #1f7a38, #3b82f6, #d81e2a);
    background-size: 200% 100%;
    animation: ux-scroll-shimmer 3s linear infinite;
    filter: blur(0px);
    opacity: 0.9;
    transform: scaleX(var(--scroll-progress, 0));
    transform-origin: left;
}

.scroll-progress.has-glow::after {
    box-shadow: 0 0 12px 2px var(--ux-glow-color);
    height: 3px;
}

@keyframes ux-scroll-shimmer {
    0% {
        background-position: 0% 50%;
    }

    100% {
        background-position: 200% 50%;
    }
}

[data-theme="dark"] .scroll-progress::after {
    filter: brightness(1.2);
}

/* ============================================================
   2. MAGNETIC BUTTON EFFECT
   ============================================================ */
.button[data-magnetic],
a.button[data-magnetic] {
    transition: transform 0.3s var(--ux-transition-spring), box-shadow 0.3s ease;
    will-change: transform;
}

/* ============================================================
   3. RIPPLE CLICK EFFECT
   ============================================================ */
.button,
a.button,
.vote-button,
.hub-card,
.beitrag-step {
    position: relative;
    overflow: hidden;
}

.ux-ripple {
    position: absolute;
    border-radius: 50%;
    background: var(--ux-ripple-color);
    transform: scale(0);
    animation: ux-ripple-expand 0.6s ease-out forwards;
    pointer-events: none;
    z-index: 10;
}

@keyframes ux-ripple-expand {
    0% {
        transform: scale(0);
        opacity: 1;
    }

    100% {
        transform: scale(4);
        opacity: 0;
    }
}

/* ============================================================
   4. 3D TILT CARDS
   ============================================================ */
.hub-card,
.schedule-card,
.supplier-card,
.story-card,
.event-card,
.today-card,
.contact-card,
.whatsapp-card,
.review-card,
.news-item,
.wishlist-item,
.member-step,
.person-card,
.thanks-card,
.quote-card {
    transition: transform 0.4s var(--ux-transition-spring), box-shadow 0.4s ease;
    will-change: transform;
    transform-style: preserve-3d;
}

@media (hover: hover) and (min-width: 769px) {
    [data-tilt] {
        transform: perspective(800px) rotateX(var(--tilt-x, 0deg)) rotateY(var(--tilt-y, 0deg)) scale(1.02);
    }
}

/* ============================================================
   5. GLOW CARD SPOTLIGHT
   ============================================================ */
.hub-card::before,
.schedule-card::before,
.event-card::before,
.today-card::before,
.supplier-card::before,
.whatsapp-card::before,
.review-card::before,
.news-item::before {
    content: '';
    position: absolute;
    inset: 0;
    border-radius: inherit;
    background: var(--ux-card-glow);
    opacity: 0;
    transition: opacity 0.4s ease;
    pointer-events: none;
    z-index: 0;
}

@media (hover: hover) {

    .hub-card:hover::before,
    .schedule-card:hover::before,
    .event-card:hover::before,
    .today-card:hover::before,
    .supplier-card:hover::before,
    .whatsapp-card:hover::before,
    .review-card:hover::before,
    .news-item:hover::before {
        opacity: 1;
    }
}

/* ============================================================
   6. CONFETTI PARTICLES (Vote-Buttons)
   ============================================================ */
.ux-confetti-particle {
    position: fixed;
    width: 8px;
    height: 8px;
    border-radius: 2px;
    pointer-events: none;
    z-index: 99999;
    animation: ux-confetti-fall 1s var(--ux-transition-spring) forwards;
}

@keyframes ux-confetti-fall {
    0% {
        opacity: 1;
        transform: translate(0, 0) rotate(0deg) scale(1);
    }

    100% {
        opacity: 0;
        transform: translate(var(--confetti-x, 60px), var(--confetti-y, -120px)) rotate(var(--confetti-r, 360deg)) scale(0.3);
    }
}

/* ============================================================
   7. ANIMATED COUNTERS
   ============================================================ */
[data-counter] {
    display: inline-block;
    font-variant-numeric: tabular-nums;
}

/* ============================================================
   8. TYPING HERO EFFECT
   ============================================================ */
.mega-title.ux-typing {
    overflow: hidden;
    border-right: 3px solid var(--accent, #d81e2a);
    animation: ux-blink-cursor 0.7s step-end infinite;
    white-space: nowrap;
    width: 0;
}

.mega-title.ux-typing.ux-typing-done {
    border-right-color: transparent;
    animation: none;
    white-space: normal;
    width: auto;
}

@keyframes ux-blink-cursor {

    0%,
    100% {
        border-right-color: var(--accent, #d81e2a);
    }

    50% {
        border-right-color: transparent;
    }
}

/* ============================================================
   9. FLOATING BACK-TO-TOP BUTTON
   ============================================================ */
.ux-back-to-top {
    position: fixed;
    bottom: 5.5rem;
    right: 1.25rem;
    width: 48px;
    height: 48px;
    border-radius: 50%;
    border: none;
    background: linear-gradient(135deg, #d81e2a 0%, #b61520 100%);
    color: #fff;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 8px 24px rgba(216, 30, 42, 0.3), 0 2px 8px rgba(0, 0, 0, 0.1);
    z-index: 1000;
    opacity: 0;
    transform: translateY(20px) scale(0.8);
    pointer-events: none;
    transition: opacity 0.35s ease, transform 0.4s var(--ux-transition-bounce);
}

.ux-back-to-top.is-visible {
    opacity: 1;
    transform: translateY(0) scale(1);
    pointer-events: auto;
}

.ux-back-to-top:hover {
    transform: translateY(-3px) scale(1.08);
    box-shadow: 0 12px 32px rgba(216, 30, 42, 0.4), 0 4px 12px rgba(0, 0, 0, 0.12);
}

.ux-back-to-top:active {
    transform: translateY(0) scale(0.95);
}

.ux-back-to-top svg {
    width: 22px;
    height: 22px;
    stroke: currentColor;
    fill: none;
    stroke-width: 2.5;
    stroke-linecap: round;
    stroke-linejoin: round;
}

/* Position above bottom-nav on mobile */
@media (max-width: 920px) {
    .ux-back-to-top {
        bottom: calc(5.55rem + env(safe-area-inset-bottom));
        right: 0.9rem;
        width: auto;
        min-width: 44px;
        height: 44px;
        padding: 0 0.88rem;
        gap: 0.4rem;
        border: 1px solid rgba(216, 30, 42, 0.12);
        border-radius: 999px;
        background: rgba(255, 255, 255, 0.94);
        color: #b61520;
        box-shadow: 0 14px 28px rgba(31, 26, 22, 0.14);
    }

    .ux-back-to-top::after {
        content: "Oben";
        font-size: 0.76rem;
        font-weight: 800;
        letter-spacing: 0.01em;
    }

    .ux-back-to-top svg {
        width: 18px;
        height: 18px;
    }

    .ux-back-to-top:hover {
        transform: translateY(-2px) scale(1.03);
        box-shadow: 0 18px 34px rgba(31, 26, 22, 0.16);
    }

    [data-theme="dark"] .ux-back-to-top {
        background: rgba(32, 28, 25, 0.94);
        border-color: rgba(255, 127, 137, 0.18);
        color: #ff8e97;
        box-shadow: 0 14px 30px rgba(0, 0, 0, 0.3);
    }
}

[data-theme="dark"] .ux-back-to-top {
    background: linear-gradient(135deg, #ff6b73 0%, #d81e2a 100%);
    box-shadow: 0 8px 24px rgba(255, 107, 115, 0.25), 0 2px 8px rgba(0, 0, 0, 0.2);
}

/* ============================================================
   10. WAVE SECTION DIVIDERS
   ============================================================ */
.ux-wave-divider {
    position: relative;
    width: 100%;
    height: 48px;
    overflow: hidden;
    margin: -1px 0;
    z-index: 2;
}

.ux-wave-divider svg {
    width: 100%;
    height: 100%;
    display: block;
}

.ux-wave-divider .ux-wave-fill {
    fill: var(--bg-section, #f8f7f5);
}

.section.alt+.ux-wave-divider .ux-wave-fill,
.ux-wave-divider.ux-wave-alt .ux-wave-fill {
    fill: var(--bg-main, #ffffff);
}

[data-theme="dark"] .ux-wave-divider .ux-wave-fill {
    fill: var(--bg-section-dark, #1a1614);
}

[data-theme="dark"] .section.alt+.ux-wave-divider .ux-wave-fill,
[data-theme="dark"] .ux-wave-divider.ux-wave-alt .ux-wave-fill {
    fill: var(--bg-main-dark, #141211);
}

/* ============================================================
   11. IMAGE WIPE REVEAL
   ============================================================ */
.ux-wipe-reveal {
    clip-path: inset(0 100% 0 0);
    transition: clip-path 0.8s var(--ux-transition-spring);
}

.ux-wipe-reveal.is-revealed {
    clip-path: inset(0 0% 0 0);
}

/* ============================================================
   12. SMOOTH PAGE TRANSITIONS
   ============================================================ */
.ux-page-transition-overlay {
    position: fixed;
    inset: 0;
    background: linear-gradient(135deg, rgba(255, 244, 238, 0.97), rgba(248, 247, 245, 0.97));
    z-index: 99998;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.28s ease;
}

.ux-page-transition-overlay.is-active {
    opacity: 1;
    pointer-events: auto;
}

[data-theme="dark"] .ux-page-transition-overlay {
    background: linear-gradient(135deg, rgba(20, 18, 17, 0.97), rgba(26, 22, 20, 0.97));
}

/* Page entry animation */
body.ux-page-entering main {
    animation: ux-page-enter 0.5s var(--ux-transition-spring) forwards;
}

@keyframes ux-page-enter {
    0% {
        opacity: 0;
        transform: translateY(16px);
    }

    100% {
        opacity: 1;
        transform: translateY(0);
    }
}

/* ============================================================
   13. BREADCRUMB NAVIGATION
   ============================================================ */
.ux-breadcrumb {
    padding: 0.6rem 0 0;
    font-size: 0.78rem;
    font-weight: 600;
    color: #8a7e78;
    display: flex;
    align-items: center;
    gap: 0.4rem;
    flex-wrap: wrap;
}

.ux-breadcrumb a {
    color: #6f5f56;
    text-decoration: none;
    transition: color 0.2s ease;
}

.ux-breadcrumb a:hover {
    color: var(--accent, #d81e2a);
}

.ux-breadcrumb .ux-bc-sep {
    color: #c4b8b0;
    font-size: 0.7rem;
}

.ux-breadcrumb .ux-bc-current {
    color: var(--accent, #d81e2a);
}

[data-theme="dark"] .ux-breadcrumb {
    color: #aa9d94;
}

[data-theme="dark"] .ux-breadcrumb a {
    color: #cabfb7;
}

[data-theme="dark"] .ux-breadcrumb .ux-bc-sep {
    color: #5a4f48;
}

[data-theme="dark"] .ux-breadcrumb .ux-bc-current {
    color: #ff8e97;
}

/* ============================================================
   14. FOOTER PARALLAX REVEAL
   ============================================================ */
.site-footer {
    position: relative;
}

main {
    position: relative;
    z-index: 1;
}

/* ============================================================
   15. ENHANCED BOTTOM NAV
   ============================================================ */
.bottom-nav-link.active svg {
    transform: scale(1.1);
    transition: transform 0.3s var(--ux-transition-bounce);
}

.bottom-nav-link:active svg {
    transform: scale(0.85);
    transition: transform 0.1s ease;
}

/* Active indicator dot */
.bottom-nav-link.active::after {
    content: '';
    position: absolute;
    bottom: 4px;
    left: 50%;
    transform: translateX(-50%);
    width: 4px;
    height: 4px;
    border-radius: 50%;
    background: var(--accent, #d81e2a);
    animation: ux-dot-appear 0.3s var(--ux-transition-bounce) forwards;
}

@keyframes ux-dot-appear {
    0% {
        transform: translateX(-50%) scale(0);
    }

    100% {
        transform: translateX(-50%) scale(1);
    }
}

/* ============================================================
   16. INTERACTIVE VOTE BUTTON ENHANCEMENTS
   ============================================================ */
.vote-button {
    transition: transform 0.25s var(--ux-transition-bounce), box-shadow 0.25s ease, background 0.25s ease;
}

.vote-button:active {
    transform: scale(0.92);
}

.vote-button.ux-voted {
    animation: ux-vote-pulse 0.4s var(--ux-transition-bounce);
}

@keyframes ux-vote-pulse {
    0% {
        transform: scale(1);
    }

    40% {
        transform: scale(1.12);
    }

    100% {
        transform: scale(1);
    }
}

/* ============================================================
   17. STAGGERED REVEAL ENHANCEMENT
   ============================================================ */
[data-reveal].ux-stagger-entered {
    animation: ux-stagger-in 0.6s var(--ux-transition-spring) forwards;
    animation-delay: var(--stagger-delay, 0s);
}

@keyframes ux-stagger-in {
    0% {
        opacity: 0;
        transform: translateY(24px) scale(0.96);
    }

    100% {
        opacity: 1;
        transform: translateY(0) scale(1);
    }
}

/* ============================================================
   18. HUB CARD HOVER LIFT
   ============================================================ */
@media (hover: hover) {
    .hub-card:hover {
        transform: perspective(800px) translateY(-6px) scale(1.02);
        box-shadow: 0 20px 40px rgba(31, 26, 22, 0.12), 0 8px 16px rgba(31, 26, 22, 0.06);
    }

    [data-theme="dark"] .hub-card:hover {
        box-shadow: 0 20px 40px rgba(0, 0, 0, 0.3), 0 8px 16px rgba(0, 0, 0, 0.15);
    }
}

/* ============================================================
   19. TIMELINE INTERACTIVE ENHANCEMENT
   ============================================================ */
.timeline-item summary {
    transition: background 0.3s ease, padding-left 0.3s ease;
    cursor: pointer;
}

.timeline-item summary:hover {
    padding-left: 0.65rem;
}

.timeline-item[open] summary {
    padding-left: 0.65rem;
}

.timeline-item .timeline-detail {
    animation: ux-timeline-expand 0.4s var(--ux-transition-spring) forwards;
    overflow: hidden;
}

@keyframes ux-timeline-expand {
    0% {
        opacity: 0;
        max-height: 0;
        transform: translateY(-8px);
    }

    100% {
        opacity: 1;
        max-height: 500px;
        transform: translateY(0);
    }
}

/* ============================================================
   20. BAROMETER ANIMATION
   ============================================================ */
.bar-fill {
    transition: width 1.2s var(--ux-transition-spring) !important;
}

.bar-fill.ux-animate {
    width: 74% !important;
    /* 148/200 */
}

/* ============================================================
   21. MENU ITEM HOVER
   ============================================================ */
.menu-item.interactive-card {
    transition: transform 0.25s ease, box-shadow 0.25s ease, background 0.25s ease;
}

@media (hover: hover) {
    .menu-item.interactive-card:hover {
        transform: translateX(4px);
        background: rgba(216, 30, 42, 0.03);
    }

    [data-theme="dark"] .menu-item.interactive-card:hover {
        background: rgba(255, 127, 137, 0.06);
    }
}

/* ============================================================
   22. CURSOR TRAIL CANVAS (optional fun layer)
   ============================================================ */
.ux-cursor-canvas {
    position: fixed;
    inset: 0;
    pointer-events: none;
    z-index: 99997;
}

/* ============================================================
   REDUCED MOTION: Disable all the fun stuff
   ============================================================ */
@media (prefers-reduced-motion: reduce) {

    .ux-ripple,
    .ux-confetti-particle,
    .mega-title.ux-typing,
    .ux-wipe-reveal,
    [data-reveal].ux-stagger-entered,
    .ux-back-to-top,
    .ux-page-transition-overlay,
    .vote-button.ux-voted,
    .bar-fill.ux-animate,
    .timeline-item .timeline-detail {
        animation: none !important;
        transition: none !important;
    }

    .scroll-progress::after {
        animation: none;
    }

    .ux-wipe-reveal {
        clip-path: none;
    }

    [data-tilt] {
        transform: none !important;
    }
}
