/* ============================================================
   SWFTLab LIMS — Brightened Scientific Theme
   Cleaner, research-grade Bootstrap overrides
   ============================================================ */

/* Global font size adjustment - scale down to match 80% zoom appearance */
html {
  font-size: 80%;
}

/* Global Bootstrap Color Overrides */
:root {
  --bs-primary: #607d8b; /* modern blue-gray */
  --bs-secondary: #90a4ae; /* soft cool-gray */
  --bs-success: #6fae94; /* pleasant scientific green */
  --bs-danger: #b97b7b; /* muted rose-red */
  --bs-warning: #cfb06a; /* desaturated lab-gold */
  --bs-info: #5c7ea5; /* analytical steel blue */
  --bs-light: #eceff1; /* light gray */
  --bs-dark: #37474f; /* deep blue-gray */

  --bs-primary-hover: #546e7a;
  --bs-secondary-hover: #78909c;

  /* Soft, analytic UI background */
  --bs-body-color: #2c2c2c;
  --bs-body-bg: #fafbfc;
}

/* Base button softness */
.btn {
  border-radius: 6px;
}

/* Softer focus ring */
:root {
  --bs-focus-ring-color: rgba(96, 125, 139, 0.35);
}

/* Muted link colors */
a {
  color: var(--bs-info);
}

a:hover {
  color: var(--bs-primary);
}

/* Softer card UI */
.card {
  border-radius: 10px;
  box-shadow: 0px 1px 8px rgba(0, 0, 0, 0.05);
}

/* ============================================================
   BUTTON OVERRIDES
   ============================================================ */

.btn-primary {
  background-color: var(--bs-primary) !important;
  border-color: var(--bs-primary) !important;
  color: #fff !important;
}

.btn-primary:hover,
.btn-primary:focus {
  background-color: var(--bs-primary-hover) !important;
  border-color: var(--bs-primary-hover) !important;
}

.btn-outline-primary {
  color: var(--bs-primary) !important;
  border-color: var(--bs-primary) !important;
}

.btn-outline-primary:hover {
  background-color: var(--bs-primary) !important;
  color: #fff !important;
}

/* ============================================================
   NAVBAR ACTIVE LINK - Mobile: underline only below text
   ============================================================ */

/* Mobile: Active nav-link underline only below text, not full width */
@media (max-width: 991.98px) {
  .navbar-collapse .nav-link.active.border-bottom {
    border-bottom: none !important;
    text-decoration: underline;
    text-decoration-thickness: 3px;
    text-underline-offset: 0.3rem;
    text-decoration-color: var(--bs-dark);
  }

  /* Ensure mobile nav toggler is on the right */
  .navbar .container {
    display: flex;
    align-items: center;
  }
  
  .navbar .navbar-toggler[data-bs-target="#mainNavbar"] {
    margin-left: auto !important;
  }
  
  /* Right-align mobile dropdown menu content */
  .navbar-collapse {
    text-align: right;
  }
  
  .navbar-collapse .navbar-nav {
    align-items: flex-end;
  }
  
  .navbar-collapse .nav-item {
    text-align: right;
  }
  
  .navbar-collapse .nav-link {
    text-align: right;
    justify-content: flex-end;
  }
  
  /* Ensure dropdown menu is right-aligned */
  .navbar-collapse .dropdown-menu {
    right: 0;
    left: auto;
  }
}

/* ============================================================
   SWFTLab LIMS — Ultra-Soft Table Styling
   ============================================================ */

/* Softer header border + lighter header */
.table thead {
  background-color: var(--bs-light) !important;
  border-bottom: 0.5px solid rgba(96, 125, 139, 0.08) !important;
}

/* STRIPES: ultra-soft gray-blues */
.table-striped > tbody > tr:nth-of-type(odd) {
  --bs-table-bg: #fbfcfd; /* almost white */
  background-color: #fbfcfd !important;
}

.table-striped > tbody > tr:nth-of-type(even) {
  --bs-table-bg: #f7f9fa; /* soft neutral */
  background-color: #f7f9fa !important;
}

/* HOVER — subtle blue-gray tint that works on both stripes */
.table-hover tbody tr:hover {
  background-color: rgba(96, 125, 139, 0.06) !important;
}

