/* ============================================================
   LAYOUT — Navbar, page containers, header blocks, header-split
   ============================================================ */

/* ── Navbar / Header ─────────────────────────────────────── */

.navbar-wrapper {
  position: relative;
  background-color: #000;
  height: 180px;
  overflow: visible;
}

.navbar-wrapper-inner {
  position: relative;
  height: 100%;
  overflow: visible;
}

.navbar-wrapper-actions {
  position: absolute;
  bottom: 25px;
  right: 25px;
  display: none;           /* JS adds .nav-overflowed to show this */
  align-items: center;
  gap: 10px;
  overflow: visible;
  padding-right: 12px;
}

/* When JS detects navbar overflow, swap visibility */
.nav-overflowed .navbar-wrapper-actions {
  display: flex;
}

.nav-overflowed .nav-right {
  display: none;
}

.navbar-header {
  background:
    radial-gradient(ellipse at 15% 80%, rgba(99, 102, 241, 0.15) 0%, transparent 50%),
    radial-gradient(ellipse at 85% 20%, rgba(167, 139, 250, 0.1) 0%, transparent 45%),
    linear-gradient(170deg, #0d0825 0%, #111827 50%, #0f172a 100%);
  border-top: 1px solid rgba(255, 255, 255, 0.06);
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
  float: left;
  width: 100%;
}

.navbar-header ul {
  list-style-type: none;
  margin: 0;
  padding: 0;
  overflow: hidden;
  background: transparent;
  display: flex;
  align-items: stretch;
}

.navbar-header li {
  display: flex;
  align-items: stretch;
}

.navbar-header li a {
  display: flex;
  align-items: center;
  color: rgba(255, 255, 255, 0.75);
  text-align: center;
  padding: 14px clamp(6px, 1.1vw, 16px);
  text-decoration: none;
  white-space: nowrap;
  font-size: clamp(0.7rem, 0.85vw, 0.88rem);
  transition: background-color var(--transition-fast), color var(--transition-fast);
}

.navbar-header li a:hover:not(.active) {
  background-color: rgba(255, 255, 255, 0.1);
  color: #fff;
}

.navbar-header li a:focus-visible {
  outline: none;
  box-shadow: var(--focus-ring);
}

.navbar-header .active {
  background-color: rgba(99, 102, 241, 0.35);
  color: #fff;
}

.logo-top {
  margin: 15px;
  float: left;
  margin-top: 100px;
}

.logo-bottom {
  margin-top: -10px;
  float: left;
  margin-bottom: 15px;
  max-width: 80%;
}

/* ── Page containers ─────────────────────────────────────── */

.page-container { width: 100%; padding-top: 50px; }

.table-responsive { overflow-x: auto; -webkit-overflow-scrolling: touch; text-align: initial; }
.table-wrapper { margin-bottom: 0; }

.main-header { overflow: visible; }

.upper-header {
  padding-bottom: 4px;
  overflow: hidden;
  text-align: center;
  width: 100%;
  background-color: var(--color-background2);
  color: var(--color-text);
  transition: background-color .25s ease, color .25s ease;
}

.upper-block {
  float: left;
  color: var(--color-text);
  width: 20%;
  padding-left: 1%;
  padding-right: 1%;
  margin-top: 8px;
  margin-bottom: 0;
}

.marketcap-value {
  font-weight: 700;
}

.upper-header a {
  text-align: center;
  padding: 4px;
  text-decoration: none;
  font-size: 17px;
  line-height: 25px;
  border-radius: var(--radius-sm);
  width: 100%;
}

.upper-header a:hover { background-color: var(--color-neutral-200); color: var(--color-text); }

.upper-header a:focus-visible {
  outline: none;
  box-shadow: var(--focus-ring);
  border-radius: var(--radius-sm);
}

.lower-header {
  padding-top: 5px;
  padding-bottom: 5px;
  overflow: hidden;
  border-bottom: 2px solid var(--color-neutral-200);
}

.category-buttons { float: right; clear: right; }

.header {
  overflow: hidden;
  padding-top: 5px;
  padding-bottom: 10px;
  height: 200px;
}

.header a {
  float: left;
  color: var(--color-text);
  text-align: center;
  padding: 10px;
  text-decoration: none;
  font-size: 18px;
  line-height: 25px;
  border-radius: var(--radius-sm);
}

.header a.logo {
  font-size: 25px;
  font-weight: bold;
}

.header a:hover { background-color: var(--color-neutral-200); color: var(--color-text); }

.header a:focus-visible {
  outline: none;
  box-shadow: var(--focus-ring);
}

.header-text {
  float: none;
  clear: none;
  text-align: left;
  padding-left: 10px;
  padding-top: 20px;
}
.header-text h1 { font-size: 2.5em; float: none; }

.header-left { margin-top: 15px; }
.header-right { padding-top: 10px; text-align: right; }

/* Force h2 to always sit below floated h1 and take full width */
.header-text h2 {
  display: block;
  width: 100%;
  padding-bottom: 30px;
}

/* ── Header split: title (left) + controls/pagination (right) ── */

.header-split {
  display: flex;
  gap: 16px;
  flex-wrap: nowrap;
  align-items: stretch;
}

.header-split > .header-left {
  flex: 1 1 auto;
  min-width: 0;
}

.header-split > .header-right {
  max-width: 100%;
  display: flex;
  justify-content: flex-end;
  flex-wrap: wrap;
  gap: 12px 16px;
  flex: 0 0 auto;
  margin-left: auto;
  white-space: nowrap;
  flex-direction: column;
}

/* Neutralize legacy float/clear rules inside the header area */
.header-split .header-text,
.header-split .header-text h1,
.header-split .pagination,
.header-split .pagination2 {
  float: none !important;
  clear: none !important;
  width: auto !important;
}

.header-split .header-text h1,
.header-split .header-text h2 {
  display: block;
  color: var(--color-text);
  white-space: normal;
  overflow-wrap: anywhere;
}

.header-split .pagination,
.header-split .pagination2 {
  display: inline-flex;
  flex-wrap: nowrap;
  white-space: nowrap;
}

.header-split .pagination > *,
.header-split .pagination2 > * {
  flex: 0 0 auto;
}

.header-split .pagination-nowrap {
  display: inline-flex;
  flex-wrap: nowrap;
  white-space: nowrap;
}

/* ── Upper-header inner layout ────────────────────────────── */

.upper-header-inner {
  position: relative;
}

.upper-categories {
  display: contents;  /* desktop: behave as before */
}


/* ── Responsive ──────────────────────────────────────────── */

@media screen and (max-width: 600px) {
  .column, input[type=submit] {
    width: 100%;
    margin-top: 0;
  }
}

@media (max-width: 768px) {
  .upper-header,
  .lower-header,
  .header,
  .main-header {
    float: none !important;
    clear: both !important;
    width: 100% !important;
    height: auto !important;
    overflow: visible !important;
  }

  .upper-block,
  .category-buttons {
    float: none !important;
    clear: both !important;
    width: 100% !important;
    text-align: left !important;
  }

  .unit-select,
  .filter-select,
  .country-select,
  .sector-select {
    width: 100% !important;
    min-width: 0 !important;
    box-sizing: border-box;
    margin: 6px 0 !important;
  }

  #tablePage,
  #table-wrap,
  .dataTables_wrapper,
  #table_wrapper {
    clear: both !important;
  }

  .header-split > .header-right {
    width: 100%;
    margin-left: 0;
    justify-content: flex-start;
    margin-top: 10px;
  }

  .header-split .unit-select,
  .header-split .filter-select,
  .header-split .country-select,
  .header-split .sector-select {
    width: 100% !important;
  }

}
