/* Medya oynatıcı — minimalist floating dock */

:root {
    --mp-height: 3.5rem;
    --mp-panel-max: min(36vh, 280px);
    --mp-z: 120;
    --mp-radius: 999px;
    --mp-shell-max: 26rem;
    --mp-bg: rgba(10, 10, 14, 0.72);
    --mp-bg-panel: rgba(10, 10, 14, 0.88);
    --mp-border: rgba(255, 255, 255, 0.08);
    --mp-text: rgba(255, 255, 255, 0.92);
    --mp-muted: rgba(255, 255, 255, 0.42);
    --mp-accent: var(--color-neon-cyan, #00e5ff);
    --mp-blur: 24px;
    --mp-shadow: 0 8px 32px rgba(0, 0, 0, 0.45), 0 0 0 1px var(--mp-border);
}

/* —— Shell —— */
.mp-dock {
    position: fixed;
    left: 50%;
    bottom: 1rem;
    z-index: var(--mp-z);
    width: min(var(--mp-shell-max), calc(100% - 2rem));
    transform: translate(-50%, calc(100% + 2rem));
    opacity: 0;
    pointer-events: none;
    transition:
        transform 0.45s cubic-bezier(0.22, 1, 0.36, 1),
        opacity 0.3s ease;
}

.mp-dock--visible {
    transform: translate(-50%, 0);
    opacity: 1;
    pointer-events: auto;
}

.mp-dock__shell {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

/* —— Mini bar (pill) —— */
.mp-bar-wrap {
    width: 100%;
}

.mp-bar {
    display: flex;
    align-items: center;
    gap: 0.35rem;
    min-height: var(--mp-height);
    padding: 0.35rem 0.5rem 0.35rem 0.4rem;
    background: var(--mp-bg);
    backdrop-filter: blur(var(--mp-blur)) saturate(1.2);
    -webkit-backdrop-filter: blur(var(--mp-blur)) saturate(1.2);
    border-radius: var(--mp-radius);
    box-shadow: var(--mp-shadow);
}

.mp-bar__play {
    flex-shrink: 0;
    width: 2.5rem;
    height: 2.5rem;
    padding: 0;
    border: none;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.08);
    color: var(--mp-text);
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    transition:
        background 0.2s ease,
        color 0.2s ease,
        transform 0.15s ease;
}

.mp-bar__play:hover {
    background: rgba(255, 255, 255, 0.14);
    transform: scale(1.04);
}

.mp-bar__play.is-playing {
    background: var(--mp-accent);
    color: #0a0a0e;
}

.mp-bar__play .mp-icon--pause {
    display: none;
}

.mp-bar__play.is-playing .mp-icon--play {
    display: none;
}

.mp-bar__play.is-playing .mp-icon--pause {
    display: block;
}

.mp-bar__meta {
    flex: 1;
    min-width: 0;
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    gap: 0.1rem;
    padding: 0.2rem 0.35rem;
    border: none;
    background: transparent;
    text-align: left;
    cursor: pointer;
    border-radius: 8px;
    transition: background 0.2s ease;
}

.mp-bar__meta:hover {
    background: rgba(255, 255, 255, 0.05);
}

.mp-bar__title {
    font-size: 0.8125rem;
    font-weight: 500;
    letter-spacing: 0.01em;
    color: var(--mp-text);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    max-width: 100%;
    line-height: 1.3;
}

.mp-bar__artist {
    font-size: 0.6875rem;
    color: var(--mp-muted);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    max-width: 100%;
    line-height: 1.2;
}

.mp-bar__artist[hidden] {
    display: none;
}

.mp-bar__volume {
    display: flex;
    align-items: center;
    gap: 0.4rem;
    flex: 0 1 5.5rem;
    min-width: 0;
    margin: 0 0.15rem;
}

.mp-bar__volume input[type="range"] {
    flex: 1;
    width: 100%;
    height: 2px;
    margin: 0;
    -webkit-appearance: none;
    appearance: none;
    background: rgba(255, 255, 255, 0.14);
    border-radius: 1px;
    cursor: pointer;
}

.mp-bar__volume input[type="range"]::-webkit-slider-thumb {
    -webkit-appearance: none;
    width: 9px;
    height: 9px;
    border-radius: 50%;
    background: var(--mp-text);
    border: none;
}

.mp-bar__meta--static {
    cursor: default;
    pointer-events: none;
}

.mp-bar__meta--static:hover {
    background: transparent;
}

.mp-bar__controls {
    display: flex;
    align-items: center;
    gap: 0.1rem;
    flex-shrink: 0;
}

.mp-dock--single .mp-bar__controls {
    display: none;
}

.mp-dock--single .mp-panel {
    display: none;
}

.mp-bar__btn {
    width: 2rem;
    height: 2rem;
    padding: 0;
    border: none;
    border-radius: 50%;
    background: transparent;
    color: var(--mp-muted);
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    transition: color 0.2s ease, background 0.2s ease;
}

.mp-bar__btn:hover {
    color: var(--mp-text);
    background: rgba(255, 255, 255, 0.06);
}

.mp-bar__btn--queue.is-active {
    color: var(--mp-accent);
}

/* —— Icons —— */
.mp-icon {
    display: block;
    width: 1.125rem;
    height: 1.125rem;
}

.mp-icon--sm {
    width: 0.95rem;
    height: 0.95rem;
    flex-shrink: 0;
    color: var(--mp-muted);
}

.mp-icon--xs {
    width: 0.75rem;
    height: 0.75rem;
}

/* —— Playlist panel —— */
.mp-panel {
    display: grid;
    grid-template-rows: 0fr;
    overflow: hidden;
    border-radius: 1rem;
    background: var(--mp-bg-panel);
    backdrop-filter: blur(var(--mp-blur)) saturate(1.15);
    -webkit-backdrop-filter: blur(var(--mp-blur)) saturate(1.15);
    box-shadow: var(--mp-shadow);
    transition: grid-template-rows 0.35s cubic-bezier(0.22, 1, 0.36, 1);
}

.mp-dock--expanded .mp-panel {
    grid-template-rows: 1fr;
}

.mp-panel__inner {
    min-height: 0;
    overflow: hidden;
    max-height: var(--mp-panel-max);
    display: flex;
    flex-direction: column;
    opacity: 0;
    transition: opacity 0.25s ease 0.05s;
}

.mp-dock--expanded .mp-panel__inner {
    opacity: 1;
}

.mp-panel__head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.75rem;
    padding: 0.85rem 1rem 0.5rem;
    flex-shrink: 0;
}

