/* ── Fixed Deposit Rate Table ─────────────────────────────────────────── */

.fd-app {
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  font-size: 0.95rem;
  color: #1a1a2e;
}

/* ── Filters ────────────────────────────────────────────────────────────── */

.fd-filters {
  display: flex;
  flex-wrap: wrap;
  gap: 12px 20px;
  margin-bottom: 20px;
  padding: 16px;
  background: #f5f7fa;
  border-radius: 8px;
  border: 1px solid #e0e4ec;
}

.fd-filter-group {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.fd-filter-group label {
  font-size: 0.78rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: #555;
}

.fd-filter-group select {
  padding: 6px 10px;
  border: 1px solid #c9d0dc;
  border-radius: 5px;
  background: #fff;
  font-size: 0.9rem;
  min-width: 130px;
  cursor: pointer;
}

.fd-filter-group select:focus {
  outline: none;
  border-color: #3b6fd4;
  box-shadow: 0 0 0 3px rgba(59, 111, 212, 0.15);
}

/* ── Channel toggles ────────────────────────────────────────────────────── */

.fd-channel-toggles {
  display: flex;
  gap: 4px;
  flex-wrap: wrap;
}

.fd-channel-btn {
  padding: 4px 8px;
  border: 1px solid #c9d0dc;
  border-radius: 20px;
  background: #fff;
  cursor: pointer;
  font-size: 1rem;
  line-height: 1;
  transition: background 0.15s, border-color 0.15s;
}

.fd-channel-btn:hover {
  border-color: #3b6fd4;
  background: #eef2fc;
}

.fd-channel-btn.active {
  background: #3b6fd4;
  border-color: #3b6fd4;
  color: #fff;
}

/* ── Cards container ─────────────────────────────────────────────────────── */

.fd-cards-container {
  /* Always visible — no media-query gating */
}

/* ── Card ─────────────────────────────────────────────────────────────────── */

.fd-card {
  background: #fff;
  border: 1px solid #e0e0e0;
  border-radius: 10px;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
  margin-bottom: 16px;
  overflow: hidden;
}

.fd-card--stale {
  border-color: #f0c040;
}

/* ── Top section ─────────────────────────────────────────────────────────── */

.fd-card-top {
  display: flex;
  align-items: center;
  padding: 16px 20px;
  gap: 16px;
}

.fd-card-identity {
  display: flex;
  align-items: center;
  gap: 14px;
  flex: 1;
  min-width: 0;
}

.fd-logo {
  max-height: 50px;
  max-width: 120px;
  object-fit: contain;
  flex-shrink: 0;
}

.fd-card-id-text {
  display: flex;
  flex-direction: column;
  gap: 3px;
  flex: 1;
  min-width: 0;
}

.fd-bank-name {
  font-weight: 700;
  font-size: 1rem;
  word-break: normal;
}

.fd-product-name {
  font-size: 0.82rem;
  color: #666;
  margin-top: 2px;
}

.fd-referral-badge {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 5px 12px;
  background: #f0fdf4;
  color: #16a34a;
  border: 1px solid #bbf7d0;
  border-radius: 20px;
  font-size: 0.78rem;
  font-weight: 600;
  text-decoration: none !important;
  white-space: nowrap;
  flex-shrink: 0;
  align-self: flex-start;
  flex-shrink: 0;
  transition: background 0.15s;
}

.fd-referral-badge:hover {
  background: #dcfce7;
}

/* ── Stats bar ────────────────────────────────────────────────────────────── */

.fd-card-stats {
  display: flex;
  border-top: 1px solid #e0e0e0;
  border-bottom: 1px solid #e0e0e0;
  background: #f8f9fa;
}

.fd-stat {
  flex: 1;
  padding: 12px 16px;
  border-right: 1px solid #e0e0e0;
}

.fd-stat:last-child {
  border-right: none;
}

.fd-stat-label {
  display: block;
  font-size: 0.72rem;
  color: #888;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  margin-bottom: 4px;
}

.fd-stat-value {
  display: block;
  font-size: 0.95em;
  font-weight: 600;
}

.fd-stat-rate {
  font-size: 1.3em;
  color: #e67e22;
}

/* ── Notes ────────────────────────────────────────────────────────────────── */

.fd-card-notes {
  padding: 8px 20px;
  font-size: 0.78rem;
  color: #6b7280;
  font-style: italic;
  border-top: 1px solid #e0e0e0;
}

/* ── Bottom bar ───────────────────────────────────────────────────────────── */

.fd-card-bottom {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 12px 20px;
  gap: 12px;
}

.fd-card-meta-text {
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.fd-card-updated {
  font-size: 0.75rem;
  color: #888;
}

.fd-card-stale-warn {
  font-size: 0.75rem;
  color: #b45309;
}

/* ── Action buttons ──────────────────────────────────────────────────────── */

.fd-goto-btn {
  display: inline-block;
  padding: 8px 18px;
  background: #1a1a2e;
  color: #fff !important;
  border-radius: 6px;
  font-size: 0.88rem;
  font-weight: 600;
  text-decoration: none !important;
  white-space: nowrap;
  flex-shrink: 0;
  transition: background 0.15s;
}

.fd-goto-btn:hover {
  background: #2d2d4e;
}

/* ── Channel icons ───────────────────────────────────────────────────────── */

.fd-channel-icon {
  font-size: 1rem;
  margin-right: 2px;
}

/* ── Empty / loading states ──────────────────────────────────────────────── */

.fd-empty,
.fd-loading {
  text-align: center;
  padding: 40px 20px;
  color: #888;
  font-style: italic;
}

.fd-error {
  color: #b91c1c;
  font-weight: 500;
  padding: 12px 0;
}

/* ── Disclaimer ──────────────────────────────────────────────────────────── */

.fd-disclaimer {
  margin-top: 14px;
  font-size: 0.78rem;
  color: #999;
  text-align: center;
}

/* ── Referral badge visibility ───────────────────────────────────────────── */

.fd-referral-header { display: inline-flex; }
.fd-referral-footer { display: none; }

/* ── Filters stack on tablet ─────────────────────────────────────────────── */

@media (max-width: 768px) {
  .fd-filters {
    flex-direction: column;
  }

  .fd-filter-group select {
    min-width: 100%;
  }
}

/* ── Stats bar wraps to 2-col grid on small screens ──────────────────────── */

@media (max-width: 600px) {
  .fd-card-stats {
    flex-wrap: wrap;
  }

  .fd-stat {
    flex: none;
    width: 50%;
    box-sizing: border-box;
    border-right: none;
    border-bottom: 1px solid #e0e0e0;
  }

  /* Left column cells keep their right border */
  .fd-stat:nth-child(odd) {
    border-right: 1px solid #e0e0e0;
  }

  /* When the last stat lands in the left (odd) position, span full width */
  .fd-stat:last-child:nth-child(odd) {
    width: 100%;
    border-right: none;
  }

  /* Remove bottom border from the last row */
  .fd-stat:last-child,
  .fd-stat:nth-last-child(2):nth-child(odd) {
    border-bottom: none;
  }

  .fd-card-top {
    flex-wrap: wrap;
  }

  .fd-card-bottom {
    flex-direction: column;
    align-items: stretch;
    gap: 10px;
  }

  .fd-goto-btn {
    text-align: center;
  }

  .fd-referral-header { display: none !important; }
  .fd-referral-footer { display: block !important; width: 100%; text-align: center; box-sizing: border-box; margin-top: 8px; }
}
