/* ==========================================================
   nc-compat.css — Bootstrap 3 → 5.3 compat shim for netcat_template
   ==========================================================
   Restores minimal visual equivalents for BS3 classes that are
   still referenced by class/* PHP templates (read-only per AGENTS.md)
   and by legacy HTML comments in template/113/*.
   Navbar/dropdown/carousel styles live in netcat_files/design/style.css.
   Keep this file small. Remove rules as templates are fully migrated.

   [TEMP-DEV] File is linked from template/113/* <head> for local dev.
   For production: keep the link (class/* still needs these shims),
   or inline the required rules into style.css and remove this file.
   ========================================================== */

/* --- Glyphicons (BS3 font removed in BS5; use unicode fallback
       before migrating to Font Awesome from asset/icons_font_awesome/5.12.0) --- */

.glyphicon,
.glyphicon-chevron-left,
.glyphicon-chevron-right,
.glyphicon-chevron-up,
.glyphicon-chevron-down,
.glyphicon-menu-down,
.glyphicon-menu-right {
  display: inline-block;
  width: 1em;
  height: 1em;
  line-height: 1em;
  vertical-align: -0.125em;
  text-align: center;
  font-family: inherit;
}

.glyphicon-chevron-left::before   { content: "\2190"; } /* ← */
.glyphicon-chevron-right::before  { content: "\2192"; } /* → */
.glyphicon-chevron-up::before     { content: "\2191"; } /* ↑ */
.glyphicon-chevron-down::before   { content: "\2193"; } /* ↓ */
.glyphicon-menu-down::before      { content: "\25BC"; } /* ▼ */
.glyphicon-menu-right::before     { content: "\25B6"; } /* ▶ */

/* --- .caret (BS3 dropdown triangle; legacy markup uses <b class="caret">) --- */
.caret {
  display: inline-block;
  width: 0;
  height: 0;
  margin-left: 0.255em;
  vertical-align: 0.125em;
  border-top: 0.30em solid;
  border-right: 0.30em solid transparent;
  border-left: 0.30em solid transparent;
}

/* --- .pull-left / .pull-right (BS5: .float-start / .float-end) --- */
.pull-left  { float: left !important; }
.pull-right { float: right !important; }

/* --- .container-fluid (BS5 class, not in bootstrap.min.css) --- */
.container-fluid {
  width: 100%;
  padding-right: calc(var(--bs-gutter-x, 1.5rem) * .5);
  padding-left: calc(var(--bs-gutter-x, 1.5rem) * .5);
  margin-right: auto;
  margin-left: auto;
}

/* --- .text-right (BS3 class, BS5: .text-end) --- */
.text-right {
  text-align: right !important;
}

/* --- .hidden-xs, .visible-xs (BS3 responsive visibility, BS5: .d-none, .d-block) --- */
.hidden-xs {
  display: none !important;
}

.visible-xs {
  display: none !important;
}

@media (max-width: 575.98px) {
  .hidden-xs {
    display: inherit !important;
  }
  
  .visible-xs {
    display: block !important;
  }
}

/* --- .col-xs-* (BS3 extra-small columns, BS5: .col-*) --- */
.col-xs-1 { flex: 0 0 auto; width: 8.33333333%; }
.col-xs-2 { flex: 0 0 auto; width: 16.66666667%; }
.col-xs-3 { flex: 0 0 auto; width: 25%; }
.col-xs-4 { flex: 0 0 auto; width: 33.33333333%; }
.col-xs-5 { flex: 0 0 auto; width: 41.66666667%; }
.col-xs-6 { flex: 0 0 auto; width: 50%; }
.col-xs-7 { flex: 0 0 auto; width: 58.33333333%; }
.col-xs-8 { flex: 0 0 auto; width: 66.66666667%; }
.col-xs-9 { flex: 0 0 auto; width: 75%; }
.col-xs-10 { flex: 0 0 auto; width: 83.33333333%; }
.col-xs-11 { flex: 0 0 auto; width: 91.66666667%; }
.col-xs-12 { flex: 0 0 auto; width: 100%; }

