/* ==========================================================================
   OKSHPO SHARE — design layer over Bootstrap 3
   Loaded after bootstrap.min.css and styles.css so its rules win.
   ========================================================================== */

:root {
  --font-sans: "Inter", -apple-system, BlinkMacSystemFont, "Segoe UI",
    Roboto, "Helvetica Neue", Arial, sans-serif;
  --ink: #1a202c;
  --ink-soft: #4a5568;
  --ink-faint: #8492a6;
  --bg: #ffffff;
  --bg-subtle: #f7f9fb;
  --border: #e3e8ef;
  --border-strong: #cbd4e0;
  --accent: #1f4e6b;
  --accent-hover: #17405a;
  --accent-soft: #eaf1f6;
  --radius: 8px;
  --radius-sm: 6px;
  --shadow-sm: 0 1px 2px rgba(16, 24, 40, 0.06);
  --shadow-md: 0 4px 16px rgba(16, 24, 40, 0.10);
  --shadow-lg: 0 12px 32px rgba(16, 24, 40, 0.14);
}

/* --------------------------------------------------------------------------
   Base typography
   -------------------------------------------------------------------------- */

html {
  font-size: 16px;
}

body {
  font-family: var(--font-sans);
  color: var(--ink);
  background: var(--bg);
  font-size: 16px;
  line-height: 1.65;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

h1, h2, h3, h4, h5, h6,
.h1, .h2, .h3, .h4, .h5, .h6 {
  font-family: var(--font-sans);
  font-weight: 650;
  letter-spacing: -0.02em;
  color: var(--ink);
  line-height: 1.25;
}

h1, .h1 { font-size: 2rem; margin: 1.5rem 0 1rem; }
h2, .h2 { font-size: 1.5rem; margin: 1.5rem 0 0.75rem; }
h3, .h3 { font-size: 1.25rem; }
h4, .h4 { font-size: 1.05rem; }

p {
  margin-bottom: 1rem;
}

a {
  color: var(--accent);
  transition: color 120ms ease;
}

a:hover, a:focus {
  color: var(--accent-hover);
  text-decoration: none;
}

hr {
  border-top: 1px solid var(--border);
}

/* Bootstrap 3's .page-header: drop the old underline look */
.page-header {
  border-bottom: none;
  padding-bottom: 0;
  margin: 2.5rem 0 1.5rem;
}

::selection {
  background: var(--accent-soft);
  color: var(--accent-hover);
}

/* --------------------------------------------------------------------------
   Navbar — override navbar-inverse into a clean white bar
   -------------------------------------------------------------------------- */

.navbar-inverse {
  background: rgba(255, 255, 255, 0.92);
  backdrop-filter: saturate(180%) blur(8px);
  -webkit-backdrop-filter: saturate(180%) blur(8px);
  /* backdrop-filter creates a stacking context; must sit above
     Leaflet's panes/controls (z-index up to 1000) or nav dropdowns
     render underneath the map */
  position: relative;
  z-index: 1100;
  border: none;
  border-bottom: 1px solid var(--border);
  border-radius: 0;
  margin-bottom: 0;
  min-height: 64px;
}

.navbar-inverse .navbar-brand {
  color: var(--ink);
  font-weight: 700;
  letter-spacing: -0.02em;
  font-size: 1.1rem;
  height: 64px;
  line-height: 34px;
}

.navbar-inverse .navbar-brand:hover,
.navbar-inverse .navbar-brand:focus {
  color: var(--accent);
}

.navbar-inverse .navbar-nav > li > a {
  color: var(--ink-soft);
  font-size: 0.925rem;
  font-weight: 500;
  height: 64px;
  line-height: 34px;
  transition: color 120ms ease;
}

.navbar-inverse .navbar-nav > li > a:hover,
.navbar-inverse .navbar-nav > li > a:focus {
  color: var(--ink);
  background: transparent;
}

.navbar-inverse .navbar-nav > .open > a,
.navbar-inverse .navbar-nav > .open > a:hover,
.navbar-inverse .navbar-nav > .open > a:focus {
  color: var(--ink);
  background: var(--bg-subtle);
}

.navbar-inverse .navbar-nav > .active > a,
.navbar-inverse .navbar-nav > .active > a:hover,
.navbar-inverse .navbar-nav > .active > a:focus {
  color: var(--accent);
  background: transparent;
}

.navbar-inverse .navbar-toggle {
  border-color: var(--border-strong);
}

.navbar-inverse .navbar-toggle .icon-bar {
  background-color: var(--ink-soft);
}

.navbar-inverse .navbar-toggle:hover,
.navbar-inverse .navbar-toggle:focus {
  background-color: var(--bg-subtle);
}

.navbar-inverse .navbar-collapse,
.navbar-inverse .navbar-form {
  border-color: var(--border);
}

/* Dropdown menus */
.dropdown-menu {
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow-md);
  padding: 6px;
  margin-top: 6px;
  min-width: 200px;
}

