/*
 * This is a manifest file that'll be compiled into application.css, which will include all the files
 * listed below.
 *
 * Any CSS (and SCSS, if configured) file within this directory, lib/assets/stylesheets, or any plugin's
 * vendor/assets/stylesheets directory can be referenced here using a relative path.
 *
 * You're free to add application-wide styles to this file and they'll appear at the bottom of the
 * compiled file so the styles you add here take precedence over styles defined in any other CSS
 * files in this directory. Styles in this file should be added after the last require_* statement.
 * It is generally better to create a new file per style scope.
 *
 *= require_tree .
 *= require_self
 */

/* Override Tagify's styles */
.tagify {
  /* default (blue) */
  --tag-bg: #e8e9ff !important;
  --tag-text-color: #3a43c9 !important;
  --tag-remove-btn-color: #3a43c9 !important;
  --tag-remove-btn-bg: transparent !important;
  --tag-remove-btn-bg--hover: #3a43c9 !important;
  --tag-pad: 0.1em 0.5em !important;
}

.tagify__tag .tagify__tag-text::before {
  content: none;
}

/* tighter vertical spacing between rows */
.tagify__tag {
  margin-top: 2px !important;
  margin-bottom: 2px !important;
}

/* ensure text/bg use our vars */
.tagify__tag > div {
  color: var(--tag-text-color) !important;
}
.tagify__tag > div::before {
  box-shadow: 0 0 0 var(--tag-inset-shadow-size) var(--tag-bg) inset !important;
}

/* =========================
   Invalid (regex fail)
   Tagify uses these classes:
   - .tagify--notAllowed on the tag
   - .tagify--invalid while editing
   ========================= */
.tagify__tag.tagify--notAllowed,
.tagify__tag--editable.tagify--invalid {
  --tag-bg: #FEEBEB !important;
  --tag-text-color: #DF2325 !important;
  --tag-remove-btn-color: #DF2325 !important;
  --tag-remove-btn-bg--hover: #DF2325 !important;
}
.tagify__tag.tagify--notAllowed > div,
.tagify__tag--editable.tagify--invalid > div {
  color: #DF2325 !important;
}
.tagify__tag.tagify--notAllowed > div::before,
.tagify__tag--editable.tagify--invalid > div::before {
  box-shadow: 0 0 0 var(--tag-inset-shadow-size) #FEEBEB inset !important;
}

/* Invalid (red) – icon BEFORE the text */
.tagify__tag.tagify--notAllowed .tagify__tag-text::before,
.tagify__tag--editable.tagify--invalid .tagify__tag-text::before {
  content: "\26A0\FE0E";             /* ❌ */
  display: inline-block;
  margin-right: 6px;
  font-size: 0.9em;
  line-height: 1;
  vertical-align: middle;
  color: #DF2325;
}

/* =========================
   Already-in-use (warning)
   add class .tagify__tag--warning in JS
   ========================= */
.tagify__tag--warning {
  --tag-bg: #FFEEC6 !important;
  --tag-text-color: #F98707 !important;
  --tag-remove-btn-color: #F98707 !important;
  --tag-remove-btn-bg--hover: #F98707 !important;
}
.tagify__tag--warning > div {
  color: #F98707 !important;
}
.tagify__tag--warning > div::before {
  box-shadow: 0 0 0 var(--tag-inset-shadow-size) #FFEEC6 inset !important;
}

/* optional: make hover state for the "×" use our hover var + white glyph */
.tagify__tag__removeBtn:hover {
  background: var(--tag-remove-btn-bg--hover) !important;
  color: #fff !important;
}

/* Duplicate/Warning (yellow) – icon BEFORE the text */
.tagify__tag--warning .tagify__tag-text::before {
  content: "\26A0\FE0E";        /* ⚠ text style */
  display: inline-block;
  margin-right: 6px;
  font-size: 0.95em;
  line-height: 1;
  vertical-align: middle;
  color: #F98707;
}

/* Multi-select dropdown styles */
.multi-select-dropdown {
  position: relative;
}

.multi-select-dropdown button {
  position: relative;
  text-align: left;
  background: white;
  cursor: pointer;
  min-height: 40px;
  display: flex;
  align-items: center;
  padding: 8px 12px;
  border: 1px solid #d1d5db;
  border-radius: 6px;
  font-size: 14px;
  color: #374151;
  transition: all 0.15s ease-in-out;
}

