/* songid.css – modern, clean, responsive */
.songid-container {
    max-width: 800px;
    margin: 0 auto;
    padding: 1rem;
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Helvetica, sans-serif;
}

/* Header */
.songid-header {
    display: flex;
    justify-content: space-between;
    align-items: baseline;
    margin-bottom: 1.5rem;
    flex-wrap: wrap;
    gap: 1rem;
}
.songid-title {
    font-size: 2rem;
    font-weight: 700;
    margin: 0;
    background: linear-gradient(135deg, var(--accent, #ef4444), #f97316);
    -webkit-background-clip: text;
    background-clip: text;
    color: transparent;
}
.songid-subtitle {
    font-size: 0.8rem;
    color: var(--text-secondary, #666);
    margin: 0;
}
.songid-sync-btn {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    background: var(--bg-card, #fff);
    border: 1px solid var(--border, #ddd);
    padding: 0.5rem 1rem;
    border-radius: 2rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s;
}
.songid-sync-btn:active {
    transform: scale(0.96);
}
.songid-sync-btn:disabled {
    opacity: 0.6;
}
.animate-spin {
    animation: spin 1s linear infinite;
}
@keyframes spin {
    to { transform: rotate(360deg); }
}

/* Progress */
.songid-progress {
    height: 4px;
    background: var(--bg-elevated, #eee);
    border-radius: 2px;
    margin-bottom: 1.5rem;
    overflow: hidden;
}
.songid-progress-bar {
    height: 100%;
    background: var(--accent, #ef4444);
    width: 0%;
    transition: width 0.2s;
}

/* Tabs */
.songid-tabs {
    display: flex;
    gap: 0.5rem;
    margin-bottom: 1rem;
    border-bottom: 1px solid var(--border, #ddd);
    padding-bottom: 0.5rem;
}
.songid-tabs button {
    background: none;
    border: none;
    padding: 0.5rem 1rem;
    font-weight: 600;
    cursor: pointer;
    color: var(--text-secondary, #666);
    border-radius: 2rem;
    transition: all 0.2s;
}
.songid-tabs button.active {
    background: var(--accent, #ef4444);
    color: white;
}
.songid-tabs .badge {
    background: rgba(0,0,0,0.1);
    padding: 0.1rem 0.4rem;
    border-radius: 1rem;
    font-size: 0.75rem;
    margin-left: 0.3rem;
}
.dark-mode .songid-tabs .badge {
    background: rgba(255,255,255,0.2);
}

/* Search */
.songid-search {
    margin-bottom: 1rem;
}
.songid-search input {
    width: 100%;
    padding: 0.6rem 1rem;
    border-radius: 2rem;
    border: 1px solid var(--border, #ddd);
    background: var(--bg-card, #fff);
    color: var(--text-primary, #111);
}

/* Song list */
.songid-list {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
}
.songid-card {
    display: flex;
    align-items: center;
    gap: 1rem;
    background: var(--bg-card, #fff);
    border-radius: 1rem;
    padding: 0.75rem;
    box-shadow: 0 2px 8px rgba(0,0,0,0.05);
    transition: transform 0.1s, box-shadow 0.2s;
}
.songid-card:active {
    transform: scale(0.99);
}
.dark-mode .songid-card {
    background: #1c1c1e;
    box-shadow: 0 2px 8px rgba(0,0,0,0.3);
}
.songid-art {
    position: relative;
    width: 56px;
    height: 56px;
    flex-shrink: 0;
}
.songid-art img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    border-radius: 12px;
}
.songid-badge {
    position: absolute;
    bottom: -4px;
    right: -4px;
    background: #222;
    border-radius: 50%;
    width: 20px;
    height: 20px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 10px;
    color: white;
}
.songid-badge.locked {
    background: #22c55e;
}
.songid-badge.unlocked {
    background: #f97316;
}
.songid-info {
    flex: 1;
    min-width: 0;
}
.songid-title {
    font-weight: 700;
    font-size: 1rem;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    color: var(--text-primary, #111);
}
.songid-artist {
    font-size: 0.85rem;
    color: var(--text-secondary, #666);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}
.songid-album {
    font-size: 0.75rem;
    color: var(--text-tertiary, #999);
}
.songid-actions {
    display: flex;
    gap: 0.5rem;
}
.songid-actions button {
    background: none;
    border: none;
    cursor: pointer;
    font-size: 0.8rem;
    padding: 0.3rem 0.6rem;
    border-radius: 1rem;
    transition: background 0.1s;
}
.action-edit {
    background: #3b82f6;
    color: white;
}
.action-lock {
    background: #f97316;
    color: white;
}
.action-unlock {
    background: #64748b;
    color: white;
}
.action-apply {
    background: #22c55e;
    color: white;
}
.songid-empty {
    text-align: center;
    padding: 2rem;
    color: var(--text-secondary, #666);
}

/* Albums grid */
.songid-albums {
    margin-top: 1rem;
}
.create-album-btn {
    background: var(--accent, #ef4444);
    color: white;
    border: none;
    padding: 0.5rem 1rem;
    border-radius: 2rem;
    font-weight: 600;
    cursor: pointer;
    margin-bottom: 1rem;
}
.album-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(140px, 1fr));
    gap: 1rem;
}
.album-card {
    background: var(--bg-card, #fff);
    border-radius: 1rem;
    padding: 0.75rem;
    text-align: center;
    cursor: pointer;
    transition: transform 0.1s;
}
.album-card:active {
    transform: scale(0.98);
}
.album-art {
    width: 100%;
    aspect-ratio: 1;
    object-fit: cover;
    border-radius: 12px;
    margin-bottom: 0.5rem;
}
.album-name {
    font-weight: 700;
    font-size: 0.9rem;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}
.album-count {
    font-size: 0.75rem;
    color: var(--text-secondary, #666);
}
.album-actions {
    display: flex;
    justify-content: center;
    gap: 0.5rem;
    margin-top: 0.5rem;
}
.album-actions button {
    background: none;
    border: none;
    font-size: 0.7rem;
    cursor: pointer;
    background: #f0f0f0;
    padding: 0.2rem 0.5rem;
    border-radius: 1rem;
}
.dark-mode .album-actions button {
    background: #2c2c2e;
    color: #fff;
}

/* Modals */
.modal-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0,0,0,0.6);
    backdrop-filter: blur(4px);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 1000;
    padding: 1rem;
}
.modal-sheet, .modal-card {
    background: var(--bg-card, #fff);
    border-radius: 1.5rem;
    max-width: 90vw;
    max-height: 80vh;
    overflow: auto;
    width: 500px;
}
.modal-sheet.wide {
    width: 600px;
}
.modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 1rem;
    border-bottom: 1px solid var(--border, #ddd);
}
.modal-body {
    padding: 1rem;
}
.modal-footer {
    padding: 1rem;
    border-top: 1px solid var(--border, #ddd);
    display: flex;
    justify-content: flex-end;
    gap: 0.5rem;
}
.modal-card input, .modal-card label {
    display: block;
    margin: 0.5rem 0;
}
.modal-buttons {
    display: flex;
    gap: 0.5rem;
    margin-top: 1rem;
}
.track-list {
    margin-top: 1rem;
}
.track-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0.5rem 0;
    border-bottom: 1px solid var(--border, #eee);
}
.edit-track {
    background: none;
    border: none;
    cursor: pointer;
    color: #3b82f6;
}
.search-input {
    width: 100%;
    padding: 0.5rem;
    margin-bottom: 1rem;
    border-radius: 1rem;
    border: 1px solid var(--border, #ddd);
}
.song-select-list {
    max-height: 300px;
    overflow-y: auto;
}
.select-row {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.5rem;
    cursor: pointer;
}
.select-row .artist {
    font-size: 0.75rem;
    color: var(--text-secondary, #666);
    margin-left: auto;
}