.dropdown-menu > li > a {
  color: var(--ink-soft);
  font-size: 0.9rem;
  padding: 8px 12px;
  border-radius: var(--radius-sm);
  transition: background 100ms ease, color 100ms ease;
}

.dropdown-menu > li > a:hover,
.dropdown-menu > li > a:focus {
  color: var(--ink);
  background: var(--bg-subtle);
}

.caret {
  opacity: 0.5;
}

/* Mobile collapsed nav */
@media (max-width: 767px) {
  .navbar-inverse .navbar-nav > li > a {
    height: auto;
    line-height: 1.5;
  }
  .navbar-inverse .navbar-nav .open .dropdown-menu > li > a {
    color: var(--ink-soft);
  }
  .navbar-inverse .navbar-nav .open .dropdown-menu > li > a:hover {
    color: var(--ink);
  }
}

/* --------------------------------------------------------------------------
   Forms — modernize every .form-control / quick_form in the app
   -------------------------------------------------------------------------- */

label,
.control-label {
  font-weight: 600;
  font-size: 0.875rem;
  color: var(--ink);
  margin-bottom: 6px;
}

.form-group {
  margin-bottom: 1.25rem;
}

.form-control {
  height: 42px;
  padding: 8px 14px;
  font-size: 0.95rem;
  color: var(--ink);
  background: var(--bg);
  border: 1px solid var(--border-strong);
  border-radius: var(--radius-sm);
  box-shadow: none;
  transition: border-color 120ms ease, box-shadow 120ms ease;
}

textarea.form-control {
  height: auto;
  min-height: 96px;
}

.form-control:focus {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px var(--accent-soft);
  outline: none;
}

.form-control::placeholder {
  color: var(--ink-faint);
}

