/* =============================================================================
   EPI Suite v2 - Custom Styles
   ============================================================================= */

/* -----------------------------------------------------------------------------
   CSS Variables & Bootstrap Overrides
   ----------------------------------------------------------------------------- */
:root {
  /* Theme colors */
  --bs-primary: #185394;
  --bs-primary-rgb: 24, 83, 148;
  --bs-light-rgb: 250, 249, 245;
  --bs-secondary-bg-subtle: #f0eee6;

  /* Border radii */
  --bs-border-radius: 0.75rem;
  --bs-border-radius-sm: 0.5rem;

  /* Links */
  --bs-link-color: #185394;
  --bs-link-color-rgb: 24, 83, 148;
  --bs-link-hover-color: #0d3a6a;
}

a {
  text-decoration: none;
}

a:hover {
  text-decoration: underline;
}

svg {
  max-width: 100%;
}

/* -----------------------------------------------------------------------------
   Typography & Form Elements
   ----------------------------------------------------------------------------- */
input, button, label, select, .btn, .form-control[type="file"], .form-select, .form-check-label {
  font-weight: 500;
}

.form-label {
  font-size: .75rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  margin-bottom: 0.15rem;
  color: var(--bs-dark);
}

.form-select, .form-check-input, .form-check-label {
  cursor: pointer;
}

