/**
 * Share and Play — Frontend Styles
 * Version: 1.0.0
 *
 * Design system: Dark premium music card with rounded corners,
 * album artwork, clean typography and circular action buttons.
 */

/* ── Reset & Base ─────────────────────────────────────────────────────────── */

.sap-widget-wrapper {
    display: flex;
    flex-direction: column;
    width: 100%;
    box-sizing: border-box;
}

.sap-song-list {
    display: flex;
    flex-direction: column;
    gap: 12px;
    list-style: none;
    margin: 0;
    padding: 0;
    width: 100%;
    box-sizing: border-box;
}

/* ── Card ─────────────────────────────────────────────────────────────────── */

.sap-song-card {
    display: flex;
    align-items: center;
    flex-direction: row;
    flex-wrap: nowrap;
    gap: 0;
    background-color: #2d2d2d;
    border-radius: 16px;
    padding: 10px 16px 10px 10px;
    min-height: 90px;
    width: 100%;
    box-sizing: border-box;
    position: relative;
    overflow: hidden;
    transition:
        transform 0.18s ease,
        box-shadow 0.18s ease;
    will-change: transform;
}

.sap-song-card:hover {
    transform: translateY(-1px);
}

/* ── Cover ────────────────────────────────────────────────────────────────── */

.sap-song-cover {
    flex-shrink: 0;
    width: 80px;
    height: 80px;
    min-width: 80px;
    border-radius: 10px;
    overflow: hidden;
    margin-right: 16px;
    border: 1.5px solid rgba(255, 255, 255, 0.12);
    box-sizing: border-box;
    position: relative;
    background-color: rgba(255, 255, 255, 0.06);
}

.sap-song-cover img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
    border-radius: inherit;
}

.sap-cover-placeholder {
    width: 100%;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    background-color: rgba(255, 255, 255, 0.07);
    border-radius: inherit;
}

.sap-placeholder-icon {
    width: 32px;
    height: 32px;
    opacity: 0.35;
    color: #ffffff;
}

/* ── Info ─────────────────────────────────────────────────────────────────── */

.sap-song-info {
    flex: 1;
    min-width: 0;
    display: flex;
    flex-direction: column;
    justify-content: center;
    gap: 0;
    padding-right: 8px;
}

.sap-song-title {
    font-size: 1.125rem;
    font-weight: 600;
    color: #ffffff;
    margin: 0 0 4px 0;
    padding: 0;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    line-height: 1.3;
    letter-spacing: -0.01em;
}

.sap-song-artist {
    font-size: 0.875rem;
    font-weight: 400;
    color: #a0a0a0;
    margin: 0;
    padding: 0;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    line-height: 1.4;
}

.sap-song-subtitle {
    font-size: 0.75rem;
    font-weight: 400;
    color: #6a6a6a;
    margin: 4px 0 0 0;
    padding: 0;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

/* ── Right side ───────────────────────────────────────────────────────────── */

.sap-song-right {
    flex-shrink: 0;
    display: flex;
    align-items: center;
    gap: 14px;
    margin-left: auto;
}

.sap-song-duration {
    font-size: 0.9375rem;
    font-weight: 500;
    color: #c0c0c0;
    white-space: nowrap;
    letter-spacing: 0.02em;
    user-select: none;
    flex-shrink: 0;
}

/* ── Actions ──────────────────────────────────────────────────────────────── */

.sap-song-actions {
    display: flex;
    align-items: center;
    gap: 8px;
}

/* ── Buttons ──────────────────────────────────────────────────────────────── */

.sap-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 48px;
    height: 48px;
    border-radius: 50%;
    border: none;
    cursor: pointer;
    text-decoration: none;
    flex-shrink: 0;
    position: relative;
    transition:
        background-color 0.15s ease,
        transform 0.12s ease,
        box-shadow 0.15s ease,
        opacity 0.15s ease;
    -webkit-tap-highlight-color: transparent;
    outline-offset: 3px;
}

.sap-btn:focus-visible {
    outline: 2px solid #ffffff;
    outline-offset: 3px;
}

.sap-btn:active {
    transform: scale(0.93);
}

.sap-btn svg {
    width: 18px;
    height: 18px;
    pointer-events: none;
    display: block;
    flex-shrink: 0;
}

.sap-btn-share {
    background-color: #e8e8e8;
    color: #555555;
}

.sap-btn-share:hover {
    background-color: #d4d4d4;
    transform: scale(1.06);
}

.sap-btn-share svg {
    color: #555555;
    stroke: currentColor;
}

.sap-btn-play {
    background-color: #f0f0f0;
    color: #444444;
}

.sap-btn-play:hover {
    background-color: #e0e0e0;
    transform: scale(1.06);
}

.sap-btn-play svg {
    color: #444444;
    stroke: currentColor;
    margin-left: 2px; /* optical centering for play triangle */
}

.sap-btn-disabled {
    opacity: 0.35;
    cursor: not-allowed;
    pointer-events: none;
}

/* ── Tooltip ──────────────────────────────────────────────────────────────── */

.sap-tooltip {
    position: absolute;
    bottom: calc(100% + 8px);
    left: 50%;
    transform: translateX(-50%) translateY(4px);
    background-color: rgba(20, 20, 20, 0.92);
    color: #ffffff;
    font-size: 0.75rem;
    font-weight: 500;
    white-space: nowrap;
    padding: 5px 10px;
    border-radius: 6px;
    pointer-events: none;
    opacity: 0;
    transition:
        opacity 0.18s ease,
        transform 0.18s ease;
    z-index: 100;
    backdrop-filter: blur(4px);
    letter-spacing: 0.01em;
}

.sap-tooltip::after {
    content: '';
    position: absolute;
    top: 100%;
    left: 50%;
    transform: translateX(-50%);
    border: 5px solid transparent;
    border-top-color: rgba(20, 20, 20, 0.92);
}

.sap-btn-share.sap-tooltip-visible .sap-tooltip {
    opacity: 1;
    transform: translateX(-50%) translateY(0);
}

/* ── Empty notice (editor only) ───────────────────────────────────────────── */

.sap-empty-notice {
    padding: 24px 16px;
    text-align: center;
    color: #999999;
    border: 2px dashed rgba(255, 255, 255, 0.15);
    border-radius: 12px;
    font-size: 0.875rem;
}

/* ── Responsive ───────────────────────────────────────────────────────────── */

@media (max-width: 767px) {
    .sap-song-card {
        padding: 8px 12px 8px 8px;
        min-height: 76px;
    }

    .sap-song-cover {
        width: 66px;
        height: 66px;
        min-width: 66px;
        margin-right: 12px;
    }

    .sap-song-title {
        font-size: 1rem;
    }

    .sap-song-artist {
        font-size: 0.8125rem;
    }

    .sap-song-duration {
        font-size: 0.8125rem;
        margin-right: 10px;
    }

    .sap-btn {
        width: 40px;
        height: 40px;
    }

    .sap-btn svg {
        width: 15px;
        height: 15px;
    }
}

@media (max-width: 479px) {
    .sap-song-card {
        padding: 8px 10px 8px 8px;
        min-height: 70px;
    }

    .sap-song-cover {
        width: 58px;
        height: 58px;
        min-width: 58px;
        margin-right: 10px;
    }

    .sap-song-right {
        gap: 8px;
    }

    .sap-song-duration {
        display: none; /* hide on very small screens to save space */
    }

    .sap-song-actions {
        gap: 6px;
    }

    .sap-btn {
        width: 38px;
        height: 38px;
    }
}