/* Comfortable but compact spacing */
.table-compact tbody tr td,
.table-compact thead tr th {
  padding-top: 0.55rem !important;
  padding-bottom: 0.55rem !important;
}

/* Optional: super-light row separators */
.table-compact tbody tr {
  border-bottom: 0.5px solid rgba(0, 0, 0, 0.03);
}

/* ================================
   SWFTLabs LIMS Pagination Styling
   For Pagy v43 Bootstrap nav
   ================================ */

.pagy-bootstrap .pagination {
  margin-top: 1rem;
  gap: 4px; /* spacing between page items */
}

.pagy-bootstrap .page-item .page-link {
  border-radius: 6px;
  color: var(--bs-info); /* neutral scientific blue */
  border: 1px solid transparent;
  padding: 4px 10px;
  background-color: transparent;
}

/* Active Page */
.pagy-bootstrap .page-item.active .page-link {
  background-color: var(--bs-primary);
  border-color: var(--bs-primary);
  color: white !important;
}

/* Hover */
.pagy-bootstrap .page-item:not(.active) .page-link:hover {
  background-color: rgba(96, 125, 139, 0.15); /* scientific cool hover */
  border-color: rgba(96, 125, 139, 0.25);
  color: var(--bs-primary);
}

/* Disabled arrows (Previous/Next) */
.pagy-bootstrap .page-item.disabled .page-link {
  color: #b0b7bb; /* muted */
  background-color: transparent;
  opacity: 0.5;
}

.list-group-item-action:hover {
  background-color: rgba(
    96,
    125,
    139,
    0.1
  ) !important; /* soft scientific tint */
  border-color: var(--bs-primary) !important;
  color: var(--bs-primary) !important;
  cursor: pointer;
}

/* ============================================================
   DROPDOWN MENU STYLING - Theme-consistent hover
   ============================================================ */

/* Remove Bootstrap's default blue hover and use theme colors */
.dropdown-item {
  color: var(--bs-body-color) !important;
  transition: background-color 0.15s ease-in-out, color 0.15s ease-in-out;
}

.dropdown-item:hover,
.dropdown-item:focus {
  background-color: rgba(96, 125, 139, 0.2) !important; /* prominent scientific tint */
  color: var(--bs-primary) !important;
}

.dropdown-item.active {
  background-color: var(--bs-primary) !important;
  color: #fff !important;
}

.dropdown-item.active:hover,
.dropdown-item.active:focus {
  background-color: var(--bs-primary-hover) !important;
  color: #fff !important;
}

/* ============================================================
   REMOVE SPINNER ARROWS FROM NUMBER INPUTS
   ============================================================ */

/* Hide spinner arrows in WebKit browsers (Chrome, Safari, Edge) */
input[type='number']::-webkit-inner-spin-button,
input[type='number']::-webkit-outer-spin-button {
  -webkit-appearance: none;
  margin: 0;
}

/* Hide spinner arrows in Firefox */
input[type='number'] {
  -moz-appearance: textfield;
}

/* ============================================================
   MODAL BACKDROP - Light, user-friendly backdrop with blur effect
   ============================================================ */

.modal-backdrop {
  background-color: rgba(0, 0, 0, 0.4) !important;
  opacity: 1 !important;
  backdrop-filter: blur(3px);
  -webkit-backdrop-filter: blur(3px);
}

/* ============================================================
   TABLE HORIZONTAL SCROLL
   ============================================================ */

/* Ensure tables have horizontal scroll when they overflow */
.table-responsive {
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
}

/* For tables not wrapped in table-responsive, add scroll */
table.table {
  min-width: 100%;
}

/* Container for tables - add horizontal scroll */
.table-container,
.table-wrapper {
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
}

/* ============================================================
   SIDEBAR LAYOUT HORIZONTAL SCROLL
   ============================================================ */

/* Ensure sidebar layout allows horizontal scroll when content overflows */
.sidebar-layout-container {
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
}

/* Prevent sidebar from shrinking */
.sidebar-layout-container > aside {
  flex-shrink: 0;
}

/* Allow main content to scroll horizontally */
.sidebar-layout-container > main {
  min-width: 0;
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
}
