/* ==========================================================================
   Flexible content block: Fund Info
   Uses a unique "fi-" class prefix so the staging theme (invalda) styles for
   generic classes (.data-table, .custom-checkbox, etc.) never interfere.
   Self-contained light "card" that stays readable on any section background.
   Data engine: invl_funds plugin.
   ========================================================================== */

.fund-info {
  --fund-navy: #00003c;
  --fund-gold: #dc9623;
  --fund-line: #e2e2ec;
  --fund-muted: #5b5b74;
  --fund-panel: #e9edf7;
  position: relative;
  margin: 40px 0 60px;
  padding: 28px 28px 32px;
  background: #ffffff;
  border-radius: 12px;
  box-shadow: 0 10px 30px rgba(0, 0, 60, 0.08);
  color: var(--fund-navy);
}

@media (max-width: 767px) {
  .fund-info {
    padding: 18px 14px 22px;
  }
}

.fund-info--empty {
  padding: 20px;
  border: 1px dashed var(--fund-gold);
  border-radius: 8px;
  color: var(--fund-muted);
  background: #fff;
}

.fund-info__title {
  margin: 0 0 24px;
  font-size: clamp(20px, 2.6vw, 30px);
  line-height: 1.2;
  color: var(--fund-navy);
  text-transform: uppercase;
  letter-spacing: 0.01em;
}

/* --- Chart controls ------------------------------------------------------ */
.fund-info .fi-controls {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-end;
  gap: 16px 24px;
  margin-bottom: 20px;
}

.fund-info .fi-control {
  display: flex;
  flex-direction: column;
  gap: 6px;
  min-width: 160px;
}

.fund-info .fi-control__label {
  font-size: 13px;
  font-weight: 500;
  color: var(--fund-muted);
  margin: 0;
}

.fund-info .fi-control__label--spacer {
  visibility: hidden;
}

.fund-info .fi-field {
  position: relative;
}

.fund-info .fi-field select,
.fund-info .fi-field input[type="text"] {
  width: 100%;
  min-height: 44px;
  padding: 8px 14px;
  border: 1px solid var(--fund-line);
  border-radius: 6px;
  background: #fff !important;
  font: inherit;
  font-size: 15px;
  color: var(--fund-navy) !important;
  outline: none;
  box-shadow: none;
  transition: border-color 0.15s ease;
}

/* Keep the native <select> control (renders + closes natively). Force the
   browser default appearance so the theme cannot hide the arrow or replace it
   with a custom widget. */
.fund-info .fi-field select {
  -webkit-appearance: auto !important;
  -moz-appearance: auto !important;
  appearance: auto !important;
  padding-right: 32px;
  cursor: pointer;
}

.fund-info .fi-field select:focus,
.fund-info .fi-field input[type="text"]:focus {
  border-color: var(--fund-gold);
}

/* Checkboxes: force native rendering (theme may hide/replace checkboxes) */
.fund-info .fi-check {
  display: flex;
  align-items: center;
  min-height: 44px;
  gap: 10px;
}

.fund-info .fi-check input[type="checkbox"] {
  -webkit-appearance: auto !important;
  appearance: auto !important;
  position: static !important;
  opacity: 1 !important;
  width: 20px !important;
  height: 20px !important;
  margin: 0 !important;
  accent-color: var(--fund-gold);
  cursor: pointer;
  flex: 0 0 auto;
}

.fund-info .fi-check__label {
  font-size: 14px;
  color: var(--fund-navy);
  cursor: pointer;
  margin: 0;
}

/* --- Data tables --------------------------------------------------------- */
/* Backgrounds/colors are forced with !important because the invalda theme sets
   dark backgrounds on generic table/section elements that would otherwise show
   through and make the text unreadable. */
.fund-info .fi-table-wrap {
  width: 100%;
  overflow-x: auto;
  margin-bottom: 22px;
  background: #ffffff !important;
  border-radius: 8px;
}

.fund-info .fi-table,
.fund-info .fi-table tbody,
.fund-info .fi-table tr {
  background: transparent !important;
}

.fund-info .fi-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 14px;
  color: var(--fund-navy) !important;
  margin: 0;
}

.fund-info .fi-table td {
  padding: 14px 16px;
  vertical-align: top;
  border-bottom: 1px solid var(--fund-line);
  background: transparent !important;
  color: var(--fund-navy) !important;
}

.fund-info .fi-label {
  font-weight: 600;
  color: var(--fund-navy) !important;
}

.fund-info .fi-label--accent {
  color: var(--fund-gold) !important;
}

.fund-info .fi-title {
  font-size: 12px;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: var(--fund-muted) !important;
  margin-bottom: 4px;
}

.fund-info .fi-value {
  font-size: 15px;
  font-weight: 500;
  color: var(--fund-navy) !important;
}

/* Selected-period summary sits on a light blue panel (like the live site) */
.fund-info .fi-table-wrap.fund-info__period {
  background: var(--fund-panel) !important;
  border-radius: 8px;
  margin-bottom: 8px;
}

.fund-info .fund-info__period .fi-table td {
  border-bottom: none;
}

/* Main data table: clean light rows */
.fund-info .fi-table-wrap.fund-info__data {
  background: #ffffff !important;
  border: 1px solid var(--fund-line);
}

