<style>
/* ✅ Converter Styles — Retained As-Is (DO NOT CHANGE) */
.converter-container {
  display: flex;
  flex-wrap: wrap;
  gap: var(--global-row-gutter, 30px);
  margin-top: 0;
  align-items: stretch;
  justify-content: center;
}

.converter-box {
  flex: 1;
  min-width: 300px;
  border: 2px solid #005F73;
  padding: 20px;
  border-radius: 10px;
  background-color: #005F73;
  color: #ffffff;
}

.converter-box h2 {
  text-align: center;
  margin-bottom: 40px;
  font-weight: bold;
  color: #ffffff;
}

.currency-title {
  text-align: center;
  font-weight: bold;
  margin: 0 0 20px;
  font-size: 22px;
}

.converter-row {
  display: flex;
  flex-direction: column;
  gap: 10px;
  margin-bottom: 20px;
}

.converter-row > * {
  width: 100%;
  max-width: 400px;
}

@media (min-width: 768px) {
  .converter-row {
    flex-direction: row;
    justify-content: space-between;
    gap: 10px;
  }
  .converter-row .dropdown,
  .converter-row .currency-input {
    flex: 1;
    max-width: 100%;
  }
}

.converter-row.converter-inline {
  display: flex;
  align-items: center;
  gap: 10px;
}

.converter-row.converter-inline .dropdown {
  flex: 0 0 240px;
  max-width: 240px;
}

.converter-row.converter-inline .inline-label {
  flex: 0 0 90px;
  max-width: 90px;
  font-size: 18px;
  margin: 0;
  text-align: center;
  color: #ffffff;
}

.converter-row.converter-inline .inline-input {
  flex: 1;
  margin-bottom: 0;
}

.converter-row.converter-buying {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 20px;
  margin-right: calc(240px + 10px);
}
:dir(ltr) .converter-row.converter-buying {
  margin-right: 0;
  margin-left: calc(240px + 10px);
}
.converter-row.converter-buying .inline-label {
  flex: 0 0 90px;
  color: #ffffff;
  font-size: 18px;
}

.converter-row.converter-buying .inline-input {
  flex: 1;
}

.dropdown {
  position: relative;
}

.dropdown-button {
  background-color: #ffffff;
  color: #004E5E;
  padding: 0 12px;
  border: 1px solid #004E5E;
  border-radius: 6px;
  cursor: pointer;
  box-sizing: border-box;
  height: 48px;
  display: flex;
  align-items: center;
  justify-content: flex-start;
  gap: 4px;
  position: relative;
  padding-left: 24px;
  padding-right: 12px;
  font-size: 15px;
  line-height: 48px;
}

.dropdown-button .placeholder {
  color: #666;
}

.dropdown-list {
  position: absolute;
  top: 100%;
  left: 0;
  right: 0;
  background-color: #ffffff;
  border: 1px solid #ccc;
  max-height: 250px;
  overflow-y: auto;
  border-radius: 6px;
  z-index: 1000;
  display: none;
  font-size: 15px;
  min-height: 48px;
}

.dropdown-list.show {
  display: block;
}

.dropdown-item {
  padding: 10px;
  cursor: pointer;
  color: #004E5E;
  display: flex;
  align-items: center;
  gap: 10px;
}

.dropdown-item:hover {
  background-color: #f1f1f1;
}

.dropdown-arrow {
  position: absolute;
  left: 8px;
  font-size: 14px;
  margin-left: 0;
  color: #666;
  pointer-events: none;
}

html[dir="rtl"] .dropdown-item {
  flex-direction: row-reverse;
}

.currency-input {
  display: block;
  width: 100%;
  font-size: 20px !important;
  text-align: center;
  border: 1px solid #004E5E;
  border-radius: 6px;
  background-color: #ffffff;
  color: #004E5E;
  box-sizing: border-box;
  height: 48px;
  padding: 0 12px;
  line-height: 48px;
}

.currency-input[readonly] {
  background-color: #f0f0f0;
  cursor: default;
  font-weight: bold;
}

#convertedSellOutput {
  border: 2px solid #e53935;
}

#convertedBuyOutput {
  border: 2px solid #43a047;
}

.toggle-row {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  margin-top: 20px;
}

.google-toggle {
  background-color: #ffffff;
  border: 1px solid #004E5E;
  border-radius: 25px;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 80px;
  height: 35px;
  padding: 5px 8px;
  cursor: pointer;
  font-size: 20px;
  color: #004E5E;
  user-select: none;
  font-family: 'Rubik', sans-serif;
  font-weight: 600;
}

.google-toggle select {
  background-color: #ffffff;
  color: #004E5E;
  border: none;
}

.conversion-rate {
  text-align: center;
  font-size: 20px;
  margin-top: 20px;
  font-weight: 500;
  color: #ffffff;
}

@media (max-width: 767px) {
  .converter-row,
  .converter-row.converter-inline,
  .converter-row.converter-buying {
    display: flex !important;
    flex-direction: column !important;
    align-items: center !important;
    margin: 0 !important;
  }

  .converter-row .dropdown,
  .converter-row .currency-input,
  #convertedSellOutput,
  #convertedBuyOutput {
    flex: 1 1 auto !important;
    max-width: 300px !important;
    width: 100% !important;
    margin-bottom: 10px;
  }

  .converter-row.converter-buying .inline-label,
  .converter-row.converter-inline .inline-label {
    flex: 0 0 auto !important;
    width: 100% !important;
  }
}

/* ✅ Unified Table Styling */
table {
  width: 100%;
  border-collapse: collapse;
}

th, td {
  padding: 10px;
  text-align: center;
  border: 2px solid #004E5E;
  font-size: 17px;
}

th {
  background-color: #edf2f7;
  color: #000;
}

td {
  background-color: inherit;
}
.table-wrapper {
  width: 100%;
  overflow-x: auto; /* fallback for extreme overflow cases */
}
@media (max-width: 768px) {
  .table-wrapper {
    overflow-x: hidden; /* keep table contained */
  }

  table {
    width: 100%;
    table-layout: fixed; /* force all columns to shrink */
  }

  th, td {
    font-size: 14px; /* slightly smaller text */
    padding: 6px;
    white-space: normal; /* allow wrapping if needed */
  }

  img.flag {
    width: 24px !important;
    height: auto !important;
  }
}
/* ✅ Flag Styling */
img.flag {
  width: 35px !important;
  height: 23px !important;
  object-fit: contain;
  aspect-ratio: 35 / 23;
  display: inline-block;
  vertical-align: middle;
}

/* ✅ Market change indicators */
.rate-change {
  position: relative;
  font-weight: bold;
  margin: 0 5px;
  direction: ltr;
  cursor: default;
}

.rate-change.down { color: #B00020; }
.rate-change.up { color: #0A7E07; }

.tooltip-text {
  visibility: hidden;
  width: max-content;
  background-color: black;
  color: white;
  text-align: center;
  border-radius: 4px;
  padding: 5px 8px;
  position: absolute;
  z-index: 1;
  top: 50%;
  right: 105%;
  transform: translateY(-50%);
  white-space: nowrap;
  opacity: 0;
  transition: opacity 0.3s;
}

.rate-change:hover .tooltip-text {
  visibility: visible;
  opacity: 1;
}

@media (max-width: 768px) {
  .tooltip-text {
    font-size: 11px;
    padding: 4px 6px;
  }
}

body.ast-header-transparent {
  padding-top: 100px;
}
</style>
