/**
 * Artist Directory Styles
 * Supports gallery and list views with search, filter, and pagination
 */

/* Container */
.artist-directory {
    max-width: 1400px;
    margin: 0 auto;
    padding: 20px;
}

/* Controls Bar */
.artist-directory-controls {
    display: flex;
    flex-wrap: wrap;
    gap: 15px;
    align-items: center;
    margin-bottom: 20px;
    padding: 15px;
    background: rgba(255, 255, 255, 0.05);
    border-radius: 12px;
    backdrop-filter: blur(10px);
    position: relative;
    z-index: 100;
}

/* Search Input */
.artist-search-wrap {
    position: relative;
    flex: 1;
    min-width: 200px;
    max-width: 350px;
}

.artist-search-input {
    width: 100%;
    padding: 12px 40px 12px 16px;
    border: 1px solid rgba(255, 255, 255, 0.2);
    border-radius: 8px;
    background: rgba(255, 255, 255, 0.1);
    color: #fff;
    font-size: 14px;
    transition: all 0.3s ease;
}

.artist-search-input::placeholder {
    color: rgba(255, 255, 255, 0.5);
}

.artist-search-input:focus {
    outline: none;
    border-color: #61CE70;
    background: rgba(255, 255, 255, 0.15);
    box-shadow: 0 0 0 3px rgba(97, 206, 112, 0.2);
}

.artist-search-icon {
    position: absolute;
    right: 14px;
    top: 50%;
    transform: translateY(-50%);
    color: rgba(255, 255, 255, 0.5);
    pointer-events: none;
}

/* Filters */
.artist-filters {
    display: flex;
    flex-wrap: wrap;
    gap: 15px;
    flex: 2;
}

