/* ===========================================
   SoundCloud Custom Player v1.2 - Frontend
   =========================================== */

.scc-player {
    background: var(--scc-bg, #1a1a1a);
    color: var(--scc-text, #fff);
    border-radius: var(--scc-radius, 12px);
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
    box-shadow: 0 4px 20px rgba(0,0,0,0.15);
    margin: 20px 0;
    position: relative;
    box-sizing: border-box;
}
.scc-player * { box-sizing: border-box; }

.scc-player__artwork {
    border-radius: calc(var(--scc-radius, 12px) - 4px);
    overflow: hidden;
    flex-shrink: 0;
    background: rgba(255,255,255,0.05);
    display: flex;
    align-items: center;
    justify-content: center;
}
.scc-player__artwork img { width: 100%; height: 100%; object-fit: cover; }
.scc-player__artwork-placeholder { font-size: 32px; opacity: 0.6; }

.scc-player__body { flex: 1; min-width: 0; }
.scc-player__title {
    font-weight: 600;
    font-size: 15px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}
.scc-player__artist {
    font-size: 13px;
    opacity: 0.7;
    margin-bottom: 10px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.scc-player__controls {
    display: flex;
    align-items: center;
    gap: 12px;
}
.scc-btn {
    background: var(--scc-primary, #ff5500);
    color: #fff;
    border: none;
    width: 38px;
    height: 38px;
    border-radius: 50%;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 13px;
    transition: transform 0.15s, background 0.2s;
    flex-shrink: 0;
}
.scc-btn:hover { transform: scale(1.08); }
.scc-btn--mute {
    background: transparent;
    width: 28px;
    height: 28px;
    color: var(--scc-text, #fff);
}

.scc-player__progress {
    flex: 1;
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 11px;
    min-width: 0;
}
.scc-player__bar {
    flex: 1;
    height: 4px;
    background: rgba(255,255,255,0.15);
    border-radius: 2px;
    position: relative;
    cursor: pointer;
}
.scc-player__bar-fill {
    height: 100%;
    width: 0%;
    background: var(--scc-accent, #ff8533);
    border-radius: 2px;
    transition: width 0.1s linear;
}
.scc-player__bar-handle {
    position: absolute;
    top: 50%;
    left: 0;
    width: 12px;
    height: 12px;
    background: var(--scc-primary, #ff5500);
    border-radius: 50%;
    transform: translate(-50%, -50%);
    opacity: 0;
    transition: opacity 0.2s;
}
.scc-player__bar:hover .scc-player__bar-handle { opacity: 1; }

.scc-player__volume {
    display: flex;
    align-items: center;
    gap: 6px;
    flex-shrink: 0;
}
.scc-volume-slider {
    width: 60px;
    accent-color: var(--scc-primary, #ff5500);
}

.scc-player__iframe {
    position: absolute;
    visibility: hidden;
    height: 0 !important;
    width: 0;
    pointer-events: none;
}

/* ============ COMPACT ============ */
.scc-player--compact {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 8px 14px;
    max-width: 480px;
}
.scc-player--compact .scc-player__title {
    font-size: 13px;
    margin: 0;
    max-width: 140px;
}
.scc-player--compact .scc-btn--play {
    width: 32px;
    height: 32px;
    font-size: 11px;
}
.scc-player--compact .scc-player__controls {
    flex: 1;
    gap: 8px;
}

/* ============ STANDARD ============ */
.scc-player--standard {
    display: flex;
    align-items: center;
    gap: 16px;
    padding: 16px;
    max-width: 700px;
}
.scc-player--standard .scc-player__artwork {
    width: 80px;
    height: 80px;
}

/* ============ EXPANDED ============ */
.scc-player--expanded {
    display: flex;
    flex-direction: column;
    padding: 20px;
    max-width: 700px;
    gap: 14px;
}
.scc-player--expanded .scc-player__artwork {
    width: 100%;
    height: 220px;
}
.scc-player--expanded .scc-player__title { font-size: 18px; }
.scc-player--expanded .scc-player__artist { font-size: 14px; margin-bottom: 0; }

.scc-player__waveform {
    width: 100%;
    height: 60px;
    background: rgba(255,255,255,0.04);
    border-radius: 6px;
    overflow: hidden;
    position: relative;
    cursor: pointer;
}
.scc-waveform-canvas {
    width: 100%;
    height: 100%;
    display: block;
}

@media (max-width: 600px) {
    .scc-player--standard {
        flex-direction: column;
        align-items: stretch;
    }
    .scc-player--standard .scc-player__artwork {
        width: 100%;
        height: 160px;
    }
    .scc-player--expanded .scc-player__artwork { height: 180px; }
    .scc-player--compact .scc-player__title { max-width: 100px; }
    .scc-volume-slider { width: 50px; }
}


/* v1.4.2: imagem padrao (fallback) — leve diferenciacao visual */
.scc-player__artwork--default {
    background: rgba(255,255,255,0.04);
}
.scc-player__artwork--default img {
    object-fit: contain;
    padding: 8%;
    opacity: 0.95;
}


/* v1.5.0: Resume banner e Next track toast */
.scc-resume-banner, .scc-next-toast {
    animation: scc-slide-in 0.3s ease-out;
}
@keyframes scc-slide-in {
    from { transform: translateY(-8px); opacity: 0; }
    to { transform: translateY(0); opacity: 1; }
}
.scc-resume-banner button:hover, .scc-next-toast button:hover {
    opacity: 0.85;
}
