/* Reset for safety */
.picklepower-spotify-bar,
.picklepower-spotify-bar * {
    box-sizing: border-box;
}

/* --- Base container --- */
.picklepower-spotify-bar {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    z-index: 99999;
    background: #000;
    color: #fff;
    padding: 14px 0; /* vertical padding only */
    font-family: inherit;
    box-shadow: 0 2px 8px rgba(0,0,0,0.4);
    animation: pj-slide-down 0.3s ease-out;
}

/* Admin bar offset */
body.admin-bar .picklepower-spotify-bar {
    top: 32px;
}
@media (max-width: 782px) {
    body.admin-bar .picklepower-spotify-bar {
        top: 46px;
    }
}

/* --- Inner layout (centered + padded) --- */
.picklepower-spotify-bar__inner {
    max-width: 1200px;
    margin: 0 auto;

    /* Horizontal breathing room */
    padding: 0 20px;

    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    width: 100%;
}

/* --- Left side: art + label --- */
.picklepower-spotify-bar__left {
    display: flex;
    align-items: center;
    gap: 12px;

    /* CRITICAL: allows shrinking on narrow screens */
    flex: 1;
    min-width: 0;
}

/* Album art */
.picklepower-spotify-bar__art {
    width: 40px;
    height: 40px;
    background-size: cover;
    background-position: center;
    border-radius: 4px;
    box-shadow: 0 0 10px rgba(29,185,84,0.6);
    flex-shrink: 0;
}

/* Label */
.picklepower-spotify-bar__label {
    font-size: 14px;
    letter-spacing: 0.05em;
    text-transform: uppercase;
    opacity: 0.9;
    line-height: 1.4;

    /* Allow wrapping instead of pushing button offscreen */
    white-space: normal;
    overflow-wrap: anywhere;
}

/* --- Button --- */
.picklepower-spotify-bar__button {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 10px 20px;
    border-radius: 999px;
    background: #1DB954;
    color: #000;
    font-weight: 600;
    font-size: 14px;
    text-decoration: none;
    white-space: nowrap;

    /* CRITICAL: prevents cutoff */
    flex-shrink: 0;
    min-width: 120px;

    transition: transform 0.12s ease-out, box-shadow 0.12s ease-out, opacity 0.12s ease-out;
}

.picklepower-spotify-bar__button:hover {
    opacity: 0.92;
    transform: translateY(-1px);
    box-shadow: 0 3px 10px rgba(0,0,0,0.45);
}

/* --- Close button --- */
.picklepower-spotify-bar__close {
    background: transparent;
    border: none;
    color: #fff;
    font-size: 22px;
    line-height: 1;
    cursor: pointer;
    padding: 0 4px;
    opacity: 0.7;
    flex-shrink: 0;
}
.picklepower-spotify-bar__close:hover {
    opacity: 1;
}

/* --- Mobile layout (guaranteed no cutoff) --- */
@media (max-width: 640px) {

    .picklepower-spotify-bar__inner {
        flex-direction: column;
        align-items: stretch;
        gap: 14px;
        padding: 0 24px; /* more padding on mobile */
    }

    .picklepower-spotify-bar__left {
        justify-content: center;
        text-align: center;
    }

    .picklepower-spotify-bar__label {
        text-align: center;
    }

    .picklepower-spotify-bar__button {
        width: 100%;
        justify-content: center;
        padding: 14px 20px;
        font-size: 15px;
    }

    .picklepower-spotify-bar__close {
        align-self: center;
    }
}

/* --- Slide-down animation --- */
@keyframes pj-slide-down {
    from { transform: translateY(-100%); opacity: 0; }
    to   { transform: translateY(0); opacity: 1; }
}
