/**
 * Select2 Custom Styles for Museon Academy
 * Matches the project's design system
 */

/* Base Select2 Container */
.select2-container--default .select2-selection--single {
  height: 50px !important;
  min-height: 50px !important;
  padding: 0 16px !important;
  border: 1px solid #e5e7eb !important; /* gray-200 */
  border-radius: 2px !important; /* rounded-sm */
  background-color: #fffef9 !important; /* cream-50 */
  transition: all 0.2s ease;
  display: flex !important;
  align-items: center !important;
  position: relative !important;
}

.select2-container--default .select2-selection--single:hover {
  border-color: #d1d5db !important; /* gray-300 */
}

/* Focus State */
.select2-container--default.select2-container--focus .select2-selection--single,
.select2-container--default.select2-container--open .select2-selection--single {
  border-color: #642515 !important; /* museon-800 */
  box-shadow: 0 0 0 2px rgba(100, 37, 21, 0.1) !important; /* ring-museon-800/10 */
  background-color: #fff !important;
  outline: none !important;
}

/* Selected Text */
.select2-container--default .select2-selection--single .select2-selection__rendered {
  color: #1f2937; /* gray-800 */
  font-family: 'Source Sans 3', Helvetica, sans-serif;
  font-size: 16px;
  line-height: 50px !important; /* Match container height */
  padding-left: 0 !important;
  padding-right: 30px;
  padding-top: 0 !important;
  padding-bottom: 0 !important;
}

/* Placeholder */
.select2-container--default .select2-selection--single .select2-selection__placeholder {
  color: #9ca3af; /* gray-400 */
}

/* Arrow */
.select2-container--default .select2-selection--single .select2-selection__arrow {
  height: 50px !important;
  width: 30px;
  right: 8px;
  top: 0 !important;
  display: flex;
  align-items: center;
  justify-content: center;
}

.select2-container--default .select2-selection--single .select2-selection__arrow b {
  border-color: #6b7280 transparent transparent transparent; /* gray-500 */
  border-width: 6px 5px 0 5px;
  margin-left: -5px;
  margin-top: 0 !important;
  position: relative;
  top: 0;
}

.select2-container--default.select2-container--open .select2-selection--single .select2-selection__arrow b {
  border-color: transparent transparent #642515 transparent; /* museon-800 */
  border-width: 0 5px 6px 5px;
}

/* Dropdown */
.select2-container--default .select2-dropdown {
  border: 1px solid #642515; /* museon-800 */
  border-radius: 2px;
  box-shadow: 0 10px 15px -3px rgba(0, 0, 0, 0.1), 0 4px 6px -4px rgba(0, 0, 0, 0.1);
  margin-top: 4px;
}

.select2-container--default .select2-dropdown--above {
  margin-top: 0;
  margin-bottom: 4px;
}

/* Prevent horizontal scroll when dropdown opens */
.select2-container--open {
  z-index: 9999;
}

/* Ensure dropdown doesn't overflow viewport */
.select2-results {
  max-height: 300px;
  overflow-y: auto;
}


/* Search Box */
.select2-container--default .select2-search--dropdown {
  padding: 12px;
}

.select2-container--default .select2-search--dropdown .select2-search__field {
  border: 1px solid #e5e7eb;
  border-radius: 2px;
  padding: 10px 14px;
  font-family: 'Source Sans 3', Helvetica, sans-serif;
  font-size: 14px;
  transition: border-color 0.2s ease;
}

.select2-container--default .select2-search--dropdown .select2-search__field:focus {
  border-color: #642515;
  outline: none;
  box-shadow: 0 0 0 1px #642515;
}

/* Results */
.select2-container--default .select2-results__option {
  padding: 12px 16px;
  font-family: 'Source Sans 3', Helvetica, sans-serif;
  font-size: 14px;
  color: #374151; /* gray-700 */
  transition: all 0.15s ease;
}

.select2-container--default .select2-results__option--highlighted[aria-selected] {
  background-color: #f9ebe8; /* museon-100 */
  color: #642515; /* museon-800 */
}

.select2-container--default .select2-results__option[aria-selected=true] {
  background-color: #642515; /* museon-800 */
  color: #fff;
}

.select2-container--default .select2-results__option[aria-selected=true]:hover {
  background-color: #4a1b10; /* museon-900 */
}

