/**
 * SoundNode Sticky Player for laut.fm - Frontend Styles
 */

/* === WRAPPER === */
#lfsp-sticky-wrapper {
    position: fixed;
    z-index: 999999;
    font-family: 'Montserrat', 'Roboto', 'Arial', sans-serif;
    transition: transform 0.4s cubic-bezier(0.25, 0.8, 0.25, 1);
    overflow: visible;
}

/* === TOP / BOTTOM === */
.lfsp-position-bottom,
.lfsp-position-top {
    left: 0;
    width: 100%;
    transform: translateY(0);
}

.lfsp-position-bottom {
    bottom: 0;
}

.lfsp-position-top {
    top: 0;
}

.lfsp-position-bottom.lfsp-closed {
    transform: translateY(var(--lfsp-height, 90px));
}

.lfsp-position-top.lfsp-closed {
    transform: translateY(calc(-1 * var(--lfsp-height, 90px)));
}

/* === LEFT / RIGHT === */
.lfsp-position-left,
.lfsp-position-right {
    width: 200px;
    top: 50%;
    transform: translateY(-50%);
}

.lfsp-position-left {
    left: 0;
}

.lfsp-position-right {
    right: 0;
}

.lfsp-position-left.lfsp-closed {
    transform: translate(-100%, -50%);
}

.lfsp-position-right.lfsp-closed {
    transform: translate(100%, -50%);
}