/* Primary color override for Bootstrap */
.text-primary-vivid { color: #2a7de1 !important; } /* Brighter blue for emphasis */
.btn-primary {
  background-color: var(--bs-primary);
  border-color: var(--bs-primary);
}
.btn-primary:hover {
  background-color: #0d3a6a;
  border-color: #0d3a6a;
}
.btn-outline-primary {
  color: var(--bs-primary);
  border-color: var(--bs-primary);
}
.btn-outline-primary:hover {
  background-color: var(--bs-primary);
  border-color: var(--bs-primary);
}

/* -----------------------------------------------------------------------------
   Home Page Hero Section
   ----------------------------------------------------------------------------- */
.bg-home {
  background: linear-gradient(rgba(29, 77, 136, 0.5), rgba(10, 27, 48, 0.5)),
              url(../assets/images/home-background.svg),
              linear-gradient(#185394, #162e51);
  background-repeat: no-repeat;
  background-size: cover;
  background-position: center;
  min-height: 300px;
}

.bg-home-light {
  background: linear-gradient(rgba(255, 255, 255, 0.55), rgba(255, 255, 255, 0.45)),
              url(../assets/images/home-background.svg);
  background-repeat: no-repeat;
  background-size: cover;
  background-position: center;
}

/* -----------------------------------------------------------------------------
   Cards & Shadows
   ----------------------------------------------------------------------------- */
.card {
  --bs-card-cap-bg: white;
  --bs-card-border-width: 0;
  /* border-radius: var(--bs-border-radius); */
}

.card-header {
  background-color: white;
  border-bottom: none;
  /* border-bottom: 1px solid rgba(0, 0, 0, 0.1); */
  /* border-radius: var(--bs-border-radius) var(--bs-border-radius) 0 0; */
}

/* -----------------------------------------------------------------------------
   Tabs (Nav Tabs)
   ----------------------------------------------------------------------------- */
.nav-tabs .nav-link {
  border: none;
  border-bottom: 2px solid transparent;
  border-radius: 0;
  padding: 0.4rem 1rem;
  color: #6c757d;
  font-weight: 500;
  transition: all 0.15s ease-in-out;
}

.nav-tabs .nav-link:hover {
  border-color: transparent;
  color: var(--bs-primary);
}

.nav-tabs .nav-link.active {
  color: var(--bs-primary);
  border-bottom-color: var(--bs-primary);
  background-color: transparent;
}

/* -----------------------------------------------------------------------------
   Tables
   ----------------------------------------------------------------------------- */
.table {
  margin-bottom: 0;
}

.table th {
  font-weight: 600;
  white-space: nowrap;
}

.table-hover tbody tr:hover {
  background-color: rgba(24, 83, 148, 0.05);
}

/* Scrollable table container */
.table-responsive {
  border-radius: var(--bs-border-radius-sm);
}

/* -----------------------------------------------------------------------------
   Collapsible Sections (Native <details>)
   ----------------------------------------------------------------------------- */
details summary {
  cursor: pointer;
  user-select: none;
}

details summary::-webkit-details-marker {
  display: none;
}

details summary .bi {
  display: inline-block;
  transition: transform 0.2s ease-in-out;
}

details[open] summary .bi {
  transform: rotate(90deg);
}

details summary:hover {
  color: var(--bs-link-hover-color);
}

/* -----------------------------------------------------------------------------
   Print Styles
   ----------------------------------------------------------------------------- */
@media print {
  .no-print {
    display: none !important;
  }

  .pagebreak {
    page-break-inside: avoid;
    break-inside: avoid;
  }

  .bg-home,
  .bg-home-light {
    background: #f8f9fa !important;
    -webkit-print-color-adjust: exact;
    print-color-adjust: exact;
  }

  .card {
    box-shadow: none !important;
    border: 1px solid #dee2e6;
  }
}

/* -----------------------------------------------------------------------------
   Dropdown Menu Overrides
   ----------------------------------------------------------------------------- */
.dropdown-menu {
  border: 1px solid rgba(0, 0, 0, 0.1);
  box-shadow: 0 0.25rem 0.75rem rgba(0, 0, 0, 0.1);
  border-radius: var(--bs-border-radius-sm);
}

.dropdown-item {
  padding: 0.5rem 1rem;
  font-weight: 500;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.dropdown-item:hover {
  background-color: rgba(24, 83, 148, 0.1);
  color: var(--bs-primary);
}

.dropdown-item.active,
.dropdown-item:active,
.dropdown-item.active:hover {
  background-color: rgba(24, 83, 148, 0.1);
  color: var(--bs-primary);
}

/* -----------------------------------------------------------------------------
   Search Input & Autocomplete
   ----------------------------------------------------------------------------- */
.search-container {
  position: relative;
  max-width: 800px;
  margin: 0 auto;
}

.search-input {
  padding-right: 3rem;
  font-size: 1.1rem;
  border-radius: var(--bs-border-radius-sm);
  border: 2px solid rgba(255, 255, 255, 0.3);
  background: rgba(255, 255, 255, 0.95);
}

.search-input:focus {
  border-color: var(--bs-primary);
  box-shadow: 0 0 0 0.25rem rgba(24, 83, 148, 0.25);
}

/* Search autocomplete dropdown items */
.search-container .dropdown-item {
  white-space: normal;
}

.search-container .dropdown-item > div,
.search-container .dropdown-item > small {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  display: block;
}

/* -----------------------------------------------------------------------------
   Module List on Home Page
   ----------------------------------------------------------------------------- */
.module-list {
  list-style: none;
  padding: 0;
}

.module-list li {
  margin-bottom: 0.75rem;
  line-height: 1.5;
}

.module-list strong {
  color: var(--bs-primary);
}

/* -----------------------------------------------------------------------------
   Result Value Display (Summary Cards)
   ----------------------------------------------------------------------------- */
.result-value {
  font-size: 1.75rem;
  font-weight: 700;
  color: var(--bs-primary);
  font-variant-numeric: tabular-nums;
}

/* -----------------------------------------------------------------------------
   Model Output (Pre-formatted Text)
   ----------------------------------------------------------------------------- */
pre {
  font-size: 0.85rem;
  overflow-x: auto;
  white-space: pre-wrap;
  word-wrap: break-word;
}

/* -----------------------------------------------------------------------------
   Footer
   ----------------------------------------------------------------------------- */
.bg-primary-darker {
  background-color: #162e51;
}

.text-primary-light {
  color: #85c8ff !important;
}

footer a.text-light:hover {
  color: #85c8ff !important;
}

.flex-none-auto {
  flex: 0 0 auto;
}