.multi-select-dropdown button:hover {
  border-color: #10b981;
  box-shadow: 0 0 0 3px rgba(16, 185, 129, 0.1);
}

.multi-select-dropdown button:focus {
  outline: none;
  border-color: #10b981;
  box-shadow: 0 0 0 3px rgba(16, 185, 129, 0.1);
}

.multi-select-dropdown .dropdown-content {
  position: absolute;
  top: 100%;
  left: 0;
  right: 0;
  z-index: 50;
  background: white;
  border: 1px solid #e5e7eb;
  border-radius: 8px;
  box-shadow: 0 10px 25px -5px rgba(0, 0, 0, 0.1), 0 10px 10px -5px rgba(0, 0, 0, 0.04);
  max-height: 300px;
  overflow-y: auto;
  margin-top: 4px;
}

.multi-select-dropdown .dropdown-content input[type="text"] {
  width: 100%;
  padding: 8px 12px;
  border: 1px solid #d1d5db;
  border-radius: 4px;
  font-size: 14px;
  color: #374151;
  background: white;
  transition: all 0.15s ease-in-out;
}

.multi-select-dropdown .dropdown-content input[type="text"]:focus {
  outline: none;
  border-color: #10b981;
  box-shadow: 0 0 0 3px rgba(16, 185, 129, 0.1);
}

.multi-select-dropdown .dropdown-content input[type="text"]::placeholder {
  color: #9ca3af;
}

.multi-select-dropdown .dropdown-content label {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 10px 12px;
  cursor: pointer;
  transition: all 0.15s ease-in-out;
  border-bottom: 1px solid #f3f4f6;
  border-radius: 8px;
  margin: 2px 0;
}

.multi-select-dropdown .dropdown-content label:last-child {
  border-bottom: none;
}

.multi-select-dropdown .dropdown-content label:hover {
  background-color: #f9fafb;
}

.multi-select-dropdown .dropdown-content input[type="checkbox"] {
  margin-left: 10px;
  cursor: pointer;
  width: 16px;
  height: 16px;
  appearance: none;
  -webkit-appearance: none;
  -moz-appearance: none;
  border: none;
  background: transparent;
  position: relative;
  transition: all 0.15s ease-in-out;
}

.multi-select-dropdown .dropdown-content input[type="checkbox"]:checked {
  background: transparent;
  border: none;
  position: relative;
}

.multi-select-dropdown .dropdown-content input[type="checkbox"]:checked::after {
  content: '✓';
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  color: #3b82f6;
  font-size: 16px;
  font-weight: bold;
  line-height: 1;
}

.multi-select-dropdown .dropdown-content input[type="checkbox"]:focus {
  outline: none;
  box-shadow: none;
}

/* Selected state styling */
.multi-select-dropdown .dropdown-content label input[type="checkbox"]:checked + span,
.multi-select-dropdown .dropdown-content label:has(input[type="checkbox"]:checked) {
  background-color: rgba(59, 130, 246, 0.1);
  border: 1px solid #3b82f6;
  border-radius: 8px;
}

.multi-select-dropdown .dropdown-content span {
  cursor: pointer;
  user-select: none;
  font-size: 14px;
  color: #374151;
  line-height: 1.4;
  flex: 1;
}

/* Display text truncation */
.multi-select-dropdown button span {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  padding-right: 24px; /* Space for the arrow */
}

/* Dropdown arrow rotation */
.multi-select-dropdown button[aria-expanded="true"] svg {
  transform: translateY(-50%) rotate(180deg);
  transition: transform 0.15s ease-in-out;
}

.multi-select-dropdown button svg {
  transition: transform 0.15s ease-in-out;
}

/* Scrollbar styling for dropdown */
.multi-select-dropdown .dropdown-content::-webkit-scrollbar {
  width: 6px;
}

.multi-select-dropdown .dropdown-content::-webkit-scrollbar-track {
  background: #f1f1f1;
  border-radius: 3px;
}

.multi-select-dropdown .dropdown-content::-webkit-scrollbar-thumb {
  background: #c1c1c1;
  border-radius: 3px;
}

.multi-select-dropdown .dropdown-content::-webkit-scrollbar-thumb:hover {
  background: #a8a8a8;
}