/* --- .col-xs-offset-* (BS3 extra-small column offsets) --- */
.col-xs-offset-1 { margin-left: 8.33333333%; }
.col-xs-offset-2 { margin-left: 16.66666667%; }
.col-xs-offset-3 { margin-left: 25%; }
.col-xs-offset-4 { margin-left: 33.33333333%; }
.col-xs-offset-5 { margin-left: 41.66666667%; }
.col-xs-offset-6 { margin-left: 50%; }
.col-xs-offset-7 { margin-left: 58.33333333%; }
.col-xs-offset-8 { margin-left: 66.66666667%; }
.col-xs-offset-9 { margin-left: 75%; }
.col-xs-offset-10 { margin-left: 83.33333333%; }
.col-xs-offset-11 { margin-left: 91.66666667%; }

/* --- .navbar-dark (BS5 class, not in bootstrap.min.css) --- */
.navbar-dark {
  --bs-navbar-color: rgba(255, 255, 255, 0.55);
  --bs-navbar-hover-color: rgba(255, 255, 255, 0.75);
  --bs-navbar-disabled-color: rgba(255, 255, 255, 0.3);
  --bs-navbar-disabled-hover-color: rgba(255, 255, 255, 0.3);
  --bs-navbar-active-color: #fff;
  --bs-navbar-brand-color: #fff;
  --bs-navbar-brand-hover-color: #fff;
}

/* --- .page-item, .page-link (BS5 pagination, not in bootstrap.min.css) --- */
.page-item {
  display: list-item;
}

