/* Glitch Text Effect */
.glitch-text {
    position: relative;
    color: white;
    letter-spacing: -0.02em;
}

.glitch-text::before,
.glitch-text::after {
    content: attr(data-text);
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: #0a0a0a;
}

.glitch-text::before {
    left: 2px;
    text-shadow: -2px 0 #ff00ff;
    clip: rect(24px, 550px, 90px, 0);
    animation: glitch-anim-2 3s infinite linear alternate-reverse;
}

.glitch-text::after {
    left: -2px;
    text-shadow: -2px 0 #00f3ff;
    clip: rect(85px, 550px, 140px, 0);
    animation: glitch-anim 2.5s infinite linear alternate-reverse;
}

/* Glitch Text Effect - Small (nav/footer). Text-shadow so it works with gradient text. */
.glitch-text-sm {
    animation: glitch-shadow 2.5s ease-in-out infinite;
}

@keyframes glitch-shadow {
    0%, 90%, 100% {
        text-shadow: 0 0 0 transparent, 0 0 0 transparent;
    }
    92% {
        text-shadow: -2px 0 0 #ff00ff, 2px 0 0 #00f3ff;
    }
    94% {
        text-shadow: 2px 0 0 #00f3ff, -2px 0 0 #ff00ff;
    }
    96% {
        text-shadow: -1px 0 0 #ff00ff, 1px 0 0 #00f3ff;
    }
    98% {
        text-shadow: 0 0 0 transparent, 0 0 0 transparent;
    }
}

/* 0G logo: .logo-dark-bg = white logo (use on dark). .logo-light-bg = black logo (use on light) */
.logo-brand {
    height: 1.5em;
    width: auto;
    display: inline-block;
    vertical-align: middle;
}


@keyframes glitch-anim {
    0% {
        clip: rect(14px, 9999px, 76px, 0);
    }
    20% {
        clip: rect(89px, 9999px, 12px, 0);
    }
    40% {
        clip: rect(23px, 9999px, 96px, 0);
    }
    60% {
        clip: rect(67px, 9999px, 34px, 0);
    }
    80% {
        clip: rect(12px, 9999px, 87px, 0);
    }
    100% {
        clip: rect(45px, 9999px, 23px, 0);
    }
}

@keyframes glitch-anim-2 {
    0% {
        clip: rect(65px, 9999px, 100px, 0);
    }
    20% {
        clip: rect(12px, 9999px, 4px, 0);
    }
    40% {
        clip: rect(87px, 9999px, 56px, 0);
    }
    60% {
        clip: rect(23px, 9999px, 89px, 0);
    }
    80% {
        clip: rect(45px, 9999px, 12px, 0);
    }
    100% {
        clip: rect(34px, 9999px, 67px, 0);
    }
}

/* Smooth Scroll Behavior */
html {
    scroll-behavior: smooth;
}

/* Custom Scrollbar */
::-webkit-scrollbar {
    width: 10px;
}

::-webkit-scrollbar-track {
    background: #0a0a0a;
}

::-webkit-scrollbar-thumb {
    background: #333;
    border-radius: 5px;
}

::-webkit-scrollbar-thumb:hover {
    background: #00f3ff;
}

/* Selection Color */
::selection {
    background: #00f3ff;
    color: #0a0a0a;
}

/* Glitch Hover Effect for Images */
.glitch-hover:hover {
    animation: glitch-image 0.3s cubic-bezier(.25, .46, .45, .94) both infinite;
}

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

/* Audio Visualizer Animation (for future use) */
@keyframes equalizer {
    0% { height: 10%; }
    50% { height: 100%; }
    100% { height: 10%; }
}

.equalizer-bar {
    animation: equalizer 1s ease-in-out infinite;
}

.equalizer-bar:nth-child(2) { animation-delay: 0.1s; }
.equalizer-bar:nth-child(3) { animation-delay: 0.2s; }
.equalizer-bar:nth-child(4) { animation-delay: 0.3s; }
.equalizer-bar:nth-child(5) { animation-delay: 0.4s; }

/* Album playlist modal: track list is display-only when Spotify tab is active */
.album-tracks-display-only .album-track-item {
    cursor: default;
    pointer-events: none;
}
.album-tracks-display-only .album-track-item:hover {
    background: transparent;
}

/* Album modal tab buttons — brand-coloured active state */
.album-tab-btn {
    opacity: 0.45;
}
.album-tab-btn[data-active] {
    opacity: 1;
}
.album-tab-btn[data-active][data-album-tab="youtube"] {
    background-color: #ff0000;
}
.album-tab-btn[data-active][data-album-tab="spotify"] {
    background-color: #1db954;
}

