/* Artist List V2 Styles - Unique to adistinction plugin */

/* Container and Header */
.ad-v2-container {
    width: 100%;
    max-width: 1200px;
    margin: 0 auto;
    padding: 20px;
}

.ad-v2-header {
    text-align: center;
    margin-bottom: 40px;
}

.ad-v2-header h1 {
    font-size: 2.5rem;
    margin-bottom: 15px;
    color: #333;
    font-weight: 300;
}

.ad-v2-header p {
    font-size: 1.1rem;
    color: #666;
    max-width: 600px;
    margin: 0 auto;
    line-height: 1.6;
}

/* Filter Toggle Button (Mobile Only) */
.ad-v2-filter-toggle {
    display: none; /* Hidden by default on desktop */
    width: 100%;
    padding: 12px 20px;
    margin-bottom: 15px;
    background: #c5a3a7;
    color: white;
    border: none;
    border-radius: 5px;
    font-size: 16px;
    font-weight: 600;
    cursor: pointer;
    transition: background-color 0.3s ease, transform 0.2s ease;
    text-align: left;
    -webkit-tap-highlight-color: transparent;
    touch-action: manipulation;
}

.ad-v2-filter-toggle:hover,
.ad-v2-filter-toggle:active {
    background: #b08f94;
}

.ad-v2-filter-toggle:active {
    transform: scale(0.98);
}

/* When filters are open, change button style */
.ad-v2-filter-toggle[aria-expanded="true"] {
    background: #b08f94;
}

.ad-v2-filter-toggle-icon {
    display: inline-block;
    margin-right: 10px;
    font-size: 18px;
    transition: transform 0.3s ease;
}

/* Rotate icon when expanded */
.ad-v2-filter-toggle[aria-expanded="true"] .ad-v2-filter-toggle-icon {
    transform: rotate(90deg);
}

.ad-v2-filter-toggle-text {
    display: inline-block;
}

/* Filter Section */
.ad-v2-filters {
    display: flex;
    justify-content: center;
    gap: 15px;
    margin-bottom: 40px;
    flex-wrap: wrap; /* Allow wrapping for responsive design */
    padding: 10px 0;
}

.ad-v2-filters select {
    padding: 12px 16px;
    border: 2px solid #ddd;
    border-radius: 5px;
    background: white;
    font-size: 14px;
    color: #333;
    cursor: pointer;
    min-width: 180px;
    max-width: 24%; /* Adjusted for 4 filters */
    flex-shrink: 0; /* Prevent shrinking */
    transition: border-color 0.3s ease;
}

.ad-v2-filters select:hover,
.ad-v2-filters select:focus {
    border-color: #c5a3a7;
    outline: none;
}

/* Select2 Custom Styling */
.ad-v2-filters .select2-container {
    min-width: 180px;
    max-width: 24%;
    flex-shrink: 0;
}

.ad-v2-filters .select2-container .select2-selection--single {
    padding: 10px 14px;
    border: 2px solid #ddd;
    border-radius: 5px;
    background: white;
    height: auto;
    transition: border-color 0.3s ease;
}

.ad-v2-filters .select2-container .select2-selection--single:hover,
.ad-v2-filters .select2-container.select2-container--open .select2-selection--single {
    border-color: #c5a3a7;
}

.ad-v2-filters .select2-container .select2-selection__rendered {
    padding: 0;
    line-height: normal;
    color: #333;
    font-size: 14px;
}

.ad-v2-filters .select2-container .select2-selection__arrow {
    height: 100%;
    top: 0;
    right: 5px;
}

.ad-v2-filters .select2-dropdown {
    border: 2px solid #c5a3a7;
    border-radius: 5px;
}

.ad-v2-filters .select2-search__field {
    border: 1px solid #ddd;
    border-radius: 3px;
    padding: 5px;
}

.ad-v2-filters .select2-results__option--highlighted {
    background-color: #c5a3a7 !important;
}

/* CSS Grid Masonry Layout */
.ad-v2-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 10px; /* Very small gap between items */
    margin-top: 30px;
    grid-auto-flow: dense; /* Helps fill gaps in the grid */
}

@media (max-width: 1200px) {
    .ad-v2-grid {
        grid-template-columns: repeat(3, 1fr);
    }
}

@media (max-width: 900px) {
    .ad-v2-grid {
        grid-template-columns: repeat(2, 1fr);
    }
}

@media (max-width: 600px) {
    .ad-v2-grid {
        grid-template-columns: 1fr;
    }
}

/* Artist Card */
.ad-v2-artist-card {
    cursor: pointer;
    transition: transform 0.3s ease, box-shadow 0.3s ease;
    transform: scale(1);
    overflow: hidden;
    box-shadow: 0 4px 8px rgba(0,0,0,0.1);
    width: 100%;
    height: 100%;
}

/* Large Artist Card - 2x2 */
.ad-v2-artist-card.ad-v2-large {
    grid-column: span 2;
    grid-row: span 2;
}

/* Ensure large cards don't break on smaller screens */
@media (max-width: 600px) {
    .ad-v2-artist-card.ad-v2-large {
        grid-column: span 1;
        grid-row: span 1;
    }
}

.ad-v2-artist-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 8px 25px rgba(0,0,0,0.15);
}