select.form-control {
  -webkit-appearance: none;
  -moz-appearance: none;
  appearance: none;
  background-image: url("data:image/svg+xml;charset=utf-8,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8' viewBox='0 0 12 8'%3E%3Cpath fill='%234a5568' d='M6 8 0 0h12z'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 14px center;
  background-size: 10px;
  padding-right: 36px;
}

.help-block {
  color: var(--ink-faint);
  font-size: 0.825rem;
}

.has-error .form-control {
  border-color: #d64545;
}

.has-error .control-label,
.has-error .help-block {
  color: #b83232;
}

/* --------------------------------------------------------------------------
   Buttons
   -------------------------------------------------------------------------- */

.btn {
  font-weight: 550;
  font-size: 0.925rem;
  padding: 9px 18px;
  border-radius: var(--radius-sm);
  transition: background 120ms ease, border-color 120ms ease,
    color 120ms ease, box-shadow 120ms ease;
}

.btn-default {
  color: var(--ink);
  background: var(--bg);
  border: 1px solid var(--border-strong);
  box-shadow: var(--shadow-sm);
}

.btn-default:hover,
.btn-default:focus {
  background: var(--bg-subtle);
  border-color: var(--border-strong);
  color: var(--ink);
}

.btn-primary,
.btn-info {
  color: #fff;
  background: var(--accent);
  border: 1px solid var(--accent);
  box-shadow: var(--shadow-sm);
}

.btn-primary:hover,
.btn-primary:focus,
.btn-info:hover,
.btn-info:focus {
  background: var(--accent-hover);
  border-color: var(--accent-hover);
  color: #fff;
}

.btn-lg {
  padding: 12px 24px;
  font-size: 1rem;
}

/* --------------------------------------------------------------------------
   Tables (incl. DataTables)
   -------------------------------------------------------------------------- */

table.table,
table.dataTable {
  border-collapse: collapse !important;
  font-size: 0.925rem;
}

.table > thead > tr > th,
table.dataTable thead th,
table.dataTable thead td {
  font-size: 0.8rem;
  font-weight: 650;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: var(--ink-soft);
  background: var(--bg-subtle);
  border-bottom: 1px solid var(--border);
  border-top: none;
  padding: 12px 14px;
}

.table > tbody > tr > td,
table.dataTable tbody th,
table.dataTable tbody td {
  padding: 12px 14px;
  border-top: none;
  border-bottom: 1px solid var(--border);
  vertical-align: middle;
  color: var(--ink);
}

.table-striped > tbody > tr:nth-of-type(odd),
table.dataTable.stripe tbody tr.odd,
table.dataTable.display tbody tr.odd {
  background: var(--bg);
}

.table-hover > tbody > tr:hover,
table.dataTable.hover tbody tr:hover,
table.dataTable.display tbody tr:hover {
  background: var(--bg-subtle);
}

table.dataTable.no-footer {
  border-bottom: 1px solid var(--border);
}

/* DataTables chrome: search box, length select, pagination, info */
.dataTables_wrapper .dataTables_filter input,
.dataTables_wrapper .dataTables_length select {
  border: 1px solid var(--border-strong);
  border-radius: var(--radius-sm);
  padding: 6px 10px;
  margin-left: 6px;
  background: var(--bg);
  color: var(--ink);
}

.dataTables_wrapper .dataTables_filter input:focus {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px var(--accent-soft);
  outline: none;
}

.dataTables_wrapper .dataTables_info,
.dataTables_wrapper .dataTables_length,
.dataTables_wrapper .dataTables_filter {
  color: var(--ink-faint);
  font-size: 0.875rem;
  padding-top: 8px;
  padding-bottom: 8px;
}

.dataTables_wrapper .dataTables_paginate .paginate_button {
  border-radius: var(--radius-sm);
  border: 1px solid transparent;
  color: var(--ink-soft) !important;
  padding: 6px 12px;
}

.dataTables_wrapper .dataTables_paginate .paginate_button:hover {
  background: var(--bg-subtle);
  border: 1px solid var(--border);
  color: var(--ink) !important;
}

.dataTables_wrapper .dataTables_paginate .paginate_button.current,
.dataTables_wrapper .dataTables_paginate .paginate_button.current:hover {
  background: var(--accent);
  border: 1px solid var(--accent);
  color: #fff !important;
}

/* Bootstrap pagination */
.pagination > li > a,
.pagination > li > span {
  color: var(--ink-soft);
  border-color: var(--border);
}

.pagination > .active > a,
.pagination > .active > a:hover {
  background: var(--accent);
  border-color: var(--accent);
}

/* --------------------------------------------------------------------------
   Alerts / flash messages
   -------------------------------------------------------------------------- */

.alert {
  border-radius: var(--radius);
  border: 1px solid var(--border);
  box-shadow: var(--shadow-sm);
  font-size: 0.925rem;
  padding: 14px 18px;
}

.alert-warning {
  background: #fff9ec;
  border-color: #f2e3bc;
  color: #8a6716;
}

.alert-success {
  background: #f0faf4;
  border-color: #c9e9d5;
  color: #23694a;
}

.alert-danger {
  background: #fdf2f2;
  border-color: #f3cfcf;
  color: #9d3030;
}

.alert .close {
  opacity: 0.4;
}

/* --------------------------------------------------------------------------
   Panels → soft cards
   -------------------------------------------------------------------------- */

.panel,
.well {
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow-sm);
  background: var(--bg);
}

