/**
 * VC Creative Toolkit - Artist Listing Module Styles
 * Brand-agnostic styling using CSS custom properties
 * BEM naming convention with vc_ prefix
 */

/* ============================================================================
   Custom Properties (CSS Variables)
   ============================================================================ */

.vc_artist-listing {
  /* Layout */
  --vc-artist-cols: 4;
  --vc-artist-gap: 1.5rem;

  /* Card styling */
  --vc-artist-card-radius: var(--vc-brand-radius, 8px);
  --vc-artist-card-bg: var(--vc-brand-surface, #fff);
  --vc-artist-card-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
  --vc-artist-card-shadow-hover: 0 8px 16px rgba(0, 0, 0, 0.15);

  /* Brand colors */
  --vc-artist-accent: var(--vc-brand-accent, #00a3ff);
  --vc-artist-text: var(--vc-brand-text, #1a1a1a);
  --vc-artist-text-muted: var(--vc-brand-text-muted, #666);
  --vc-artist-border: var(--vc-brand-border, #e0e0e0);
}

/* ============================================================================
   Container & Layout
   ============================================================================ */

.vc_artist-listing {
  width: 100%;
  padding: 2rem;
}

.vc_artist-listing__inner {
  max-width: 1400px;
  margin: 0 auto;
}

/* ============================================================================
   Filter Bar
   ============================================================================ */

.vc_artist-listing__filters {
  display: flex;
  flex-wrap: wrap;
  gap: var(--vc-artist-gap);
  margin-bottom: 2rem;
  align-items: center;
}

.vc_artist-listing__filter-btn {
  padding: 0.5rem 1.25rem;
  border: 1px solid var(--vc-artist-border);
  border-radius: 2rem;
  background: var(--vc-artist-card-bg);
  color: var(--vc-artist-text);
  font-size: 0.875rem;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.3s ease;
  white-space: nowrap;
}

.vc_artist-listing__filter-btn:hover {
  border-color: var(--vc-artist-accent);
  color: var(--vc-artist-accent);
}

.vc_artist-listing__filter-btn.is-active {
  background: var(--vc-artist-accent);
  color: white;
  border-color: var(--vc-artist-accent);
}

/* ============================================================================
   Search Bar
   ============================================================================ */

.vc_artist-listing__search-wrap {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.75rem 1rem;
  border: 1px solid var(--vc-artist-border);
  border-radius: var(--vc-artist-card-radius);
  background: var(--vc-artist-card-bg);
  margin-bottom: 2rem;
  max-width: 300px;
}

.vc_artist-listing__search-icon {
  flex-shrink: 0;
  width: 18px;
  height: 18px;
  color: var(--vc-artist-text-muted);
}

.vc_artist-listing__search-input {
  flex: 1;
  border: none;
  background: transparent;
  color: var(--vc-artist-text);
  font-size: 0.875rem;
  outline: none;
}

.vc_artist-listing__search-input::placeholder {
  color: var(--vc-artist-text-muted);
}

/* ============================================================================
   Layout Toggle
   ============================================================================ */

.vc_artist-listing__toggle-group {
  display: flex;
  gap: 0.5rem;
  margin-bottom: 2rem;
  margin-left: auto;
}

.vc_artist-listing__toggle-btn {
  padding: 0.5rem;
  border: 1px solid var(--vc-artist-border);
  border-radius: var(--vc-artist-card-radius);
  background: var(--vc-artist-card-bg);
  color: var(--vc-artist-text-muted);
  cursor: pointer;
  transition: all 0.3s ease;
  width: 40px;
  height: 40px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.vc_artist-listing__toggle-btn:hover {
  border-color: var(--vc-artist-accent);
  color: var(--vc-artist-accent);
}

.vc_artist-listing__toggle-btn.is-active {
  background: var(--vc-artist-accent);
  color: white;
  border-color: var(--vc-artist-accent);
}

/* ============================================================================
   Grid Layout
   ============================================================================ */

.vc_artist-listing__grid {
  display: grid;
  grid-template-columns: repeat(var(--vc-artist-cols), 1fr);
  gap: var(--vc-artist-gap);
}

.vc_artist-listing__grid[data-layout="list"] {
  grid-template-columns: 1fr;
}

.vc_artist-listing__grid[data-layout="list"] .vc_artist-listing__card {
  display: flex;
  gap: var(--vc-artist-gap);
}

.vc_artist-listing__grid[data-layout="list"] .vc_artist-listing__card-image {
  width: 80px;
  min-width: 80px;
  height: 80px;
}

.vc_artist-listing__grid[data-layout="list"] .vc_artist-listing__card-info {
  flex: 1;
  display: flex;
  flex-direction: column;
  justify-content: center;
}

/* ============================================================================
   Card Styles
   ============================================================================ */

.vc_artist-listing__card {
  background: var(--vc-artist-card-bg);
  border-radius: var(--vc-artist-card-radius);
  box-shadow: var(--vc-artist-card-shadow);
  overflow: hidden;
  cursor: pointer;
  transition: all 0.3s ease;
  display: flex;
  flex-direction: column;
}

.vc_artist-listing__card[data-visible="false"] {
  display: none;
}

.vc_artist-listing__card:hover {
  box-shadow: var(--vc-artist-card-shadow-hover);
  transform: translateY(-2px);
}

.vc_artist-listing__card-image {
  width: 100%;
  aspect-ratio: 1 / 1;
  object-fit: cover;
  background: linear-gradient(135deg, #f5f5f5 25%, transparent 25%, transparent 75%, #f5f5f5 75%, #f5f5f5),
              linear-gradient(135deg, #f5f5f5 25%, transparent 25%, transparent 75%, #f5f5f5 75%, #f5f5f5);
  background-size: 20px 20px;
  background-position: 0 0, 10px 10px;
  background-color: #f9f9f9;
}

.vc_artist-listing__card-info {
  padding: 1rem;
  flex: 1;
  display: flex;
  flex-direction: column;
}

.vc_artist-listing__card-name {
  font-size: 1rem;
  font-weight: 600;
  color: var(--vc-artist-text);
  margin: 0 0 0.25rem 0;
  line-height: 1.3;
}

.vc_artist-listing__card-genre {
  font-size: 0.8125rem;
  color: var(--vc-artist-text-muted);
  margin: 0;
  line-height: 1.4;
}

.vc_artist-listing__card-origin {
  font-size: 0.75rem;
  color: var(--vc-artist-text-muted);
  margin: 0.5rem 0 0 0;
  line-height: 1.4;
}

/* ============================================================================
   Modal Styles
   ============================================================================ */

.vc_artist-listing__modal {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 1000;
  pointer-events: none;
}

.vc_artist-listing__modal.is-active {
  pointer-events: auto;
}

.vc_artist-listing__modal-overlay {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(0, 0, 0, 0.8);
  opacity: 0;
  transition: opacity 0.3s ease;
}

.vc_artist-listing__modal.is-active .vc_artist-listing__modal-overlay {
  opacity: 1;
}

.vc_artist-listing__modal-content {
  position: relative;
  background: var(--vc-artist-card-bg);
  border-radius: var(--vc-artist-card-radius);
  max-width: 600px;
  width: 90vw;
  max-height: 80vh;
  overflow-y: auto;
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
  display: flex;
  flex-direction: column;
  z-index: 1001;
}

.vc_artist-listing__modal-body {
  padding: 2rem;
  flex: 1;
}

.vc_artist-listing__modal-header {
  display: flex;
  gap: 1.5rem;
  margin-bottom: 2rem;
  padding-bottom: 2rem;
  border-bottom: 1px solid var(--vc-artist-border);
}

.vc_artist-listing__modal-photo {
  width: 120px;
  height: 120px;
  min-width: 120px;
  border-radius: var(--vc-artist-card-radius);
  object-fit: cover;
}

.vc_artist-listing__modal-info {
  display: flex;
  flex-direction: column;
  justify-content: center;
}

.vc_artist-listing__modal-name {
  font-size: 1.5rem;
  font-weight: 700;
  color: var(--vc-artist-text);
  margin: 0 0 0.5rem 0;
  line-height: 1.2;
}

.vc_artist-listing__modal-genre {
  font-size: 0.9375rem;
  color: var(--vc-artist-text-muted);
  margin: 0;
}

.vc_artist-listing__modal-section {
  margin-bottom: 2rem;
}

.vc_artist-listing__modal-section:last-child {
  margin-bottom: 0;
}

.vc_artist-listing__modal-title {
  font-size: 0.875rem;
  font-weight: 600;
  color: var(--vc-artist-text);
  margin: 0 0 0.75rem 0;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.vc_artist-listing__modal-text {
  font-size: 0.9375rem;
  color: var(--vc-artist-text);
  margin: 0;
  line-height: 1.6;
}

.vc_artist-listing__modal-socials {
  display: flex;
  gap: 1rem;
  margin-top: 1.5rem;
}

.vc_artist-listing__social {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  background: #f0f0f0;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.3s ease;
  text-decoration: none;
  font-size: 18px;
}

.vc_artist-listing__social:hover {
  background: var(--vc-artist-accent);
  color: white;
  transform: translateY(-2px);
}

.vc_artist-listing__modal-close {
  position: absolute;
  top: 1.5rem;
  right: 1.5rem;
  width: 40px;
  height: 40px;
  background: var(--vc-artist-card-bg);
  border: 1px solid var(--vc-artist-border);
  border-radius: 50%;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.3s ease;
  z-index: 1;
  color: var(--vc-artist-text);
}

.vc_artist-listing__modal-close:hover {
  background: var(--vc-artist-accent);
  color: white;
  border-color: var(--vc-artist-accent);
}

/* ============================================================================
   Results Counter
   ============================================================================ */

.vc_artist-listing__visible-count {
  font-size: 0.875rem;
  color: var(--vc-artist-text-muted);
  margin-top: 1rem;
  display: inline-block;
}

/* ============================================================================
   Scroll Lock (Body)
   ============================================================================ */

body.vc-scroll-locked {
  overflow: hidden;
}

/* ============================================================================
   Responsive Breakpoints
   ============================================================================ */

/* Tablet: 1024px and below */
@media (max-width: 1024px) {
  .vc_artist-listing {
    --vc-artist-cols: 3;
  }
}

/* Tablet: 768px and below */
@media (max-width: 768px) {
  .vc_artist-listing {
    --vc-artist-cols: 2;
    --vc-artist-gap: 1rem;
    padding: 1.5rem;
  }

  .vc_artist-listing__filters {
    margin-bottom: 1.5rem;
  }

  .vc_artist-listing__modal-content {
    max-width: 95vw;
    max-height: 90vh;
  }

  .vc_artist-listing__modal-header {
    flex-direction: column;
    align-items: center;
    text-align: center;
    gap: 1rem;
  }

  .vc_artist-listing__modal-photo {
    width: 100px;
    height: 100px;
  }
}

/* Mobile: 480px and below */
@media (max-width: 480px) {
  .vc_artist-listing {
    --vc-artist-cols: 1;
    --vc-artist-gap: 0.75rem;
    padding: 1rem;
  }

  .vc_artist-listing__filters {
    margin-bottom: 1rem;
    gap: 0.5rem;
  }

  .vc_artist-listing__filter-btn {
    font-size: 0.8125rem;
    padding: 0.4rem 1rem;
  }

  .vc_artist-listing__search-wrap {
    max-width: none;
    margin-bottom: 1rem;
  }

  .vc_artist-listing__toggle-group {
    margin-bottom: 1rem;
  }

  .vc_artist-listing__modal-body {
    padding: 1.5rem;
  }

  .vc_artist-listing__modal-header {
    margin-bottom: 1.5rem;
    padding-bottom: 1.5rem;
  }

  .vc_artist-listing__modal-close {
    top: 1rem;
    right: 1rem;
    width: 36px;
    height: 36px;
  }
}

/* ============================================================================
   Reduced Motion & Accessibility
   ============================================================================ */

@media (prefers-reduced-motion: reduce) {
  .vc_artist-listing__filter-btn,
  .vc_artist-listing__card,
  .vc_artist-listing__toggle-grid,
  .vc_artist-listing__toggle-list,
  .vc_artist-listing__social,
  .vc_artist-listing__modal-close {
    transition: none !important;
  }

  .vc_artist-listing__card:hover {
    transform: none;
  }

  .vc_artist-listing__social:hover {
    transform: none;
  }
}

/* ============================================================================
   Print Styles
   ============================================================================ */

@media print {
  .vc_artist-listing__filters,
  .vc_artist-listing__search-wrap,
  .vc_artist-listing__toggle-group,
  .vc_artist-listing__modal {
    display: none !important;
  }

  .vc_artist-listing {
    padding: 0;
  }

  .vc_artist-listing__card {
    box-shadow: none;
    border: 1px solid var(--vc-artist-border);
  }

  .vc_artist-listing__card:hover {
    box-shadow: none;
    transform: none;
  }
}
