/* Basic styling for whole app */
*,
*::before,
*::after {
  box-sizing: border-box;
}

* {
  margin: 0;
}

html,
body,
#__next {
  height: 100%;
}

body {
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
  background-color: white;
}

mg,
picture,
video,
canvas,
svg {
  display: block;
  max-width: 100%;
}

input,
button,
textarea,
select {
  font: inherit;
}

p,
h1,
h2,
h3,
h4,
h5,
h6 {
  overflow-wrap: break-word;
}

#root,
#__next {
  isolation: isolate;
}

em {
  font-style: italic;
  font-size: 0.9rem;
}

img {
  filter: grayscale(1);
}

img:hover {
  filter: grayscale(0);
}

/* Solid border */
hr.solid {
  border-top: 1px solid #e5e1e1;
}

footer {
  position: fixed;
  bottom: 0;
  width: 100%;
  background-color: black;
  color: white;
  padding: 8px 0;
  text-align: center;
  height: 42px;
  font-family: system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto,
    Oxygen, Ubuntu, Cantarell, "Open Sans", "Helvetica Neue", sans-serif;
  font-size: 0.9rem;
}

footer a {
  color: white;
}

.main-container {
  margin: auto;
  max-width: 920px;
  display: flex;
  flex-direction: row;
  justify-content: space-between;
  display: block;
  padding: 0 16px;
}

.navbar {
  margin-top: 8px;
  display: flex;
  flex-direction: row;
  justify-content: space-between;
  align-items: center;
}

.nav-links {
  display: flex;
  flex-direction: row;
  gap: 16px;
  text-decoration: underline;
  font-family: system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto,
    Oxygen, Ubuntu, Cantarell, "Open Sans", "Helvetica Neue", sans-serif;
}

.nav-links-item:hover {
  opacity: 0.5;
}

.nav-links a {
  color: #231f20;
  opacity: 0.7;
}

.name {
  font-size: 1.1rem;
  font-family: "Lora", Georgia, "Times New Roman", Times, serif;
  font-optical-sizing: auto;
  text-align: left;
  color: #231f20;
  padding: 8px 0px;
}

.tagline {
  font-family: "Lora", Georgia, "Times New Roman", Times, serif;
  font-optical-sizing: auto;
  margin-top: 36px;
  font-size: 1.3rem;
  margin-bottom: 18px;
}

.logo-row {
  font-size: 0.9rem;
  display: flex;
  flex-direction: row;
  align-items: center;
  gap: 16px;
  margin-bottom: 42px;
}

.main-area > p {
  font-family: system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto,
    Oxygen, Ubuntu, Cantarell, "Open Sans", "Helvetica Neue", sans-serif;
  font-size: 0.9rem;
}

.search-bar-container {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
  margin-bottom: 32px;
  font-family: system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto,
    Oxygen, Ubuntu, Cantarell, "Open Sans", "Helvetica Neue", sans-serif;
}

/* Center the text within the alternative input */
.picker-button {
  text-align: center;
}

/* Optional: Apply button-like styling */
.picker-button {
  display: inline-block;
  width: auto;
  padding: 0.375rem 0.75rem; /* Adjust padding as needed */
  font-size: 1rem;
  line-height: 1.5;
  color: #212529;
  background-color: #e9ecef;
  border: 1px solid #ced4da;
  border-radius: 0.25rem;
  cursor: pointer;
}

/* Remove default input styles */
.picker-button {
  -webkit-appearance: none;
  -moz-appearance: none;
  appearance: none;
}

/* Optional: Add hover effect */
.picker-button:hover {
  background-color: #dee2e6;
}

/* Media query for small screens */
@media (max-width: 926px) {
  .picker-button {
    font-size: 0.9rem;
    padding: 0.3rem 0.6rem;
    min-width: 120px;
  }
}

.info-container {
  height: 1600px;
  border: 1px solid black;
  display: grid;
  grid-template-rows: 5fr repeat(10, 1fr);
  margin-bottom: 32px;
}

.info-container-item {
  display: flex;
  flex-direction: row;
  justify-content: space-between;
  align-items: center;
  padding: 8px 16px;
  border-bottom: 1px solid black;
}

.main-chart-wrapper {
  margin-top: 48px;
  margin-bottom: 48px;
  font-family: system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto,
    Oxygen, Ubuntu, Cantarell, "Open Sans", "Helvetica Neue", sans-serif;
  font-size: 0.9rem;
}

.main-table-wrapper {
  font-family: system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto,
    Oxygen, Ubuntu, Cantarell, "Open Sans", "Helvetica Neue", sans-serif;
  font-size: 0.9rem;
  overflow-x: auto; /* Enable horizontal scrolling */
  -webkit-overflow-scrolling: touch; /* Smooth scrolling on iOS devices */
}

.main-table-wrapper table {
  width: 100%;
  min-width: 600px; /* Adjust this value based on your table's minimum width */
  border-collapse: collapse;
}

/* When the cursor is on top of a specific row, make the background a bit darker */
.main-table-wrapper tr:hover {
  background-color: #f5f5f5;
  color: rgb(0, 106, 212);
  cursor: pointer;
}

.flatpickr-input {
  background-color: white;
  text-align: center;
}

.search-bar-item.date-item {
  padding: 0;
  overflow: hidden;
}

.search-bar-item.date-item input {
  width: 100%;
  height: 100%;
  border: none;
  padding: 0 10px;
  text-align: center;
  font-family: system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto,
    Oxygen, Ubuntu, Cantarell, "Open Sans", "Helvetica Neue", sans-serif;
}