/* Results Group */
.select2-container--default .select2-results__group {
  padding: 10px 16px;
  font-weight: 600;
  font-size: 12px;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: #642515; /* museon-800 */
  background-color: #fdf8f7; /* museon-50 */
  border-bottom: 1px solid #f2d4ce; /* museon-200 */
}

/* Multiple Selection */
.select2-container--default .select2-selection--multiple {
  min-height: 50px;
  padding: 6px 8px;
  border: 1px solid #e5e7eb;
  border-radius: 2px;
  background-color: #fff;
  transition: all 0.2s ease;
}

.select2-container--default .select2-selection--multiple:hover {
  border-color: #e8b5aa;
}

.select2-container--default.select2-container--focus .select2-selection--multiple {
  border-color: #642515;
  box-shadow: 0 0 0 1px #642515;
  outline: none;
}

/* Multiple Selection Tags */
.select2-container--default .select2-selection--multiple .select2-selection__choice {
  background-color: #f9ebe8; /* museon-100 */
  border: 1px solid #f2d4ce; /* museon-200 */
  border-radius: 2px;
  color: #642515; /* museon-800 */
  padding: 4px 8px 4px 24px;
  margin: 4px;
  font-size: 13px;
  font-family: 'Source Sans 3', Helvetica, sans-serif;
}

.select2-container--default .select2-selection--multiple .select2-selection__choice__remove {
  color: #8a3d2d; /* museon-700 */
  margin-left: 0;
  margin-right: 8px;
  position: absolute;
  left: 6px;
  font-size: 16px;
  font-weight: bold;
}

.select2-container--default .select2-selection--multiple .select2-selection__choice__remove:hover {
  color: #4a1b10; /* museon-900 */
  background-color: transparent;
}

/* Search in Multiple */
.select2-container--default .select2-selection--multiple .select2-search--inline .select2-search__field {
  font-family: 'Source Sans 3', Helvetica, sans-serif;
  font-size: 14px;
  margin-top: 6px;
  padding-left: 8px;
}

/* Clear Button */
.select2-container--default .select2-selection--single .select2-selection__clear {
  color: #9ca3af;
  font-size: 16px;
  font-weight: normal;
  position: absolute !important;
  right: 36px !important;
  top: 50% !important;
  transform: translateY(-50%) !important;
  margin: 0 !important;
  padding: 0 4px;
  height: auto;
  line-height: 1;
}

.select2-container--default .select2-selection--single .select2-selection__clear:hover {
  color: #642515;
}

/* Disabled State */
.select2-container--default.select2-container--disabled .select2-selection--single {
  background-color: #f9fafb; /* gray-50 */
  cursor: not-allowed;
}

.select2-container--default.select2-container--disabled .select2-selection--single .select2-selection__rendered {
  color: #9ca3af;
}

/* Loading State */
.select2-container--default .select2-results__option--load-more,
.select2-container--default .select2-results__option--loading {
  color: #9ca3af;
  font-style: italic;
  padding: 12px 16px;
}

/* No Results */
.select2-container--default .select2-results__message {
  color: #9ca3af;
  font-style: italic;
  padding: 12px 16px;
  text-align: center;
}

/* Dark Theme for Artist Panel Sidebar Area - NOT Needed for selects inside main content */

/* Small Size Variant */
.select2-sm .select2-container--default .select2-selection--single {
  min-height: 40px;
  padding: 8px 12px;
}

.select2-sm .select2-container--default .select2-selection--single .select2-selection__rendered {
  line-height: 22px;
  font-size: 14px;
}

/* Full Width */
.select2-container {
  width: 100% !important;
}

/* Auto Width - for filter/sort dropdowns */
.select2-auto-width + .select2-container {
  width: auto !important;
  min-width: 150px;
  max-width: 200px;
}

.select2-auto-width + .select2-container .select2-selection--single {
  min-height: 42px;
  padding: 8px 12px;
}

.select2-auto-width + .select2-container .select2-selection--single .select2-selection__rendered {
  font-size: 14px;
  line-height: 24px;
}

/* Animation */
.select2-container--default .select2-dropdown {
  animation: select2FadeIn 0.15s ease-out;
}

@keyframes select2FadeIn {
  from {
    opacity: 0;
    transform: translateY(-4px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}