.well {
  padding: 24px;
}

.panel-heading {
  background: var(--bg-subtle);
  border-bottom: 1px solid var(--border);
  border-radius: var(--radius) var(--radius) 0 0;
  font-weight: 600;
}

.panel-default > .panel-heading {
  color: var(--ink);
  background: var(--bg-subtle);
}

/* --------------------------------------------------------------------------
   Page shell + footer
   -------------------------------------------------------------------------- */

.page-shell {
  min-height: calc(100vh - 64px - 96px);
  padding-top: 1rem;
}

.site-footer {
  border-top: 1px solid var(--border);
  background: var(--bg-subtle);
  padding: 28px 0;
  margin-top: 48px;
}

.site-footer p {
  margin: 0;
  font-size: 0.875rem;
  color: var(--ink-faint);
}

/* --------------------------------------------------------------------------
   Homepage hero + action cards
   -------------------------------------------------------------------------- */

.hero {
  text-align: center;
  padding: 64px 16px 40px;
  max-width: 760px;
  margin: 0 auto;
}

.hero img.hero-logo {
  width: 340px;
  max-width: 90%;
  height: auto;
  margin-bottom: 32px;
}

.hero h1 {
  font-size: 2.4rem;
  font-weight: 700;
  letter-spacing: -0.03em;
  margin: 0 0 16px;
}

.hero p.lead {
  font-size: 1.1rem;
  font-weight: 400;
  color: var(--ink-soft);
  line-height: 1.7;
  margin-bottom: 0;
}

.action-cards {
  display: flex;
  flex-wrap: wrap;
  gap: 20px;
  justify-content: center;
  max-width: 1000px;
  margin: 24px auto 48px;
  padding: 0 16px;
}

.action-card {
  flex: 1 1 210px;
  max-width: 260px;
  display: block;
  padding: 24px 22px;
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow-sm);
  text-decoration: none;
  transition: box-shadow 150ms ease, transform 150ms ease,
    border-color 150ms ease;
}

.action-card:hover,
.action-card:focus {
  box-shadow: var(--shadow-md);
  transform: translateY(-2px);
  border-color: var(--border-strong);
  text-decoration: none;
}

.action-card h3 {
  font-size: 1rem;
  font-weight: 650;
  margin: 0 0 6px;
  color: var(--ink);
}

.action-card p {
  font-size: 0.875rem;
  color: var(--ink-faint);
  margin: 0;
  line-height: 1.5;
}

.action-card .card-arrow {
  display: inline-block;
  margin-top: 12px;
  font-size: 0.875rem;
  font-weight: 550;
  color: var(--accent);
}

/* --------------------------------------------------------------------------
   Loading overlay (shown while a search/form submission is in flight)
   -------------------------------------------------------------------------- */

.loading-overlay {
  position: fixed;
  inset: 0;
  z-index: 2000; /* above navbar (1100) and Leaflet (1000) */
  display: none;
  align-items: center;
  justify-content: center;
  flex-direction: column;
  gap: 16px;
  background: rgba(255, 255, 255, 0.75);
  backdrop-filter: blur(2px);
  -webkit-backdrop-filter: blur(2px);
}

.loading-overlay.is-active {
  display: flex;
}

.loading-overlay .spinner {
  width: 44px;
  height: 44px;
  border: 4px solid var(--accent-soft);
  border-top-color: var(--accent);
  border-radius: 50%;
  animation: loading-spin 0.8s linear infinite;
}

.loading-overlay .loading-text {
  font-size: 0.95rem;
  font-weight: 550;
  color: var(--ink-soft);
}

@keyframes loading-spin {
  to { transform: rotate(360deg); }
}

/* --------------------------------------------------------------------------
   Misc cleanup
   -------------------------------------------------------------------------- */

/* Old inline map sizing in styles.css hardcodes 1200px; keep it responsive */
#map {
  max-width: 100%;
}

/* Legacy <center> blocks on some pages */
center img {
  max-width: 100%;
}