.page-link {
  position: relative;
  display: block;
  padding: 0.375rem 0.75rem;
  color: var(--bs-link-color, #0d6efd);
  text-decoration: none;
  background-color: var(--bs-body-bg, #fff);
  border: 1px solid var(--bs-border-color, #dee2e6);
  transition: color 0.15s ease-in-out, background-color 0.15s ease-in-out, border-color 0.15s ease-in-out, box-shadow 0.15s ease-in-out;
}

.page-link:hover {
  z-index: 2;
  color: var(--bs-link-hover-color, #0a58ca);
  background-color: var(--bs-tertiary-bg, #f8f9fa);
  border-color: var(--bs-border-color, #dee2e6);
}

.page-link:focus {
  z-index: 3;
  color: var(--bs-link-hover-color, #0a58ca);
  background-color: var(--bs-tertiary-bg, #f8f9fa);
  outline: 0;
  box-shadow: 0 0 0 0.25rem rgba(13, 110, 253, 0.25);
}

.page-item.active .page-link {
  z-index: 3;
  color: #fff;
  background-color: var(--bs-primary, #0d6efd);
  border-color: var(--bs-primary, #0d6efd);
}

/* --- .close (BS3 modal close button, BS5: .btn-close) --- */
.close {
  float: right;
  font-size: calc(1.5rem + 0.75vw);
  font-weight: 700;
  line-height: 1;
  color: #000;
  opacity: 0.5;
  border: 0;
  background: transparent;
}

.close:hover,
.close:focus {
  opacity: 0.75;
}

.close::before {
  content: "\00d7";
}

/* --- .col-{sm,md,lg}-offset-* (BS3 column offsets, BS5: .offset-{sm,md,lg}-*) --- */
@media (min-width: 576px) {
  .col-sm-offset-1 { margin-left: 8.33333333%; }
  .col-sm-offset-2 { margin-left: 16.66666667%; }
  .col-sm-offset-3 { margin-left: 25%; }
  .col-sm-offset-4 { margin-left: 33.33333333%; }
  .col-sm-offset-5 { margin-left: 41.66666667%; }
  .col-sm-offset-6 { margin-left: 50%; }
  .col-sm-offset-7 { margin-left: 58.33333333%; }
  .col-sm-offset-8 { margin-left: 66.66666667%; }
  .col-sm-offset-9 { margin-left: 75%; }
  .col-sm-offset-10 { margin-left: 83.33333333%; }
  .col-sm-offset-11 { margin-left: 91.66666667%; }
}

@media (min-width: 768px) {
  .col-md-offset-1 { margin-left: 8.33333333%; }
  .col-md-offset-2 { margin-left: 16.66666667%; }
  .col-md-offset-3 { margin-left: 25%; }
  .col-md-offset-4 { margin-left: 33.33333333%; }
  .col-md-offset-5 { margin-left: 41.66666667%; }
  .col-md-offset-6 { margin-left: 50%; }
  .col-md-offset-7 { margin-left: 58.33333333%; }
  .col-md-offset-8 { margin-left: 66.66666667%; }
  .col-md-offset-9 { margin-left: 75%; }
  .col-md-offset-10 { margin-left: 83.33333333%; }
  .col-md-offset-11 { margin-left: 91.66666667%; }
}

@media (min-width: 992px) {
  .col-lg-offset-1 { margin-left: 8.33333333%; }
  .col-lg-offset-2 { margin-left: 16.66666667%; }
  .col-lg-offset-3 { margin-left: 25%; }
  .col-lg-offset-4 { margin-left: 33.33333333%; }
  .col-lg-offset-5 { margin-left: 41.66666667%; }
  .col-lg-offset-6 { margin-left: 50%; }
  .col-lg-offset-7 { margin-left: 58.33333333%; }
  .col-lg-offset-8 { margin-left: 66.66666667%; }
  .col-lg-offset-9 { margin-left: 75%; }
  .col-lg-offset-10 { margin-left: 83.33333333%; }
  .col-lg-offset-11 { margin-left: 91.66666667%; }
}

/* --- .img-responsive (BS5: .img-fluid) — legacy markup in class/* templates --- */
.img-responsive {
  display: block;
  max-width: 100%;
  height: auto;
}

/* --- .img-thumbnail (BS5 has it, but class/* uses it combined with
        .img-responsive; ensure border + padding survive) --- */
.img-responsive.img-thumbnail,
.img-thumbnail.img-responsive {
  padding: 4px;
  border: 1px solid #dee2e6;
  border-radius: 0.25rem;
  background-color: #fff;
}

/* --- .btn-default (BS5: .btn-secondary) — class/* PHP templates --- */
.btn-default {
  color: #333;
  background-color: #fff;
  border-color: #ccc;
}

.btn-default:hover,
.btn-default:focus,
.btn-default:active {
  color: #333;
  background-color: #e6e6e6;
  border-color: #adadad;
}

/* --- .nav-tabs, .nav-pills (BS5 has them; ensure .nav > li > a still works
        for class/* legacy markup) --- */
.nav-tabs,
.nav-pills {
  display: flex;
  flex-wrap: wrap;
  padding-left: 0;
  margin-bottom: 0;
  list-style: none;
}

.nav-tabs > li,
.nav-pills > li {
  display: block;
}

.nav-tabs > li > a,
.nav-tabs > li > .nav-link,
.nav-pills > li > a,
.nav-pills > li > .nav-link {
  display: block;
  padding: 0.5rem 1rem;
  color: var(--bs-link-color, #0d6efd);
  text-decoration: none;
}

.nav-tabs {
  border-bottom: 1px solid #dee2e6;
}

.nav-tabs > li > a,
.nav-tabs > li > .nav-link {
  margin-bottom: -1px;
  border: 1px solid transparent;
  border-top-left-radius: 0.25rem;
  border-top-right-radius: 0.25rem;
}

.nav-tabs > li.active > a,
.nav-tabs > li.active > .nav-link {
  color: #495057;
  background-color: #fff;
  border-color: #dee2e6 #dee2e6 #fff #dee2e6;
}

.nav-pills > li.active > a,
.nav-pills > li.active > .nav-link {
  color: #fff;
  background-color: var(--bs-primary, #0d6efd);
}

/* --- .panel, .panel-body, .panel-heading (BS3, removed in BS5) —
        class/2002/AddTemplate.html uses these --- */
.panel {
  background-color: #fff;
  border: 1px solid transparent;
  border-radius: 0.25rem;
  box-shadow: 0 1px 1px rgba(0, 0, 0, 0.05);
  margin-bottom: 1rem;
}

.panel-body {
  padding: 15px;
}

.panel-heading {
  padding: 10px 15px;
  border-bottom: 1px solid transparent;
  border-top-left-radius: calc(0.25rem - 1px);
  border-top-right-radius: calc(0.25rem - 1px);
  background-color: #f5f5f5;
  color: #333;
  font-weight: 600;
}

.panel-default {
  border-color: #ddd;
}

.panel-default > .panel-heading {
  color: #333;
  background-color: #f5f5f5;
  border-color: #ddd;
}

/* --- .close (BS5: .btn-close) — keep, already above --- */

/* --- .sr-only (BS5: .visually-hidden) — minimal inline fallback --- */
.sr-only,
.visually-hidden {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}
.sr-only-focusable:active,
.sr-only-focusable:focus {
  position: static;
  width: auto;
  height: auto;
  margin: 0;
  overflow: visible;
  clip: auto;
  white-space: normal;
}
