/* ===================================
   CSS VARIABLES & ROOT STYLES & BASE STYLE
   =================================== */
:root {
  --border-color: #b5b5b5d4;
  --border-radius: 0.9rem;
  --box-shadow: 0 0.125rem 0.25rem rgba(0, 0, 0, 0.075);
  --transition: all 0.3s ease;
}

body {
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto,
    "Helvetica Neue", Arial, sans-serif;
  font-size: 14px;
}

/* ===================================
   ANIMATIONS & KEYFRAMES
   =================================== */
@keyframes gradientAnimation {
  0% {
    background-position: 0% 50%;
  }
  50% {
    background-position: 100% 50%;
  }
  100% {
    background-position: 0% 50%;
  }
}

@keyframes fadeIn {
  from {
    opacity: 0;
  }
  to {
    opacity: 1;
  }
}

@keyframes glowPulse {
  0% {
    box-shadow: 0 0 10px rgba(13, 110, 253, 0.3);
  }
  100% {
    box-shadow: 0 0 20px rgba(13, 110, 253, 0.45);
  }
}

/* ===================================
   FORM SECTIONS & CARDS
   =================================== */
.form-section {
  background-color: #f8f9fa;
  padding: 0.5rem;
  border-radius: var(--border-radius);
  border: 1px solid var(--border-color);
  box-shadow: 0 4px 6px rgba(13, 110, 253, 0.15);
  position: relative;
  overflow: visible;
}

.card-header {
  box-shadow: 0 0.25rem 0.75rem rgba(0, 0, 0, 0.1);
  background-color: #f7f7f7;
  transition: var(--transition);
}

.card:hover {
  box-shadow: 0 0.5rem 1rem rgba(0, 0, 0, 0.15);
}

.card-body {
  padding: 0.5rem;
}

/* ===================================
   SECTION HEADERS
   =================================== */