.mp-panel__label {
    font-size: 0.6875rem;
    font-weight: 500;
    letter-spacing: 0.12em;
    text-transform: uppercase;
    color: var(--mp-muted);
}

.mp-panel__volume {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    flex: 1;
    max-width: 8rem;
    min-width: 0;
}

.mp-panel__volume input[type="range"] {
    flex: 1;
    height: 2px;
    margin: 0;
    -webkit-appearance: none;
    appearance: none;
    background: rgba(255, 255, 255, 0.12);
    border-radius: 1px;
    cursor: pointer;
}

.mp-panel__volume input[type="range"]::-webkit-slider-thumb {
    -webkit-appearance: none;
    width: 10px;
    height: 10px;
    border-radius: 50%;
    background: var(--mp-text);
    border: none;
    box-shadow: 0 0 0 2px rgba(255, 255, 255, 0.15);
}

.mp-panel__volume input[type="range"]::-moz-range-thumb {
    width: 10px;
    height: 10px;
    border-radius: 50%;
    background: var(--mp-text);
    border: none;
}

.mp-playlist {
    list-style: none;
    margin: 0;
    padding: 0 0.5rem;
    overflow-y: auto;
    flex: 1;
    min-height: 0;
}

.mp-track {
    display: flex;
    align-items: center;
    gap: 0.25rem;
    border-radius: 0.5rem;
    transition: background 0.15s ease;
}

