/* ============================================
   OVERLAY WIDGET - Real-time song display
   ============================================ */

:root {
    --primary: #a855f7;
    --primary-light: #d8a1ff;
    --fg: #f8fafc;
    --fg-secondary: #cbd5e1;
    --fg-tertiary: #94a3b8;
    --shadow-lg: rgba(15, 23, 42, 0.25);
    --border-subtle: rgba(148, 163, 184, 0.12);
}

* {
    box-sizing: border-box;
}

html, body {
    margin: 0;
    padding: 0;
    width: 100%;
    height: 100%;
    background: transparent;
    overflow: hidden;
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", sans-serif;
}

.overlay-container {
    display: flex;
    align-items: flex-start;
    justify-content: flex-start;
    width: 100%;
    height: 100%;
    padding: 16px;
    pointer-events: none;
}

.overlay-widget {
    display: flex;
    flex-direction: column;
    gap: 12px;
    width: min(280px, calc(100vw - 32px));
    padding: 12px;
    border-radius: 16px;
    backdrop-filter: blur(16px) saturate(150%);
    background: linear-gradient(135deg, rgba(30, 41, 59, 0.9) 0%, rgba(15, 23, 42, 0.7) 100%);
    border: 1px solid var(--border-subtle);
    box-shadow: 0 20px 50px var(--shadow-lg), inset 0 1px 0 rgba(255, 255, 255, 0.1);
    animation: slideIn 500ms cubic-bezier(0.16, 1, 0.3, 1);
    pointer-events: auto;
    transform: scale(1);
    transform-origin: left top;
    transition: border-color 0.3s ease, background 0.3s ease, box-shadow 0.3s ease, opacity 0.3s ease;
}

.overlay-widget.hidden {
    display: none;
}

.overlay-widget.error {
    border-color: rgba(239, 68, 68, 0.3);
    background: linear-gradient(135deg, rgba(30, 41, 59, 0.9) 0%, rgba(42, 15, 15, 0.7) 100%);
}

.overlay-widget.error .icon {
    color: #ef4444;
}

.vinyl-showcase {
    position: relative;
    width: 100%;
    height: 180px;
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 auto;
}

.album-cover {
    position: relative;
    width: 150px;
    height: 150px;
    border-radius: 8px;
    overflow: hidden;
    background: linear-gradient(135deg, rgba(168, 85, 247, 0.2), rgba(236, 72, 153, 0.1));
    box-shadow:
        0 15px 50px rgba(0, 0, 0, 0.5),
        inset 0 0 20px rgba(0, 0, 0, 0.2);
    animation: coverIn 450ms ease-out;
}

.artwork {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}

.artwork-placeholder {
    position: absolute;
    inset: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 48px;
    color: var(--primary);
    opacity: 0.4;
    background: rgba(0, 0, 0, 0.1);
}

.header {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 8px;
}

.title-section {
    display: flex;
    flex-direction: column;
    gap: 4px;
    flex: 1;
    min-width: 0;
}

.song-title {
    font-size: 16px;
    font-weight: 600;
    line-height: 1.3;
    color: var(--fg);
    margin: 0;
    word-break: break-word;
    overflow-wrap: break-word;
}

.song-artist {
    font-size: 12px;
    font-weight: 500;
    line-height: 1.4;
    color: var(--fg-secondary);
    margin: 0;
    opacity: 0.9;
}

.meta-info {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 11px;
    color: var(--fg-tertiary);
    font-weight: 500;
    letter-spacing: 0.3px;
    text-transform: uppercase;
    opacity: 0.75;
}

.status-indicator {
    width: 6px;
    height: 6px;
    border-radius: 50%;
    background: var(--primary);
    animation: pulse 2s ease-in-out infinite;
    flex-shrink: 0;
}

.status-indicator.offline {
    background: #ef4444;
    animation: none;
}

.status-bar {
    width: 100%;
    height: 3px;
    border-radius: 999px;
    background: linear-gradient(90deg, rgba(168, 85, 247, 0.3), rgba(236, 72, 153, 0.3));
    overflow: hidden;
    position: relative;
}

.status-bar::after {
    content: '';
    position: absolute;
    inset: 0;
    background: linear-gradient(90deg, transparent, var(--primary), transparent);
    animation: flow 2s ease-in-out infinite;
}

/* Animations */
@keyframes slideIn {
    from {
        opacity: 0;
    }
    to {
        opacity: 1;
    }
}

@keyframes flow {
    0%, 100% { transform: translateX(-100%); }
    50% { transform: translateX(100%); }
}

@keyframes pulse {
    0%, 100% { opacity: 0.8; transform: scale(1); }
    50% { opacity: 1; transform: scale(1.2); }
}

@keyframes fadeIn {
    to { opacity: 1; }
}

@keyframes coverIn {
    from {
        opacity: 0;
        transform: scale(0.9) translateY(8px);
    }
    to {
        opacity: 1;
        transform: scale(1) translateY(0);
    }
}

/* ── Skeleton loading ─────────────────────────────────────────── */
@keyframes sk-shimmer {
    0%   { background-position: -600px 0; }
    100% { background-position:  600px 0; }
}
.sk-card {
    display: flex;
    flex-direction: column;
    gap: 10px;
    padding: 2px 0;
    pointer-events: none;
    width: 100%;
}
.sk-card .sk-row {
    background: linear-gradient(90deg,rgba(148,163,184,.06) 25%,rgba(148,163,184,.14) 50%,rgba(148,163,184,.06) 75%);
    background-size: 1200px 100%;
    animation: sk-shimmer 1.8s infinite linear;
    border-radius: 4px;
    display: block;
    height: 12px;
}
.sk-card .sk-row-lg,
.sk-card .sk-row-sm,
.sk-card .sk-row-mid,
.sk-card .sk-badge,
.sk-card .sk-tile {
    background: linear-gradient(90deg,rgba(148,163,184,.06) 25%,rgba(148,163,184,.14) 50%,rgba(148,163,184,.06) 75%);
    background-size: 1200px 100%;
    animation: sk-shimmer 1.8s infinite linear;
    display: block;
}
.sk-card .sk-row-lg  { height: 22px; width: 70%;  border-radius: 6px; }
.sk-card .sk-row-sm  { height: 10px; width: 50%;  border-radius: 4px; }
.sk-card .sk-row-mid { height: 14px; width: 80%;  border-radius: 4px; }
.sk-card .sk-badge   { height: 18px; width: 80px; border-radius: 999px; }
.sk-card .sk-tiles   { display: flex; gap: 6px; justify-content: center; }
.sk-card .sk-tile    { width: 38px; height: 38px; border-radius: 6px; flex-shrink: 0; }
.sk-card.sk-hidden   { display: none !important; }
