/* Visually hidden but accessible to screen readers */
.visually-hidden {
  position: absolute;
  width: 1px;
  height: 1px;
  margin: -1px;
  padding: 0;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

/* Debug info styles
.debug-info {
  margin-top: 1rem;
  padding: 0.5rem;
  border: 1px solid #ddd;
  border-radius: 4px;
  background-color: #f9f9f9;
  font-family: monospace;
  font-size: 12px;
}

.debug-info pre {
  overflow-x: auto;
  white-space: pre-wrap;
  word-wrap: break-word;
}

.debug-info summary {
  cursor: pointer;
  color: #666;
  font-weight: bold;
  margin-bottom: 0.5rem;
}
*/

/* Global Styles */
body {
  margin: 0;
  padding: 0;
  font-family: 'Inter', 'Roboto', -apple-system, BlinkMacSystemFont, sans-serif;
}

.time-deposit-container {
  color: #333;
  max-width: 100%;
  margin: 0 auto;
  padding: 0;
  background-color: #fff;
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.08);
  overflow: hidden;
  display: flex;
  flex-direction: column;
  min-height: 100vh;
}

/* Header Styles */
.header {
  padding: 2rem;
  background: linear-gradient(135deg, #3c454e83, rgba(70, 66, 83, 0.911));
  width: 100%;
  box-sizing: border-box;
  overflow-wrap: break-word;
}

.title {
  margin: 1rem auto 0;
  font-size: 1.8rem;
  font-weight: 700;
  color: #ffffff;
  letter-spacing: -0.02em;
  max-width: 960px;
}

/* SEO Description */
.seo-description {
  margin: 1rem auto 0;
  padding-top: 1rem;
  border-top: 1px solid rgba(255, 255, 255, 0.5);
  max-width: 960px;
}

.seo-description p {
  margin: 0;
  font-size: 0.9rem;
  color: #ffffff;
  line-height: 1.5;
}

/* SEO Content Section */
.seo-content {
  margin-top: 2.5rem;
  padding-top: 1.5rem;
  border-top: 1px solid rgba(0, 0, 0, 0.1);
  line-height: 1.6;
}

.seo-content h3 {
  font-size: 1.2rem;
  margin-top: 1.5rem;
  margin-bottom: 0.75rem;
}

.seo-content h3:first-child {
  margin-top: 0;
}

.seo-content p {
  margin-bottom: 1rem;
  color: #444;
}

.seo-content ul {
  padding-left: 1.5rem;
  margin-bottom: 1.5rem;
}

.seo-content li {
  margin-bottom: 0.5rem;
}

.terms-glossary dt {
  font-weight: 600;
  margin-top: 1rem;
}

.terms-glossary dd {
  margin-left: 0;
  margin-bottom: 0.75rem;
  color: #555;
}

/* Filter Styles */
.inline-table-filters {
  margin-top: 0.75rem;
  margin-bottom: 0.5rem;
}

.filters-section h2 {
  margin-top: 0;
  margin-bottom: 1rem;
  font-size: 1.2rem;
  font-weight: 600;
  color: #333;
}

.filters-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(0, 1fr));
  column-gap: 1rem; /* Adds spacing only between columns */
  padding-left: 0;  /* No padding on left */
  padding-right: 0; /* No padding on right */
  box-sizing: border-box;
  width: 100%; /* use 100% instead of 100vw */
}

/* Custom dropdown filter styles */
.dropdown-filter {
  position: relative;
  margin-bottom: 0.5rem;
  width: 100%; /* Make dropdown fill available width */
}

.dropdown-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 0.5rem;
  background-color: #fff;
  border: 1px solid #ddd;
  border-radius: 4px;
  cursor: pointer;
  user-select: none;
  min-height: 15px;
}

.dropdown-header:hover {
  border-color: #bbb;
}

.dropdown-header:focus {
  outline: 2px solid rgba(0, 102, 204, 0.27);
}

.dropdown-selected {
  font-size: 0.9rem;
}

.dropdown-arrow {
  font-size: 0.7rem;
  margin-left: 0.5rem;
  color: #666;
}

.dropdown-menu {
  position: absolute;
  z-index: 1000;
  background-color: #fff;
  border: 1px solid #ddd;
  border-radius: 4px;
  margin-top: 2px;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
  overflow-y: auto;
  max-height: 200px;
  width: 100%;
}

.dropdown-option {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.5rem;
  cursor: pointer;
  font-size: 0.9rem;
}

.dropdown-option:hover {
  background-color: #f5f7fa;
}

.dropdown-option:focus {
  outline: 2px solid rgba(0, 102, 204, 0.27);
  background-color: #f0f4f8;
}

.dropdown-option.selected {
  background-color: #f0f4f8;
}

.dropdown-option input {
  margin: 0;
}

