:root {
  --color-primary: #0099ff;
  --color-text-primary: #181d27;
  --color-text-secondary: #535862;
  --color-text-tertiary: #5875ad;
  --color-bar: #2b8cd1;
  --color-text-dark: #000000;
  --color-text-light: #414651;
  --color-text-white: #ffffff;
  --color-background: #ffffff;
  --color-surface: #ffffff;
  --color-border: #e9eaeb;
  --color-border-light: #d5d7da;
  --color-icon-bg: #d1e2f1;
  --color-icon-border: #e8f1f8;
  --color-table-header-bg: #f0f5f8;
  --font-main: "Inter", sans-serif;
  --color-success: #429900;
  --color-danger: #9f0505;
  --color-primary: #0099ff;
  --color-white: #ffffff;
  --color-text-primary: #181d27;
  --color-text-secondary: #535862;
  --color-text-light: #414651;
  --color-text-black: #000000;
  --color-border: #e9eaeb;
  --color-border-alt: #d5d7da;
  --color-background-light: #f0f5f8;
  --color-income: #429900;
  --color-expense: #9f0505;
  --color-link: #5875ad;
  --color-chart-bar: #2b8cd1;
  --shadow-sm: 0px 1px 2px 0px rgba(10, 13, 18, 0.05);
  --shadow-md: 0px 0px 15px 3px rgba(172, 172, 172, 0.2);
  --shadow-lg: 0px 8px 8px -4px rgba(10, 13, 18, 0.03),
    0px 20px 24px -4px rgba(10, 13, 18, 0.08);
  overflow-y: scroll;        /* keeps the ability to scroll */
  scrollbar-width: none;     /* hides scrollbar in Firefox */
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  font-family: "Inter", sans-serif;
  background-color: transparent;
  color: var(--color-text-primary);
  display: flex;
  justify-content: center;
  align-items: flex-start;
  padding: 20px 10px;
  min-height: 100vh;
}

.hidden {
  display: none !important;
}

.bank-statement-modal {
  background-color: var(--color-white);
  padding: 12px;
  display: flex;
  flex-direction: column;
  gap: 32px;
  width: 100%;
  max-width: 1030px;
}

.modal-header {
  display: flex;
  justify-content: center; /* Horizontal centering */
  align-items: center; /* Vertical centering */
}

.logo {
  height: 30px;
}

.close-button {
  background: none;
  border: none;
  cursor: pointer;
  padding: 0;
}

.close-button img {
  width: 24px;
  height: 24px;
}

.modal-content {
  display: flex;
  flex-direction: column;
  gap: 24px;
}