.flatpickr-calendar {
  font-family: system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto,
    Oxygen, Ubuntu, Cantarell, "Open Sans", "Helvetica Neue", sans-serif;
}

/* Flatpickr mobile optimizations */
@media (max-width: 480px) {
  .flatpickr-calendar {
    width: 100% !important;
    max-width: 300px; /* Adjust as needed */
  }
  .flatpickr-days {
    width: 100% !important;
  }
  .dayContainer {
    width: 100% !important;
    min-width: auto !important;
    max-width: none !important;
  }
  .flatpickr-day {
    max-width: none !important;
    flex-basis: 14.28% !important;
    height: 40px !important;
    line-height: 40px !important;
  }
  .flatpickr-current-month {
    font-size: 100% !important;
    padding: 10px 0 0 0 !important;
  }
  .flatpickr-monthDropdown-months {
    font-size: 14px !important;
  }
  .flatpickr-current-month .flatpickr-monthDropdown-months {
    width: auto !important;
    max-width: 120px !important;
  }
  .flatpickr-current-month input.cur-year {
    font-size: 14px !important;
  }
}

.about-paragraph {
  font-family: system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto,
    Oxygen, Ubuntu, Cantarell, "Open Sans", "Helvetica Neue", sans-serif;
}

#disclaimer {
  padding-bottom: 128px;
}

.divider-table-filter-row {
  height: 16px;
}

/* Add these styles to your existing CSS file */

/* DataTable specific styles */
.dataTables_wrapper {
  position: relative;
  clear: both;
  font-family: system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto,
    Oxygen, Ubuntu, Cantarell, "Open Sans", "Helvetica Neue", sans-serif;
  font-size: 0.9rem;
}

.dataTables_scroll {
  clear: both;
}

.dataTables_scrollBody {
  min-height: 400px; /* This should match the scrollY value */
}

#myTable {
  width: 100% !important;
  min-width: 600px; /* Consistent with your existing table style */
}

#myTable thead th {
  position: sticky;
  top: 0;
  background-color: #fff;
  z-index: 1;
}

.dataTables_empty {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
}

/* Adjust existing styles */
.main-table-wrapper {
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
}

#myTable {
  width: 100% !important;
  min-width: 600px; /* Adjust this value based on your table's minimum width */
}

.dataTables_scrollHead,
.dataTables_scrollBody {
  overflow-x: visible !important;
  width: 100% !important;
}

#myTable thead th {
  position: sticky;
  top: 0;
  background-color: #fff;
  z-index: 1;
}

/* Ensure header cells have the same width as body cells */
#myTable thead th,
#myTable tbody td {
  white-space: nowrap;
  box-sizing: border-box;
}

/* Remove fixed width on columns if any */
#myTable.dataTable.fixedHeader-floating,
#myTable.dataTable.fixedHeader-locked {
  table-layout: auto !important;
}

.main-table-wrapper table {
  border-collapse: collapse;
}

/* When the cursor is on top of a specific row, make the background a bit darker */
.main-table-wrapper tr:hover,
#myTable tbody tr:hover {
  background-color: #f5f5f5;
  color: rgb(0, 106, 212);
  cursor: pointer;
}

/* Additional styles for DataTables elements */
.dataTables_info,
.dataTables_paginate {
  margin-top: 10px;
  font-size: 0.9rem;
}

.dataTables_paginate .paginate_button {
  padding: 5px 10px;
  margin: 0 2px;
  border: 1px solid #ddd;
  border-radius: 3px;
  cursor: pointer;
}

.dataTables_paginate .paginate_button.current {
  background-color: #f5f5f5;
  font-weight: bold;
}

/* Responsive adjustments */
@media (max-width: 926px) {
  .dataTables_wrapper {
    font-size: 0.9rem;
  }

  .dataTables_info,
  .dataTables_paginate {
    font-size: 0.9rem;
  }

  .dataTables_paginate .paginate_button {
    padding: 3px 6px;
  }
}

.filter-row {
  display: flex;
  flex-direction: row;
  justify-content: space-between;
  align-items: center;
  overflow-x: auto;
  white-space: nowrap;
  scrollbar-width: none; /* Firefox */
}

@media (max-width: 926px) {
  .filter-row {
    font-size: 14px; /* Set a base font size */
    line-height: 1.2; /* Adjust line height for better spacing */
  }

  .filter-row label {
    font-size: 0.9em; /* Slightly smaller than the base font size */
  }

  .filter-row input,
  .filter-row select,
  .filter-row button {
    font-size: 16px; /* Keep 16px for input elements to prevent zooming on iOS */
    height: 32px; /* Slightly taller for better touch targets */
    padding: 0 8px; /* Add some horizontal padding */
  }

  #kindFilter {
    width: auto; /* Let it size to content */
    max-width: 100px; /* But not too wide */
  }

  #totalReturnMin,
  #totalReturnMax {
    width: 60px; /* Narrower for small screens */
  }

  #customSearch {
    width: 120px; /* Narrower for small screens */
  }

  #resetFilters {
    padding: 0 10px; /* Add some padding to the button */
    font-size: 0.9em; /* Slightly smaller than the base font size */
  }
}

@media (max-width: 926px) {
  .main-chart-wrapper {
    margin-bottom: 24px;
  }

  .divider-table-filter-row {
    height: 0px;
  }
}
