/* Custom styles for the admin interface */

body {
  background-color: white;
}

:root {
  --body-bg: none;
}

.login {
  background-color: #005b81;
}

h1 {
  color: #005b81;
}

#header {
  background-color: white;
}

#header a:link,
#header a:visited,
#logout-form button {
  color: black;
}

#user-tools {
  color: black;
}

#nav-sidebar {
  background-color: #005b81;
}

#nav-sidebar .current-model {
  color: white;
  background: hsla(0, 0%, 100%, .08);
}

#nav-filter {
  display: none;
}

nav .module tr {
  background-color: #005b81;
  height: 60px;
  align-items: center;
  font-size: .9375rem;
  padding-left: 29px;
}

#nav-sidebar .current-model {
  color: #fff;
  border-right: 5px solid #f2a900;
  background: hsla(0, 0%, 100%, .08);
}

#nav-sidebar tr th {
  padding-top: 22px;
  padding-left: 60px;
}

nav .module tr a {
  color: hsla(0, 0%, 100%, .65);
}

div .content {
  background: white;
}

.custom-header {
  background-color: #343a40;
  color: white;
  padding: 10px 20px;
}

.custom-logo {
  max-height: 50px;
  margin-right: 10px;
}

.custom-branding {
  display: flex;
  align-items: center;
}

/* Hide the delete option for foreign key fields in Django admin */
.related-widget-wrapper-link.delete-related {
  display: none !important;
}

.vTextField,
.vUUIDField {
  width: 12em;
}

/* Target form rows with multiple fields for inline display */
fieldset.module div.form-row label {
  font-weight: normal;
  /* Ensure labels are not bold */
}

fieldset.module div.form-row {
  display: flex;
  gap: 5px;
  /* Adds spacing between fields */
  flex-wrap: wrap;
  /* Allows wrapping if fields overflow */
}

/* Adjust field width for grouped fields */
fieldset.module div.form-row .field-vehicle_year,
fieldset.module div.form-row .field-vehicle_make,
fieldset.module div.form-row .field-vehicle_body_type,
fieldset.module div.form-row .field-vehicle_registration_plate_no,
fieldset.module div.form-row .field-owner_name_suffix,
fieldset.module div.form-row .field-owner_first_name,
fieldset.module div.form-row .field-owner_middle_name,
fieldset.module div.form-row .field-owner_last_name,
fieldset.module div.form-row .field-co_owner_name_suffix,
fieldset.module div.form-row .field-co_owner_first_name,
fieldset.module div.form-row .field-co_owner_middle_name,
fieldset.module div.form-row .field-co_owner_last_name,
fieldset.module div.form-row .field-current_mailing_address_street_number,
fieldset.module div.form-row .field-current_mailing_address_street_name,
fieldset.module div.form-row .field-current_mailing_address_apartment_number,
fieldset.module div.form-row .field-current_mailing_address_city,
fieldset.module div.form-row .field-current_mailing_address_state,
fieldset.module div.form-row .field-current_mailing_address_zip_code,
fieldset.module div.form-row .field-lien_holder_city,
fieldset.module div.form-row .field-lien_holder_state,
fieldset.module div.form-row .field-lien_holder_zip_code {
  flex: 1;
  /* Distribute fields equally across the row */
  min-width: 60px;
  /* Minimum width for better responsiveness */
}

#lien_form fieldset.module div.form-row label:not(.vCheckboxLabel) {
  display: block;
  width: 100%;
}

#lien_form fieldset.module div.form-row .vTextField,
#lien_form fieldset.module div.form-row select {
  /* width: 100%; */
}

#lien_form fieldset.module div.form-row.field-lien_is_ny_certificate_of_title {
  align-items: center;
}

/* Explicitly show required field asterisk in Django admin */
fieldset.module div.form-row label.required::after {
  content: "*";
  margin-left: 4px;
  color: #d9534f;
  font-weight: bold;
}

/* WHY: Hide Django 4.x theme toggle - not needed for this application and causes UI inconsistency with old server */
#toggle-nav-sidebar,
[data-theme-toggle],
.theme-toggle,
button[title="Toggle theme"],
#header button[title*="theme"],
form[id*="theme"],
#theme-toggle {
  display: none !important;
}

/* Hide the color scheme toggle that appears in Django 4.1+ admin */
[for="id_theme"],
#id_theme,
.field-theme {
  display: none !important;
}

/* WHY: Hide Django 4.1+ color scheme toggle button - matches old server appearance */
button.theme-toggle {
  display: none !important;
}
/* WHY: Updated footer styling to match old server - right-aligned with smaller font */
.custom-footer {
  background-color: #005b81;
  color: white;
  text-align: right;
  padding: 8px 20px;
  position: fixed;
  bottom: 0;
  right: 0;
  width: auto;
  font-size: 0.75rem;
  z-index: 1000;
}

.custom-footer a {
  color: white;
  text-decoration: none;
}

.custom-footer a:hover {
  text-decoration: underline;
}

.login .custom-footer {
  display: none;
}
