/* HOODRANKED floating widgets: music player + currency converter.
   Bespoke component CSS (vinyl spin, progress scrubber, currency tabs) —
   kept separate from style.css since it's only loaded on pages that use
   the widgets. Colors are pulled from the same palette as the rest of the
   site (surface-gray #111111, muted-steel #1F2937, outline #8e9192) so it
   doesn't feel like a bolted-on third-party component. */

.hr-widget {
    position: fixed;
    bottom: 20px;
    z-index: 45;
    /* above page content, below the mobile drawer (z-50) */
    font-family: "Montserrat", sans-serif;
}

.hr-widget-inner {
    background: #111111;
    color: #ffffff;
    overflow: hidden;
    width: 272px;
    border: 1px solid #1f2937;
    box-shadow: 0 8px 40px rgba(0, 0, 0, 0.5);
    transition: width 0.3s ease;
}

.hr-widget-pill {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 10px 14px;
    cursor: pointer;
    user-select: none;
    transition: background 0.2s;
    min-height: 52px;
}

.hr-widget-pill:hover {
    background: rgba(255, 255, 255, 0.05);
}

.pill-icon {
    width: 32px;
    height: 32px;
    background: #ffffff;
    color: #000000;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.pill-label {
    font-family: "Bebas Neue", sans-serif;
    font-size: 14px;
    letter-spacing: 1.5px;
    flex: 1;
    overflow: hidden;
    white-space: nowrap;
    text-overflow: ellipsis;
}

.pill-chevron {
    color: #8e9192;
    transition: transform 0.3s;
    flex-shrink: 0;
}

.hr-widget.expanded .pill-chevron {
    transform: rotate(180deg);
}

.hr-widget-body {
    max-height: 0;
    overflow: hidden;
    transition: max-height 0.4s cubic-bezier(0.16, 1, 0.3, 1);
}

.hr-widget-body-inner {
    padding: 0 16px 16px;
    border-top: 1px solid #1f2937;
}

/* Music player */
#musicWidget {
    left: 20px;
}