.filter-group {
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.filter-label {
    font-size: 11px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    color: rgba(255, 255, 255, 0.7);
    display: flex;
    align-items: center;
    gap: 6px;
}

.filter-label i {
    font-size: 12px;
}

/* Genre label color */
.filter-group:nth-child(1) .filter-label {
    color: #5dade2;
}

/* Mood label color */
.filter-group:nth-child(2) .filter-label {
    color: #f5b041;
}

/* Sort label color */
.filter-group:nth-child(3) .filter-label {
    color: #61CE70;
}

/* Standard select (for sort) */
.artist-filter-select {
    padding: 10px 35px 10px 14px;
    border: 1px solid rgba(255, 255, 255, 0.2);
    border-radius: 8px;
    background: rgba(255, 255, 255, 0.1);
    color: #fff;
    font-size: 14px;
    cursor: pointer;
    appearance: none;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' fill='white' viewBox='0 0 16 16'%3E%3Cpath d='M8 11L3 6h10l-5 5z'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 12px center;
    min-width: 160px;
    transition: all 0.3s ease;
}

.artist-filter-select:hover {
    border-color: rgba(255, 255, 255, 0.4);
}

.artist-filter-select:focus {
    outline: none;
    border-color: #61CE70;
    box-shadow: 0 0 0 3px rgba(97, 206, 112, 0.2);
}

.artist-filter-select option {
    background: #1a1a2e;
    color: #fff;
}

/* Multiselect Component */
.multiselect {
    position: relative;
    min-width: 180px;
    z-index: 200;
}

.multiselect.open {
    z-index: 201;
}

.multiselect-toggle {
    width: 100%;
    padding: 10px 35px 10px 14px;
    border: 1px solid rgba(255, 255, 255, 0.2);
    border-radius: 8px;
    background: rgba(255, 255, 255, 0.1);
    color: #fff;
    font-size: 14px;
    cursor: pointer;
    text-align: left;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    transition: all 0.3s ease;
}

.multiselect-toggle:hover {
    border-color: rgba(255, 255, 255, 0.4);
}

.multiselect.open .multiselect-toggle {
    border-color: #61CE70;
    box-shadow: 0 0 0 3px rgba(97, 206, 112, 0.2);
    border-bottom-left-radius: 0;
    border-bottom-right-radius: 0;
}

.multiselect-toggle i {
    font-size: 12px;
    transition: transform 0.2s;
    flex-shrink: 0;
}

.multiselect.open .multiselect-toggle i {
    transform: rotate(180deg);
}

.multiselect-text {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.multiselect-text.has-selection {
    color: #61CE70;
    font-weight: 500;
}

.multiselect-dropdown {
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    background: #1a1a2e;
    border: 1px solid #61CE70;
    border-top: none;
    border-radius: 0 0 8px 8px;
    z-index: 1000;
    display: none;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.4);
}

.multiselect.open .multiselect-dropdown {
    display: block;
}

.multiselect-search {
    padding: 10px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

.multiselect-search-input {
    width: 100%;
    padding: 8px 12px;
    border: 1px solid rgba(255, 255, 255, 0.2);
    border-radius: 6px;
    background: rgba(255, 255, 255, 0.05);
    color: #fff;
    font-size: 13px;
}

.multiselect-search-input::placeholder {
    color: rgba(255, 255, 255, 0.4);
}

.multiselect-search-input:focus {
    outline: none;
    border-color: rgba(97, 206, 112, 0.5);
}

.multiselect-options {
    max-height: 250px;
    overflow-y: auto;
    padding: 5px 0;
}

.multiselect-options::-webkit-scrollbar {
    width: 6px;
}

.multiselect-options::-webkit-scrollbar-track {
    background: rgba(255, 255, 255, 0.05);
}

.multiselect-options::-webkit-scrollbar-thumb {
    background: rgba(255, 255, 255, 0.2);
    border-radius: 3px;
}

.multiselect-option {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 10px 14px;
    cursor: pointer;
    transition: background 0.2s;
}

.multiselect-option:hover {
    background: rgba(255, 255, 255, 0.08);
}

.multiselect-option input[type="checkbox"] {
    width: 16px;
    height: 16px;
    accent-color: #61CE70;
    cursor: pointer;
    flex-shrink: 0;
}

.multiselect-option .option-text {
    flex: 1;
    font-size: 13px;
    color: #fff;
}

.multiselect-option .option-count {
    font-size: 11px;
    color: rgba(255, 255, 255, 0.5);
    background: rgba(255, 255, 255, 0.1);
    padding: 2px 8px;
    border-radius: 10px;
}

.multiselect-actions {
    display: flex;
    gap: 10px;
    padding: 10px;
    border-top: 1px solid rgba(255, 255, 255, 0.1);
}

.multiselect-clear,
.multiselect-apply {
    flex: 1;
    padding: 8px 12px;
    border: none;
    border-radius: 6px;
    font-size: 13px;
    cursor: pointer;
    transition: all 0.2s;
}

.multiselect-clear {
    background: rgba(255, 255, 255, 0.1);
    color: rgba(255, 255, 255, 0.7);
}

.multiselect-clear:hover {
    background: rgba(255, 255, 255, 0.15);
    color: #fff;
}

.multiselect-apply {
    background: #61CE70;
    color: #fff;
    font-weight: 500;
}

.multiselect-apply:hover {
    background: #52b860;
}

/* Genre multiselect accent */
#genre-multiselect .multiselect-text.has-selection {
    color: #5dade2;
}

#genre-multiselect.open .multiselect-toggle {
    border-color: #5dade2;
    box-shadow: 0 0 0 3px rgba(93, 173, 226, 0.2);
}

#genre-multiselect .multiselect-dropdown {
    border-color: #5dade2;
}

#genre-multiselect .multiselect-option input[type="checkbox"] {
    accent-color: #5dade2;
}

#genre-multiselect .multiselect-apply {
    background: #5dade2;
}

#genre-multiselect .multiselect-apply:hover {
    background: #4a9fd4;
}

/* Mood multiselect accent */
#mood-multiselect .multiselect-text.has-selection {
    color: #f5b041;
}

#mood-multiselect.open .multiselect-toggle {
    border-color: #f5b041;
    box-shadow: 0 0 0 3px rgba(245, 176, 65, 0.2);
}

#mood-multiselect .multiselect-dropdown {
    border-color: #f5b041;
}

#mood-multiselect .multiselect-option input[type="checkbox"] {
    accent-color: #f5b041;
}

#mood-multiselect .multiselect-apply {
    background: #f5b041;
    color: #1a1a2e;
}

#mood-multiselect .multiselect-apply:hover {
    background: #e6a332;
}

/* View Toggle */
.artist-view-toggle {
    display: flex;
    gap: 5px;
    background: rgba(255, 255, 255, 0.1);
    padding: 4px;
    border-radius: 8px;
}

.view-toggle-btn {
    padding: 10px 14px;
    border: none;
    background: transparent;
    color: rgba(255, 255, 255, 0.6);
    cursor: pointer;
    border-radius: 6px;
    transition: all 0.2s ease;
}

.view-toggle-btn:hover {
    color: #fff;
    background: rgba(255, 255, 255, 0.1);
}

.view-toggle-btn.active {
    background: #61CE70;
    color: #fff;
}

