/**
 * Sync page styles.
 */

.sync-page {
    max-width: var(--screen-lg);
    margin: 0 auto;
    padding: 1.5rem 1rem;
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
}

.library-header {
    display: flex;
    align-items: center;
    justify-content: space-between;

    & .page-title {
        margin: 0;
    }
}

/* ── Sync cards ──────────────────────────────────────────────────────────── */

.sync-card {
    background: var(--surface-1);
    border: 1px solid var(--border);
    border-radius: 0.75rem;
    padding: 1.25rem;

    &.hidden {
        display: none;
    }
}

.sync-card-title {
    font-size: 1rem;
    font-weight: 600;
    color: var(--text-primary);
    margin: 0 0 1rem;
}

/* ── Storage bar ─────────────────────────────────────────────────────────── */

.sync-storage-info {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.sync-storage-bar-wrapper {
    height: 8px;
    background: var(--surface-3);
    border-radius: 4px;
    overflow: hidden;
}

.sync-storage-bar {
    height: 100%;
    background: var(--primary);
    border-radius: 4px;
    transition: width 0.4s ease;
}

.sync-storage-text {
    font-size: 0.85rem;
    color: var(--text-secondary);
}

/* ── Library stats ───────────────────────────────────────────────────────── */

.sync-stats {
    display: flex;
    gap: 2rem;
    margin-bottom: 1.25rem;
}

.sync-stat {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.25rem;
}

.sync-stat-value {
    font-size: 1.75rem;
    font-weight: 700;
    color: var(--text-primary);
}

.sync-stat-label {
    font-size: 0.8rem;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.sync-actions {
    display: flex;
    gap: 0.75rem;
    flex-wrap: wrap;
    align-items: center;
}

/* ── Sync progress ───────────────────────────────────────────────────────── */

.sync-progress-wrapper {
    height: 8px;
    background: var(--surface-3);
    border-radius: 4px;
    overflow: hidden;
    margin-bottom: 0.75rem;
}

.sync-progress-bar {
    height: 100%;
    background: var(--primary);
    border-radius: 4px;
    transition: width 0.3s ease;
}

.sync-progress-text {
    font-size: 0.875rem;
    color: var(--text-secondary);
    margin: 0 0 0.75rem;
}

/* ── Album list ──────────────────────────────────────────────────────────── */

.sync-album-list {
    display: flex;
    flex-direction: column;
    max-height: 480px;
    overflow-y: auto;
}

.sync-album-row {
    display: grid;
    grid-template-columns: 48px 1fr auto auto;
    align-items: center;
    gap: 0.75rem;
    padding: 0.5rem 0;
    border-bottom: 1px solid var(--border-subtle);

    &:last-child {
        border-bottom: none;
    }
}

.sync-album-art {
    width: 48px;
    height: 48px;
    border-radius: 4px;
    overflow: hidden;
    background: var(--surface-2);
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--text-muted);
    flex-shrink: 0;

    & img {
        width: 100%;
        height: 100%;
        object-fit: cover;
        display: block;
    }
}

.sync-album-info {
    display: flex;
    flex-direction: column;
    min-width: 0;
}

.sync-album-name {
    font-size: 0.875rem;
    font-weight: 500;
    color: var(--text-primary);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.sync-album-artist {
    font-size: 0.75rem;
    color: var(--text-muted);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.sync-album-status {
    font-size: 0.75rem;
    display: flex;
    align-items: center;
    gap: 0.25rem;

    &.synced {
        background: color-mix(in srgb, var(--success) 15%, transparent);
        color: var(--success-dark);
    }

    &.syncing {
        background: color-mix(in srgb, var(--primary) 15%, transparent);
        color: var(--primary-dark);
    }

    & .material-icons {
        font-size: 1rem;
    }
}

.sync-album-btn {
    color: var(--text-muted);
    padding: 0.25rem;

    &:hover {
        color: var(--primary);
    }

    & .material-icons {
        font-size: 1.2rem;
    }
}
