/* =============================================
   555 Player — Public Styles (v3.1)
   ============================================= */
:root {
    --fff-accent:              #ffffff;
    --fff-bg:                  transparent;
    --fff-card-bg:             rgba(255,255,255,0.06);
    --fff-card-border-color:   rgba(255,255,255,0.1);
    --fff-card-border-width:   1px;
    --fff-card-border-style:   solid;
    --fff-text:                #ffffff;
    --fff-muted:               rgba(255,255,255,0.55);
    --fff-bar:                 rgba(255,255,255,0.18);
    --fff-bar-fill:            #ffffff;
    --fff-shadow:              0 8px 32px rgba(0,0,0,0.45);
    --fff-radius:              16px;
    --fff-transition:          0.3s ease;

    /* Cards per row */
    --fff-cards-per-row:       4;
    --fff-card-gap:            16px;

    /* Gap between cover image and player bar */
    --fff-cover-bar-gap:       20px;

    /* Cover image */
    --fff-cover-width:         100%;
    --fff-cover-height:        auto;
    --fff-cover-aspect:        65%;
    --fff-cover-fit:           cover;
    --fff-cover-border-color:  transparent;
    --fff-cover-border-width:  0px;
    --fff-cover-border-style:  solid;
    --fff-cover-border-radius: 0px;

    /* Player bar */
    --fff-bar-bg:              rgba(0,0,0,0.35);
    --fff-bar-border-color:    transparent;
    --fff-bar-border-width:    0px;
    --fff-bar-border-style:    solid;

    /* Controls */
    --fff-controls-border-color:  transparent;
    --fff-controls-border-width:  0px;
    --fff-controls-border-style:  solid;
    --fff-controls-bg:            transparent;

    /* Dots */
    --fff-dot-color:           rgba(255,255,255,0.25);
    --fff-dot-active-color:    rgba(255,255,255,0.85);
    --fff-dot-size:            7px;
    --fff-dot-gap:             7px;
    --fff-dot-radius:          50%;

    /* Wrapper */
    --fff-wrapper-border-color:  transparent;
    --fff-wrapper-border-width:  0px;
    --fff-wrapper-border-style:  solid;
    --fff-wrapper-border-radius: 20px;
    --fff-wrapper-width:         100%;
    --fff-wrapper-height:        auto;

    /* Text */
    --fff-text-align:          center;

    /* Glossy icon */
    --fff-glossy-tint:         rgba(255,255,255,0.18);

    /* === Hover customization === */
    /* Card hover */
    --fff-card-hover-shadow:       0 8px 32px rgba(0,0,0,0.45);
    --fff-card-hover-translateY:   -4px;
    --fff-card-hover-scale:        1;
    --fff-card-hover-bg:           ;          /* leave blank = no change */
    --fff-card-hover-border-color: ;

    /* Cover image hover */
    --fff-cover-hover-scale:       0;
    --fff-cover-hover-brightness:  1;

    /* Button hover */
    --fff-btn-hover-scale:         1.12;
    --fff-btn-hover-color:         #ffffff;

    /* Progress bar hover */
    --fff-progress-hover-fill:     #a78bfa;

    /* Dot hover */
    --fff-dot-hover-color:         rgba(255,255,255,0.6);
}

/* ---- Wrapper ---- */
.fff-player-wrapper {
    background: var(--fff-bg);
    border-radius: var(--fff-wrapper-border-radius);
    border: var(--fff-wrapper-border-width) var(--fff-wrapper-border-style) var(--fff-wrapper-border-color);
    padding: 28px 0 20px;
    width: var(--fff-wrapper-width);
    height: var(--fff-wrapper-height);
    overflow: hidden;
    box-sizing: border-box;
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
}
.fff-no-tracks {
    text-align: center; padding: 40px; color: #888; font-style: italic;
}

/* ---- Carousel ---- */
.fff-carousel-container {
    position: relative;
    display: flex;
    align-items: center;
    padding: 0 20px;
    user-select: none;
}
.fff-carousel-track-wrap {
    flex: 1;
    overflow: hidden;
    cursor: grab;
    touch-action: pan-y;
}
.fff-carousel-track-wrap.fff-dragging { cursor: grabbing; }
.fff-carousel-track {
    display: flex;
    gap: var(--fff-card-gap);
    transition: transform 0.45s cubic-bezier(0.25, 0.46, 0.45, 0.94);
    will-change: transform;
    align-items: stretch;
}
.fff-carousel-track.fff-no-transition { transition: none !important; }

/* ---- Navigation ---- */
.fff-nav { display: none !important; }

