/**
 * Music Importer by streetflows – Frontend Player Styles
 *
 * Layout-critical rules use !important because this player is injected
 * directly into post content, where theme stylesheets (buttons, images,
 * box-sizing resets) frequently load after this file and would otherwise
 * override the fixed dimensions the player relies on.
 */

.ytisf-player,
.ytisf-player *,
.ytisf-player *::before,
.ytisf-player *::after {
    box-sizing: border-box;
}

/* ── Outer wrapper: white rounded card — long horizontal bar, short height ── */
.ytisf-player {
    --ytisf-color: #4A47E0;
    --ytisf-bg: #ffffff;
    --ytisf-text: #15112B;
    --ytisf-text-secondary: #8C8CA1;
    --ytisf-track: #D6D6F5;
    --ytisf-icon: #ffffff;
    display: grid !important;
    grid-template-columns: auto minmax(0, 1fr) auto;
    grid-template-rows: auto auto;
    grid-template-areas:
        "top wave controls"
        "top times controls";
    align-items: center;
    column-gap: 20px;
    row-gap: 2px;
    background: var(--ytisf-bg);
    border-radius: 16px;
    padding: 12px 20px;
    margin: 24px auto 0;
    max-width: 720px;
    width: 100%;
    box-shadow: 0 10px 30px rgba(20,20,60,.08), 0 1px 4px rgba(20,20,60,.06);
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
    color: var(--ytisf-text);
    list-style: none;
}

/* ── Left cluster: art + meta ── */
.ytisf-player__top {
    grid-area: top;
    display: flex;
    flex-direction: row;
    align-items: center;
    gap: 12px;
    min-width: 0;
}

/* ── Album Art — fixed 52 × 52 thumbnail, rounded, always cropped to fill ── */
.ytisf-player__art {
    flex: 0 0 52px !important;
    width: 52px !important;
    height: 52px !important;
    border-radius: 12px !important;
    overflow: hidden !important;
    background: #ECECFB;
    line-height: 0;
}

.ytisf-player__art img {
    display: block !important;
    width: 100% !important;
    height: 100% !important;
    max-width: none !important;
    object-fit: cover !important;
    object-position: center center !important;
    margin: 0 !important;
    padding: 0 !important;
    border: none !important;
    border-radius: 0 !important;
}

