/* =====================================
   MEHRAZI PLAYER - ENHANCED UI LAYER
   Additive effects/utilities only (no core component overrides)
   ===================================== */

/* Scroll reveal helper (JS toggles .is-visible) */
:where(.mehrazi-player, .mp-video-player, .mehrazi-archive-wrapper) .mp-card-animated {
    opacity: 0;
    transform: translateY(14px);
    transition: opacity 0.35s var(--mp-ease-smooth), transform 0.35s var(--mp-ease-smooth);
}

:where(.mehrazi-player, .mp-video-player, .mehrazi-archive-wrapper) .mp-card-animated.is-visible {
    opacity: 1;
    transform: translateY(0);
}

/* Hero ambient glow */
.mp-archive-hero::before {
    content: '';
    position: absolute;
    inset: -35% -20% auto auto;
    width: 60%;
    height: 60%;
    background: radial-gradient(circle, rgba(212, 175, 55, 0.16), transparent 70%);
    pointer-events: none;
    animation: mpUiHeroGlow 8s ease-in-out infinite;
}

@keyframes mpUiHeroGlow {
    0%, 100% { transform: translate(0, 0) scale(1); }
    50% { transform: translate(-18%, -18%) scale(1.15); }
}

/* Active playback pulse */
.mehrazi-player.is-playing .mp-cover-img {
    animation: mpUiPulse 2s ease-in-out infinite;
}

@keyframes mpUiPulse {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.72; }
}

/* Floating motion used by mehrazi-ui-enhanced.js */
@keyframes mpUiFloat {
    0%, 100% { transform: translateY(0); }
    50% { transform: translateY(-14px); }
}

/* Click ripple used by mehrazi-ui-enhanced.js */
.mp-ripple-effect {
    position: absolute;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.3);
    transform: scale(0);
    pointer-events: none;
    animation: mpUiRipple 0.6s ease-out;
}

@keyframes mpUiRipple {
    0% { transform: scale(0); opacity: 1; }
    100% { transform: scale(4); opacity: 0; }
}

/* Inline ripple fallback on active play button */
:where(.mehrazi-player, .mp-video-player) .mp-play:active::after {
    content: '';
    position: absolute;
    inset: 0;
    border-radius: inherit;
    background: rgba(255, 255, 255, 0.3);
    animation: mpUiRipple 0.6s ease-out;
}

/* Toast notifications fallback (when MehraziUX toast is unavailable) */
body > .mp-toast {
    --mp-toast-offset-transform: translateY(20px);
    position: fixed;
    left: 12px;
    right: 12px;
    bottom: 12px;
    padding: 14px 24px;
    border-radius: 12px;
    border: 1px solid rgba(255, 255, 255, 0.15);
    background: linear-gradient(135deg, rgba(17,24,39,0.95), rgba(11,12,15,0.98));
    backdrop-filter: blur(20px);
    color: #fff;
    font-size: 0.9rem;
    box-shadow: 0 10px 30px rgba(0,0,0,0.5);
    opacity: 0;
    transform: var(--mp-toast-offset-transform);
    transition: opacity 0.3s ease, transform 0.3s ease;
    z-index: var(--mp-z-notification);
}

body > .mp-toast.is-active {
    opacity: 1;
    transform: translateY(0);
}

body > .mp-toast--success {
    border-color: rgba(34, 197, 94, 0.5);
}

body > .mp-toast--error {
    border-color: rgba(244, 63, 94, 0.5);
}

/* Scroll to top button */
.mp-scroll-top {
    position: fixed;
    left: 16px;
    bottom: 16px;
    width: 44px;
    height: 44px;
    border: 0;
    border-radius: 50%;
    background: var(--mp-primary-gradient);
    color: #000;
    font-size: 20px;
    cursor: pointer;
    opacity: 0;
    visibility: hidden;
    transform: translateY(20px);
    transition: opacity 0.3s ease, transform 0.3s ease, visibility 0.3s ease;
    z-index: var(--mp-z-tooltip);
    box-shadow: 0 8px 24px rgba(212,175,55,0.4);
}

.mp-scroll-top.is-visible {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
}

.mp-scroll-top:hover {
    transform: translateY(-5px);
    box-shadow: 0 12px 32px rgba(212,175,55,0.6);
}

/* Skeleton loader */
.mp-skeleton-loader {
    position: absolute;
    inset: 0;
    background: linear-gradient(
        90deg,
        rgba(255,255,255,0.05) 0%,
        rgba(255,255,255,0.1) 50%,
        rgba(255,255,255,0.05) 100%
    );
    background-size: 200% 100%;
    animation: skeleton 1.5s linear infinite;
}

@media (min-width: 768px) {
    body > .mp-toast {
        --mp-toast-offset-transform: translateX(100px);
        left: auto;
        right: 30px;
        bottom: 30px;
    }

    body > .mp-toast.is-active {
        transform: translateX(0);
    }

    .mp-scroll-top {
        left: 30px;
        bottom: 30px;
        width: 50px;
        height: 50px;
        font-size: 24px;
    }
}

@media (prefers-reduced-motion: reduce) {
    .mp-card-animated,
    .mp-cover-img,
    .mp-ripple-effect,
    .mp-skeleton-loader,
    body > .mp-toast,
    .mp-scroll-top {
        animation: none !important;
        transition: none !important;
        transform: none !important;
    }
}