/* Clear filters pill */
.clear-pill {
  background-color: #fff;
  cursor: pointer;
  border: 1px solid #0066cc;
}

.clear-pill:hover {
  background-color: #fafafa;
}

.clear-pill:focus {
  outline: 2px solid rgba(0, 102, 204, 0.27);
}

/* Active Filters */
.active-filters {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;

  margin-bottom: 0.5rem;
}

.filter-tag {
  display: inline-flex;
  align-items: center;
  padding: 0.25rem 0.5rem;
  background-color: #f0f4f8;
  border: 1px solid #0066cc;
  border-radius: 16px;
  font-size: 0.8rem;
  animation: fadeIn 0.3s ease;
}

.remove-filter {
  background: none;
  border: none;
  margin-left: 0.25rem;
  cursor: pointer;
  font-size: 1rem;
  line-height: 1;
  padding: 0 0.25rem;
  color: #666;
}

.remove-filter:hover {
  color: #ff3b30;
}

.remove-filter:focus {
  outline: 2px solid rgba(0, 102, 204, 0.27);
}

/* Table title row */
.table-header-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 0.5rem;
  margin-bottom: 0.75rem;
}
.rows-count {
  font-size: 0.85rem;
  color: #666;
}
.rows-count-bar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.5rem 1rem;
  justify-content: flex-start;
  margin-bottom: 0.25rem;
}

.table-title {
  margin: 0;
  font-size: 1.1rem;
  font-weight: 600;
  color: #1a1a1a;
}
.last-updated-inline {
  font-size: 0.85rem;
  font-weight: 400;
  color: #666;
}
/* Table Section */
.table-section {
  padding: 1.5rem;
  flex-grow: 1;
  background-color: #fff;
  margin: auto;
  max-width: 960px;
}

.table-container {
  display: block;
  border-radius: 6px;
  box-shadow: 0 2px 6px #ddd;
}

.rates-table {
  width: 100%;
  table-layout: fixed;
  border-collapse: collapse;
  font-size: 0.875rem;
}

.rates-table th, .rates-table td {
  overflow: visible; 
  padding: 0.5rem 0.5rem;
  text-align: left;
  border-bottom: 1px solid #ddd;
}

.rates-table th {
  background-color: rgba(70, 66, 83, 0.068);
  font-weight: 600;
  color: #333;
  position: relative;
  user-select: none;
}

.bank-name {
  width: 30%;   /* 30% of table width */
  max-width: 300px; /* optional max width */
}

.period {
  width: 20%;
  max-width: 200px;
}

.min-amount,
.max-amount,
.member-tier,
.interest-rate {
  width: 10%;
  max-width: 100px;
}


.rates-table th.sortable:hover {
  background-color: rgba(70, 66, 83, 0.158);
  cursor: pointer;
}

.sort-indicator::after {
  content: '';
  display: inline-block;
  margin-left: 0.5rem;
  width: 0;
  height: 0;
}

.sorted-asc .sort-indicator::after {
  content: '▲';
  font-size: 0.7rem;
  vertical-align: middle;
}

.sorted-desc .sort-indicator::after {
  content: '▼';
  font-size: 0.7rem;
  vertical-align: middle;
}

/* Row appearance */
.rates-table tbody tr {
  background-color: #ffffff;
}

.rates-table tbody tr:hover {
  background-color: #ffffff;
}

.high-rate-row {
  background-color: #ffffff !important;
}

.high-rate-row:hover {
  background-color: #ffffff !important;
}

/* No results styling */
.no-results-cell {
  padding: 0 !important;
}

.no-results {
  background-color: transparent;
  border-left: none;
  padding: 1rem 0 1rem 1rem;
  margin: 0;
  text-align: left;
}

.interest-rate-cell {
  font-weight: 600;
}

/* Error Message */
.error-message {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  padding: 2rem;
  text-align: left;
  background-color: #fff4f4;
  border-radius: 4px;
  border: 1px solid #ffcdd2;
}

.error-message p {
  margin: 0;
  color: #d32f2f;
}

/* Error Message */
.new-message {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  padding: 1rem;
  text-align: left;
  background-color: #d2e4ff;
  border-radius: 4px;
  border: 1px solid rgb(171, 197, 255);
  margin-bottom: 1.5rem;
}

.new-message p {
  margin: 0;
  color: rgb(58, 67, 87);
}

/* Pagination */
.pagination {
  display: flex;
  justify-content: center;
  align-items: center;
  margin-top: 1.5rem;
  gap: 1rem;
}

.pagination-btn {
  padding: 0.5rem 1rem;
  background-color: transparent;
  border: 1px solid #303030;
  border-radius: 4px;
  cursor: pointer;
  font-size: 0.9rem;
  transition: all 0.2s ease;
}

.pagination-btn:hover:not(:disabled) {
  background-color: rgba(0, 0, 0, 0.05);
}

