/* ============================================= */
/* BOOTSTRAP CUSTOM COLORS */
/* ============================================= */

/* Bootstrap Custom Color Variables */
:root {
    /* Primary colors */
    --bs-primary: #262262;
    --bs-primary-rgb: 38, 34, 98;
    
    /* Secondary colors */
    --bs-secondary: #DC5128;
    --bs-secondary-rgb: 220, 81, 40;
    
    /* Button colors */
    --bs-btn-bg: #262262;
    --bs-btn-border-color: #262262;
    --bs-btn-color: #fff;
    --bs-btn-hover-bg: #201d53;
    --bs-btn-hover-border-color: #201d53;
    --bs-btn-hover-color: #fff;
    --bs-btn-active-bg: #1e1b4e;
    --bs-btn-active-border-color: #1e1b4e;
    --bs-btn-active-color: #fff;
    
    /* Secondary button colors */
    --bs-btn-secondary-bg: #DC5128;
    --bs-btn-secondary-border-color: #DC5128;
    --bs-btn-secondary-color: #fff;
    --bs-btn-secondary-hover-bg: #bb4522;
    --bs-btn-secondary-hover-border-color: #bb4522;
    --bs-btn-secondary-hover-color: #fff;
    --bs-btn-secondary-active-bg: #b04120;
    --bs-btn-secondary-active-border-color: #b04120;
    --bs-btn-secondary-active-color: #fff;
  }
  
  /* Primary button styles */
  .btn-primary {
    --bs-btn-bg: #262262;
    --bs-btn-border-color: #262262;
    --bs-btn-hover-bg: #201d53;
    --bs-btn-hover-border-color: #201d53;
    --bs-btn-active-bg: #1e1b4e;
    --bs-btn-active-border-color: #1e1b4e;
  }
  
  /* Dark mode: Add subtle shadow to primary buttons for better contrast */
  [data-bs-theme="dark"] .btn-primary {
    box-shadow: 0 0 0 1px rgba(255, 255, 255, 0.1), 0 2px 4px rgba(0, 0, 0, 0.3);
  }
  
  [data-bs-theme="dark"] .btn-primary:hover {
    box-shadow: 0 0 0 1px rgba(255, 255, 255, 0.15), 0 4px 8px rgba(0, 0, 0, 0.4);
  }
  
  /* Secondary button styles */
  .btn-secondary {
    --bs-btn-bg: #DC5128;
    --bs-btn-border-color: #DC5128;
    --bs-btn-hover-bg: #bb4522;
    --bs-btn-hover-border-color: #bb4522;
    --bs-btn-active-bg: #b04120;
    --bs-btn-active-border-color: #b04120;
  }
  
  /* Outline Primary button styles */
  .btn-outline-primary {
    --bs-btn-color: #262262;
    --bs-btn-border-color: #262262;
    --bs-btn-hover-color: #fff;
    --bs-btn-hover-bg: #262262;
    --bs-btn-hover-border-color: #262262;
    --bs-btn-focus-shadow-rgb: 38, 34, 98;
    --bs-btn-active-color: #fff;
    --bs-btn-active-bg: #262262;
    --bs-btn-active-border-color: #262262;
    --bs-btn-active-shadow: inset 0 3px 5px rgba(0, 0, 0, 0.125);
    --bs-btn-disabled-color: #262262;
    --bs-btn-disabled-bg: transparent;
    --bs-btn-disabled-border-color: #262262;
    --bs-gradient: none;
  }
  
  /* Dark mode: Add shadow to outline primary for better visibility */
  [data-bs-theme="dark"] .btn-outline-primary {
    --bs-btn-color: #a8a9d8 !important;  /* Lighter purple text for visibility */
    --bs-btn-border-color: #a8a9d8 !important;
    box-shadow: 0 0 0 1px rgba(255, 255, 255, 0.1);
    background-color: rgba(38, 34, 98, 0.1);
  }
  
  [data-bs-theme="dark"] .btn-outline-primary:hover {
    --bs-btn-color: #fff !important;
    --bs-btn-bg: #262262 !important;
    --bs-btn-border-color: #262262 !important;
    box-shadow: 0 0 0 1px rgba(255, 255, 255, 0.15), 0 2px 4px rgba(0, 0, 0, 0.3);
  }
  
  [data-bs-theme="dark"] .btn-outline-secondary {
    /* Secondary outline buttons are fine - orange is visible in dark mode */
    box-shadow: 0 0 0 1px rgba(255, 255, 255, 0.05);
  }
  
  /* Outline Secondary button styles */
  .btn-outline-secondary {
    --bs-btn-color: #DC5128;
    --bs-btn-border-color: #DC5128;
    --bs-btn-hover-color: #fff;
    --bs-btn-hover-bg: #DC5128;
    --bs-btn-hover-border-color: #DC5128;
    --bs-btn-focus-shadow-rgb: 220, 81, 40;
    --bs-btn-active-color: #fff;
    --bs-btn-active-bg: #DC5128;
    --bs-btn-active-border-color: #DC5128;
    --bs-btn-active-shadow: inset 0 3px 5px rgba(0, 0, 0, 0.125);
    --bs-btn-disabled-color: #DC5128;
    --bs-btn-disabled-bg: transparent;
    --bs-btn-disabled-border-color: #DC5128;
    --bs-gradient: none;
  }
  
  /* Background utilities */
  .bg-primary { background-color: #262262 !important; }
  .bg-secondary { background-color: #DC5128 !important; }
  
  /* Dark mode: Add subtle border to primary backgrounds for definition */
  [data-bs-theme="dark"] .bg-primary { 
    background-color: #262262 !important; 
    box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.1);
  }
  
  /* Text utilities */
  .text-primary { color: #262262 !important; }
  .text-secondary { color: #DC5128 !important; }
  
  /* Dark mode: Add text shadow to primary text for better readability */
  [data-bs-theme="dark"] .text-primary { 
    color: #a8a9d8 !important;  /* Lighter purple for visibility */
  }
  
  [data-bs-theme="dark"] .text-secondary { 
    color: #DC5128 !important;  /* Orange is fine in dark mode */
  }
  
  /* Border utilities */
  .border-primary { border-color: #262262 !important; }
  .border-secondary { border-color: #DC5128 !important; }
  
  /* Dark mode: Make primary borders more visible with slight transparency */
  [data-bs-theme="dark"] .border-primary { 
    border-color: rgba(38, 34, 98, 0.7) !important;
    box-shadow: 0 0 0 1px rgba(255, 255, 255, 0.05);
  }
  
  /* Link colors */
  .link-primary { color: #262262 !important; }
  .link-secondary { color: #DC5128 !important; }
  
  .link-primary:hover, .link-primary:focus { color: #201d53 !important; }
  .link-secondary:hover, .link-secondary:focus { color: #bb4522 !important; }
  
  /* Dark mode: Make primary links visible */
  [data-bs-theme="dark"] .link-primary { color: #a8a9d8 !important; }
  [data-bs-theme="dark"] .link-primary:hover, 
  [data-bs-theme="dark"] .link-primary:focus { color: #c2c3e8 !important; }
  
  /* Badges */
  .badge.bg-primary { 
    background-color: #262262 !important; 
    color: #fff !important;
  }
  .badge.bg-secondary { 
    background-color: #DC5128 !important; 
    color: #fff !important;
  }
  
  /* Dark mode: Badges with better contrast */
  [data-bs-theme="dark"] .badge.bg-primary { 
    background-color: #a8a9d8 !important; 
    color: #000 !important;  /* Dark text on light purple background */
  }
  
  /* Button link styles */
  .btn-link {
    --bs-btn-font-weight: 400;
    --bs-btn-color: var(--bs-link-color);
    --bs-btn-bg: transparent;
    --bs-btn-border-color: transparent;
    --bs-btn-hover-color: var(--bs-link-hover-color);
    --bs-btn-hover-border-color: transparent;
    --bs-btn-active-color: var(--bs-link-hover-color);
    --bs-btn-active-border-color: transparent;
    --bs-btn-disabled-color: #6c757d;
    --bs-btn-disabled-border-color: transparent;
    --bs-btn-box-shadow: none;
    --bs-btn-focus-shadow-rgb: 38, 34, 98;
    text-decoration: underline;
  }
  
  .btn-link:focus-visible {
    color: var(--bs-btn-color);
  }
  
  .btn-link:hover {
    color: var(--bs-btn-hover-color);
  }
  
  /* Form control focus */
  .form-control:focus, .form-select:focus {
    border-color: rgba(38, 34, 98, 0.5);
    box-shadow: 0 0 0 0.25rem rgba(38, 34, 98, 0.25);
  }
  
  /* Dark mode: Enhanced focus visibility with white accent */
  [data-bs-theme="dark"] .form-control:focus, 
  [data-bs-theme="dark"] .form-select:focus {
    border-color: rgba(38, 34, 98, 0.7);
    box-shadow: 
      0 0 0 0.25rem rgba(38, 34, 98, 0.25),
      0 0 0 1px rgba(255, 255, 255, 0.1);
  }
  
  /* Progress bars */
  .progress-bar { background-color: #262262; }
  .progress-bar-secondary { background-color: #DC5128; }
  
  /* Badges */
  .badge.bg-primary { background-color: #262262 !important; }
  .badge.bg-secondary { background-color: #DC5128 !important; }
  
  /* Alerts */
  .alert-primary {
    --bs-alert-color: #fff;
    --bs-alert-bg: #262262;
    --bs-alert-border-color: #262262;
  }
  
  .alert-secondary {
    --bs-alert-color: #fff;
    --bs-alert-bg: #DC5128;
    --bs-alert-border-color: #DC5128;
  }
  
  /* Dark mode: Alert styling with better contrast */
  [data-bs-theme="dark"] .alert-primary {
    --bs-alert-color: #000;
    --bs-alert-bg: #a8a9d8;
    --bs-alert-border-color: #a8a9d8;
    box-shadow: 0 0 0 1px rgba(255, 255, 255, 0.1);
  }
  
  /* List group items */
  .list-group-item-primary {
    color: #171338;
    background-color: #d1d0e7;
    border-color: #c4c2df;
  }
  
  .list-group-item-primary.list-group-item-action:hover,
  .list-group-item-primary.list-group-item-action:focus {
    color: #171338;
    background-color: #bcc0d0;
  }
  
  .list-group-item-secondary {
    color: #842e17;
    background-color: #f5d5cc;
    border-color: #f0c7b8;
  }
  
  .list-group-item-secondary.list-group-item-action:hover,
  .list-group-item-secondary.list-group-item-action:focus {
    color: #842e17;
    background-color: #edbeb7;
  }
  
  /* Dropdown items */
  .dropdown-item.active,
  .dropdown-item:active {
    color: #fff;
    text-decoration: none;
    background-color: #262262;
  }
  
  /* Spinners */
  .spinner-border-primary {
    --bs-spinner-border-color: currentcolor;
    --bs-spinner-border-color-rgb: 38, 34, 98;
    color: #262262;
  }
  
  .spinner-border-secondary {
    --bs-spinner-border-color: currentcolor;
    --bs-spinner-border-color-rgb: 220, 81, 40;
    color: #DC5128;
  }
  
  /* ============================================= */
  /* SELECT2 DARK MODE CUSTOMIZATION */
  /* ============================================= */
  
  [data-bs-theme="dark"] .select2-container--bootstrap-5 .select2-selection {
    background-color: #2b2f32 !important;
    color: #f8f9fa !important;
    border-color: #444c54 !important;
  }
  
  [data-bs-theme="dark"] .select2-container--bootstrap-5 .select2-selection__placeholder {
    color: #adb5bd !important;
  }
  
  [data-bs-theme="dark"] .select2-container--bootstrap-5.select2-container--focus .select2-selection {
    border-color: #66afe9 !important;
    box-shadow: 0 0 0 0.25rem rgba(102, 175, 233, 0.25) !important;
  }
  
  [data-bs-theme="dark"] .select2-container--bootstrap-5 .select2-dropdown {
    background-color: #2b2f32 !important;
    color: #f8f9fa !important;
    border: 1px solid #444c54 !important;
  }
  
  [data-bs-theme="dark"] .select2-container--bootstrap-5 .select2-results__option {
    background-color: #2b2f32 !important;
    color: #f8f9fa !important;
  }
  
  [data-bs-theme="dark"] .select2-container--bootstrap-5 .select2-results__option--highlighted {
    background-color: #495057 !important;
    color: #fff !important;
  }
  
  [data-bs-theme="dark"] .select2-container--bootstrap-5 .select2-selection__rendered {
    color: #f8f9fa !important;
  }
  
  [data-bs-theme="dark"] .select2-container--bootstrap-5 .select2-search__field {
    background-color: #2b2f32 !important;
    color: #f8f9fa !important;
    border: 1px solid #444c54 !important;
  }
  
  [data-bs-theme="dark"] .select2-container--bootstrap-5 .select2-search__field::placeholder {
    color: #adb5bd !important;
  }
  
  [data-bs-theme="dark"] .select2-container--bootstrap-5 .select2-selection__choice {
    background-color: #495057 !important;
    color: #f8f9fa !important;
    border: 1px solid #6c757d !important;
  }
  
  [data-bs-theme="dark"] .select2-container--bootstrap-5 .select2-selection__choice__remove {
    color: #f8f9fa !important;
  }
  
  [data-bs-theme="dark"] .select2-container--bootstrap-5 .select2-selection__choice__remove:hover {
    color: #fff !important;
  }
  
  /* ============================================= */
  /* CUSTOM UTILITY CLASSES */
  /* ============================================= */
  
  .cursor-disabled[disabled] {
    cursor: not-allowed !important;
  }
  
  .logo-spinner {
    display: inline-block;
    width: 2rem;
    height: 2rem;
    animation: spin 1s linear infinite;
  }
  
  .logo-spinner-sm {
    width: 1.5rem;
    height: 1.5rem;
  }
  
  .logo-spinner img {
    width: 100%;
    height: 100%;
    object-fit: contain;
  }
  
  @keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
  }