.artist-search-modal {
    width: 100%;
    height: 100%;
    padding: 20px;
    display: flex;
    flex-direction: column;
    box-sizing: border-box;
    overflow: hidden;
}

.artist-search-header h2 {
    font-size: 16px;
    font-weight: 400;
    color: var(--text-secondary);
    text-align: center;
    margin: 0 0 30px 0;
}

.artist-search-input-wrapper {
    position: relative;
    margin-bottom: 30px;
}

.artist-search-input {
    width: 100%;
    padding: 16px 50px 16px 50px;
    font-size: 16px;
    border: 2px solid var(--border-color);
    border-radius: 50px;
    background: var(--background);
    color: var(--text);
    transition: all 0.3s ease;
    outline: none;
}

.artist-search-input:focus {
    border-color: var(--primary);
    box-shadow: 0 0 0 3px var(--primary-fade);
}

.artist-search-input::before {
    content: '🔍';
    position: absolute;
    left: 20px;
    top: 50%;
    transform: translateY(-50%);
    font-size: 18px;
}

.clear-search-btn {
    position: absolute;
    right: 20px;
    top: 50%;
    transform: translateY(-50%);
    background: none;
    border: none;
    color: var(--text-secondary);
    font-size: 20px;
    cursor: pointer;
    padding: 5px;
    opacity: 0.6;
    transition: opacity 0.2s;
}

.clear-search-btn:hover {
    opacity: 1;
}

.search-results-container {
    flex: 1;
    overflow-y: auto;
    min-height: 0;
    margin-bottom: 20px;
    padding-right: 12px;
}

/* Search Filter Tabs */
.search-filter-tabs {
    display: flex;
    gap: 8px;
    margin-bottom: 20px;
    padding: 6px;
    background: var(--card-background);
    border: 1px solid var(--border-color);
    border-radius: 12px;
    width: fit-content;
}

.search-tab {
    padding: 8px 20px;
    border: none;
    border-radius: 8px;
    background: transparent;
    color: var(--text-secondary);
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s ease;
    white-space: nowrap;
}

.search-tab:hover {
    background: var(--background);
    color: var(--text);
}

.search-tab.active {
    background: var(--primary);
    color: white;
}

.search-results-label {
    font-size: 14px;
    font-weight: 500;
    color: var(--text-secondary);
    margin-bottom: 15px;
}

.artist-search-modal .artist-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 12px;
}

@media (max-width: 600px) {
    .artist-search-modal .artist-grid {
        grid-template-columns: 1fr;
    }
}

.artist-search-modal .album-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 12px;
}

@media (max-width: 600px) {
    .artist-search-modal .album-grid {
        grid-template-columns: 1fr;
    }
}

.artist-search-modal .artist-card {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 12px 16px;
    background: var(--card-background);
    border: 1px solid var(--border-color);
    border-radius: 12px;
    transition: all 0.2s ease;
    cursor: pointer;
}

.artist-search-modal .artist-card:hover:not(.disabled) {
    border-color: var(--primary);
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
}

.artist-search-modal .artist-card.selected {
    border-color: var(--primary);
    background: var(--primary-fade);
}

.artist-search-modal .artist-card.disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

.artist-search-modal .artist-card-content {
    display: flex;
    align-items: center;
    gap: 12px;
    flex: 1;
    min-width: 0;
}

.artist-search-modal .artist-image-wrapper {
    flex-shrink: 0;
}

.artist-search-modal .artist-image {
    width: 50px;
    height: 50px;
    border-radius: 50%;
    object-fit: cover;
}

.artist-search-modal .artist-image-placeholder {
    width: 50px;
    height: 50px;
    border-radius: 50%;
    background: var(--background);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 24px;
}

.artist-search-modal .artist-info {
    flex: 1;
    min-width: 0;
}

.artist-search-modal .artist-name {
    font-size: 15px;
    font-weight: 500;
    color: var(--text);
    margin-bottom: 3px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.artist-search-modal .artist-genres {
    font-size: 12px;
    color: var(--text-secondary);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.artist-search-modal .add-artist-btn {
    flex-shrink: 0;
    width: 32px;
    height: 32px;
    border-radius: 50%;
    border: 2px solid var(--primary);
    background: var(--background);
    color: var(--primary);
    font-size: 18px;
    font-weight: bold;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s;
}

.artist-search-modal .add-artist-btn:hover:not(:disabled) {
    background: var(--primary);
    color: white;
    transform: scale(1.1);
}

.artist-search-modal .add-artist-btn.added {
    background: var(--primary);
    color: white;
}

.artist-search-modal .add-artist-btn:disabled {
    opacity: 0.3;
    cursor: not-allowed;
}

.selected-artists-section {
    margin-bottom: 30px;
}

.selected-artists-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 15px;
    font-size: 14px;
    font-weight: 500;
    color: var(--text-secondary);
}

.selected-artists-header .header-content {
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex: 1;
    gap: 10px;
}

.selected-albums-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 12px;
    font-size: 14px;
    font-weight: 500;
    color: var(--text);
}

