/*!**********************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************!*\
  !*** css ../../node_modules/.pnpm/next@15.2.1_@babel+core@7.28.0_react-dom@19.1.0_react@19.1.0__react@19.1.0_sass@1.89.2/node_modules/next/dist/build/webpack/loaders/css-loader/src/index.js??ruleSet[1].rules[13].oneOf[10].use[2]!../../node_modules/.pnpm/next@15.2.1_@babel+core@7.28.0_react-dom@19.1.0_react@19.1.0__react@19.1.0_sass@1.89.2/node_modules/next/dist/build/webpack/loaders/postcss-loader/src/index.js??ruleSet[1].rules[13].oneOf[10].use[3]!../../packages/ui/Switch/index.css ***!
  \**********************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************/
.switch-container {
    border-radius: 50px;
    background-color: #ebeced;
    width: fit-content;
}

.non-active-switch {
    background-color: #ebeced !important;
}

.switch-button {
    border-radius: 50px;
    padding: 0.5rem 1rem;
    font-size: 0.875rem;
    font-weight: 400;
    color: #374151;
    cursor: pointer;
    transition: all 0.3s ease;
    max-height: 40px;
}
/*!*******************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************!*\
  !*** css ../../node_modules/.pnpm/next@15.2.1_@babel+core@7.28.0_react-dom@19.1.0_react@19.1.0__react@19.1.0_sass@1.89.2/node_modules/next/dist/build/webpack/loaders/css-loader/src/index.js??ruleSet[1].rules[13].oneOf[10].use[2]!../../node_modules/.pnpm/next@15.2.1_@babel+core@7.28.0_react-dom@19.1.0_react@19.1.0__react@19.1.0_sass@1.89.2/node_modules/next/dist/build/webpack/loaders/postcss-loader/src/index.js??ruleSet[1].rules[13].oneOf[10].use[3]!../../packages/ui/ChartTable/ChartTable.css ***!
  \*******************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************/
.chart-table-container {
  position: relative;
  /* border: 1px solid #e5e7eb; */
  /* border-radius: 8px; */
  background: white;
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.1); 
  overflow: visible;
  border-radius: 0px 0px 40px 40px !important;
}

.chart-table-container .chart-content {
  position: relative;
  background: white;
  min-height: 400px; /* Ensure enough space for chart and axis */
  /* border-radius: 0px 0px 40px 40px !important; */
  border-radius: 0px 0px 0px 0px !important;
}

/* Export dropdown styling */
.chart-table-container .export-dropdown {
  position: relative;
}

.chart-table-container .dropdown-menu {
  background: white;
  border: 1px solid #d1d5db;
  border-radius: 6px;
  box-shadow: 0 10px 15px -3px rgba(0, 0, 0, 0.1), 0 4px 6px -2px rgba(0, 0, 0, 0.05);
  margin-top: 0.25rem;
}

.chart-table-container .dropdown-item {
  padding: 0.5rem 0.75rem;
  color: #374151;
  font-size: 0.875rem;
  transition: background-color 0.15s ease;
  border: none;
  background: none;
  width: 100%;
  text-align: left;
  cursor: pointer;
}

.chart-table-container .dropdown-item:hover {
  background: #f3f4f6;
  color: #0066cc;
}

/* Button styling */
.chart-table-container .btn-outline-secondary {
  border-color: #d1d5db;
  color: #374151;
}

.chart-table-container .btn-outline-secondary:hover {
  background-color: #f9fafb;
  border-color: #9ca3af;
  color: #0066cc;
}

/* Switch styling in container */
.chart-table-container .btn-group-toggle .btn {
  font-size: 0.875rem;
}

/* Responsive design */
@media (max-width: 768px) {
  .chart-table-container {
    padding: .2rem;
  }

  .chart-table-container .d-flex.justify-content-between {
    flex-direction: column;
    gap: 1rem;
    align-items: stretch;
  }

  .chart-table-container .d-flex.align-items-center {
    justify-content: flex-end;
  }

  /* Tools row: allow wrapping on mobile to prevent overcrowding */
  .chart-table-container .tools-row {
    display: flex !important;
    flex-direction: row !important;
    flex-wrap: wrap !important;
    justify-content: flex-start !important;
    align-items: center !important;
    gap: 0.5rem !important;
    padding: 0.75rem 1rem !important;
  }

  /* Left group: chart/table and relative/absolute switches */
  .chart-table-container .tools-row > div:first-child {
    flex: 0 1 auto;
    min-width: 0;
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
    justify-content: flex-start;
    align-items: center;
  }

  /* Right group: project/funding toggle and export */
  .chart-table-container .tools-row > div:last-child {
    flex: 0 1 auto;
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
    justify-content: flex-start;
    align-items: center;
    margin-left: auto;
  }

  /* When groups wrap to separate rows, ensure consistent left alignment */
  @media (max-width: 600px) {
    .chart-table-container .tools-row > div:last-child {
      margin-left: 0;
      flex-basis: 100%;
      margin-top: 0.5rem;
    }
  }

  /* Switch stays inline, can shrink slightly */
  .chart-table-container .switch-container {
    display: inline-flex !important;
    width: auto !important;
    flex: 0 1 auto;
    min-width: 0;
    gap: 0.25rem !important;
  }

  /* Reduce switch button padding slightly on mobile for better fit */
  .chart-table-container .switch-button {
    padding: 0.4rem 0.6rem !important;
    font-size: 0.8rem !important;
  }

  /* Export dropdown stays inline on the right */
  .chart-table-container .export-dropdown {
    display: inline-flex !important;
    flex: 0 0 auto;
  }

  /* Increase tap target on mobile */
  .chart-table-container .export-button {
    width: 44px !important;
    height: 44px !important;
  }

  /* Turn dropdown into a bottom sheet on mobile */
  .chart-table-container .dropdown-menu {
    position: fixed !important;
    right: 1rem !important;
    left: 1rem !important;
    bottom: 1rem !important;
    top: auto !important;
    transform: none !important;
    min-width: unset !important;
    width: auto;
    z-index: 1050;
  }

  .chart-table-container .dropdown-item {
    padding: 0.75rem 1rem;
    font-size: 1rem;
  }
}

/* Dark mode disabled
@media (prefers-color-scheme: dark) {
  .chart-table-container {
    background: #1f2937;
    border-color: #374151;
  }

  .chart-table-container .chart-content {
    background: #1f2937;
  }

  .chart-table-container .dropdown-menu {
    background: #374151;
    border-color: #4b5563;
  }

  .chart-table-container .dropdown-item {
    color: #d1d5db;
  }

  .chart-table-container .dropdown-item:hover {
    background: #4b5563;
    color: #3b82f6;
  }

  .chart-table-container .btn-outline-secondary {
    background: #374151;
    border-color: #4b5563;
    color: #d1d5db;
  }

  .chart-table-container .btn-outline-secondary:hover {
    background: #4b5563;
    border-color: #6b7280;
    color: #3b82f6;
  }
}
*/

.export-button {
  border: none;
  background-color: var(--primary) !important;
  color: white !important;
  cursor: pointer;
  border-radius: 36px !important;
  width: 50px !important;
  height: 40px !important;
}

.tools-row {
  background-color: #F7F7F7;
}