.section-header {
  background: linear-gradient( -45deg, #1a77ff, #18c1dd, #1a77ff, #0d5bb8, #18c1dd);
  background-size: 400% 400%;
  animation: gradientAnimation 15s ease infinite;
  color: white;
  border-radius: var(--border-radius);
  padding: 15px 20px;
  font-size: 20px;
  box-shadow: 0 2px 5px rgba(0, 0, 0, 0.1);
}

.section-content {
  background-color: white;
  padding: 20px;
  border-radius: var(--border-radius);
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
}

.form-header {
  background: linear-gradient(-45deg, #4338ca, #6366f1, #4338ca, #3730a3, #6366f1);
  background-size: 400% 400%;
  animation: gradientAnimation 15s ease infinite;
  color: white;
  border-radius: var(--border-radius);
  padding: 15px 20px;
  font-size: 20px;
  box-shadow: 0 2px 5px rgba(0, 0, 0, 0.1);
}

/* ===================================
   FORM CONTROLS & INPUTS
   =================================== */
.form-label {
  font-weight: 600;
  color: #343a40;
}

.form-control,
.form-select {
  border: 1px solid var(--border-color); 
  border-radius: var(--border-radius) !important;
  transition: var(--transition) !important;
}

.form-control:focus,
.form-select:focus {
  border-color: #3498db;
  box-shadow: 0 0 0 0.25rem rgba(52, 152, 219, 0.25);
}

.required-label::after {
  content: " *";
  color: red;
  font-weight: bold;
}

input[readonly] {
  background-color: #f5f5f5;
}

#statusMessage {
  font-weight: 500;
}

/* Date picker icon positioning */
.gj-icon {
  right: 5px !important;
  top: 9px !important;
}

/* ===================================
   SELECT2 DROPDOWN STYLES
   =================================== */
.select2-selection {
  border: 1px solid var(--border-color) !important;
  border-radius: var(--border-radius) !important;
  transition: var(--transition) !important;
  padding: 2px;
}

.select2-selection--single .select2-selection__arrow {
    top: 4px !important;
}

.select2-selection--single {
    height: 35px !important;
}

.select2-results__options {
  max-height: 280px;
  overflow-y: auto;
  background-color: #ffffff;
  font-size: 14px;
  padding: 8px 0;
  border-radius: 8px;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
  border: 1px solid #e1e5e9;
  
  /* Custom scrollbar */
  scrollbar-width: thin;
  scrollbar-color: #cbd5e0 #f7fafc;
}

.select2-results__options::-webkit-scrollbar {
  width: 6px;
}

.select2-results__options::-webkit-scrollbar-track {
  background: #f7fafc;
  border-radius: 3px;
}

.select2-results__options::-webkit-scrollbar-thumb {
  background: #cbd5e0;
  border-radius: 3px;
}

.select2-results__options::-webkit-scrollbar-thumb:hover {
  background: #a0aec0;
}

.select2-results__option {
  padding: 12px 16px;
  cursor: pointer;
  transition: all 0.2s ease;
  border-bottom: 1px solid #f1f5f9;
  color: #374151;
  font-weight: 400;
  line-height: 1.4;
  position: relative;
}

.select2-results__option:last-child {
  border-bottom: none;
}

.select2-results__option:hover {
  background-color: #f8fafc;
  color: #1f2937;
}

.select2-results__option--highlighted {
  background-color: #3b82f6 !important;
  color: white !important;
  font-weight: 500;
  transform: translateX(2px);
  box-shadow: inset 3px 0 0 #1d4ed8;
}

.select2-results__option--selected {
  background-color: #eff6ff;
  color: #1e40af;
  font-weight: 500;
  position: relative;
}

.select2-results__option--selected::after {
  content: "✓";
  position: absolute;
  right: 16px;
  top: 50%;
  transform: translateY(-50%);
  color: #3b82f6;
  font-weight: bold;
}

.select2-results__option--disabled {
  color: #9ca3af;
  cursor: not-allowed;
  opacity: 0.6;
}

.select2-results__option--disabled:hover {
  background-color: transparent;
}

.select2-results__option:focus {
  outline: 2px solid #3b82f6;
  outline-offset: -2px;
}

/* Group headers */
.select2-results__group {
  padding: 8px 16px 4px;
  font-weight: 600;
  color: #6b7280;
  font-size: 12px;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  background-color: #f9fafb;
  border-bottom: 1px solid #e5e7eb;
}

/* Loading state */
.select2-results__option--loading {
  text-align: center;
  color: #6b7280;
  font-style: italic;
}

/* No results message */
.select2-results__message {
  padding: 16px;
  text-align: center;
  color: #6b7280;
  font-style: italic;
}

/* ===================================
   BUTTONS & BUTTON VARIANTS
   =================================== */
.button {
  font-weight: 600 !important;
  border-radius: 3rem !important;
  transition: all 0.3s ease !important;
  color: white !important;
}

.button:hover {
  opacity: 0.85;
  transform: translateY(-2px);
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
  cursor: pointer;
  color: white;
}

.button-blue {
  background: linear-gradient(100deg, #4e54c8 0%, #8f94fb 100%);
}

.button-aqua {
  background: linear-gradient(100deg, #185a9d 0%, #00c385 100%);
}

.button-violet {
  background: linear-gradient(100deg, #6d03c9 0%, #9733ee 100%);
}

.button-green {
  background: linear-gradient(100deg, #11998e 0%, #00d851 100%);
}

.button-red {
  background: linear-gradient(100deg, #cc0000 0%, #ff0000 100%);
}

.button-grey {
  background: linear-gradient(100deg, #6c757d 0%, #adb5bd 100%);
}
.button-golden {
  background: linear-gradient(100deg, #FFD700 0%, #FFA500 100%);
}
.btn:disabled {
  color: white;
}

/* ===================================
   NAVIGATION TABS
   =================================== */
.nav-tabs {
  border: none;
  display: flex;
  justify-content: flex-start;
  gap: 0.5rem;
  margin: 0.5rem;
  flex-wrap: wrap;
}

.nav-tabs .nav-link {
  color: black;
  background: #f8f9fa;
  border: 1px solid #dee2e6;
  border-radius: 2rem;
  padding: 0.5rem 1.2rem;
  font-weight: 500;
  transition: all 0.3s ease;
  font-size: 0.95rem;
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.05);
}

.nav-tabs .nav-link:hover:not(.active) {
  background: linear-gradient(90deg, #eaf4ff 0%, #d4e3ff 100%);
  border-color: #b6d4fe;
  color: #062d74;
  transform: translateY(-1px);
}

.nav-tabs .nav-link.active {
  color: #fff !important;
  background: linear-gradient(100deg, #0d6efd, #3a8bfd);
  border-color: transparent;
  font-weight: 600;
  box-shadow: 0 4px 10px rgba(13, 110, 253, 0.3);
  transform: translateY(-2px);
  outline: 2px solid #0069ff;
  outline-offset: 1px;
  border: 1px solid white;
  animation: glowPulse 1.2s ease-in-out infinite alternate;
}

/* ===================================
   TABLES & DATA TABLES
   =================================== */
.table thead th {
  background: linear-gradient(to bottom, #4F76C7, cornflowerblue) !important;
  color: white !important;
  border: none !important;
  font-size: 14px !important;
}

.table tbody tr {
  font-size: 13px;
}

.table-hover tbody tr:hover {
  background-color: #edf2fb;
  transition: 0.2s;
  cursor: pointer;
}

table th, table td {
  border: none !important;
  padding: 12px 18px;
  vertical-align: middle;
}

/* DataTables Styling */
.dataTables_wrapper .dataTables_filter {
  margin-bottom: 10px;
  margin-top: 10px;
  margin-right: 1rem;
}

.dataTables_wrapper .dataTables_filter input {
  border-radius: 20px !important;
  padding: 5px 15px !important;
  outline-color: #3498db !important;
  outline-offset: 2px !important;
}

.dataTables_wrapper .dataTables_length select {
  border-radius: 20px !important;
  padding: 5px 10px !important;
  margin-top: 8px !important;
  outline-color: #3498db !important;
  outline-offset: 2px !important;
}

.dataTables_paginate .paginate_button {
  border-radius: 20px !important;
  width: 40px !important;
  height: 36px !important;
  line-height: 36px !important;
  padding: 0 !important;
  margin: 0 3px;
}

.dataTables_paginate .paginate_button:hover {
  background: #4361ee !important;
  border-color: #e0e0e0 !important;
}

.dataTables_paginate .paginate_button.disabled:hover {
  background: #e0e0e0 !important;
  border-color: #e0e0e0 !important;
  cursor: not-allowed;
}

/* ===================================
   RESPONSIVE DESIGN - TABLET & SMALL DESKTOP
   =================================== */
@media (max-width: 768px) {
  body {
    padding: 0.25rem;
  }
  
  .section-header {
    padding: 10px 15px;
  }
  
  .section-header h4 {
    font-size: 1.1rem;
  }
  
  .form-section {
    padding: 0.75rem;
  }
  
  .nav-tabs {
    justify-content: center;
  }
  
  .nav-tabs .nav-link {
    padding: 0.4rem 0.8rem;
    font-size: 0.8rem;
    margin-bottom: 0.25rem;
  }
  
  .form-label {
    font-size: 0.85rem;
    margin-bottom: 0.25rem;
  }
  
  .form-control,
  .form-select {
    font-size: 0.85rem;
    padding: 0.5rem 0.75rem;
  }
  
  .modal-dialog {
    margin: 0.5rem;
    max-width: calc(100vw - 1rem);
  }
  
  .modal-body {
    padding: 1rem;
  }
  
  .modal-header {
    padding: 0.75rem 1rem;
  }
  
  .modal-footer {
    padding: 0.75rem 1rem;
  }
  
  /* Button responsive adjustments */
  .button {
    font-size: 0.9rem;
    padding: 0.5rem 1rem;
  }

  .button i {
    font-size: 1rem;
  }
  
  /* DataTables responsive adjustments */
  .dataTables_wrapper .dataTables_filter,
  .dataTables_wrapper .dataTables_length {
    text-align: center;
    margin-bottom: 15px;
    margin-right: 0;
  }
  
  .dataTables_wrapper .dataTables_filter input {
    max-width: 100%;
    min-width: 200px;
  }
  
  .dataTables_wrapper .dataTables_length select {
    margin-top: 5px;
  }
  
  .dataTables_paginate {
    text-align: center;
    margin-top: 15px;
  }
  
  .dataTables_paginate .paginate_button {
    width: 35px !important;
    height: 32px !important;
    line-height: 32px !important;
    margin: 0 2px;
    font-size: 14px;
  }
  
  .dataTables_paginate .paginate_button:not(.current):not(.next):not(.previous):not(.first):not(.last) {
    display: none;
  }
}

/* ===================================
   RESPONSIVE DESIGN - MOBILE
   =================================== */
@media (max-width: 576px) {
  .section-header h4 {
    font-size: 1rem;
  }
  
  .nav-tabs .nav-link {
    font-size: 0.75rem;
    padding: 0.3rem 0.6rem;
  }
  
  .form-label {
    font-size: 0.8rem;
  }
  
  .form-control,
  .form-select {
    font-size: 0.8rem;
  }
  
  /* Button responsive adjustments */
  .button {
    font-size: 0.85rem;
    padding: 0.4rem 0.9rem;
  }

  .button i {
    font-size: 0.95rem;
  }
  
  /* Utility classes for responsive spacing */
  .g-3 {
    --bs-gutter-x: 0.5rem;
    --bs-gutter-y: 0.5rem;
  }
  
  .mb-2 {
    margin-bottom: 0.5rem !important;
  }
  
  .p-2 {
    padding: 0.5rem !important;
  }
}

/* ===================================
   RESPONSIVE DESIGN - SMALL MOBILE
   =================================== */
@media screen and (max-width: 576px) {
  .dataTables_wrapper .dataTables_filter {
    margin-bottom: 20px;
  }
  
  .dataTables_wrapper .dataTables_filter input {
    min-width: 180px;
    padding: 8px 15px !important;
  }
  
  .dataTables_wrapper .dataTables_length select {
    padding: 8px 10px !important;
  }
  
  .dataTables_paginate .paginate_button {
    width: 32px !important;
    height: 32px !important;
    line-height: 32px !important;
    margin: 0 1px;
    font-size: 13px;
  }
  
  .dataTables_paginate .paginate_button:not(.current):not(.next):not(.previous) {
    display: none;
  }
}

@media (max-width: 576px) { 
  table.table,
  table.table thead,
  table.table tbody,
  table.table th,
  table.table td,
  table.table tr {
    display: block;
    width: 100%;
  }

  table.table thead {
    display: none;
  }

  table.table tr {
    margin-bottom: 1.25rem;
    border-radius: 0.75rem;
    box-shadow: 0 4px 12px rgba(59, 130, 246, 0.12);
    background: linear-gradient(to right, #ffffff, #f8faff);
    border-left: 4px solid #3B82F6;
    padding: 0.75rem;
    margin-top: 3px;
    transition: all 0.3s ease;
  }

  table.table tr:hover {
    box-shadow: 0 6px 16px rgba(59, 130, 246, 0.16);
    transform: translateY(-2px);
  }

  table.table td {
    position: relative;
    border: none !important;
    border-bottom: 1px solid #e0e7ff;
    background-color: transparent;
    color: #1F2937;
    font-size: 1rem;
    font-weight: 500;
    transition: background-color 0.2s ease;
    border-bottom: 1px solid rgba(226, 232, 240, 0.6);
    display: flex;
    justify-content: space-between;
  }
  
  table.table td::before {
	  content: attr(data-label);
	  display: block;
	  font-weight: 700;
	  color: #0ea5e9;
	  margin-bottom: 4px;
	  margin-right: 10px;
	  padding-bottom: 4px;
	  text-transform: uppercase;
	  letter-spacing: 0.04em;
	  font-size: 1rem;
	  text-transform: capitalize;
	  flex-shrink: 0;
      min-width: 100px;
  }

  /* Highlight important cells */
  table.table td.highlight {
    background-color: rgba(167, 139, 250, 0.1);
    color: #7c3aed;
  }
  
}

/* choices js */
/* .choices__list--dropdown { */
/*   position: absolute; */
/*   z-index: 9999; */
/* } */

.toggle-password {
  background: transparent;
  border: none;
  padding: 0 0.75rem;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--bs-body-color, #6c757d);
  font-size: 1rem;
  transition: color 0.2s ease, background 0.2s ease;
}

/* Hover / focus effect */
.toggle-password:hover {
  color: var(--bs-blue, #0d6efd);          /* brand color on hover */
  background: transparent;
  border-radius: 0.25rem;                  /* soft roundness for hover */
  outline: none;
}

.toggle-password.active {
  background: transparent;
}