.mp-track:hover {
    background: rgba(255, 255, 255, 0.04);
}

.mp-track--current {
    background: rgba(255, 255, 255, 0.06);
}

.mp-track--current .mp-track__dot {
    background: var(--mp-accent);
    box-shadow: 0 0 8px rgba(0, 229, 255, 0.45);
}

.mp-track--current .mp-track__title {
    color: var(--mp-text);
}

.mp-track__main {
    flex: 1;
    display: flex;
    align-items: center;
    gap: 0.65rem;
    min-width: 0;
    padding: 0.55rem 0.45rem;
    border: none;
    background: transparent;
    text-align: left;
    cursor: pointer;
    font: inherit;
    color: inherit;
    border-radius: 0.5rem;
}

.mp-track__dot {
    flex-shrink: 0;
    width: 5px;
    height: 5px;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.2);
    transition: background 0.2s ease, box-shadow 0.2s ease;
}

.mp-track__text {
    display: flex;
    flex-direction: column;
    min-width: 0;
    gap: 0.1rem;
}

.mp-track__title {
    font-size: 0.8125rem;
    font-weight: 450;
    color: rgba(255, 255, 255, 0.78);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    transition: color 0.15s ease;
}

.mp-track__main:hover .mp-track__title {
    color: var(--mp-text);
}

.mp-track__artist {
    font-size: 0.6875rem;
    color: var(--mp-muted);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.mp-track__queue {
    flex-shrink: 0;
    width: 1.75rem;
    height: 1.75rem;
    padding: 0;
    margin-right: 0.25rem;
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 50%;
    background: transparent;
    color: transparent;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    transition:
        border-color 0.2s ease,
        background 0.2s ease,
        color 0.2s ease;
}

.mp-track__queue:hover {
    border-color: rgba(255, 255, 255, 0.22);
}

.mp-track__queue.is-on {
    border-color: rgba(0, 229, 255, 0.35);
    background: rgba(0, 229, 255, 0.1);
    color: var(--mp-accent);
}

.mp-panel__foot {
    display: flex;
    justify-content: center;
    gap: 1.25rem;
    padding: 0.5rem 1rem 0.85rem;
    flex-shrink: 0;
    border-top: 1px solid rgba(255, 255, 255, 0.05);
}

.mp-panel__link {
    padding: 0.25rem 0;
    border: none;
    background: none;
    font-size: 0.6875rem;
    letter-spacing: 0.04em;
    color: var(--mp-muted);
    cursor: pointer;
    transition: color 0.2s ease;
}

.mp-panel__link:hover {
    color: var(--mp-text);
}

.mp-panel__hint {
    margin: 0 1rem 0.75rem;
    padding: 0.45rem 0.6rem;
    font-size: 0.6875rem;
    color: var(--mp-muted);
    text-align: center;
    border-radius: 6px;
    background: rgba(255, 255, 255, 0.04);
}

.mp-panel__hint--warn {
    color: var(--color-neon-orange, #ff6b00);
    background: rgba(255, 107, 0, 0.08);
}

/* —— Body offset —— */
body.has-media-dock {
    padding-bottom: calc(var(--mp-height) + 2rem);
}

body.has-media-dock-expanded:not(.has-media-dock-single) {
    padding-bottom: calc(var(--mp-height) + var(--mp-panel-max) + 2.75rem);
}

body.has-media-dock-single {
    padding-bottom: calc(var(--mp-height) + 2rem);
}

@media (max-width: 480px) {
    .mp-dock {
        width: calc(100% - 1.25rem);
        bottom: 0.65rem;
    }

    .mp-bar__btn[data-action="prev"],
    .mp-bar__btn[data-action="next"] {
        display: none;
    }

    body.has-media-dock-expanded {
        padding-bottom: calc(var(--mp-height) + min(34vh, 240px) + 2rem);
    }
}