/* === PLAYER BODY === */
.lfsp-player-body {
    height: var(--lfsp-height, 90px);
    background: linear-gradient(180deg, #1a1a1a 0%, var(--lfsp-panel, #101010) 100%);
    box-shadow:
        0 -10px 30px rgba(0, 0, 0, 0.8),
        0 -2px 10px rgba(255, 0, 60, 0.1),
        0 -2px 10px rgba(0, 240, 255, 0.1);
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 0 1rem;
    position: relative;
}

.lfsp-position-top .lfsp-player-body {
    box-shadow:
        0 10px 30px rgba(0, 0, 0, 0.8),
        0 2px 10px rgba(255, 0, 60, 0.1),
        0 2px 10px rgba(0, 240, 255, 0.1);
}

.lfsp-position-left .lfsp-player-body {
    height: auto;
    min-height: 200px;
    padding: 1.25rem 1rem;
    border-radius: 0 8px 8px 0;
    box-shadow:
        10px 0 30px rgba(0, 0, 0, 0.8),
        2px 0 10px rgba(255, 0, 60, 0.1),
        2px 0 10px rgba(0, 240, 255, 0.1);
}

.lfsp-position-right .lfsp-player-body {
    height: auto;
    min-height: 200px;
    padding: 1.25rem 1rem;
    border-radius: 8px 0 0 8px;
    box-shadow:
        -10px 0 30px rgba(0, 0, 0, 0.8),
        -2px 0 10px rgba(255, 0, 60, 0.1),
        -2px 0 10px rgba(0, 240, 255, 0.1);
}

/* === ACCENT LINE === */
.lfsp-player-body::before {
    content: "";
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 3px;
    background: linear-gradient(90deg, var(--lfsp-accent-1, #ff003c) 0%, var(--lfsp-accent-2, #00f0ff) 100%);
    box-shadow:
        0 0 15px rgba(255, 0, 60, 0.5),
        0 0 15px rgba(0, 240, 255, 0.5);
    z-index: 2;
}

.lfsp-position-top .lfsp-player-body::before {
    top: auto;
    bottom: 0;
}

.lfsp-position-left .lfsp-player-body::before {
    width: 3px;
    height: 100%;
    top: 0;
    left: auto;
    right: 0;
    background: linear-gradient(180deg, var(--lfsp-accent-1, #ff003c) 0%, var(--lfsp-accent-2, #00f0ff) 100%);
}

.lfsp-position-right .lfsp-player-body::before {
    width: 3px;
    height: 100%;
    top: 0;
    left: 0;
    background: linear-gradient(180deg, var(--lfsp-accent-1, #ff003c) 0%, var(--lfsp-accent-2, #00f0ff) 100%);
}

/* === TOGGLE BUTTON === */
.lfsp-toggle-btn {
    position: absolute;
    top: -24px;
    right: 20px;
    width: 44px;
    height: 24px;
    background-color: var(--lfsp-panel, #101010);
    border-radius: 4px 4px 0 0;
    cursor: pointer;
    display: flex;
    justify-content: center;
    align-items: center;
    border: none;
    border-top: 2px solid var(--lfsp-accent-2, #00f0ff);
    box-shadow: 0 -5px 15px rgba(0, 240, 255, 0.2);
    z-index: 1000000;
    padding: 0;
    pointer-events: auto;
}

.lfsp-position-top .lfsp-toggle-btn {
    top: auto;
    bottom: -24px;
    border-radius: 0 0 4px 4px;
    border-top: none;
    border-bottom: 2px solid var(--lfsp-accent-2, #00f0ff);
    box-shadow: 0 5px 15px rgba(0, 240, 255, 0.2);
}

.lfsp-position-left .lfsp-toggle-btn {
    top: 50%;
    right: auto;
    bottom: auto;
    left: 100%;
    transform: translateY(-50%);
    width: 24px;
    height: 44px;
    border-radius: 0 4px 4px 0;
    border-top: none;
    border-right: 2px solid var(--lfsp-accent-2, #00f0ff);
    box-shadow: 5px 0 15px rgba(0, 240, 255, 0.2);
}

.lfsp-position-right .lfsp-toggle-btn {
    top: 50%;
    left: auto;
    bottom: auto;
    right: 100%;
    transform: translateY(-50%);
    width: 24px;
    height: 44px;
    border-radius: 4px 0 0 4px;
    border-top: none;
    border-left: 2px solid var(--lfsp-accent-2, #00f0ff);
    box-shadow: -5px 0 15px rgba(0, 240, 255, 0.2);
}

/* === TOGGLE ICON === */
.lfsp-toggle-icon {
    font-size: 10px;
    color: var(--lfsp-accent-2, #00f0ff);
    transition: transform 0.4s ease;
    line-height: 1;
}

.lfsp-position-bottom.lfsp-closed .lfsp-toggle-icon {
    transform: rotate(180deg);
}

.lfsp-position-top .lfsp-toggle-icon {
    transform: rotate(180deg);
}

.lfsp-position-top.lfsp-closed .lfsp-toggle-icon {
    transform: rotate(0deg);
}

.lfsp-position-left .lfsp-toggle-icon {
    transform: rotate(-90deg);
}

.lfsp-position-left.lfsp-closed .lfsp-toggle-icon {
    transform: rotate(90deg);
}

.lfsp-position-right .lfsp-toggle-icon {
    transform: rotate(90deg);
}

.lfsp-position-right.lfsp-closed .lfsp-toggle-icon {
    transform: rotate(-90deg);
}

/* === INNER WRAPPER === */
.lfsp-inner-wrapper {
    width: 100%;
    max-width: 900px;
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.lfsp-position-left .lfsp-inner-wrapper,
.lfsp-position-right .lfsp-inner-wrapper {
    flex-direction: column;
    align-items: center;
    justify-content: center;
    text-align: center;
    gap: 0.75rem;
    max-width: none;
}

.lfsp-left-area {
    display: flex;
    align-items: center;
    gap: 1rem;
}

.lfsp-position-left .lfsp-left-area,
.lfsp-position-right .lfsp-left-area {
    flex-direction: column;
    align-items: center;
    gap: 0.5rem;
}

/* === PLAY BUTTON === */
.lfsp-play-btn {
    width: 56px;
    height: 56px;
    border-radius: 50%;
    background: #000;
    border: 2px solid transparent;
    background-image: linear-gradient(#000, #000), linear-gradient(135deg, var(--lfsp-accent-1, #ff003c), var(--lfsp-accent-2, #00f0ff));
    background-origin: border-box;
    background-clip: content-box, border-box;
    display: flex;
    justify-content: center;
    align-items: center;
    cursor: pointer;
    color: var(--lfsp-text, #ffffff);
    box-shadow:
        -5px 0 15px rgba(255, 0, 60, 0.3),
        5px 0 15px rgba(0, 240, 255, 0.3);
    transition: transform 0.2s, box-shadow 0.2s;
    flex-shrink: 0;
    padding: 0;
}

.lfsp-position-left .lfsp-play-btn,
.lfsp-position-right .lfsp-play-btn {
    width: 48px;
    height: 48px;
}

.lfsp-play-btn:hover {
    transform: scale(1.05);
    box-shadow:
        -8px 0 25px rgba(255, 0, 60, 0.6),
        8px 0 25px rgba(0, 240, 255, 0.6);
}

.lfsp-play-btn:focus-visible {
    outline: 2px solid var(--lfsp-accent-2, #00f0ff);
    outline-offset: 3px;
}

.lfsp-play-btn.lfsp-playing {
    animation: lfsp-pulse 2s infinite;
}

@keyframes lfsp-pulse {
    0%, 100% {
        box-shadow:
            -5px 0 15px rgba(255, 0, 60, 0.3),
            5px 0 15px rgba(0, 240, 255, 0.3);
    }
    50% {
        box-shadow:
            -8px 0 25px rgba(255, 0, 60, 0.5),
            8px 0 25px rgba(0, 240, 255, 0.5);
    }
}

/* === PLAY/PAUSE ICON CENTERING FIX === */
.lfsp-icon-play,
.lfsp-icon-pause {
    display: flex;
    align-items: center;
    justify-content: center;
    line-height: 0;
    width: 20px;
    height: 20px;
}

.lfsp-icon-play svg,
.lfsp-icon-pause svg {
    display: block;
}

.lfsp-icon-play svg {
    transform: translateX(1px);
}

/* === VOLUME === */
.lfsp-volume-control {
    display: flex;
    align-items: center;
    gap: 4px;
}

.lfsp-position-left .lfsp-volume-control,
.lfsp-position-right .lfsp-volume-control {
    flex-direction: column;
    gap: 2px;
}

.lfsp-mute-btn {
    background: none;
    border: none;
    cursor: pointer;
    padding: 4px;
    font-size: 16px;
    line-height: 1;
}

.lfsp-volume-slider {
    width: 70px;
    height: 4px;
    -webkit-appearance: none;
    appearance: none;
    background: rgba(255, 255, 255, 0.2);
    border-radius: 2px;
    outline: none;
}

.lfsp-position-left .lfsp-volume-slider,
.lfsp-position-right .lfsp-volume-slider {
    width: 60px;
}

.lfsp-volume-slider::-webkit-slider-thumb {
    -webkit-appearance: none;
    width: 12px;
    height: 12px;
    border-radius: 50%;
    background: var(--lfsp-accent-2, #00f0ff);
    cursor: pointer;
}

.lfsp-volume-slider::-moz-range-thumb {
    width: 12px;
    height: 12px;
    border-radius: 50%;
    background: var(--lfsp-accent-2, #00f0ff);
    cursor: pointer;
    border: none;
}

/* === SONG INFO === */
.lfsp-song-info {
    flex-grow: 1;
    margin: 0 1.5rem;
    overflow: hidden;
    display: flex;
    flex-direction: column;
    justify-content: center;
}

.lfsp-position-left .lfsp-song-info,
.lfsp-position-right .lfsp-song-info {
    margin: 0;
    flex-grow: 0;
    width: 100%;
}

.lfsp-title {
    font-size: 1.1rem;
    font-weight: 700;
    color: var(--lfsp-text, #ffffff);
    letter-spacing: 0.5px;
    text-transform: uppercase;
    text-shadow: 0 0 2px rgba(0, 0, 0, 0.5);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.lfsp-position-left .lfsp-title,
.lfsp-position-right .lfsp-title {
    font-size: 0.8rem;
    white-space: normal;
    word-break: break-word;
    display: -webkit-box;
    -webkit-line-clamp: 3;
    -webkit-box-orient: vertical;
}

.lfsp-subtitle {
    font-size: 0.8rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 1px;
    margin-top: 4px;
    color: var(--lfsp-accent-2, #00f0ff);
    background: linear-gradient(90deg, var(--lfsp-accent-1, #ff003c), var(--lfsp-accent-2, #00f0ff));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.lfsp-position-left .lfsp-subtitle,
.lfsp-position-right .lfsp-subtitle {
    font-size: 0.65rem;
}

/* === META === */
.lfsp-meta {
    text-align: right;
    min-width: 80px;
    flex-shrink: 0;
    display: flex;
    flex-direction: column;
    align-items: flex-end;
    gap: 2px;
}

.lfsp-position-left .lfsp-meta,
.lfsp-position-right .lfsp-meta {
    text-align: center;
    align-items: center;
    min-width: 0;
}

.lfsp-time {
    color: var(--lfsp-text, #ffffff);
    font-weight: 300;
    font-size: 1.2rem;
    font-variant-numeric: tabular-nums;
    text-shadow: 0 0 5px rgba(255, 255, 255, 0.3);
}

.lfsp-position-left .lfsp-time,
.lfsp-position-right .lfsp-time {
    font-size: 0.9rem;
}

.lfsp-link {
    display: block;
    font-size: 0.65rem;
    color: #888;
    text-decoration: none;
    text-transform: uppercase;
    letter-spacing: 1px;
    transition: color 0.3s;
}

.lfsp-stream-link:hover {
    color: var(--lfsp-accent-1, #ff003c);
}

.lfsp-soundnode-link {
    color: var(--lfsp-accent-2, #00f0ff);
    opacity: 0.6;
    font-weight: 600;
}

.lfsp-soundnode-link:hover {
    opacity: 1;
    color: var(--lfsp-accent-2, #00f0ff);
}

/* === MOBILE === */
.lfsp-hide-mobile {
    /* Vorbereitung */
}

@media (max-width: 768px) {
    .lfsp-hide-mobile {
        display: none !important;
    }

    .lfsp-position-left,
    .lfsp-position-right {
        width: 100%;
        top: auto;
        bottom: 0;
        left: 0;
        right: auto;
        transform: translateY(0);
    }

    .lfsp-position-left.lfsp-closed,
    .lfsp-position-right.lfsp-closed {
        transform: translateY(80px);
    }

    .lfsp-position-left .lfsp-player-body,
    .lfsp-position-right .lfsp-player-body {
        height: 80px;
        min-height: 0;
        padding: 0 15px;
        border-radius: 0;
        box-shadow:
            0 -10px 30px rgba(0, 0, 0, 0.8),
            0 -2px 10px rgba(255, 0, 60, 0.1),
            0 -2px 10px rgba(0, 240, 255, 0.1);
    }

    .lfsp-position-left .lfsp-player-body::before,
    .lfsp-position-right .lfsp-player-body::before {
        width: 100%;
        height: 3px;
        top: 0;
        left: 0;
        right: auto;
        background: linear-gradient(90deg, var(--lfsp-accent-1, #ff003c) 0%, var(--lfsp-accent-2, #00f0ff) 100%);
    }

    .lfsp-position-left .lfsp-inner-wrapper,
    .lfsp-position-right .lfsp-inner-wrapper {
        flex-direction: row;
        text-align: left;
        gap: 0;
    }

    .lfsp-position-left .lfsp-left-area,
    .lfsp-position-right .lfsp-left-area {
        flex-direction: row;
        gap: 0;
    }

    .lfsp-position-left .lfsp-song-info,
    .lfsp-position-right .lfsp-song-info {
        margin: 0 15px;
    }

    .lfsp-position-left .lfsp-title,
    .lfsp-position-right .lfsp-title {
        font-size: 0.95rem;
        -webkit-line-clamp: unset;
        display: block;
        white-space: normal;
        max-height: 2.8em;
        line-height: 1.4em;
        position: relative;
    }

    .lfsp-position-left .lfsp-meta,
    .lfsp-position-right .lfsp-meta {
        text-align: right;
        align-items: flex-end;
    }

    .lfsp-position-left .lfsp-toggle-btn,
    .lfsp-position-right .lfsp-toggle-btn {
        top: -35px;
        left: auto;
        right: 0;
        bottom: auto;
        transform: none;
        width: 50px;
        height: 35px;
        border-radius: 4px 0 0 0;
        border-top: 2px solid var(--lfsp-accent-2, #00f0ff);
        border-left: none;
        border-right: none;
        box-shadow: 0 -5px 15px rgba(0, 240, 255, 0.2);
    }

    .lfsp-position-left .lfsp-toggle-icon,
    .lfsp-position-right .lfsp-toggle-icon {
        transform: rotate(0deg);
    }

    .lfsp-position-left.lfsp-closed .lfsp-toggle-icon,
    .lfsp-position-right.lfsp-closed .lfsp-toggle-icon {
        transform: rotate(180deg);
    }

    .lfsp-position-left .lfsp-volume-control,
    .lfsp-position-right .lfsp-volume-control {
        display: none;
    }

    .lfsp-position-left .lfsp-play-btn,
    .lfsp-position-right .lfsp-play-btn {
        width: 48px;
        height: 48px;
    }

    .lfsp-player-body {
        height: 80px;
        padding: 0 15px;
    }

    .lfsp-left-area {
        gap: 0;
    }

    .lfsp-volume-control {
        display: none;
    }

    .lfsp-song-info {
        margin: 0 15px;
    }

    .lfsp-play-btn {
        width: 48px;
        height: 48px;
    }

    .lfsp-toggle-btn {
        width: 50px;
        height: 35px;
        top: -35px;
        right: 0;
        border-radius: 4px 0 0 0;
    }

    .lfsp-position-top .lfsp-toggle-btn {
        bottom: -35px;
        border-radius: 0 0 0 4px;
    }

    .lfsp-title {
        font-size: 0.95rem;
        white-space: normal;
        max-height: 2.8em;
        line-height: 1.4em;
        overflow: hidden;
        position: relative;
        display: block;
    }

    .lfsp-title::after {
        content: "";
        position: absolute;
        bottom: 0;
        right: 0;
        width: 40%;
        height: 1.4em;
        background: linear-gradient(to right, rgba(16, 16, 16, 0), var(--lfsp-panel, #101010) 90%);
        pointer-events: none;
    }

    .lfsp-soundnode-link {
        display: none;
    }
}

/* === BUFFERING STATE === */
@keyframes lfsp-spin {
    to { transform: rotate(360deg); }
}

.lfsp-play-btn.lfsp-buffering {
    pointer-events: none;
    opacity: 0.7;
}

.lfsp-play-btn.lfsp-buffering .lfsp-icon-play,
.lfsp-play-btn.lfsp-buffering .lfsp-icon-pause {
    display: none !important;
}

.lfsp-play-btn.lfsp-buffering::after {
    content: "";
    width: 20px;
    height: 20px;
    border: 2px solid transparent;
    border-top-color: var(--lfsp-accent-2, #00f0ff);
    border-radius: 50%;
    animation: lfsp-spin 0.8s linear infinite;
}