/* ---- Dots ---- */
.fff-dots {
    display: flex;
    justify-content: center;
    gap: var(--fff-dot-gap);
    margin-top: 18px;
    padding: 0 20px;
    flex-wrap: wrap;
}
.fff-dot {
    width: var(--fff-dot-size);
    height: var(--fff-dot-size);
    border-radius: var(--fff-dot-radius);
    background: var(--fff-dot-color);
    border: none;
    cursor: pointer;
    padding: 0;
    transition: background var(--fff-transition), transform var(--fff-transition);
    flex-shrink: 0;
}
.fff-dot:hover { background: var(--fff-dot-hover-color); }
.fff-dot.fff-dot-active {
    background: var(--fff-dot-active-color);
    transform: scale(1.35);
}

/* ---- Card ---- */
.fff-card {
    /* Width driven by CSS variable set inline on wrapper by shortcode/JS */
    flex: 0 0 var(--fff-card-width, calc((100% - 2 * var(--fff-card-gap)) / 3));
    background: var(--fff-card-bg);
    border: var(--fff-card-border-width) var(--fff-card-border-style) var(--fff-card-border-color);
    border-radius: var(--fff-radius);
    overflow: hidden;
    display: flex;
    flex-direction: column;
    transition: transform var(--fff-transition), box-shadow var(--fff-transition), background var(--fff-transition), border-color var(--fff-transition);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    min-width: 0;
}
.fff-card:hover {
    transform: translateY(var(--fff-card-hover-translateY)) scale(var(--fff-card-hover-scale));
    box-shadow: var(--fff-card-hover-shadow);
    background: var(--fff-card-hover-bg, var(--fff-card-bg));
    border-color: var(--fff-card-hover-border-color, var(--fff-card-border-color));
}
.fff-card.fff-active {
    border-color: rgba(255,255,255,0.4);
    box-shadow: 0 0 0 2px rgba(255,255,255,0.2), var(--fff-shadow);
}

