/* Select2 Custom Styling for Raven Consultants Jobs */
/* Matches the site's color scheme and design patterns */

/* Main Select2 Container */
.select2-container {
  width: 100% !important;
}

/* Selection Box Styling */
.select2-container--default .select2-selection--single {
  height: 45px;
  border: 1px solid #dddddd;
  border-radius: 4px;
  background-color: #ffffff;
  transition: border-color 0.3s ease, box-shadow 0.3s ease;
}

.select2-container--default .select2-selection--single:hover {
  border-color: #78EB54;
}

.select2-container--default.select2-container--focus .select2-selection--single {
  border-color: #78EB54 !important;
  box-shadow: 0 0 0 2px rgba(120, 235, 84, 0.1);
  outline: none;
}

/* Selected Text Styling */
.select2-container--default .select2-selection--single .select2-selection__rendered {
  color: #333333;
  line-height: 43px;
  padding-left: 15px;
  padding-right: 30px;
  font-size: 16px;
  font-family: var(--text-font);
  font-weight: 400;
}

/* Placeholder Styling */
.select2-container--default .select2-selection--single .select2-selection__placeholder {
  color: #999999;
}

/* Arrow Styling */
.select2-container--default .select2-selection--single .select2-selection__arrow {
  height: 43px;
  right: 12px;
  top: 1px;
}

.select2-container--default .select2-selection--single .select2-selection__arrow b {
  border-color: #666666 transparent transparent transparent;
  border-style: solid;
  border-width: 6px 5px 0 5px;
  height: 0;
  left: 50%;
  margin-left: -5px;
  margin-top: -3px;
  position: absolute;
  top: 50%;
  width: 0;
}

/* Open state arrow */
.select2-container--default.select2-container--open .select2-selection--single .select2-selection__arrow b {
  border-color: transparent transparent #666666 transparent;
  border-width: 0 5px 6px 5px;
}

/* Dropdown Styling */
.select2-dropdown {
  border: 1px solid #78EB54;
  border-radius: 4px;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
  background-color: #ffffff;
  z-index: 9999;
}

/* Kill horizontal scrollbar and page scroll when dropdown open */
body:has(.select2-dropdown) {
  overflow: hidden !important;
  overflow-x: hidden !important;
}

.custom-select2-dropdown {
  max-width: 100vw !important;
  overflow-x: hidden !important;
}

/* Prevent page scroll completely */
.select2-dropdown .select2-results__options {
  max-height: 200px;
  overflow-y: auto;
  overflow-x: hidden;
}

/* Search Box in Dropdown */
.select2-container--default .select2-search--dropdown .select2-search__field {
  border: 1px solid #dddddd;
  border-radius: 4px;
  padding: 8px 12px;
  font-size: 14px;
  font-family: var(--text-font);
  background-color: #ffffff;
  color: #333333;
}

.select2-container--default .select2-search--dropdown .select2-search__field:focus {
  border-color: #78EB54;
  outline: none;
  box-shadow: 0 0 0 2px rgba(120, 235, 84, 0.1);
}

/* Results List */
.select2-container--default .select2-results__options {
  max-height: 200px;
  overflow-y: auto;
}

.select2-container--default .select2-results__option {
  padding: 10px 15px;
  font-size: 15px;
  font-family: var(--text-font);
  color: #333333;
  background-color: #ffffff;
  cursor: pointer;
  transition: background-color 0.2s ease;
}

/* Highlighted Option */
.select2-container--default .select2-results__option--highlighted[aria-selected] {
  background-color: #78EB54;
  color: #ffffff;
}

/* Selected Option */
.select2-container--default .select2-results__option[aria-selected=true] {
  background-color: #f8f9fa;
  color: #45A735;
  font-weight: 500;
}

/* Clear Button */
.select2-container--default .select2-selection--single .select2-selection__clear {
  color: #999999;
  cursor: pointer;
  float: right;
  font-weight: bold;
  margin-right: 10px;
  margin-top: 12px;
}

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

/* Loading Spinner */
.select2-container--default.select2-container--loading .select2-selection--single .select2-selection__rendered::after {
  content: '';
  position: absolute;
  right: 35px;
  top: 50%;
  margin-top: -8px;
  width: 16px;
  height: 16px;
  border: 2px solid #78EB54;
  border-radius: 50%;
  border-top-color: transparent;
  animation: spin 1s linear infinite;
}

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

/* Form-specific Styling */
.filter-form .select2-container {
  margin-bottom: 0;
}

.filter-form .select2-container--default .select2-selection--single {
  height: 45px;
  border: 1px solid #dddddd;
}

/* Job Applications Status Dropdowns */
.status-section .select2-container {
  width: 150px !important;
}

.status-section .select2-container--default .select2-selection--single {
  height: 35px;
  border: 1px solid #dddddd;
  border-radius: 4px;
}

.status-section .select2-container--default .select2-selection--single .select2-selection__rendered {
  line-height: 33px;
  font-size: 14px;
  padding-left: 12px;
}

.status-section .select2-container--default .select2-selection--single .select2-selection__arrow {
  height: 33px;
}

/* Category and Subcategory Specific Styling */
.select2-category,
.select2-subcategory {
  min-width: 200px;
}

/* Employment and Job Type Dropdowns */
.select2-employment,
.select2-jobtype {
  min-width: 150px;
}

/* Responsive Design */
@media (max-width: 768px) {
  .select2-container--default .select2-selection--single {
    height: 40px;
  }
  
  .select2-container--default .select2-selection--single .select2-selection__rendered {
    line-height: 38px;
    font-size: 14px;
    padding-left: 12px;
  }
  
  .select2-container--default .select2-selection--single .select2-selection__arrow {
    height: 38px;
  }
  
  .status-section .select2-container {
    width: 100% !important;
  }
}

/* Dark/Light Theme Support */
.dark-section .select2-container--default .select2-selection--single {
  background-color: rgba(255, 255, 255, 0.1);
  border-color: rgba(255, 255, 255, 0.2);
  color: #ffffff;
}

.dark-section .select2-container--default .select2-selection--single .select2-selection__rendered {
  color: #ffffff;
}

.dark-section .select2-container--default .select2-selection--single .select2-selection__placeholder {
  color: rgba(255, 255, 255, 0.7);
}

/* Disabled State */
.select2-container--default.select2-container--disabled .select2-selection--single {
  background-color: #f8f9fa;
  border-color: #e9ecef;
  cursor: not-allowed;
}

.select2-container--default.select2-container--disabled .select2-selection--single .select2-selection__rendered {
  color: #6c757d;
}

/* RTL Support */
.rtl .select2-container--default .select2-selection--single .select2-selection__rendered {
  padding-left: 30px;
  padding-right: 15px;
}

.rtl .select2-container--default .select2-selection--single .select2-selection__arrow {
  left: 12px;
  right: auto;
}

.rtl .select2-container--default .select2-selection--single .select2-selection__clear {
  float: left;
  margin-left: 10px;
  margin-right: 0;
}

/* High Contrast Mode */
@media (prefers-contrast: high) {
  .select2-container--default .select2-selection--single {
    border-width: 2px;
  }
  
  .select2-container--default .select2-results__option--highlighted[aria-selected] {
    background-color: #000000;
    color: #ffffff;
  }
}

/* Print Styles */
@media print {
  .select2-container--default .select2-selection--single .select2-selection__arrow {
    display: none;
  }
}