/* Active Filters */
.artist-active-filters {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 10px 15px;
    background: rgba(97, 206, 112, 0.1);
    border-radius: 8px;
    margin-bottom: 15px;
    flex-wrap: wrap;
}

.active-filters-label {
    color: rgba(255, 255, 255, 0.7);
    font-size: 13px;
}

.active-filters-tags {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    flex: 1;
}

.filter-tag {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 5px 10px;
    background: rgba(97, 206, 112, 0.2);
    border-radius: 20px;
    font-size: 12px;
    color: #fff;
}

.filter-tag .remove-filter {
    border: none;
    background: none;
    color: rgba(255, 255, 255, 0.7);
    cursor: pointer;
    padding: 0;
    font-size: 16px;
    line-height: 1;
    transition: color 0.2s;
}

.filter-tag .remove-filter:hover {
    color: #E7565A;
}

.clear-all-filters {
    padding: 6px 12px;
    border: 1px solid rgba(255, 255, 255, 0.3);
    background: transparent;
    color: rgba(255, 255, 255, 0.7);
    border-radius: 6px;
    cursor: pointer;
    font-size: 12px;
    transition: all 0.2s;
}

.clear-all-filters:hover {
    background: rgba(255, 255, 255, 0.1);
    color: #fff;
}

/* Results Info */
.artist-results-info {
    margin-bottom: 15px;
    color: rgba(255, 255, 255, 0.6);
    font-size: 14px;
}

/* Loading */
.artist-loading {
    display: none;
    justify-content: center;
    padding: 40px;
}

.artist-loading-spinner {
    width: 40px;
    height: 40px;
    border: 3px solid rgba(255, 255, 255, 0.1);
    border-top-color: #61CE70;
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

@keyframes spin {
    to { transform: rotate(360deg); }
}

/* Artist Container - Common */
.artist-container {
    transition: opacity 0.2s ease;
}

.artist-no-results,
.artist-error {
    text-align: center;
    padding: 60px 20px;
    color: rgba(255, 255, 255, 0.6);
    font-size: 16px;
}

/* ========================================
   GALLERY VIEW
   ======================================== */
.artist-container.gallery-view {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 25px;
}

.gallery-view .artist-card {
    background: rgba(255, 255, 255, 0.05);
    border-radius: 16px;
    overflow: hidden;
    transition: all 0.3s ease;
    border: 1px solid rgba(255, 255, 255, 0.1);
    position: relative;
    z-index: 1;
}

.gallery-view .artist-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 15px 40px rgba(0, 0, 0, 0.3);
    border-color: rgba(97, 206, 112, 0.3);
}

.gallery-view .artist-card-link {
    display: block;
    text-decoration: none;
    color: inherit;
}

.gallery-view .artist-image {
    position: relative;
    width: 100%;
    padding-top: 100%; /* 1:1 Aspect Ratio */
    background: rgba(255, 255, 255, 0.05);
    overflow: hidden;
}

.gallery-view .artist-image img {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.5s ease, filter 0.3s ease;
}

.gallery-view .artist-card:hover .artist-image img {
    transform: scale(1.08);
    filter: brightness(0.7);
}