/* ---- Cover ---- */
.fff-cover-wrap {
    position: relative;
    width: var(--fff-cover-width);
    padding-bottom: var(--fff-cover-aspect);
    overflow: hidden;
    background: transparent;
    border: var(--fff-cover-border-width) var(--fff-cover-border-style) var(--fff-cover-border-color);
    border-radius: var(--fff-cover-border-radius);
    flex-shrink: 0;
}
.fff-cover-wrap img {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    object-fit: var(--fff-cover-fit);
    transition: transform 0.5s ease, filter 0.5s ease;
}
.fff-card:hover .fff-cover-wrap img {
    transform: scale(var(--fff-cover-hover-scale));
    filter: brightness(var(--fff-cover-hover-brightness));
}
.fff-cover-placeholder {
    position: absolute; inset: 0;
    display: flex; align-items: center; justify-content: center;
    background: linear-gradient(135deg, #1a1a2e, #16213e, #0f3460);
}
.fff-cover-placeholder svg { width: 60%; height: 60%; }
.fff-overlay {
    position: absolute; inset: 0;
    background: linear-gradient(to bottom, transparent 40%, rgba(0,0,0,0.6) 100%);
}

/* Gap spacer between cover and player bar */
.fff-cover-bar-spacer {
    height: var(--fff-cover-bar-gap);
    flex-shrink: 0;
    display: block;
}

/* ---- Player Bar ---- */
.fff-player-bar {
    padding: 14px 16px 16px;
    display: flex;
    flex-direction: column;
    gap: 10px;
    background: var(--fff-bar-bg);
    border: var(--fff-bar-border-width) var(--fff-bar-border-style) var(--fff-bar-border-color);
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
    flex: 1;
}
.fff-track-info {
    display: flex; flex-direction: column; gap: 2px;
    text-align: var(--fff-text-align);
}
.fff-track-title {
    font-size: 13px; font-weight: 700; color: var(--fff-text);
    white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
    letter-spacing: 0.04em; text-transform: uppercase;
}
.fff-track-artist {
    font-size: 11px; color: var(--fff-muted);
    white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}

/* ---- Controls ---- */
.fff-controls {
    display: flex; align-items: center; justify-content: center; gap: 14px;
    background: var(--fff-controls-bg);
    border: var(--fff-controls-border-width) var(--fff-controls-border-style) var(--fff-controls-border-color);
    padding: 4px 0;
}

/* ---- Base Button ---- */
.fff-btn {
    background: transparent;
    border: none;
    color: var(--fff-text);
    cursor: pointer;
    padding: 0; line-height: 1; font-size: 13px;
    transition: color var(--fff-transition), transform var(--fff-transition), opacity var(--fff-transition);
    display: flex; align-items: center; justify-content: center;
    flex-shrink: 0;
}
.fff-btn:hover {
    transform: scale(var(--fff-btn-hover-scale));
    color: var(--fff-btn-hover-color);
}
.fff-btn svg { display: block; pointer-events: none; }

/* ================================================
   GLOSSY CIRCLE STYLE
   ================================================ */
.fff-btn.fff-glossy-circle {
    border-radius: 50%;
    position: relative;
    overflow: hidden;
    background: transparent !important;
    border: 1px solid rgba(255,255,255,0.30) !important;
    box-shadow:
        0 4px 16px rgba(0,0,0,0.35),
        0 1px 0 rgba(255,255,255,0.15) inset,
        0 -1px 0 rgba(0,0,0,0.25) inset;
    backdrop-filter: blur(12px) saturate(1.4);
    -webkit-backdrop-filter: blur(12px) saturate(1.4);
    transition: transform 0.2s ease, box-shadow 0.2s ease, opacity 0.2s ease;
}
.fff-btn.fff-glossy-circle::before {
    content: ''; position: absolute; inset: 0; border-radius: 50%;
    background: var(--fff-glossy-tint, rgba(255,255,255,0.18));
    pointer-events: none; z-index: 0;
}
.fff-btn.fff-glossy-circle::after {
    content: ''; position: absolute; top: 0; left: 0; right: 0; height: 50%;
    border-radius: 50% 50% 0 0 / 50% 50% 0 0;
    background: linear-gradient(180deg, rgba(255,255,255,0.28) 0%, rgba(255,255,255,0.04) 100%);
    pointer-events: none; z-index: 1;
}
.fff-btn.fff-glossy-circle svg,
.fff-btn.fff-glossy-circle span { position: relative; z-index: 2; }
.fff-btn.fff-glossy-circle:hover {
    transform: scale(var(--fff-btn-hover-scale, 1.10));
    box-shadow:
        0 6px 22px rgba(0,0,0,0.45),
        0 1px 0 rgba(255,255,255,0.22) inset,
        0 -1px 0 rgba(0,0,0,0.3) inset;
    opacity: 1;
}
.fff-btn.fff-glossy-circle:active { transform: scale(0.95); }

.fff-play-pause.fff-glossy-circle { width: 46px; height: 46px; }
.fff-prev-track.fff-glossy-circle,
.fff-next-track.fff-glossy-circle { width: 36px; height: 36px; opacity: 0.82; }
.fff-prev-track.fff-glossy-circle:hover,
.fff-next-track.fff-glossy-circle:hover { opacity: 1; }

/* ---- Progress ---- */
.fff-progress-wrap { display: flex; align-items: center; gap: 8px; }
.fff-current-time,
.fff-duration {
    font-size: 10px; color: var(--fff-muted);
    white-space: nowrap; min-width: 30px;
    font-variant-numeric: tabular-nums;
}
.fff-duration { text-align: right; }
.fff-progress-bar {
    flex: 1; position: relative; height: 4px;
    background: var(--fff-bar);
    border-radius: 99px; cursor: pointer; overflow: hidden;
    transition: height 0.2s ease;
}
.fff-progress-bar:hover { height: 6px; }
.fff-progress-fill {
    position: absolute; left: 0; top: 0; height: 100%;
    background: var(--fff-bar-fill);
    border-radius: 99px; width: 0%;
    transition: width 0.1s linear;
    pointer-events: none;
}
.fff-seeker {
    position: absolute; inset: -6px 0;
    width: 100%; height: 16px;
    opacity: 0; cursor: pointer; margin: 0; padding: 0;
}
.fff-progress-bar:hover .fff-progress-fill {
    background: linear-gradient(90deg, var(--fff-progress-hover-fill, #a78bfa), var(--fff-bar-fill));
}

/* ---- Playing animation ---- */
.fff-card.fff-playing .fff-cover-wrap::after {
    content: ''; position: absolute; inset: 0;
    background: rgba(108,99,255,0.08);
    animation: fff-pulse 2s ease-in-out infinite;
    pointer-events: none;
}
@keyframes fff-pulse {
    0%, 100% { opacity: 0; }
    50%       { opacity: 1; }
}
.fff-audio { display: none; }

/* =============================================
   Responsive
   ============================================= */
@media (max-width: 900px) {
    .fff-card { flex: 0 0 calc(50% - var(--fff-card-gap) / 2) !important; }
}
@media (max-width: 560px) {
    .fff-card { flex: 0 0 calc(90% - var(--fff-card-gap) / 2) !important; }
    .fff-carousel-container { padding: 0 8px; }
}