.selected-albums-header .header-content {
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex: 1;
    gap: 10px;
}

/* Collapsible functionality */
.collapsible-header {
    cursor: pointer;
    user-select: none;
    transition: all 0.2s ease;
    padding: 8px;
    margin: -8px;
    border-radius: 8px;
}

.collapsible-header:hover {
    background: var(--hover-color, rgba(0, 0, 0, 0.05));
}

.collapse-icon {
    font-size: 12px;
    transition: transform 0.3s ease;
    color: var(--text-secondary);
    display: none;
    /* Hidden by default, shown on mobile */
}

.collapse-icon.collapsed {
    transform: rotate(-90deg);
}

.collapsible-content {
    max-height: 500px;
    overflow: hidden;
    transition: max-height 0.3s ease, opacity 0.3s ease;
    opacity: 1;
}

.collapsible-content.collapsed {
    max-height: 0;
    opacity: 0;
}

.artist-counter {
    font-size: 13px;
    color: var(--text-secondary);
}

.selected-artists-pills {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
}

.no-selection {
    text-align: center;
    padding: 30px;
    color: var(--text-secondary);
    font-size: 14px;
}

.artist-pill {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 8px 12px 8px 8px;
    background: var(--primary);
    color: white;
    border-radius: 25px;
    font-size: 14px;
}

.pill-image {
    width: 28px;
    height: 28px;
    border-radius: 50%;
    object-fit: cover;
}

.pill-name {
    font-weight: 500;
}

.pill-remove-btn {
    background: rgba(255, 255, 255, 0.2);
    border: none;
    color: white;
    width: 20px;
    height: 20px;
    border-radius: 50%;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 12px;
    transition: background 0.2s;
}

.pill-remove-btn:hover {
    background: rgba(255, 255, 255, 0.3);
}

.continue-btn {
    width: 100%;
    padding: 16px;
    font-size: 16px;
    font-weight: 600;
    color: white;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    border: none;
    border-radius: 12px;
    cursor: pointer;
    transition: all 0.3s ease;
}

.continue-btn:hover:not(:disabled) {
    transform: translateY(-2px);
    box-shadow: 0 8px 20px rgba(102, 126, 234, 0.4);
}

.continue-btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
    transform: none;
}

.loading,
.error,
.no-results {
    text-align: center;
    padding: 40px;
    color: var(--text-secondary);
    font-size: 14px;
    grid-column: 1 / -1;
}

.error {
    color: var(--error);
}

.artist-pill.loading {
    opacity: 0.8;
}

.artist-pill.cached {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
}

.pill-spinner {
    animation: spin 1s linear infinite;
    font-size: 14px;
}

@keyframes spin {
    from {
        transform: rotate(0deg);
    }

    to {
        transform: rotate(360deg);
    }
}

.pill-check {
    font-size: 14px;
    font-weight: bold;
}

.pill-error {
    font-size: 14px;
    cursor: help;
}