.title-section {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.main-title {
  font-size: 28px;
  font-weight: 700;
  line-height: 38px;
  color: var(--color-text-black);
  margin: 0;
}

.subtitle {
  font-size: 18px;
  font-weight: 400;
  line-height: 20px;
  color: var(--color-text-secondary);
  margin: 0;
}

.content-card {
  background-color: var(--color-white);
  padding: 24px;
  border-radius: 12px;
  box-shadow: var(--shadow-md);
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.section-title {
  font-size: 20px;
  font-weight: 700;
  line-height: 28px;
  color: var(--color-text-primary);
  margin: 0;
}

.details-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px 24px;
  margin-top: 8px;
}

.detail-item {
  display: grid;
  grid-template-columns: 150px 1fr;
  gap: 24px;
}

.detail-label {
  font-size: 18px;
  font-weight: 600;
  line-height: 20px;
}

.detail-value {
  font-size: 18px;
  font-weight: 400;
  line-height: 20px;
}

.summary-container {
  display: flex;
  gap: 16px;
}

.summary-card {
  flex: 1;
  border: 1px solid var(--color-border);
  border-radius: 12px;
  box-shadow: var(--shadow-sm);
  display: flex;
  flex-direction: column;
}

.summary-card-content {
  padding: 20px 16px;
  display: flex;
  flex-direction: column;
  gap: 20px;
}

.summary-title {
  font-size: 16px;
  font-weight: 600;
  line-height: 24px;
  margin: 0;
}

.summary-title.income {
  color: var(--color-income);
}
.summary-title.expense {
  color: var(--color-expense);
}

.summary-amount {
  font-size: 40px;
  font-weight: 300;
  line-height: 48px;
  margin: 0;
}

.summary-breakdown {
  padding: 16px;
  display: flex;
  flex-direction: column;
  gap: 10px;
  border-top: 1px solid var(--color-border);
}

.breakdown-item {
  display: flex;
  justify-content: space-between;
  font-size: 16px;
  font-weight: 600;
  
}

.breakdown-item .text-muted {
  color: #747474;
}

.breakdown-amount {
  font-weight: 600;
  font-size: 18px;
}

.section-subtitle {
  font-size: 16px;
  font-weight: 400;
  line-height: 24px;
  color: var(--color-link);
  margin: 0;
}

.insights-container {
  display: flex;
  gap: 16px;
}

.insight-card {
  flex: 1;
  border: 1px solid var(--color-border);
  border-radius: 12px;
  padding: 20px 16px;
  display: flex;
  flex-direction: column;
  gap: 24px;
}

.insight-title {
  font-size: 16px;
  font-weight: 600;
  line-height: 24px;
  margin: 0;
}

.chart-wrapper {
  width: 100%;
  flex-grow: 1;
}

.chart-list {
  list-style: none;
  padding: 0;
  margin: 0;
  display: flex;
  flex-direction: column;
  gap: 28px; /* Approximate vertical spacing */
}

.chart-item {
  display: flex;
  align-items: center;
  gap: 8px;
  position: relative;
}

.chart-row {
  display: grid;
  grid-template-columns: 60px 1fr 60px;
  align-items: center;
  gap: 8px;
  font-size: 13px;
}

.chart-label {
  width: 70px;
  text-align: right;
  font-size: 13px;
  font-weight: 500;
  color: var(--color-text-light);
  flex-shrink: 0;
}

.chart-value {
  font-weight: 400;
  text-align: left;
}

.bar-wrapper {
  background-color: #f0f0f0;
  border-radius: 4px;
  height: 13px;
}

.chart-bar-container {
  flex-grow: 1;
  background-color: #f0f1f2;
  border-radius: 4px;
  height: 13px;
}

.chart-bar {
  background-color: var(--color-bar);
  height: 100%;
  border-radius: 4px;
}

.tooltip {
  position: absolute;
  left: calc(91.25% + 70px); /* Position after the bar */
  top: 50%;
  transform: translate(15px, -50%);
  background-color: #eeeeee;
  border-radius: 8px;
  padding: 8px 12px;
  box-shadow: 0px 4px 6px -2px rgba(10, 13, 18, 0.03),
    0px 12px 16px -4px rgba(10, 13, 18, 0.08);
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 2px;
  z-index: 10000;
}
.tooltip-value {
  font-size: 12px;
  font-weight: 600;
  color: #000;
}

.tooltip-link {
  font-size: 12px;
  font-weight: 500;
  color: #0c64a2;
  text-decoration: none;
}

.tooltip-link:hover {
  text-decoration: underline;
}
/* Hide tooltip by default */
.chart-item .tooltip {
  display: none;
  opacity: 0;
  transition: opacity 0.2s ease;
}

/* Show tooltip when hovering over the list item */
.chart-item:hover .tooltip {
  display: flex;
  opacity: 1;
}

.chart-footer {
  font-size: 13px;
  font-weight: 400;
  text-align: center;
  color: #393f4a;
  margin: 12px 0 0;
}

.table-card {
  background-color: var(--color-white);
  border: 1px solid var(--color-border);
  border-radius: 12px;
  box-shadow: var(--shadow-sm);
  padding: 16px 20px;
  display: flex;
  flex-direction: column;
  gap: 24px;
}

.table-card-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.table-title {
  font-size: 18px;
  font-weight: 600;
  margin: 0;
  color: var(--color-text-black);
}

.toggle-button {
  background: none;
  border: none;
  cursor: pointer;
}

.table-wrapper {
  border: 0.5px solid var(--color-border);
  border-radius: 12px;
  overflow: hidden;
}

table {
  width: 100%;
  border-collapse: collapse;
}

th,
td {
  padding: 16px 24px;
  text-align: left;
  font-size: 14px;
  border-bottom: 1px solid var(--color-border);
}

tbody tr:last-child td {
  border-bottom: none;
}

thead th {
  background-color: var(--color-background-light);
  font-weight: 500;
  line-height: 18px;
}

th.amount-header,
td.amount-cell {
  font-weight: 600;
}

td {
  font-weight: 400;
  line-height: 20px;
}

.modal-footer {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 32px;
}

.powered-by {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 18px;
  font-weight: 500;
  color: #444444;
}

.powered-by img {
  height: 20px;
}

.actions {
  display: flex;
  gap: 12px;
  align-self: flex-end;
}

.btn {
  border-radius: 8px;
  padding: 12px 20px;
  font-size: 16px;
  font-weight: 600;
  line-height: 24px;
  cursor: pointer;
  border: 1px solid transparent;
  box-shadow: var(--shadow-sm);
}

.btn-primary {
  background-color: var(--color-primary);
  border-color: var(--color-primary);
  color: var(--color-white);
  padding: 10px 18px;
  border-radius: 5px;
}

.btn-secondary {
  background-color: var(--color-white);
  border-color: var(--color-border-alt);
  color: var(--color-text-light);
}

@media (max-width: 992px) {
  .details-grid {
    grid-template-columns: 1fr;
  }
  .detail-item {
    grid-template-columns: 120px 1fr;
  }
  .summary-container,
  .insights-container {
    flex-direction: column;
  }
  .tooltip {
    left: 150px;
  }
}

@media (max-width: 768px) {
  body {
    padding: 20px 10px;
  }
  .bank-statement-modal {
    padding: 16px;
    gap: 24px;
  }
  .content-card,
  .table-card {
    padding: 16px;
  }
  .chart-row {
    grid-template-columns: 50px 1fr 50px;
  }
  .tooltip {
    display: none; /* Hide tooltip on smaller screens for simplicity */
  }
  .actions {
    width: 100%;
    flex-direction: column-reverse;
  }
  .btn {
    width: 100%;
    text-align: center;
  }
}

@media (max-width: 480px) {
  .detail-item {
    grid-template-columns: 1fr;
    gap: 4px;
  }
  .breakdown-item {
    flex-direction: column;
    font-weight: 600;
    align-items: flex-start;
    gap: 4px;
  }
  .table-wrapper {
    overflow-x: auto;
  }
  table {
    min-width: 500px;
  }
}

html::-webkit-scrollbar,
body::-webkit-scrollbar {
  display: none;             /* hides scrollbar in Chrome, Safari, Edge */
}
