/*
 * This is a manifest file that'll be compiled into application.css.
 *
 * With Propshaft, assets are served efficiently without preprocessing steps. You can still include
 * application-wide styles in this file, but keep in mind that CSS precedence will follow the standard
 * cascading order, meaning styles declared later in the document or manifest will override earlier ones,
 * depending on specificity.
 *
 * Consider organizing styles into separate files for maintainability.
 */

/* Select2 custom styles to match Tailwind */
.select2-container--default .select2-selection--single {
  height: 2.5rem !important;
  /* h-10 = 40px */
  border: 1px solid #d1d5db !important;
  /* border-gray-300 */
  border-radius: 0.375rem !important;
  /* rounded-md */
}

.select2-container--default .select2-selection--single .select2-selection__rendered {
  line-height: 2.5rem !important;
  /* Match height for vertical centering */
  padding-left: 0.75rem !important;
  /* px-3 */
  padding-right: 0.75rem !important;
  font-size: 0.875rem !important;
  /* text-sm */
}

.select2-container--default .select2-selection--single .select2-selection__arrow {
  height: 2.5rem !important;
  /* Match container height */
}

.select2-container--default.select2-container--focus .select2-selection--single {
  border-color: #3b82f6 !important;
  /* focus:ring-blue-500 */
  outline: none !important;
  box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.5) !important;
  /* focus:ring-2 */
}

/* Prevent horizontal scroll in Select2 dropdowns */
.select2-results__option {
  overflow: hidden !important;
  text-overflow: ellipsis !important;
  white-space: nowrap !important;
}

.select2-container--default .select2-results__option {
  padding: 0.5rem 0.75rem !important;
  /* py-2 px-3 for better spacing */
}

/* Also apply to the selected item in the dropdown */
.select2-container--default .select2-selection--single .select2-selection__rendered {
  overflow: hidden !important;
  text-overflow: ellipsis !important;
  white-space: nowrap !important;
}

/* Shake animation for authentication failures */
@keyframes shake {

  0%,
  100% {
    transform: translateX(0);
  }

  10%,
  30%,
  50%,
  70%,
  90% {
    transform: translateX(-10px);
  }

  20%,
  40%,
  60%,
  80% {
    transform: translateX(10px);
  }
}

.shake {
  animation: shake 0.5s;
}

/* Field change visualization */
.field-change-wrapper {
  position: relative;
  display: inline-block;
  width: 100%;
  padding-top: 1.2em;
  /* Make space for the old value above */
}

.field-old-value {
  position: absolute;
  top: 0;
  left: 0;
  font-size: 0.7em;
  color: #9ca3af;
  /* gray-400 */
  text-decoration: line-through;
  text-decoration-color: #ef4444;
  /* red-500 */
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  max-width: 100%;
  pointer-events: none;
}

.field-new-value {
  display: inline;
}