.artist-pill.error {
    background: linear-gradient(135deg, #f56565 0%, #c53030 100%);
}

/* Search Section Headers */
.search-section-header {
    font-size: 14px;
    font-weight: 600;
    color: var(--text);
    margin: 20px 0 12px 0;
    padding-bottom: 8px;
    border-bottom: 2px solid var(--border-color);
    grid-column: 1 / -1;
}

.search-section-header:first-child {
    margin-top: 0;
}

/* Show More Button */
.show-more-btn {
    width: 100%;
    padding: 12px;
    margin-top: 12px;
    background: var(--card-background);
    border: 1px solid var(--border-color);
    border-radius: 8px;
    color: var(--text);
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s ease;
}

.show-more-btn:hover {
    background: var(--background);
    border-color: var(--primary);
    color: var(--primary);
}

.show-more-btn:active {
    transform: scale(0.98);
}

/* Album Cards */
.artist-search-modal .album-card {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 12px 16px;
    background: var(--card-background);
    border: 1px solid var(--border-color);
    border-radius: 12px;
    transition: all 0.2s ease;
    cursor: pointer;
}

.artist-search-modal .album-card:hover {
    border-color: var(--primary);
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
}

.artist-search-modal .album-card-content {
    display: flex;
    align-items: center;
    gap: 12px;
    flex: 1;
    min-width: 0;
}

.artist-search-modal .album-image-wrapper {
    flex-shrink: 0;
}

.artist-search-modal .album-image {
    width: 50px;
    height: 50px;
    border-radius: 8px;
    object-fit: cover;
}

.artist-search-modal .album-image-placeholder {
    width: 50px;
    height: 50px;
    border-radius: 8px;
    background: var(--background);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 24px;
}

.artist-search-modal .album-info {
    flex: 1;
    min-width: 0;
}

.artist-search-modal .album-title {
    font-size: 15px;
    font-weight: 500;
    color: var(--text);
    margin-bottom: 3px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.artist-search-modal .album-artist {
    font-size: 12px;
    color: var(--text-secondary);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.artist-search-modal .add-album-btn {
    flex-shrink: 0;
    width: 32px;
    height: 32px;
    border-radius: 50%;
    border: 2px solid var(--primary);
    background: var(--background);
    color: var(--primary);
    font-size: 18px;
    font-weight: bold;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s;
}

.artist-search-modal .add-album-btn:hover {
    background: var(--primary);
    color: white;
    transform: scale(1.1);
}

/* Added album state */
.artist-search-modal .add-album-btn.album-added {
    background: var(--primary);
    color: white;
    opacity: 0.7;
}

.artist-search-modal .album-card.album-added {
    opacity: 0.7;
    border-color: var(--primary);
    background: var(--primary-fade);
}

/* Selected Albums Section */
.selected-albums-section {
    margin-bottom: 20px;
}

.selected-albums-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 12px;
    font-size: 14px;
    font-weight: 500;
    color: var(--text);
}

.album-counter {
    color: var(--text-secondary);
    font-size: 13px;
}

.selected-albums-pills {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    min-height: 40px;
}

.album-pill {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 6px 12px;
    background: var(--card-background);
    border: 1px solid var(--border-color);
    border-radius: 20px;
    font-size: 13px;
    transition: all 0.2s;
}

.album-pill:hover {
    border-color: var(--primary);
    transform: translateY(-1px);
}

.album-pill .pill-image {
    width: 28px;
    height: 28px;
    border-radius: 4px;
    object-fit: cover;
}

.album-pill .pill-placeholder {
    width: 28px;
    height: 28px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 16px;
}

.pill-album-info {
    display: flex;
    flex-direction: column;
    gap: 2px;
    max-width: 200px;
}

.pill-album-title {
    font-weight: 500;
    color: var(--text);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.pill-album-artist {
    font-size: 11px;
    color: var(--text-secondary);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

@media (max-width: 768px) {
    .artist-search-modal {
        padding: 10px;
        overflow-x: hidden;
        width: 100%;
        max-width: 100%;
    }

    /* Show collapse icons on mobile */
    .collapse-icon {
        display: block;
    }

    /* Ensure all containers respect width */
    .artist-search-input-wrapper,
    .search-results-container,
    .artist-search-modal .artist-grid,
    .artist-search-modal .album-grid {
        width: 100%;
        max-width: 100%;
    }

    /* Force 1 column layout on mobile */
    .artist-search-modal .artist-grid,
    .artist-search-modal .album-grid {
        grid-template-columns: 1fr;
    }

    /* Remove container padding to match search box width */
    .search-results-container {
        padding-right: 0;
        margin-right: 0;
    }

    /* Hide add buttons on mobile - entire card is clickable */
    .artist-search-modal .add-artist-btn,
    .artist-search-modal .add-album-btn {
        display: none !important;
    }

    /* Make cards full width and clickable on mobile */
    .artist-search-modal .artist-card,
    .artist-search-modal .album-card {
        width: 100%;
        max-width: 100%;
        padding: 12px;
        margin: 0;
    }

    .artist-search-modal .artist-card:active,
    .artist-search-modal .album-card:active {
        background-color: var(--bg-secondary);
        transform: scale(0.98);
    }

    /* Enable text wrapping for long titles */
    .artist-search-modal .artist-name,
    .artist-search-modal .album-title {
        white-space: normal;
        overflow: hidden;
        display: -webkit-box;
        -webkit-line-clamp: 2;
        -webkit-box-orient: vertical;
        line-height: 1.3;
    }

    .artist-search-modal .artist-genres,
    .artist-search-modal .album-artist {
        white-space: normal;
        overflow: hidden;
        display: -webkit-box;
        -webkit-line-clamp: 2;
        -webkit-box-orient: vertical;
        line-height: 1.3;
    }

    /* Collapsible sections behavior on mobile */
    .collapsible-content.collapsed {
        max-height: 0 !important;
        opacity: 0 !important;
    }
}