.gallery-view .artist-no-image {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    background: linear-gradient(135deg, #2a2a4a 0%, #1a1a2e 100%);
}

.gallery-view .artist-no-image i {
    font-size: 60px;
    color: rgba(255, 255, 255, 0.2);
}

/* Overlay on image */
.gallery-view .artist-overlay {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    padding: 60px 15px 15px 15px;
    background: linear-gradient(to top, rgba(0, 0, 0, 0.85) 0%, rgba(0, 0, 0, 0.4) 60%, transparent 100%);
    transform: translateY(0);
    transition: all 0.3s ease;
}

.gallery-view .artist-card:hover .artist-overlay {
    padding-bottom: 20px;
    background: linear-gradient(to top, rgba(0, 0, 0, 0.95) 0%, rgba(0, 0, 0, 0.6) 70%, transparent 100%);
}

.gallery-view .artist-name {
    margin: 0 0 8px 0;
    font-size: 18px;
    font-weight: 600;
    color: #fff;
    text-shadow: 0 2px 4px rgba(0, 0, 0, 0.5);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.gallery-view .artist-overlay .artist-meta {
    display: flex;
    gap: 12px;
    color: rgba(255, 255, 255, 0.9);
    font-size: 13px;
    margin: 0;
}

.gallery-view .artist-overlay .meta-item {
    display: flex;
    align-items: center;
    gap: 5px;
    background: rgba(0, 0, 0, 0.4);
    padding: 4px 10px;
    border-radius: 12px;
}

.gallery-view .artist-overlay .meta-item i {
    color: #61CE70;
}

.gallery-view .artist-info {
    padding: 12px 15px 15px;
}

.gallery-view .artist-meta-date {
    font-size: 11px;
    color: rgba(255, 255, 255, 0.5);
    margin-bottom: 10px;
}

.gallery-view .artist-meta-date i {
    margin-right: 5px;
    color: rgba(255, 255, 255, 0.4);
}

.gallery-view .artist-tags {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.gallery-view .tag-group {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 6px;
}

.gallery-view .tag-label {
    font-size: 10px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.3px;
    display: flex;
    align-items: center;
    gap: 4px;
    margin-right: 2px;
}

.gallery-view .tag-label i {
    font-size: 10px;
}

.gallery-view .genre-group .tag-label {
    color: #5dade2;
}

.gallery-view .mood-group .tag-label {
    color: #f5b041;
}

.gallery-view .artist-tag {
    padding: 3px 8px;
    border-radius: 10px;
    font-size: 10px;
    font-weight: 500;
}

.gallery-view .genre-tag {
    background: rgba(52, 152, 219, 0.2);
    color: #5dade2;
    border: 1px solid rgba(52, 152, 219, 0.3);
    text-decoration: none;
    transition: all 0.2s;
}

.gallery-view .genre-tag:hover {
    background: rgba(52, 152, 219, 0.4);
    transform: translateY(-1px);
}

.gallery-view .mood-tag {
    background: rgba(243, 156, 18, 0.2);
    color: #f5b041;
    border: 1px solid rgba(243, 156, 18, 0.3);
    text-decoration: none;
    transition: all 0.2s;
}

.gallery-view .mood-tag:hover {
    background: rgba(243, 156, 18, 0.4);
    transform: translateY(-1px);
}

/* ========================================
   LIST VIEW
   ======================================== */
.artist-container.list-view {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.list-view .artist-card {
    background: rgba(255, 255, 255, 0.03);
    border-radius: 12px;
    transition: all 0.2s ease;
    border: 1px solid rgba(255, 255, 255, 0.08);
}

.list-view .artist-card:hover {
    background: rgba(255, 255, 255, 0.06);
    border-color: rgba(97, 206, 112, 0.3);
}

.list-view .artist-card-link {
    display: flex;
    align-items: center;
    gap: 20px;
    padding: 15px;
    text-decoration: none;
    color: inherit;
}

.list-view .artist-image {
    width: 70px;
    height: 70px;
    border-radius: 10px;
    overflow: hidden;
    flex-shrink: 0;
    background: rgba(255, 255, 255, 0.05);
}

.list-view .artist-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.list-view .artist-no-image {
    width: 100%;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    background: linear-gradient(135deg, #2a2a4a 0%, #1a1a2e 100%);
}

.list-view .artist-no-image i {
    font-size: 28px;
    color: rgba(255, 255, 255, 0.2);
}

.list-view .artist-info {
    flex: 1;
    min-width: 0; /* Allow text truncation */
}

.list-view .artist-name {
    margin: 0 0 8px 0;
    font-size: 16px;
    font-weight: 600;
    color: #fff;
}

.list-view .artist-meta {
    display: flex;
    flex-wrap: wrap;
    gap: 20px;
    margin-bottom: 8px;
    color: rgba(255, 255, 255, 0.6);
    font-size: 13px;
}

.list-view .meta-item {
    display: flex;
    align-items: center;
    gap: 6px;
}

.list-view .meta-item i {
    color: #61CE70;
    width: 14px;
}

.list-view .artist-tags {
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
}

.list-view .tag-group {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 6px;
}

.list-view .tag-label {
    font-size: 10px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.3px;
    display: flex;
    align-items: center;
    gap: 4px;
}

.list-view .tag-label i {
    font-size: 10px;
}

.list-view .genre-group .tag-label {
    color: #5dade2;
}

.list-view .mood-group .tag-label {
    color: #f5b041;
}

.list-view .artist-tag {
    padding: 3px 8px;
    border-radius: 10px;
    font-size: 10px;
    font-weight: 500;
}

.list-view .genre-tag {
    background: rgba(52, 152, 219, 0.2);
    color: #5dade2;
    border: 1px solid rgba(52, 152, 219, 0.3);
    text-decoration: none;
    transition: all 0.2s;
}

.list-view .genre-tag:hover {
    background: rgba(52, 152, 219, 0.4);
}

.list-view .mood-tag {
    background: rgba(243, 156, 18, 0.2);
    color: #f5b041;
    border: 1px solid rgba(243, 156, 18, 0.3);
    text-decoration: none;
    transition: all 0.2s;
}

.list-view .mood-tag:hover {
    background: rgba(243, 156, 18, 0.4);
}

/* ========================================
   PAGINATION
   ======================================== */
.artist-pagination {
    margin-top: 30px;
    display: flex;
    justify-content: center;
}

.pagination-inner {
    display: flex;
    align-items: center;
    gap: 5px;
}

.page-btn {
    min-width: 40px;
    height: 40px;
    padding: 0 12px;
    border: 1px solid rgba(255, 255, 255, 0.2);
    background: transparent;
    color: rgba(255, 255, 255, 0.7);
    border-radius: 8px;
    cursor: pointer;
    font-size: 14px;
    transition: all 0.2s ease;
    display: flex;
    align-items: center;
    justify-content: center;
}

.page-btn:hover {
    background: rgba(255, 255, 255, 0.1);
    color: #fff;
    border-color: rgba(255, 255, 255, 0.3);
}

.page-btn.active {
    background: #61CE70;
    border-color: #61CE70;
    color: #fff;
}

.page-ellipsis {
    color: rgba(255, 255, 255, 0.4);
    padding: 0 8px;
}

/* ========================================
   RESPONSIVE
   ======================================== */
@media (max-width: 768px) {
    .artist-directory {
        padding: 15px;
    }

    .artist-directory-controls {
        flex-direction: column;
        align-items: stretch;
    }

    .artist-search-wrap {
        max-width: none;
    }

    .artist-filters {
        flex-direction: row;
        flex-wrap: wrap;
    }

    .filter-group {
        flex: 1;
        min-width: 140px;
    }

    .artist-filter-select {
        width: 100%;
    }

    .multiselect {
        min-width: 100%;
    }

    .multiselect-dropdown {
        position: fixed;
        top: auto;
        bottom: 0;
        left: 0;
        right: 0;
        border-radius: 16px 16px 0 0;
        max-height: 70vh;
        border: none;
        border-top: 2px solid;
    }

    #genre-multiselect .multiselect-dropdown {
        border-top-color: #5dade2;
    }

    #mood-multiselect .multiselect-dropdown {
        border-top-color: #f5b041;
    }

    .multiselect.open .multiselect-toggle {
        border-radius: 8px;
    }

    .multiselect-options {
        max-height: 45vh;
    }

    .artist-view-toggle {
        align-self: flex-end;
    }

    .artist-container.gallery-view {
        grid-template-columns: repeat(auto-fill, minmax(160px, 1fr));
        gap: 15px;
    }

    .gallery-view .artist-info {
        padding: 10px 12px 12px;
    }

    .gallery-view .artist-name {
        font-size: 14px;
    }

    .gallery-view .artist-overlay {
        padding: 40px 10px 10px 10px;
    }

    .gallery-view .artist-overlay .artist-meta {
        gap: 8px;
        font-size: 11px;
    }

    .gallery-view .artist-overlay .meta-item {
        padding: 3px 8px;
    }

    .gallery-view .artist-meta-date {
        font-size: 10px;
    }

    .list-view .artist-card-link {
        padding: 12px;
        gap: 12px;
    }

    .list-view .artist-image {
        width: 55px;
        height: 55px;
    }

    .list-view .artist-name {
        font-size: 14px;
    }

    .list-view .artist-meta {
        flex-direction: column;
        gap: 5px;
    }

    .list-view .meta-date {
        display: none;
    }

    .pagination-inner {
        flex-wrap: wrap;
        justify-content: center;
    }

    .page-btn {
        min-width: 36px;
        height: 36px;
    }
}

@media (max-width: 480px) {
    .gallery-view .artist-tags {
        display: none; /* Hide tags on very small screens */
    }

    .list-view .artist-tags {
        display: none;
    }

    .filter-group {
        width: 100%;
    }

    .artist-filter-select {
        width: 100%;
    }

    .multiselect {
        width: 100%;
    }
}

/* Mobile overlay backdrop */
@media (max-width: 768px) {
    .multiselect.open::before {
        content: '';
        position: fixed;
        top: 0;
        left: 0;
        right: 0;
        bottom: 0;
        background: rgba(0, 0, 0, 0.6);
        z-index: 99;
    }
}