.vinyl {
    width: 68px;
    height: 68px;
    border-radius: 50%;
    background: radial-gradient(circle at center, #444 0%, #111 28%, #222 42%, #111 48%, #1a1a1a 65%, #0a0a0a 100%);
    border: 1.5px solid #1f2937;
    position: relative;
    box-shadow: 0 0 20px rgba(0, 0, 0, 0.6);
    flex-shrink: 0;
}

.vinyl::after {
    content: "";
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 11px;
    height: 11px;
    background: #ffffff;
    border-radius: 50%;
    border: 2px solid #111111;
}

.vinyl.spinning {
    animation: vinylSpin 3s linear infinite;
}

@keyframes vinylSpin {
    from {
        transform: rotate(0deg);
    }

    to {
        transform: rotate(360deg);
    }
}

.track-meta {
    flex: 1;
    min-width: 0;
}

.track-title {
    font-family: "Bebas Neue", sans-serif;
    font-size: 15px;
    letter-spacing: 0.5px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.track-artist {
    font-family: "JetBrains Mono", monospace;
    font-size: 10px;
    color: #8e9192;
    margin-top: 1px;
}

.progress-area {
    margin: 12px 0 4px;
    cursor: pointer;
}

.progress-track {
    height: 2px;
    background: #1f2937;
    border-radius: 4px;
}

.progress-fill {
    height: 100%;
    background: #ffffff;
    border-radius: 4px;
    transition: width 0.5s linear;
    position: relative;
}

.progress-fill::after {
    content: "";
    position: absolute;
    right: -4px;
    top: -4px;
    width: 8px;
    height: 8px;
    background: #ffffff;
    border-radius: 50%;
    opacity: 0;
    transition: opacity 0.2s;
}

.progress-area:hover .progress-fill::after {
    opacity: 1;
}

.time-row {
    display: flex;
    justify-content: space-between;
    font-family: "JetBrains Mono", monospace;
    font-size: 9px;
    color: #8e9192;
    margin-top: 3px;
}

.player-controls {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-top: 10px;
}

.p-btn {
    background: none;
    border: none;
    color: #8e9192;
    cursor: pointer;
    width: 30px;
    height: 30px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: color 0.2s, background 0.2s;
}

.p-btn:hover {
    color: #ffffff;
    background: rgba(255, 255, 255, 0.08);
}

.p-btn.p-play {
    width: 38px;
    height: 38px;
    background: #ffffff;
    color: #000000;
}

.p-btn.p-play:hover {
    background: #e0e0e0;
}

.p-btn.p-active {
    color: #ffffff;
}

.vol-row {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-top: 10px;
    padding-top: 10px;
    border-top: 1px solid #1f2937;
}

.vol-row svg {
    color: #8e9192;
    flex-shrink: 0;
}

input[type="range"] {
    -webkit-appearance: none;
    flex: 1;
    height: 2px;
    border-radius: 4px;
    background: #1f2937;
    cursor: pointer;
    outline: none;
}

input[type="range"]::-webkit-slider-thumb {
    -webkit-appearance: none;
    width: 10px;
    height: 10px;
    background: #ffffff;
    border-radius: 50%;
}

.playing-bars {
    display: none;
    align-items: flex-end;
    gap: 2px;
    height: 14px;
}

.playing-bars span {
    display: block;
    width: 3px;
    background: #ffffff;
    border-radius: 2px;
    animation: barAnim 0.8s ease infinite alternate;
}

.playing-bars span:nth-child(2) {
    animation-delay: 0.2s;
}

.playing-bars span:nth-child(3) {
    animation-delay: 0.4s;
}

@keyframes barAnim {
    from {
        height: 3px;
    }

    to {
        height: 13px;
    }
}

.is-playing .playing-bars {
    display: flex;
}

.is-playing .pill-track-name {
    display: none;
}

/* Currency widget */
#currencyWidget {
    right: 20px;
}

.cur-price-box {
    background: #1a1a1a;
    border-radius: 10px;
    padding: 12px;
    margin: 10px 0;
}

.cur-ngn-label {
    font-family: "JetBrains Mono", monospace;
    font-size: 10px;
    color: #8e9192;
    text-transform: uppercase;
    letter-spacing: 1px;
    margin-bottom: 2px;
}

.cur-ngn-val {
    font-family: "Bebas Neue", sans-serif;
    font-size: 20px;
}

.cur-converted {
    font-family: "Bebas Neue", sans-serif;
    font-size: 17px;
    color: #c4c7c8;
    margin-top: 3px;
    min-height: 22px;
}

.cur-rate {
    font-family: "JetBrains Mono", monospace;
    font-size: 9px;
    color: #444748;
    margin-top: 3px;
}

.cur-tabs {
    display: flex;
    gap: 4px;
}

.cur-tab {
    flex: 1;
    border: 1px solid #1f2937;
    border-radius: 8px;
    padding: 6px 2px;
    text-align: center;
    cursor: pointer;
    transition: all 0.2s;
    background: #1a1a1a;
}

.cur-tab:hover {
    border-color: #444748;
}

.cur-tab.active {
    background: #ffffff;
    color: #000000;
    border-color: #ffffff;
}

.cur-tab .t-flag {
    font-size: 13px;
    display: block;
}

.cur-tab .t-code {
    font-family: "Bebas Neue", sans-serif;
    font-size: 10px;
    letter-spacing: 0.5px;
    display: block;
    margin-top: 1px;
}

.cur-tab.active .t-code {
    color: #000000;
}

.cur-status {
    display: flex;
    align-items: center;
    gap: 4px;
}

.status-dot {
    width: 5px;
    height: 5px;
    border-radius: 50%;
    background: #444748;
    flex-shrink: 0;
}

.status-dot.live {
    background: #4ade80;
    animation: statusPulse 2s infinite;
}

@keyframes statusPulse {

    0%,
    100% {
        opacity: 1;
    }

    50% {
        opacity: 0.3;
    }
}

.shimmer {
    display: inline-block;
    width: 60px;
    height: 10px;
    background: linear-gradient(90deg, #1f2937 25%, #2e2e2e 50%, #1f2937 75%);
    background-size: 200% 100%;
    animation: shimmerAnim 1.2s infinite;
    border-radius: 4px;
    vertical-align: middle;
}

@keyframes shimmerAnim {
    0% {
        background-position: 200% 0;
    }

    100% {
        background-position: -200% 0;
    }
}

/* Mobile: collapse both widgets to icon-only pills so they never overlap.
   Only one can be expanded at a time (enforced in floating-widgets.js). */
@media (max-width: 639px) {
    .hr-widget {
        bottom: 16px;
    }

    .hr-widget-inner {
        width: 52px;
        border-radius: 26px;
        transition: width 0.35s cubic-bezier(0.16, 1, 0.3, 1), border-radius 0.35s ease;
    }

    .hr-widget.expanded .hr-widget-inner {
        width: calc(100vw - 40px);
        max-width: 320px;
        border-radius: 16px;
    }

    #musicWidget {
        left: 16px;
        right: auto;
    }

    #currencyWidget {
        right: 16px;
        left: auto;
    }

    .hr-widget:not(.expanded) .pill-label,
    .hr-widget:not(.expanded) .pill-chevron,
    .hr-widget:not(.expanded) .cur-status {
        display: none;
    }

    .hr-widget:not(.expanded) .hr-widget-pill {
        justify-content: center;
        padding: 10px;
        gap: 0;
    }

    .hr-widget.expanded .pill-label,
    .hr-widget.expanded .pill-chevron {
        display: flex;
    }

    .hr-widget.expanded .cur-status {
        display: flex;
    }
}

@media (prefers-reduced-motion: reduce) {

    .vinyl.spinning,
    .playing-bars span,
    .status-dot.live,
    .shimmer {
        animation: none !important;
    }
}