.ad-v2-artist-card.ad-v2-hidden {
    display: none !important; /* Completely remove from layout */
    grid-column: auto;
    grid-row: auto;
}

/* Image Wrapper */
.ad-v2-image-wrapper {
    position: relative;
    width: 100%;
    padding-bottom: 100%; /* 1:1 Aspect Ratio for square images */
    overflow: hidden;
}

.ad-v2-image-wrapper img {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.3s ease;
}

.ad-v2-artist-card:hover .ad-v2-image-wrapper img {
    transform: scale(1.05);
}

/* Overlay (Always Visible) */
.ad-v2-overlay {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    background: linear-gradient(to top, rgba(0,0,0,0.9), rgba(0,0,0,0.7), transparent);
    color: white;
    padding: 10px;
    text-align: center;
    pointer-events: none;
}

.ad-v2-artist-name {
    color: #FFF !important;
    font-family: 'Great Vibes', cursive !important;
    font-size: 2.5rem !important;
    font-weight: 500 !important;
    margin: 0 0 0 0 !important;
    /* text-shadow: 1px 1px 2px rgba(255,255,255,0.7) !important; */
    /* text-shadow: 0px 0px 3px rgba(255,255,255,1) !important; */
    text-shadow: 0px 0px 3px rgba(158,116,124,1) !important;
}

.ad-v2-artist-category {
    font-size: 0.9rem;
    margin: 0;
    opacity: 0.9;
    text-shadow: 1px 1px 2px rgba(0,0,0,0.5);
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

/* Description (Hover Effect) */
.ad-v2-description {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(197, 163, 167, 0.95);
    color: white;
    padding: 20px;
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    transition: opacity 0.3s ease;
    pointer-events: none;
}

.ad-v2-artist-card:hover .ad-v2-description {
    opacity: 1;
}

.ad-v2-description p {
    font-size: 0.95rem;
    line-height: 1.5;
    margin: 0;
    text-align: center;
    max-height: 100%;
    overflow-y: auto;
}

/* Responsive Design */
@media (max-width: 768px) {
    .ad-v2-container {
        padding: 15px;
        min-height: 4000px;
    }

    .ad-v2-header h1 {
        font-size: 2rem;
    }

    /* Show filter toggle button on mobile */
    .ad-v2-filter-toggle {
        display: block !important;
    }

    /* Collapsible filters on mobile - hidden by default */
    .ad-v2-filters {
        display: flex !important;
        flex-direction: column;
        gap: 10px;
        padding: 0;
        margin-bottom: 20px;
        max-height: 0;
        opacity: 0;
        overflow: hidden;
        transition: max-height 0.4s ease-out, opacity 0.3s ease-out, padding 0.3s ease-out;
        pointer-events: none;
    }

    /* When filters are open */
    .ad-v2-filters.ad-v2-filters-open {
        max-height: 600px;
        opacity: 1;
        overflow: visible;
        padding: 15px 0;
        pointer-events: auto;
    }

    .ad-v2-filters select {
        width: 100%;
        min-width: auto;
        max-width: 100%;
        font-size: 14px;
        padding: 12px 16px;
    }

    .ad-v2-filters .select2-container {
        width: 100% !important;
        min-width: auto;
        max-width: 100%;
    }

    .ad-v2-description {
        padding: 15px;
    }

    .ad-v2-description p {
        font-size: 0.9rem;
    }
}

@media (max-width: 480px) {
    .ad-v2-header h1 {
        font-size: 1.8rem;
    }

    .ad-v2-header p {
        font-size: 1rem;
    }

    .ad-v2-filters select {
        width: 100%;
        min-width: auto;
        padding: 10px 12px;
        font-size: 14px;
    }

    .ad-v2-filters .select2-container {
        width: 100% !important;
        min-width: auto;
    }

    .ad-v2-filters .select2-container .select2-selection--single {
        padding: 8px 12px;
        font-size: 14px;
    }

    .ad-v2-filters {
        gap: 8px;
    }

    .ad-v2-filter-toggle {
        font-size: 15px;
        padding: 10px 16px;
    }
}

/* Slide down animation for mobile filters */
@keyframes ad-v2-slideDown {
    from {
        opacity: 0;
        transform: translateY(-10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Smooth transitions for grid reflow */
.ad-v2-grid {
    transition: all 0.3s ease;
}

/* Ensure grid items maintain aspect ratio */
.ad-v2-artist-card {
    position: relative;
}

/* Filtering animation state */
.ad-v2-grid.ad-v2-filtering {
    transition: all 0.3s ease-out;
}

.ad-v2-grid.ad-v2-filtering .ad-v2-artist-card {
    transition: opacity 0.3s ease-out, transform 0.3s ease-out;
}

/* Ensure hidden items animate out smoothly */
.ad-v2-artist-card {
    transition: opacity 0.3s ease-out;
}

.ad-v2-artist-card.ad-v2-hidden {
    opacity: 0;
    pointer-events: none;
}

/* Optional: Add subtle fade effect when cards appear */
.ad-v2-artist-card {
    animation: ad-v2-fadeIn 0.3s ease;
}

@keyframes ad-v2-fadeIn {
    from {
        opacity: 0;
        transform: translateY(10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}