.fund-info .fund-info__data .fi-table tr:last-child td {
  border-bottom: none;
}

/* --- Chart --------------------------------------------------------------- */
.fund-info .fund-info__chart-holder {
  margin-top: 8px;
}

.fund-info .invlChart {
  min-height: 500px;
  width: 100%;
  background: #fff;
}

.fund-info .invlChart > div {
  width: 100%;
}

/* --- jQuery UI selectmenu (period dropdown built by invlchart.js) -------- */
.fund-info .ui-selectmenu-button.ui-button {
  width: 100% !important;
  min-height: 44px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 8px 14px;
  margin: 0;
  border: 1px solid var(--fund-line);
  border-radius: 6px;
  background: #fff;
  font: inherit;
  font-size: 15px;
  color: var(--fund-navy);
  text-decoration: none;
  outline: none;
}

.fund-info .ui-selectmenu-button.ui-button:focus,
.fund-info .ui-selectmenu-button.ui-button:hover {
  border-color: var(--fund-gold);
  color: var(--fund-navy);
}

.fund-info .ui-selectmenu-button .ui-selectmenu-text {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  color: var(--fund-navy);
}

.fund-info .ui-selectmenu-button .ui-icon {
  position: static;
  margin: 0;
  width: 0;
  height: 0;
  border-left: 5px solid transparent;
  border-right: 5px solid transparent;
  border-top: 6px solid var(--fund-navy);
  text-indent: 0;
  background: none;
  overflow: hidden;
}

/* Dropdown list (jQuery UI appends it to <body>, so it is not scoped).
   IMPORTANT: jQuery UI opens/closes the selectmenu purely via CSS by toggling the
   .ui-selectmenu-open class. The invalda theme does not load jQuery UI's own CSS,
   so we must provide the default hidden state here, otherwise the menu stays
   visible forever (never closes). */
.ui-selectmenu-menu {
  position: absolute;
  top: 0;
  left: 0;
  display: none;
  z-index: 10000;
}

.ui-selectmenu-menu.ui-selectmenu-open {
  display: block;
}

.ui-selectmenu-menu .ui-menu {
  list-style: none;
  margin: 4px 0 0;
  padding: 6px;
  background: #fff;
  border: 1px solid #e2e2ec;
  border-radius: 8px;
  box-shadow: 0 8px 24px rgba(0, 0, 60, 0.12);
  max-height: 320px;
  overflow-y: auto;
  font-size: 14px;
}

.ui-selectmenu-menu .ui-menu-item {
  list-style: none;
  margin: 0;
}

.ui-selectmenu-menu .ui-menu-item-wrapper {
  display: block;
  padding: 8px 12px;
  border-radius: 4px;
  color: #00003c;
  cursor: pointer;
}

.ui-selectmenu-menu .ui-menu-item-wrapper.ui-state-active,
.ui-selectmenu-menu .ui-menu-item-wrapper:hover {
  background: #dc9623;
  color: #fff;
}

/* --- jQuery UI datepicker (theme CSS is not loaded globally on invalda) --- */
/* Hidden by default; the datepicker JS toggles inline display when opened.
   Without this the #ui-datepicker-div renders as a stray calendar at the bottom
   of the page on load. */
.ui-datepicker {
  display: none;
  background: #fff;
  border: 1px solid #e2e2ec;
  border-radius: 8px;
  padding: 10px;
  box-shadow: 0 8px 24px rgba(0, 0, 60, 0.12);
  font-size: 13px;
  z-index: 10000;
  width: auto;
}

.ui-datepicker .ui-datepicker-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 8px;
  background: none;
  border: none;
}

.ui-datepicker .ui-datepicker-title {
  font-weight: 600;
  color: #00003c;
}

.ui-datepicker .ui-datepicker-prev,
.ui-datepicker .ui-datepicker-next {
  cursor: pointer;
  color: #dc9623;
  padding: 0 6px;
  user-select: none;
  position: static;
  width: auto;
  height: auto;
  text-indent: 0;
}

.ui-datepicker table {
  width: 100%;
  border-collapse: collapse;
  margin: 0;
  background: none;
}

.ui-datepicker th {
  color: #5b5b74;
  font-weight: 500;
  padding: 4px;
  border: none;
  background: none;
}

.ui-datepicker td {
  padding: 0;
  border: none;
  background: none;
}

.ui-datepicker td a,
.ui-datepicker td span {
  display: block;
  text-align: center;
  padding: 6px;
  border-radius: 4px;
  text-decoration: none;
  color: #00003c;
  background: none;
  border: none;
}

.ui-datepicker td a:hover {
  background: #f3f0e8;
}

.ui-datepicker td a.ui-state-active,
.ui-datepicker td a.ui-state-highlight {
  background: #dc9623;
  color: #fff;
}

/* --- Responsive ---------------------------------------------------------- */
@media (max-width: 767px) {
  .fund-info .fi-table,
  .fund-info .fi-table tbody,
  .fund-info .fi-table tr,
  .fund-info .fi-table td {
    display: block;
    width: 100%;
  }

  .fund-info .fi-table td:empty {
    display: none;
  }

  .fund-info .fi-control {
    width: 100%;
  }
}
