:host {
    display: block;
}

.external-playback-dock {
    display: grid;
    grid-template-columns: auto minmax(0, 1fr) auto;
    align-items: center;
    gap: 14px;
    min-height: 72px;
    padding: 2px 14px;
    border: 1px solid color-mix(in srgb, var(--mat-sys-outline-variant) 60%, transparent);
    border-radius: 15px 15px 0 0;
    background:
        linear-gradient(
            135deg,
            color-mix(in srgb, var(--mat-sys-surface-container-high) 88%, white 12%),
            color-mix(in srgb, var(--mat-sys-surface-container) 92%, transparent)
        );
    box-shadow:
        0 18px 42px rgba(15, 23, 42, 0.12),
        inset 0 1px 0 rgba(255, 255, 255, 0.28);
}

.external-playback-dock--error {
    border-color: color-mix(in srgb, var(--mat-sys-error) 50%, transparent);
    background:
        linear-gradient(
            135deg,
            color-mix(in srgb, var(--mat-sys-error-container) 72%, transparent),
            color-mix(in srgb, var(--mat-sys-surface-container) 90%, transparent)
        );
}

.external-playback-dock--compact {
    min-height: 48px;
    padding: 8px 10px;
    gap: 10px;
    border-radius: 16px;
    box-shadow:
        0 12px 28px rgba(15, 23, 42, 0.16),
        inset 0 1px 0 rgba(255, 255, 255, 0.18);

    .external-playback-dock__artwork {
        width: 38px;
        height: 38px;
        border-radius: 12px;
    }

    .external-playback-dock__title {
        font-size: 0.86rem;
    }

    .external-playback-dock__status {
        font-size: 0.72rem;
    }
}

.external-playback-dock__artwork {
    width: 48px;
    height: 48px;
    padding: 0;
    border: 0;
    border-radius: 14px;
    overflow: hidden;
    background: color-mix(in srgb, var(--mat-sys-surface-container-highest) 92%, transparent);
    box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.18);
    color: inherit;
    cursor: default;
    transition:
        transform 0.18s ease,
        box-shadow 0.18s ease;

    img,
    .external-playback-dock__placeholder {
        width: 100%;
        height: 100%;
    }

    img {
        object-fit: cover;
        display: block;
    }

    &--interactive {
        cursor: pointer;

        &:hover {
            transform: scale(1.04);
            box-shadow:
                inset 0 0 0 1px rgba(255, 255, 255, 0.32),
                0 6px 16px rgba(0, 0, 0, 0.28);
        }

        &:focus-visible {
            outline: 2px solid var(--mat-sys-primary);
            outline-offset: 2px;
        }
    }
}

.external-playback-dock__placeholder {
    display: grid;
    place-items: center;
    color: var(--mat-sys-on-surface-variant);
}

.external-playback-dock__meta {
    min-width: 0;
}

.external-playback-dock__chip {
    display: inline-flex;
    align-items: center;
    height: 18px;
    border-radius: 999px;
    background: color-mix(
        in srgb,
        var(--mat-sys-surface-container-highest) 80%,
        transparent
    );
    color: var(--mat-sys-on-surface-variant);
    border: 1px solid
        color-mix(in srgb, var(--mat-sys-outline-variant) 70%, transparent);
    font-size: 0.66rem;
    font-weight: 700;
    letter-spacing: 0.08em;
}

.external-playback-dock__title {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    font-size: 0.95rem;
    font-weight: 700;
    color: var(--mat-sys-on-surface);
    margin-bottom: 2px;
}

.external-playback-dock__status {
    display: flex;
    align-items: center;
    gap: 6px;
    color: var(--mat-sys-on-surface-variant);
    font-size: 0.78rem;
    min-width: 0;

    .external-playback-dock__status-separator {
        opacity: 0.55;
        font-weight: 700;
        line-height: 1;
    }

    .external-playback-dock__status-icon {
        width: 14px;
        height: 14px;
        font-size: 14px;
    }

    .external-playback-dock__status-text {
        overflow: hidden;
        text-overflow: ellipsis;
        white-space: nowrap;
    }

    mat-spinner {
        flex-shrink: 0;
    }
}

.external-playback-dock__actions {
    display: flex;
    align-items: center;
    gap: 6px;
}

.external-playback-dock__button {
    border-radius: 999px;
    white-space: nowrap;
}

@media (max-width: 720px) {
    .external-playback-dock {
        grid-template-columns: auto minmax(0, 1fr) auto;
    }

    .external-playback-dock:not(.external-playback-dock--compact) {
        .external-playback-dock__button span {
            display: none;
        }
    }
}