/* Inline mini-player tab buttons — brand-coloured active state */
.inline-player-tab-btn {
    opacity: 0.45;
}
.inline-player-tab-btn[data-active] {
    opacity: 1;
}
.inline-player-tab-btn[data-active][data-inline-player-tab="youtube"] {
    background-color: #ff0000;
}
.inline-player-tab-btn[data-active][data-inline-player-tab="spotify"] {
    background-color: #1db954;
}

.inline-player-drag-handle {
    cursor: grab;
    touch-action: none;
    user-select: none;
}

.inline-player-shell-maximized {
    width: min(95vw, 1600px) !important;
    max-height: 95vh;
    overflow: auto;
}

.inline-player-shell-maximized #inline-track-player-artwork {
    aspect-ratio: 16/9;
}

@media (max-width: 767px) {
    .inline-player-shell-maximized {
        width: 100vw !important;
        max-width: 100vw !important;
        height: 100dvh !important;
        max-height: 100dvh !important;
        left: 0 !important;
        top: 0 !important;
        right: auto !important;
        bottom: auto !important;
        transform: none !important;
    }

    .inline-player-shell-maximized > .relative {
        height: 100dvh;
        min-height: 100dvh;
        border-radius: 0;
        display: flex;
        flex-direction: column;
    }

    .inline-player-shell-maximized #inline-track-player-artwork {
        aspect-ratio: auto;
        flex: 1 1 auto;
        min-height: 0;
    }

    .inline-player-shell-maximized #inline-track-player-player-wrap,
    .inline-player-shell-maximized > .relative > .p-2\.5 {
        flex: 0 0 auto;
    }
}

.inline-player-shell-maximized {
    --inline-control-size: clamp(2.5rem, 3.2vw, 3rem);
    --inline-control-icon-size: clamp(1.05rem, 1.4vw, 1.3rem);
    --inline-control-gap: 0.5rem;
}

@media (max-width: 767px) {
    .inline-player-shell-maximized {
        --inline-control-size: 2.5rem;
        --inline-control-icon-size: 1.05rem;
        --inline-control-gap: 0.35rem;
    }
}

.inline-player-shell-maximized .inline-player-control {
    width: var(--inline-control-size) !important;
    height: var(--inline-control-size) !important;
    flex-shrink: 0;
}

.inline-player-shell-maximized .inline-player-control svg,
.inline-player-shell-maximized .inline-player-control i,
.inline-player-shell-maximized .inline-player-control img {
    width: var(--inline-control-icon-size) !important;
    height: var(--inline-control-icon-size) !important;
}

.inline-player-shell-maximized #inline-track-player-close {
    top: 0.625rem;
    right: 0.625rem;
}

.inline-player-shell-maximized #inline-track-player-maximize {
    top: 0.625rem;
    right: calc(0.625rem + var(--inline-control-size) + 0.5rem) !important;
}

.inline-player-shell-maximized #inline-track-player-youtube-controls {
    gap: var(--inline-control-gap);
}

.inline-player-shell-maximized .inline-player-control + .inline-player-control {
    margin-left: 0;
}

.inline-player-shell-maximized #inline-track-player-tabs {
    gap: 0.25rem;
    padding: 0.35rem;
}

.inline-player-shell-maximized .inline-player-tab-btn {
    width: var(--inline-control-size);
    height: var(--inline-control-size);
    padding: 0;
    align-items: center;
    justify-content: center;
}

.inline-player-shell-maximized .inline-player-tab-btn:not(.hidden) {
    display: inline-flex;
}

.inline-player-shell-maximized .inline-player-tab-btn i,
.inline-player-shell-maximized .inline-player-tab-btn img {
    width: var(--inline-control-icon-size);
    height: var(--inline-control-icon-size);
}

.inline-player-shell-maximized #inline-track-player-links {
    gap: var(--inline-control-gap);
    align-items: center;
    flex-wrap: wrap;
}

.inline-player-shell-maximized #inline-track-player-links a {
    width: var(--inline-control-size);
    height: var(--inline-control-size);
    flex-shrink: 0;
}

.inline-player-shell-maximized #inline-track-player-links a img {
    width: var(--inline-control-icon-size);
    height: var(--inline-control-icon-size);
}

.inline-player-scrubber {
    --inline-scrubber-track-height: 2px;
    position: relative;
    width: 100%;
    height: 18px;
    display: flex;
    align-items: flex-end;
    cursor: pointer;
    touch-action: none;
}

