/* LinkTube - Music Smart Links: the music card (public profile and Admin Previewer, same markup) and the music editor.
   The card header is a template button (a.tubebutton / a.preview-a), so it takes the active template's colors,
   typography, radius and hover. The platform rows use the template's button variables (Template Engine v2) with
   neutral fallbacks for the older templates. Platform marks sit on a white badge so they stay recognizable on any
   background. Icons: Models/MusicPlatforms.cs, Models/PhosphorIcons.cs. */

/* ---- Card header (the button) ---- */
a.lt-music-toggle {
    display: flex !important;
    align-items: center;
    gap: 12px;
    text-align: left !important;
}
a.lt-music-toggle > .lt-music-cover {
    position: static !important;
    display: block !important;
    width: 48px;
    height: 48px;
    margin: 0 !important;
    flex: none;
    border-radius: 8px;
    object-fit: cover;
}
a.lt-music-toggle > .lt-music-cover-empty {
    display: inline-flex !important;
    align-items: center;
    justify-content: center;
    background: rgba(127, 127, 127, .18);
}
a.lt-music-toggle > .lt-music-cover-empty .ph-icon { display: inline-flex; width: 24px; height: 24px; }
a.lt-music-toggle > .lt-music-text {
    display: flex !important;
    flex-direction: column;
    flex: 1;
    min-width: 0;
    line-height: 1.25;
}
a.lt-music-toggle .lt-music-title { display: block; font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
a.lt-music-toggle .lt-music-artist { display: block; margin-top: 2px; font-size: .85em; opacity: .75; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
a.lt-music-toggle > .lt-music-caret {
    display: inline-flex !important;
    width: 20px;
    height: 20px;
    flex: none;
    transition: transform .2s ease;
}
a.lt-music-toggle > .lt-music-caret .ph-icon,
a.lt-music-toggle > .lt-music-caret svg { width: 100%; height: 100%; display: block; }
a.lt-music-toggle[aria-expanded="true"] > .lt-music-caret { transform: rotate(180deg); }

/* ---- Platform rows ---- */
.lt-music-panel {
    width: 100%;
    max-width: var(--lt-content-width, 100%);
    margin: 0 auto 14px;
    padding: 0 4px;
    box-sizing: border-box;
}
.lt-music-panel[hidden] { display: none !important; }
.lt-music-row {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-top: 8px;
    padding: 10px 14px;
    border: var(--lt-btn-border, 1px solid rgba(39, 53, 82, .10));
    border-radius: var(--lt-btn-radius, 12px);
    background: var(--lt-btn-bg, #ffffff);
    color: var(--lt-btn-text, #273552) !important;
    font-family: var(--lt-font-button, inherit);
    text-decoration: none !important;
    text-align: left;
    box-shadow: var(--lt-btn-shadow, none);
    transition: transform .15s ease, box-shadow .15s ease, background .15s ease;
}
.lt-music-row:hover,
.lt-music-row:focus-visible {
    background: var(--lt-btn-bg-hover, var(--lt-btn-bg, #f4f7fb));
    color: var(--lt-btn-text-hover, var(--lt-btn-text, #273552)) !important;
    box-shadow: var(--lt-btn-shadow-hover, 0 2px 8px rgba(39, 53, 82, .12));
    transform: translateY(-1px);
}
.lt-music-badge {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 32px;
    height: 32px;
    flex: none;
    border-radius: 50%;
    background: #ffffff;
    box-shadow: 0 0 0 1px rgba(39, 53, 82, .08);
}
.lt-music-badge svg { width: 18px; height: 18px; display: block; }
.lt-music-name { flex: 1; min-width: 0; font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.lt-music-play { font-size: .85em; opacity: .8; }
.lt-music-arrow { display: inline-flex; width: 16px; height: 16px; flex: none; }
.lt-music-arrow .ph-icon, .lt-music-arrow svg { width: 100%; height: 100%; display: block; }

@media (prefers-reduced-motion: reduce) {
    a.lt-music-toggle > .lt-music-caret, .lt-music-row { transition: none; }
    .lt-music-row:hover { transform: none; }
}

/* ---- Admin editor (Links tab) ---- */
.lt-edit-music { margin-top: 8px; }
.lt-edit-music .form-control { margin-top: 6px; }
.lt-edit-music-badge {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 2px 10px;
    border-radius: 999px;
    background: #e8f6fc;
    color: #00427d;
    font-size: 12px;
    font-weight: 600;
}
.lt-edit-music-badge .ph-icon { display: inline-flex; width: 16px; height: 16px; }
.lt-edit-music-add { display: flex; gap: 6px; margin-top: 8px; }
.lt-edit-music-add .form-control { margin-top: 0; }
.lt-edit-music-add button { white-space: nowrap; }
.lt-edit-platform { display: inline-flex; align-items: center; gap: 8px; margin-top: 6px; font-size: 13px; font-weight: 600; color: #273552; }
.lt-edit-platform .lt-music-badge { width: 26px; height: 26px; }
.lt-edit-platform .lt-music-badge svg { width: 15px; height: 15px; }
.lt-edit-error { display: block; margin-top: 6px; font-size: 13px; color: #c4383a; }
.lt-edit-hint { display: block; margin-top: 6px; font-size: 12px; color: #5f6b80; }