/* ── Meta: title / artist·genre / format badge ── */
.ytisf-player__meta {
    flex: 1;
    min-width: 0;
    max-width: 170px;
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.ytisf-player__title {
    font-weight: 800;
    font-size: 15px;
    line-height: 1.25;
    color: var(--ytisf-text);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.ytisf-player__artist {
    font-size: 12px;
    font-weight: 500;
    color: var(--ytisf-text-secondary);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.ytisf-player__format {
    display: flex;
    align-items: center;
    gap: 6px;
    margin-top: 1px;
}

.ytisf-player__format-badge {
    display: inline-flex !important;
    align-items: center;
    padding: 1px 8px !important;
    border: 1.5px solid var(--ytisf-color);
    border-radius: 999px;
    font-size: 9.5px;
    font-weight: 800;
    letter-spacing: .03em;
    color: var(--ytisf-color);
    line-height: 1.4;
}

.ytisf-player__format-rate {
    font-size: 10.5px;
    font-weight: 500;
    color: var(--ytisf-text-secondary);
}

/* ── Waveform — sits in the middle column, above the time labels ── */
.ytisf-player__waveform {
    grid-area: wave;
    position: relative;
    align-self: end;
    width: 100%;
    height: 28px;
    cursor: pointer;
}

.ytisf-player__wave-bars {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 3px;
    width: 100%;
    height: 100%;
}

.ytisf-player__wave-bar {
    flex: 1 1 auto;
    min-width: 2px;
    height: var(--h, 40%);
    border-radius: 3px;
    background: var(--ytisf-track);
    transition: background-color .1s ease;
    pointer-events: none;
}

.ytisf-player__wave-bar.is-played {
    background: var(--ytisf-color);
}

.ytisf-player__wave-cursor {
    position: absolute;
    top: 0;
    left: 0%;
    width: 3px;
    height: 100%;
    background: var(--ytisf-color);
    border-radius: 3px;
    transform: translateX(-50%);
    pointer-events: none;
    box-shadow: 0 0 0 3px rgba(74,71,224,.12);
}

/* ── Time labels — directly under the waveform in the middle column ── */
.ytisf-player__times {
    grid-area: times;
    display: flex;
    align-items: center;
    justify-content: space-between;
    align-self: start;
    width: 100%;
}

.ytisf-player__time {
    font-size: 10.5px;
    font-weight: 600;
    font-variant-numeric: tabular-nums;
    color: var(--ytisf-text-secondary);
}

/* ── Controls: back15 / play / fwd15, right-aligned ── */
.ytisf-player__controls {
    grid-area: controls;
    display: flex;
    align-items: center;
    justify-content: flex-end;
    gap: 10px;
}

/* Reset any theme button styling, then draw crisp, fixed-size circles */
.ytisf-player__btn {
    position: relative;
    -webkit-appearance: none !important;
    appearance: none !important;
    -webkit-tap-highlight-color: transparent;
    box-sizing: border-box !important;
    display: inline-flex !important;
    align-items: center !important;
    justify-content: center !important;
    margin: 0 !important;
    padding: 0 !important;
    line-height: 0 !important;
    border: none !important;
    cursor: pointer;
    transition: transform .12s ease, filter .12s ease, box-shadow .12s ease;
}
.ytisf-player__btn:hover  { transform: scale(1.05); }
.ytisf-player__btn:active { transform: scale(0.94); }
.ytisf-player__btn:focus-visible {
    outline: 2px solid var(--ytisf-color);
    outline-offset: 3px;
}

/* Back 15 / Forward 15 — ghost circles with a rotate-arrow icon + "15" label */
.ytisf-player__btn--back15,
.ytisf-player__btn--fwd15 {
    flex: 0 0 34px !important;
    width: 34px !important;
    height: 34px !important;
    min-width: 34px !important;
    min-height: 34px !important;
    border-radius: 50% !important;
    background: var(--ytisf-bg) !important;
    border: 1.5px solid var(--ytisf-track) !important;
    color: var(--ytisf-text);
}
.ytisf-player__btn--back15 svg,
.ytisf-player__btn--fwd15 svg {
    display: block !important;
    width: 18px !important;
    height: 18px !important;
    flex-shrink: 0 !important;
    pointer-events: none;
}
.ytisf-player__btn-num {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    font-size: 7px;
    font-weight: 800;
    letter-spacing: -.02em;
    pointer-events: none;
}

/* Play/Pause — filled circle with a soft accent glow */
.ytisf-player__btn--play {
    flex: 0 0 48px !important;
    width: 48px !important;
    height: 48px !important;
    min-width: 48px !important;
    min-height: 48px !important;
    border-radius: 50% !important;
    background: var(--ytisf-color) !important;
    color: var(--ytisf-icon) !important;
    box-shadow: 0 0 0 7px rgba(74,71,224,.08), 0 6px 14px rgba(74,71,224,.35);
}
.ytisf-player__btn--play svg {
    display: block;
    width: 20px !important;
    height: 20px !important;
    flex-shrink: 0 !important;
    pointer-events: none;
}
/* Optical centering: the play triangle's visual weight sits left of its
   bounding box, so nudge it right a hair to look centered in the circle. */
.ytisf-player__btn--play .ytisf-player__icon-play {
    transform: translateX(2px);
}

/* hidden <audio> */
.ytisf-player__audio { display: none; }

/* ── Download buttons row ── */
.ytisf-download-row {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 12px;
    margin-top: 14px;
    max-width: 720px;
    margin-left: auto;
    margin-right: auto;
}

.ytisf-download-btn {
    box-sizing: border-box !important;
    -webkit-appearance: none !important;
    appearance: none !important;
    display: inline-flex !important;
    align-items: center !important;
    justify-content: center !important;
    gap: 12px !important;
    width: auto !important;
    max-width: 100% !important;
    padding: 14px 20px !important;
    margin: 0 !important;
    border: none !important;
    border-radius: 999px !important;
    background: #1DB954;
    color: #fff !important;
    font-weight: 700 !important;
    font-size: 17px !important;
    line-height: 1.2 !important;
    letter-spacing: .02em;
    text-decoration: none !important;
    box-shadow: 0 2px 8px rgba(0,0,0,.18);
    transition: filter .15s, transform .1s;
}
.ytisf-download-btn:hover  { filter: brightness(0.92); transform: translateY(-1px); }
.ytisf-download-btn:active { transform: translateY(0); }
.ytisf-download-btn svg    { width: 20px !important; height: 20px !important; flex-shrink: 0 !important; display: block !important; }

/* ── Streaming platform links ── */
.ytisf-platforms {
    max-width: 720px;
    margin: 14px auto 0;
    background: #f6f7f9;
    border: 1px solid rgba(0,0,0,.06);
    border-radius: 16px;
    padding: 18px 20px;
    box-sizing: border-box;
}
.ytisf-platforms__heading {
    margin: 0 0 12px;
    font-size: 15px;
    font-weight: 800;
    color: #16181c;
}
.ytisf-platforms__row {
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
}
.ytisf-platform-btn {
    display: inline-flex !important;
    align-items: center !important;
    justify-content: center !important;
    gap: 10px !important;
    flex: 1 1 160px;
    padding: 14px 18px !important;
    margin: 0 !important;
    border: none !important;
    border-radius: 999px !important;
    color: #fff !important;
    font-weight: 700 !important;
    font-size: 14px !important;
    line-height: 1.2;
    text-decoration: none !important;
    box-shadow: 0 2px 8px rgba(0,0,0,.12);
    transition: filter .15s, transform .1s;
}
.ytisf-platform-btn:hover  { filter: brightness(0.94); transform: translateY(-1px); }
.ytisf-platform-btn:active { transform: translateY(0); }
.ytisf-platform-btn svg    { width: 20px !important; height: 20px !important; flex-shrink: 0 !important; display: block !important; }

.ytisf-platform-btn--spotify       { background: #1DB954; }
.ytisf-platform-btn--apple_music   { background: linear-gradient(135deg, #FA5F7C, #FA233B); }
.ytisf-platform-btn--youtube_music { background: #FF0000; }
.ytisf-platform-btn--audiomack     { background: #FFA200; }
.ytisf-platform-btn--boomplay      { background: linear-gradient(135deg, #FF7A00, #EA3B2E); }
.ytisf-platform-btn--deezer        { background: linear-gradient(135deg, #A238FF, #1E1E2C); }

@media (max-width: 480px) {
    .ytisf-platforms { padding: 12px 8px; border-radius: 14px; }
    .ytisf-platforms__heading { padding: 0 6px; }
    .ytisf-platforms__row {
        display: grid;
        grid-template-columns: repeat(3, 1fr);
        gap: 8px;
    }
    .ytisf-platform-btn {
        flex: unset;
        flex-direction: row;
        gap: 3px;
        padding: 12px 8px !important;
        font-size: 12px !important;
        overflow: hidden;
    }
    .ytisf-platform-btn span {
        overflow: hidden;
        text-overflow: ellipsis;
        white-space: nowrap;
    }
    .ytisf-platform-btn svg { width: 16px !important; height: 16px !important; }
}

/* ── Lyrics ── */
.ytisf-lyrics {
    max-width: 720px;
    margin: 10px auto 0;
}
.ytisf-lyrics__heading {
    font-size: 17px;
    font-weight: 700;
    color: #000;
    margin: 0 0 8px;
    padding: 6px 0 0;
}
.ytisf-lyrics__body {
    font-size: 14px;
    line-height: 1.7;
    padding: 10px 14px;
    background: var(--ytisf-lyrics-bg, rgba(0,0,0,.04));
    color: var(--ytisf-lyrics-text-color, inherit);
    border-radius: 8px;
}

/* ══════════════════════════════════════════════════════════════════════
   STYLE VARIANT: NEUMORPHIC
   Soft light-gray card with a photo cutout bleeding off the left/bottom
   edge, a plain slider-style seek bar with a round thumb, a decorative
   favorite heart in the corner, and skip-style transport icons.
   ══════════════════════════════════════════════════════════════════════ */
.ytisf-player.ytisf-player--style-dark {
    display: block !important;
    position: relative;
    background: linear-gradient(145deg, #eef0f3, #d7d9dd);
    border-radius: 22px;
    padding: 18px 30px;
    min-height: 108px;
    box-shadow: 10px 10px 22px rgba(20,20,25,.16), -8px -8px 18px rgba(255,255,255,.7);
    overflow: visible;
}
.ytisf-player.ytisf-player--style-dark::after {
    content: '\2661';
    position: absolute;
    top: 14px;
    right: 20px;
    font-size: 18px;
    line-height: 1;
    color: #9a9aa1;
}
.ytisf-player--style-dark .ytisf-player__art {
    flex: 0 0 52px !important;
    width: 52px !important;
    height: 52px !important;
    border-radius: 12px !important;
    box-shadow: 0 3px 10px rgba(0,0,0,.16);
}
.ytisf-player--style-dark .ytisf-player__art img {
    object-position: center center !important;
}
.ytisf-player.ytisf-player--style-dark.ytisf-player--no-art {
    padding: 18px 30px;
}
.ytisf-player--style-dark .ytisf-player__top {
    display: flex;
    align-items: center;
    gap: 14px;
    padding-right: 26px;
}
.ytisf-player--style-dark .ytisf-player__meta {
    display: flex;
    flex-direction: column;
    gap: 3px;
    max-width: none;
    min-width: 0;
}
.ytisf-player--style-dark .ytisf-player__artist {
    order: -1;
    font-size: 13px;
    font-weight: 500;
    color: #8a8a90;
}
.ytisf-player--style-dark .ytisf-player__title {
    font-family: Georgia, 'Times New Roman', serif;
    font-size: 22px;
    font-weight: 700;
    color: #2c2c30;
    white-space: normal;
}
.ytisf-player--style-dark .ytisf-player__format {
    display: none !important;
}
.ytisf-player--style-dark .ytisf-player__waveform {
    height: 6px;
    margin-top: 18px;
}
.ytisf-player--style-dark .ytisf-player__wave-bars {
    display: none;
}
.ytisf-player--style-dark .ytisf-player__waveform::before {
    content: '';
    position: absolute;
    left: 0;
    right: 0;
    top: 50%;
    transform: translateY(-50%);
    height: 4px;
    border-radius: 2px;
    background: rgba(0,0,0,.12);
    box-shadow: inset 1px 1px 2px rgba(0,0,0,.18);
}
.ytisf-player--style-dark .ytisf-player__wave-cursor {
    width: 16px !important;
    height: 16px !important;
    border-radius: 50%;
    top: 50%;
    transform: translate(-50%, -50%);
    background: #f4f4f6;
    box-shadow: 2px 2px 5px rgba(0,0,0,.2), -2px -2px 4px rgba(255,255,255,.85);
}
.ytisf-player--style-dark .ytisf-player__times {
    display: none;
}
.ytisf-player--style-dark .ytisf-player__controls {
    justify-content: center;
    gap: 26px;
    margin-top: 14px;
}
.ytisf-player--style-dark .ytisf-player__btn--back15,
.ytisf-player--style-dark .ytisf-player__btn--fwd15 {
    background: none !important;
    border: none !important;
    width: auto !important;
    height: auto !important;
    min-width: 0 !important;
    min-height: 0 !important;
    color: #6a6a70;
}
.ytisf-player--style-dark .ytisf-player__btn--back15 svg,
.ytisf-player--style-dark .ytisf-player__btn--fwd15 svg {
    width: 20px !important;
    height: 20px !important;
}
.ytisf-player--style-dark .ytisf-player__btn--play {
    width: 46px !important;
    height: 46px !important;
    min-width: 46px !important;
    min-height: 46px !important;
    background: linear-gradient(145deg, #f2f2f4, #dcdce0) !important;
    box-shadow: 4px 4px 9px rgba(0,0,0,.16), -4px -4px 8px rgba(255,255,255,.75);
    color: #3a3a3f !important;
}

/* ══════════════════════════════════════════════════════════════════════
   STYLE VARIANT: MINIMAL BAR
   White card, no art: transport icons on the left, title/artist stacked
   right-aligned, and a thin flat progress line with time labels beneath.
   ══════════════════════════════════════════════════════════════════════ */
.ytisf-player.ytisf-player--style-minimal {
    display: grid !important;
    grid-template-columns: auto 1fr;
    grid-template-rows: auto auto auto;
    grid-template-areas:
        "controls top"
        "wave wave"
        "times times";
    column-gap: 18px;
    row-gap: 8px;
    background: var(--ytisf-bg);
    border-radius: 14px;
    padding: 18px 22px;
    box-shadow: 0 4px 20px rgba(20,20,60,.10);
    max-width: 640px;
}
.ytisf-player--style-minimal .ytisf-player__format {
    display: none !important;
}
.ytisf-player--style-minimal .ytisf-player__art {
    flex: 0 0 52px !important;
    width: 52px !important;
    height: 52px !important;
    border-radius: 12px !important;
}
.ytisf-player--style-minimal .ytisf-player__top {
    grid-area: top;
    display: flex;
    align-items: center;
    justify-content: flex-end;
    gap: 12px;
}
.ytisf-player--style-minimal.ytisf-player--no-art .ytisf-player__top {
    justify-content: flex-end;
}
.ytisf-player--style-minimal .ytisf-player__meta {
    display: flex;
    flex-direction: column;
    align-items: flex-end;
    text-align: right;
    max-width: none;
    gap: 3px;
    justify-content: center;
    height: 100%;
}
.ytisf-player--style-minimal .ytisf-player__title {
    text-transform: uppercase;
    font-weight: 800;
    letter-spacing: .04em;
    font-size: 13px;
    white-space: normal;
}
.ytisf-player--style-minimal .ytisf-player__artist {
    text-transform: uppercase;
    font-weight: 600;
    letter-spacing: .04em;
    font-size: 11px;
    color: var(--ytisf-text-secondary);
}
.ytisf-player--style-minimal .ytisf-player__controls {
    grid-area: controls;
    gap: 14px;
    align-items: center;
}
.ytisf-player--style-minimal .ytisf-player__btn--play,
.ytisf-player--style-minimal .ytisf-player__btn--back15,
.ytisf-player--style-minimal .ytisf-player__btn--fwd15 {
    background: none !important;
    border: none !important;
    box-shadow: none !important;
    width: auto !important;
    height: auto !important;
    min-width: 0 !important;
    min-height: 0 !important;
    color: #111 !important;
}
.ytisf-player--style-minimal .ytisf-player__btn svg {
    width: 15px !important;
    height: 15px !important;
}
.ytisf-player--style-minimal .ytisf-player__btn--play svg {
    width: 20px !important;
    height: 20px !important;
}
.ytisf-player--style-minimal .ytisf-player__waveform {
    grid-area: wave;
    height: 3px;
}
.ytisf-player--style-minimal .ytisf-player__wave-bars {
    gap: 0;
}
.ytisf-player--style-minimal .ytisf-player__wave-bar {
    min-width: 0 !important;
    flex: 1 1 0;
    border-radius: 0;
    background: #e4e4e6;
}
.ytisf-player--style-minimal .ytisf-player__wave-bar.is-played {
    background: #111;
}
.ytisf-player--style-minimal .ytisf-player__wave-cursor {
    display: none;
}
.ytisf-player--style-minimal .ytisf-player__times {
    grid-area: times;
    width: auto;
}
.ytisf-player--style-minimal .ytisf-player__time {
    font-size: 9px;
    color: #999;
}

/* ── Responsive: on narrow screens, drop the waveform+times to their own
   full-width row beneath art/meta/controls, instead of squeezing three
   columns into a small viewport. Still short — just two compact rows
   instead of one — rather than the old fully-stacked card. ── */
@media (max-width: 480px) {
    .ytisf-player {
        grid-template-columns: auto 1fr auto;
        grid-template-areas:
            "top top controls"
            "wave wave wave"
            "times times times";
        row-gap: 6px;
        column-gap: 12px;
        padding: 14px 16px;
        border-radius: 16px;
    }
    .ytisf-player__meta { max-width: none; }
    .ytisf-player__art {
        flex: 0 0 46px !important;
        width: 46px !important;
        height: 46px !important;
        border-radius: 10px !important;
    }
    .ytisf-player__title { font-size: 14px; }
    .ytisf-player__waveform { height: 26px; align-self: center; }
    .ytisf-player__controls { gap: 8px; }
    .ytisf-player__btn--play {
        flex: 0 0 42px !important;
        width: 42px !important;
        height: 42px !important;
        min-width: 42px !important;
        min-height: 42px !important;
    }
    .ytisf-player__btn--back15,
    .ytisf-player__btn--fwd15 {
        flex: 0 0 30px !important;
        width: 30px !important;
        height: 30px !important;
        min-width: 30px !important;
        min-height: 30px !important;
    }
    .ytisf-download-btn { max-width: 100%; }
}