.inline-player-scrubber__track {
    width: 100%;
    height: var(--inline-scrubber-track-height);
    border-radius: 9999px;
    background: rgba(255, 255, 255, 0.35);
    overflow: hidden;
    transition: height 180ms ease, background-color 180ms ease;
}

.inline-player-scrubber__progress {
    height: 100%;
    width: 0%;
    background: #ffffff;
    box-shadow: 0 0 10px rgba(255, 255, 255, 0.38);
}

.inline-player-scrubber__thumb {
    position: absolute;
    top: calc(100% - (var(--inline-scrubber-track-height) / 2));
    left: 0%;
    width: 0;
    height: 0;
    border-radius: 9999px;
    background: #ffffff;
    transform: translate(-50%, -50%);
    opacity: 0;
    box-shadow: 0 0 0 rgba(255, 255, 255, 0);
    transition: opacity 140ms ease, width 180ms ease, height 180ms ease, box-shadow 180ms ease;
}

.inline-player-scrubber.is-active .inline-player-scrubber__track,
.inline-player-scrubber:hover .inline-player-scrubber__track {
    --inline-scrubber-track-height: 6px;
    height: var(--inline-scrubber-track-height);
    background: rgba(255, 255, 255, 0.42);
}

.inline-player-scrubber.is-active .inline-player-scrubber__thumb,
.inline-player-scrubber:hover .inline-player-scrubber__thumb {
    width: 12px;
    height: 12px;
    opacity: 1;
    box-shadow: 0 0 0 5px rgba(255, 255, 255, 0.2);
}

.inline-player-scrubber.is-disabled {
    opacity: 0.45;
    cursor: default;
}

.inline-player-drag-handle:active,
.inline-player-shell-dragging,
.inline-player-shell-dragging .inline-player-drag-handle {
    cursor: grabbing;
}

/* Inline mini player embed slide animations (Spotify/YouTube) */
.inline-player-embed-wrap {
    max-height: 0;
    opacity: 0;
    overflow: hidden;
    transform: translateY(-8px);
    transition: max-height 320ms cubic-bezier(0.22, 1, 0.36, 1), opacity 220ms ease, transform 320ms cubic-bezier(0.22, 1, 0.36, 1);
}

.inline-player-embed-wrap.is-open {
    max-height: 92px;
    opacity: 1;
    transform: translateY(0);
}

.inline-player-embed-pane {
    max-height: 0;
    opacity: 0;
    overflow: hidden;
    pointer-events: none;
    transform: translateY(-6px);
    transition: max-height 280ms cubic-bezier(0.22, 1, 0.36, 1), opacity 200ms ease, transform 280ms cubic-bezier(0.22, 1, 0.36, 1);
}

.inline-player-embed-pane.is-visible {
    max-height: 80px;
    opacity: 1;
    pointer-events: auto;
    transform: translateY(0);
}

#inline-track-player-lyrics-shell:not(.hidden) {
    display: flex;
    align-items: center;
    justify-content: center;
    text-align: center;
    left: 50%;
    right: auto;
    width: 95%;
    transform: translate(-50%, -50%);
}

#inline-track-player-lyrics {
    width: 100%;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 0.1rem;
    margin: 0 auto;
}

#inline-track-player-lyrics > div {
    width: 100%;
    max-width: none;
    margin: 0 auto;
    text-align: center;
}

/* Album playlist modal — mobile: Spotify mode fills height, no tracklist */
@media (max-width: 767px) {
    #album-playlist-modal.spotify-mode #album-player-area {
        flex: 1;
        min-height: 68vh;
    }
    #album-playlist-modal.spotify-mode #album-playlist-iframe {
        display: block;
        width: 100%;
        aspect-ratio: auto !important;
        height: 100% !important;
        min-height: 68vh !important;
    }
}

@media (prefers-reduced-motion: reduce) {
    .inline-player-embed-wrap,
    .inline-player-embed-pane,
    .inline-player-scrubber__track,
    .inline-player-scrubber__thumb {
        transition: none;
    }
}

/* Lazy-loaded cover art */
img.lazy-media-image[loading="lazy"] {
    opacity: 0;
    transition: opacity 0.35s ease;
    background-color: rgba(255, 255, 255, 0.04);
}

img.lazy-media-image[loading="lazy"].lazy-media-loaded {
    opacity: 1;
}

@media (prefers-reduced-motion: reduce) {
    img.lazy-media-image[loading="lazy"] {
        opacity: 1;
        transition: none;
    }
}
