html {
  font-size: 14px;
}

@media (min-width: 768px) {
  html {
    font-size: 16px;
  }
}

.btn:focus,
.btn:active:focus,
.btn-link.nav-link:focus,
.form-control:focus,
.form-check-input:focus {
  box-shadow: 0 0 0 0.1rem white, 0 0 0 0.25rem #258cfb;
}

html {
  position: relative;
  min-height: 100%;
}

body {
  margin-bottom: 60px;
}

.form-floating>.form-control-plaintext::placeholder,
.form-floating>.form-control::placeholder {
  color: var(--bs-secondary-color);
  text-align: end;
}

.form-floating>.form-control-plaintext:focus::placeholder,
.form-floating>.form-control:focus::placeholder {
  text-align: start;
}

/* Glass Card Dropdown Styles */
.glass-card .form-control,
.glass-card .form-select {
  background-color: rgba(255, 255, 255, 0.1);
  border-color: rgba(255, 255, 255, 0.2);
  color: #fff;
}

.glass-card .form-control:focus,
.glass-card .form-select:focus {
  background-color: rgba(255, 255, 255, 0.2);
  border-color: rgba(255, 255, 255, 0.5);
  color: #fff;
  box-shadow: 0 0 0 0.25rem rgba(255, 255, 255, 0.1);
}

.glass-card .form-select option {
  background-color: #2c3e50;
  /* Dark background for options for readability */
  color: #fff;
}

.glass-card .form-control::placeholder {
  color: rgba(255, 255, 255, 0.5);
}

/* Glass Card Nav Tabs */
.glass-card .nav-tabs {
  border-bottom: 1px solid rgba(255, 255, 255, 0.15);
}

.glass-card .nav-tabs .nav-link {
  border: none;
  background: transparent;
  color: rgba(255, 255, 255, 0.6) !important;
  transition: all 0.3s ease;
  margin-right: 0.5rem;
}

.glass-card .nav-tabs .nav-link:hover {
  background: rgba(255, 255, 255, 0.05);
  color: #fff !important;
  border: none;
}

.glass-card .nav-tabs .nav-link.active {
  background: rgba(255, 255, 255, 0.15) !important;
  color: #fff !important;
  border: none !important;
  border-bottom: 2px solid #fff !important;
  border-radius: 4px 4px 0 0;
}

.italic {
  font-style: italic;
}

/* Select2 Global Overrides for Glass Theme */
/* Selection Container (Input box) - Scoped to glass-card to avoid affecting other areas if needed */
.glass-card .select2-container--bootstrap-5 .select2-selection {
  background-color: rgba(255, 255, 255, 0.1) !important;
  border-color: rgba(255, 255, 255, 0.2) !important;
  color: #fff !important;
  display: flex !important;
  align-items: center !important;
}

.glass-card .select2-container--bootstrap-5 .select2-selection--single .select2-selection__rendered {
  color: #fff !important;
  flex-grow: 1;
}

.glass-card .select2-container--bootstrap-5 .select2-selection--single .select2-selection__placeholder {
  color: rgba(255, 255, 255, 0.5) !important;
}

/* Dropdown Menu - Global Scope because Select2 appends to body */
.select2-container--bootstrap-5 .select2-dropdown {
  background-color: #212529 !important;
  /* Dark background matching bootstrap dark or similar */
  border-color: rgba(255, 255, 255, 0.2) !important;
  color: #fff !important;
}

.select2-container--bootstrap-5 .select2-search__field {
  background-color: rgba(255, 255, 255, 0.1) !important;
  border-color: rgba(255, 255, 255, 0.2) !important;
  color: #fff !important;
}

.select2-container--bootstrap-5 .select2-results__option {
  color: #fff !important;
  background-color: #212529 !important;
}

.select2-container--bootstrap-5 .select2-results__option--highlighted {
  background-color: #0d6efd !important;
  /* Bootstrap Primary */
  color: #fff !important;
}

/* Ensure no white background leaks through */
.select2-container--bootstrap-5 .select2-results {
  background-color: #212529 !important;
}

/* Mobile Card Layout for DataTables */
/* Mobile Card Layout for DataTables */
@media (max-width: 767.98px) {

  /* Force card layout by overriding table display styles */
  .table-card-mobile,
  .table-card-mobile thead,
  .table-card-mobile tbody,
  .table-card-mobile th,
  .table-card-mobile td,
  .table-card-mobile tr {
    display: block !important;
    width: 100% !important;
    /* Force full width to prevent overflow */
    box-sizing: border-box;
  }

  /* Hide header row */
  .table-card-mobile thead tr {
    position: absolute;
    top: -9999px;
    left: -9999px;
  }

  .table-card-mobile tbody tr {
    margin-bottom: 1rem;
    border: 1px solid rgba(255, 255, 255, 0.15);
    border-radius: 0.5rem;
    padding: 1rem;
    background: rgba(44, 62, 80, 0.4);
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
  }

  .table-card-mobile tbody td {
    border: none;
    border-bottom: 1px solid rgba(255, 255, 255, 0.05);
    position: relative;
    padding: 0.5rem 0 !important;
    text-align: left;
    white-space: normal;
    word-wrap: break-word;
    display: flex !important;
    justify-content: space-between;
    align-items: center;
  }

  .table-card-mobile tbody td::before {
    content: attr(data-label);
    font-weight: 700;
    color: rgba(255, 255, 255, 0.7);
    margin-right: auto;
    padding-right: 1rem;
    white-space: nowrap;
    flex-basis: 40%;
    flex-shrink: 0;
  }

  /* The actual cell content */
  .table-card-mobile tbody td>* {
    text-align: right;
  }

  .table-card-mobile tbody td:last-child {
    border-bottom: 0;
  }

  /* Fix for Actions column */
  .table-card-mobile tbody td[data-label="Actions"] {
    justify-content: flex-end;
    flex-wrap: wrap;
    gap: 0.5rem;
  }

  .table-card-mobile tbody td[data-label="Actions"]::before {
    display: none;
  }
}