.pagination-btn:focus {
  outline: 2px solid rgba(0, 102, 204, 0.27);
}

.pagination-btn:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

.page-info {
  font-size: 0.9rem;
  color: #666;
}

/* Loading States */
.loading-container {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 3rem 0;
}

.loading-spinner {
  width: 40px;
  height: 40px;
  border: 3px solid rgba(0, 0, 0, 0.1);
  border-radius: 50%;
  border-top-color: #0066cc;
  animation: spin 1s linear infinite;
  margin-bottom: 1rem;
}

@keyframes spin {
  to {
    transform: rotate(360deg);
  }
}

/* Footer */
.footer {
  padding: 1.5rem;
  font-size: 0.9rem;
  color: #666;
}

.footer-content {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 0.5rem;
}

.footer p {
  margin: 0;
}

.disclaimer {
  font-style: italic;
}

.copyright {
  font-size: 0.8rem;
  color: #444;
}

.feedback-content {
  margin-top: 2rem;
  display: flex;
  justify-content: center;   /* vertical centering */
  align-items: center;       /* horizontal centering */
  flex-direction: column;
  padding: 40px;
  gap: 20px;
  background-color: rgba(70, 66, 83, 0.068);
  text-align: center;        /* center text inside children */
  box-sizing: border-box;
}

.feedback-content > * {
  margin-block-start: 0;
  margin-block-end: 0;
}

.feedback-content h3 {
  margin: 0;
  width: 100%;
  margin-bottom: 10px;
}

#feedback-btn {
  margin: 0 auto;        /* center button block horizontally */
  display: block;        /* make button block-level for margin auto to work */
  width: auto;           /* natural width */
  padding: 0.5rem 1rem;
  background-color: #3c454ec9;
  cursor: pointer;
  font-size: 0.9rem;
  color: #fff;
  transition: all 0.2s ease;
  border: 0px;
  border-radius: 4px;
}

#feedback-btn:hover:not(:disabled) {
  background-color: #3c454e;
;
}

  .rates-table th.sortable {
    position: relative;
    padding-right: 20px;
    cursor: pointer;
    user-select: none;
    font-weight: 600;
    color: #333;
  }

  .rates-table th.sortable::before {
    content: "";
    position: absolute;
    right: 8px;
    top: 50%; /* center vertically */
    border-left: 5px solid transparent;
    border-right: 5px solid transparent;
    border-bottom: 6px solid gray;
    width: 0;
    height: 0;
    opacity: 0.4;
    transform: translateY(-85%); /* pull up half arrow height, adjust -50% or -60% as needed */
  }

  .rates-table th.sortable::after {
    content: "";
    position: absolute;
    right: 8px;
    top: 50%; /* center vertically */
    border-left: 5px solid transparent;
    border-right: 5px solid transparent;
    border-top: 6px solid gray;
    width: 0;
    height: 0;
    opacity: 0.4;
    transform: translateY(35%); /* pull down a bit for spacing, adjust as needed */
  }


  .rates-table th.sorted-asc::before {
    border-bottom-color: black;
    opacity: 1;
  }

  .rates-table th.sorted-desc::after {
    border-top-color: black;
    opacity: 1;
  }

/* Animations */
@keyframes fadeIn {
  from {
    opacity: 0;
    transform: translateY(-5px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

/* Responsive Styles */
@media (max-width: 768px) {
  .filters-grid {
    display: flex;
    flex-wrap: nowrap;
    align-items: flex-end;
    gap: 1rem;
    overflow: visible;
    position: relative;
    padding-left: 0;
    padding-right: 0; 

  }
  
  .dropdown-filter {
    flex: 1 1 0;
    min-width: 0;
  }
  
  .title {
    font-size: 1.5rem;
  }
  
  /* Keep table font size consistent on mobile */
  .rates-table {
    font-size: 0.875rem;
    width: 100%;
    table-layout: fixed;
  }

}

/* Make tables responsive on mobile with labels */
@media (max-width: 640px) {
  .rates-table thead {
    display: none;
  }
  
  .rates-table tr {
    display: block;
    margin-bottom: 1rem;
    border: 1px solid #ddd;
    border-radius: 4px;
  }
  
  .rates-table td {
    display: flex;
    justify-content: space-between;
    padding: 0.75rem;
    text-align: right;
    border-bottom: 1px solid #f0f0f0;
  }
  
  .rates-table td:last-child {
    border-bottom: none;
  }
  
  .rates-table td::before {
    content: attr(data-label);
    font-weight: 600;
    margin-right: 1rem;
    text-align: left;
  }

}

@media (max-width: 500px) {
  .last-updated-inline {
    display: block;  /* Makes it occupy its own line */
    margin-top: 0.5rem; /* Optional spacing from above line */
  }
}