/**
 * Notification Bar Styles — Kinetic Glow Edition
 *
 * Features:
 * - Animated gradient background with shimmer
 * - Floating particle system
 * - Moving mascot character
 * - Pulsing glow CTA button
 * - Smooth entrance / dismiss animations
 * - Close button with session persistence
 * - Responsive design
 * - Reduced motion support
 *
 * @package SpiracleThemes
 * @since 1.0.0
 */

/* ========================================
   Notification Bar — Kinetic Glow Design
   ======================================== */

/* Icon alignment */
.st-notification-text i,
.st-notification-text svg {
    margin-right: 5px;
    font-size: 0.9rem;
    vertical-align: middle;
}

/* ── Main bar wrapper ── */
.st-notification-bar {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    z-index: 1100;
    padding: 0;
    overflow: hidden;
    opacity: 0;
    transform: translateY(-100%);
    transition: opacity 0.5s cubic-bezier(0.22, 1, 0.36, 1),
                transform 0.6s cubic-bezier(0.34, 1.56, 0.64, 1);
}

/* Animated gradient background */
.st-notification-bar::before {
    content: '';
    position: absolute;
    inset: 0;
    background: linear-gradient(
        90deg,
        var(--st-bar-bg, #5454EE) 0%,
        var(--st-bar-bg-alt, #7c6cee) 25%,
        var(--st-bar-bg, #5454EE) 50%,
        var(--st-bar-bg-alt, #7c6cee) 75%,
        var(--st-bar-bg, #5454EE) 100%
    );
    background-size: 300% 100%;
    animation: stBarGradientShift 6s ease infinite;
    z-index: 0;
}

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

/* Shimmer overlay */
.st-notification-bar::after {
    content: '';
    position: absolute;
    top: 0;
    left: -150%;
    width: 80%;
    height: 100%;
    background: linear-gradient(
        90deg,
        transparent 0%,
        rgba(255, 255, 255, 0.08) 40%,
        rgba(255, 255, 255, 0.15) 50%,
        rgba(255, 255, 255, 0.08) 60%,
        transparent 100%
    );
    animation: stBarShimmer 4s ease-in-out infinite;
    z-index: 1;
    pointer-events: none;
}

@keyframes stBarShimmer {
    0%   { left: -150%; }
    100% { left: 150%; }
}

/* ── Particle canvas ── */
.st-notification-particles {
    position: absolute;
    inset: 0;
    z-index: 1;
    pointer-events: none;
    overflow: hidden;
    transition: transform 0.15s ease-out;
}

.st-notification-particle {
    position: absolute;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.4);
    animation: stParticleFloat linear infinite;
    pointer-events: none;
}

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

/* ── Riding cyclist mascot ── */
.st-notification-mascot {
    position: absolute;
    left: 0;
    bottom: -2px;
    z-index: 2;
    pointer-events: none;
    animation: stMascotWalk 14s linear infinite;
    filter: drop-shadow(0 2px 6px rgba(0, 0, 0, 0.25));
}

.st-notification-mascot-inner {
    display: flex;
    align-items: flex-end;
    animation: stMascotBounce 0.4s ease-in-out infinite;
}

.st-notification-mascot-inner svg {
    width: 52px;
    height: 32px;
    filter: brightness(0) invert(1);
    opacity: 0.8;
}

/* Cyclist riding across the bar */
@keyframes stMascotWalk {
    0% {
        left: -60px;
        opacity: 0;
    }
    3% {
        opacity: 0.8;
    }
    50% {
        opacity: 0.8;
    }
    97% {
        opacity: 0.8;
    }
    100% {
        left: calc(100% + 60px);
        opacity: 0;
    }
}

/* Cyclist bounce while riding */
@keyframes stMascotBounce {
    0%, 100% {
        transform: translateY(0);
    }
    50% {
        transform: translateY(-3px);
    }
}

/* ── Bike wheel spin ── */
.st-bike-wheel {
    animation: stWheelSpin 0.6s linear infinite;
}

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

/* ── Pedal crank rotation ── */
.st-bike-crank {
    animation: stCrankSpin 0.8s linear infinite;
}

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

/* ── Scarf wave ── */
.st-bike-scarf {
    animation: stScarfWave 0.6s ease-in-out infinite alternate;
    transform-origin: 30px 7px;
}

@keyframes stScarfWave {
    0% {
        transform: rotate(0deg) scaleX(1);
        opacity: 1;
    }
    100% {
        transform: rotate(-3deg) scaleX(0.92);
        opacity: 0.7;
    }
}

/* ── Speed lines pulse ── */
.st-bike-speed {
    animation: stSpeedPulse 0.4s ease-in-out infinite alternate;
}

@keyframes stSpeedPulse {
    0% {
        opacity: 0.15;
        transform: translateX(0);
    }
    100% {
        opacity: 0.4;
        transform: translateX(-2px);
    }
}

/* ── Dust trail ── */
.st-bike-dust {
    animation: stDustPuff 0.5s ease-in-out infinite alternate;
}

@keyframes stDustPuff {
    0% {
        opacity: 0.15;
        transform: translate(0, 0) scale(1);
    }
    100% {
        opacity: 0.35;
        transform: translate(-3px, -1px) scale(1.1);
    }
}

/* ── Container & content ── */
.st-notification-container {
    max-width: 1280px;
    margin: 0 auto;
    padding: 0.7rem 1rem;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 1rem;
    position: relative;
    z-index: 2;
}

.st-notification-content {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 1rem;
    flex: 1;
    text-align: center;
    min-width: 0;
}

/* ── Text with subtle entrance ── */
.st-notification-text {
    font-size: 0.875rem;
    font-weight: 500;
    line-height: 1.4;
    position: relative;
    animation: stTextSlideIn 0.8s cubic-bezier(0.22, 1, 0.36, 1) 0.3s both;
}

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

/* ── CTA Button — Glow Pulse ── */
.st-notification-btn {
    display: inline-flex;
    align-items: center;
    padding: 0.4rem 1.1rem;
    border-radius: 9999px;
    font-size: 0.8125rem;
    font-weight: 600;
    text-decoration: none;
    white-space: nowrap;
    transition: all 0.3s cubic-bezier(0.22, 1, 0.36, 1);
    flex-shrink: 0;
    position: relative;
    animation: stBtnSlideIn 0.8s cubic-bezier(0.22, 1, 0.36, 1) 0.5s both;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}

@keyframes stBtnSlideIn {
    from {
        opacity: 0;
        transform: translateX(12px) scale(0.9);
    }
    to {
        opacity: 1;
        transform: translateX(0) scale(1);
    }
}

.st-notification-btn:hover {
    transform: translateY(-2px) scale(1.05);
    box-shadow: 0 6px 20px rgba(0, 0, 0, 0.2);
}

.st-notification-btn:active {
    transform: translateY(0) scale(0.97);
}

/* Arrow icon animation on hover */
.st-notification-btn svg {
    transition: transform 0.3s ease;
}
.st-notification-btn:hover svg {
    transform: translateX(3px);
}

/* ── Dismiss animation ── */
.st-notification-bar.st-notification-dismissing {
    animation: stBarDismiss 0.5s cubic-bezier(0.55, 0, 1, 0.45) forwards;
}

@keyframes stBarDismiss {
    0% {
        opacity: 1;
        transform: translateY(0);
        max-height: 60px;
    }
    60% {
        opacity: 0;
        transform: translateY(-100%);
        max-height: 60px;
    }
    100% {
        opacity: 0;
        transform: translateY(-100%);
        max-height: 0;
        padding: 0;
        margin: 0;
    }
}

/* ── Visible state ── */
.st-notification-bar.st-notification-visible {
    opacity: 1;
    transform: translateY(0);
}

/* ── Body spacing when notification bar is visible ── */
body.st-notification-visible .st-nav {
    top: 42px;
    transition: top 0.5s cubic-bezier(0.22, 1, 0.36, 1);
}

body.st-notification-visible .st-hero-padding,
body.st-notification-visible .st-hero {
    padding-top: calc(8rem + 42px);
}

/* ── Responsive ── */
@media (max-width: 768px) {
    .st-notification-container {
        flex-wrap: nowrap;
        padding: 0.6rem 2.5rem 0.6rem 0.75rem;
    }

    .st-notification-content {
        flex-direction: column;
        gap: 0.4rem;
    }

    .st-notification-text {
        font-size: 0.8125rem;
    }

    .st-notification-btn {
        font-size: 0.75rem;
        padding: 0.3rem 0.85rem;
    }

    /* Smaller cyclist on mobile */
    .st-notification-mascot-inner svg {
        width: 38px;
        height: 24px;
    }

    @keyframes stMascotWalk {
        0% {
            left: -45px;
            opacity: 0;
        }
        3% {
            opacity: 0.7;
        }
        50% {
            opacity: 0.7;
        }
        97% {
            opacity: 0.7;
        }
        100% {
            left: calc(100% + 45px);
            opacity: 0;
        }
    }

    body.st-notification-visible .st-nav {
        top: 62px;
    }

    body.st-notification-visible .st-hero-padding,
    body.st-notification-visible .st-hero {
        padding-top: calc(6rem + 62px);
    }
}

@media (max-width: 480px) {
    .st-notification-content {
        flex-direction: row;
        flex-wrap: wrap;
        justify-content: center;
    }

    .st-notification-container {
        padding: 0.5rem 2.2rem 0.5rem 0.6rem;
    }

    body.st-notification-visible .st-nav {
        top: 62px;
    }
}

/* ── Reduced motion preference ── */
@media (prefers-reduced-motion: reduce) {
    .st-notification-bar,
    .st-notification-bar::before,
    .st-notification-bar::after,
    .st-notification-text,
    .st-notification-btn,
    .st-notification-particle,
    .st-notification-mascot,
    .st-notification-mascot-inner,
    .st-bike-wheel,
    .st-bike-crank,
    .st-bike-scarf,
    .st-bike-speed,
    .st-bike-dust {
        animation: none !important;
        transition: opacity 0.3s ease, transform 0.3s ease !important;
    }

    .st-notification-bar.st-notification-visible {
        opacity: 1;
        transform: translateY(0);
    }

    .st-notification-mascot {
        display: none;
    }
}
