/*
 * Vietadi Tỷ Giá — Frontend styles
 * Minimal, mobile-first, không override theme.
 * Dùng class prefix .vtygia- để tránh xung đột.
 */

/* ── Rate inline ──────────────────────────────────────── */
.vtygia-rate {
  display: flex;
  flex-direction: column;
  gap: 4px;
  margin: 0.75em 0;
}

.vtygia-rate__main {
  font-size: 1.5em;
  font-weight: 600;
  line-height: 1.3;
}

.vtygia-rate__currency {
  color: #1a1a1a;
}

.vtygia-rate__value {
  color: #0070f3;
}

.vtygia-rate__vnd {
  color: #555;
  font-size: 0.85em;
  font-weight: 400;
}

/* ── Thời gian cập nhật ──────────────────────────────── */
.vtygia-time {
  display: block;
  font-size: 0.78em;
  color: #888;
  margin-top: 2px;
}

/* ── Error ───────────────────────────────────────────── */
.vtygia-error {
  color: #c00;
  font-size: 0.9em;
}

/* ── Table base ──────────────────────────────────────── */
.vtygia-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.93em;
  margin: 0.5em 0;
}

.vtygia-table thead tr {
  background: #f5f5f5;
}

.vtygia-table th {
  padding: 10px 12px;
  text-align: left;
  font-weight: 600;
  font-size: 0.85em;
  color: #555;
  border-bottom: 2px solid #e0e0e0;
}

.vtygia-table td {
  padding: 10px 12px;
  border-bottom: 1px solid #f0f0f0;
  vertical-align: middle;
}

.vtygia-table tbody tr:hover {
  background: #fafafa;
}

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

/* ── Bang (hub table) ────────────────────────────────── */
.vtygia-bang {
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
}

.vtygia-table__flag {
  font-size: 1.4em;
  width: 36px;
  padding-right: 4px !important;
}

.vtygia-table__code {
  min-width: 120px;
}

.vtygia-table__code strong {
  display: block;
  font-size: 1em;
}

.vtygia-table__code small {
  color: #888;
  font-size: 0.82em;
}

.vtygia-table__rate {
  font-weight: 600;
  color: #0070f3;
  white-space: nowrap;
}

.vtygia-table__100 {
  color: #555;
  white-space: nowrap;
}

/* ── Doi nhanh (converter table) ─────────────────────── */
.vtygia-doi {
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
}

.vtygia-table--doi .vtygia-doi__amount {
  font-weight: 600;
  white-space: nowrap;
}

.vtygia-table--doi .vtygia-doi__arrow {
  color: #bbb;
  text-align: center;
  width: 30px;
}

.vtygia-table--doi .vtygia-doi__vnd strong {
  color: #0070f3;
}

/* ── Responsive ──────────────────────────────────────── */
@media (max-width: 480px) {
  .vtygia-rate__main {
    font-size: 1.25em;
  }
  .vtygia-table th,
  .vtygia-table td {
    padding: 8px;
    font-size: 0.87em;
  }
  .vtygia-table__100 {
    display: none; /* ẩn cột 100 đơn vị trên mobile nhỏ */
  }
}

/* ── Dark mode ───────────────────────────────────────── */
@media (prefers-color-scheme: dark) {
  .vtygia-rate__currency { color: #eee; }
  .vtygia-rate__value    { color: #58a6ff; }
  .vtygia-rate__vnd      { color: #aaa; }
  .vtygia-time           { color: #777; }
  .vtygia-table thead tr { background: #1e1e1e; }
  .vtygia-table th       { color: #aaa; border-bottom-color: #333; }
  .vtygia-table td       { border-bottom-color: #2a2a2a; }
  .vtygia-table tbody tr:hover { background: #1a1a1a; }
  .vtygia-table__code small    { color: #777; }
  .vtygia-table__rate    { color: #58a6ff; }
  .vtygia-table__100     { color: #aaa; }
}

/* ════════════════════════════════════════════════════════
   TRAVEL CURRENCY HUB — [vtygia_hub country="..."]
   Prefix riêng .vtygia-hub để không xung đột với shortcode cũ.
   ════════════════════════════════════════════════════════ */

.vtygia-hub {
  display: flex;
  flex-direction: column;
  gap: 36px;
  margin: 1.5em 0;
}

.vtygia-section__title {
  font-size: 1.3em;
  font-weight: 700;
  margin: 0 0 14px;
  color: #1a1a1a;
}

/* ── 1. Live data ─────────────────────────────────────── */
.vtygia-live__grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 10px;
}

.vtygia-live__row {
  display: flex;
  align-items: baseline;
  gap: 6px;
  padding: 14px 16px;
  background: #f7f9fc;
  border-radius: 10px;
  border: 1px solid #e8edf3;
}

.vtygia-live__amount {
  font-weight: 600;
  color: #1a1a1a;
}

.vtygia-live__eq {
  color: #aaa;
}

.vtygia-live__vnd {
  font-weight: 700;
  color: #0070f3;
  margin-left: auto;
}

/* ── 2. Chi phí du lịch ──────────────────────────────── */
.vtygia-cost__grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 10px;
}

.vtygia-cost__item {
  display: flex;
  flex-direction: column;
  gap: 4px;
  padding: 12px 14px;
  background: #fff;
  border: 1px solid #ececec;
  border-radius: 10px;
}

.vtygia-cost__label {
  font-size: 0.85em;
  color: #888;
}

.vtygia-cost__amount {
  font-weight: 600;
  font-size: 1.05em;
}

.vtygia-cost__vnd {
  font-size: 0.82em;
  color: #0070f3;
}

/* ── 3. Mệnh giá phổ biến ────────────────────────────── */
.vtygia-denom__grid {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

.vtygia-denom__item {
  flex: 1 1 140px;
  display: flex;
  flex-direction: column;
  gap: 2px;
  padding: 14px;
  border-radius: 10px;
  background: linear-gradient(135deg, #fff7e6, #fff);
  border: 1px solid #f0e0bb;
  text-align: center;
}

.vtygia-denom__face {
  font-weight: 700;
}

.vtygia-denom__vnd {
  font-size: 0.85em;
  color: #555;
}

/* ── 4. Calculator (Chi phí chuyến đi) ───────────────── */
.vtygia-calc {
  background: #f7f9fc;
  border: 1px solid #e8edf3;
  border-radius: 14px;
  padding: 20px;
}

.vtygia-calc__hint {
  font-size: 0.88em;
  color: #777;
  margin: 0 0 16px;
}

.vtygia-calc__row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 8px 0;
  border-bottom: 1px solid #e8edf3;
}

.vtygia-calc__label {
  font-size: 0.92em;
  color: #444;
}

.vtygia-calc__input {
  width: 110px;
  padding: 8px 10px;
  border: 1px solid #d8dee6;
  border-radius: 8px;
  font-size: 0.95em;
  text-align: right;
}

.vtygia-calc__result {
  margin-top: 16px;
  padding-top: 12px;
}

.vtygia-calc__total-row {
  display: flex;
  justify-content: space-between;
  padding: 6px 0;
  font-size: 0.95em;
}

.vtygia-calc__total-row--vnd {
  font-size: 1.25em;
  font-weight: 700;
  color: #0070f3;
}

/* ── 5. Đổi tiền ở đâu ────────────────────────────────── */
.vtygia-exchange__grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 12px;
}

.vtygia-exchange__item {
  padding: 14px 16px;
  border: 1px solid #ececec;
  border-radius: 10px;
}

.vtygia-exchange__label {
  margin: 0 0 6px;
  font-size: 1em;
  font-weight: 600;
}

.vtygia-exchange__desc {
  margin: 0;
  font-size: 0.88em;
  color: #666;
  line-height: 1.5;
}

/* ── 6. Tour liên quan ───────────────────────────────── */
.vtygia-tour__grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 14px;
}

.vtygia-tour__card {
  display: block;
  border: 1px solid #ececec;
  border-radius: 12px;
  overflow: hidden;
  text-decoration: none;
  color: inherit;
  transition: box-shadow 0.15s ease, transform 0.15s ease;
}

.vtygia-tour__card:hover {
  box-shadow: 0 6px 18px rgba(0,0,0,0.08);
  transform: translateY(-2px);
}

.vtygia-tour__img {
  width: 100%;
  aspect-ratio: 16/9;
  background: #f0f0f0;
  overflow: hidden;
}

.vtygia-tour__img img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.vtygia-tour__body {
  padding: 12px 14px;
}

.vtygia-tour__title {
  margin: 0 0 6px;
  font-size: 0.95em;
  font-weight: 600;
  line-height: 1.4;
  color: #1a1a1a;
}

.vtygia-tour__price {
  font-size: 0.92em;
  color: #0070f3;
  font-weight: 600;
}

.vtygia-more-link {
  display: inline-block;
  margin-top: 14px;
  font-size: 0.92em;
  font-weight: 600;
  color: #0070f3;
  text-decoration: none;
}

.vtygia-more-link:hover {
  text-decoration: underline;
}

/* ── 7. Địa điểm nổi bật ──────────────────────────────── */
.vtygia-place__grid {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.vtygia-place__chip {
  padding: 8px 16px;
  border-radius: 999px;
  background: #f0f4fa;
  color: #1a1a1a;
  text-decoration: none;
  font-size: 0.9em;
  font-weight: 500;
  border: 1px solid #e0e8f2;
}

.vtygia-place__chip:hover {
  background: #e3eaf6;
}

/* ── 8. Bài viết liên quan ────────────────────────────── */
.vtygia-article__list {
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.vtygia-article__item {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  padding: 12px 4px;
  border-bottom: 1px solid #f0f0f0;
  text-decoration: none;
  color: inherit;
}

.vtygia-article__item:hover .vtygia-article__title {
  color: #0070f3;
}

.vtygia-article__title {
  font-size: 0.95em;
  font-weight: 500;
}

.vtygia-article__date {
  font-size: 0.82em;
  color: #999;
  white-space: nowrap;
}

/* ── 9. Khám phá thêm ─────────────────────────────────── */
.vtygia-explore__grid {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.vtygia-explore__chip {
  padding: 8px 16px;
  border-radius: 8px;
  background: #fff;
  border: 1px solid #ddd;
  color: #444;
  text-decoration: none;
  font-size: 0.88em;
}

.vtygia-explore__chip:hover {
  border-color: #0070f3;
  color: #0070f3;
}

/* ── Vé máy bay / Thời tiết / Bản đồ (link chips) ─────── */
.vtygia-link__grid {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.vtygia-link__chip {
  padding: 8px 16px;
  border-radius: 999px;
  text-decoration: none;
  font-size: 0.9em;
  font-weight: 500;
  color: #1a1a1a;
  background: #f0f4fa;
  border: 1px solid #e0e8f2;
  transition: background 0.15s ease, border-color 0.15s ease;
}

.vtygia-link__chip:hover {
  background: #e3eaf6;
}

/* Accent màu riêng theo từng block để dễ phân biệt khi lướt nhanh. */
.vtygia-flights .vtygia-link__chip { background: #eef6ff; border-color: #d3e6fb; }
.vtygia-flights .vtygia-link__chip:hover { background: #ddeeff; }

.vtygia-weather .vtygia-link__chip { background: #eafaf4; border-color: #cdeede; }
.vtygia-weather .vtygia-link__chip:hover { background: #d8f4e9; }

.vtygia-map .vtygia-link__chip { background: #fff4ec; border-color: #fad9c2; }
.vtygia-map .vtygia-link__chip:hover { background: #ffe9d9; }

/* ── Responsive (mobile) ─────────────────────────────── */
@media (max-width: 640px) {
  .vtygia-live__grid,
  .vtygia-cost__grid,
  .vtygia-exchange__grid,
  .vtygia-tour__grid {
    grid-template-columns: 1fr 1fr;
  }
}

@media (max-width: 480px) {
  .vtygia-live__grid,
  .vtygia-cost__grid,
  .vtygia-exchange__grid,
  .vtygia-tour__grid {
    grid-template-columns: 1fr;
  }
  .vtygia-calc__row {
    flex-direction: column;
    align-items: flex-start;
    gap: 6px;
  }
  .vtygia-calc__input {
    width: 100%;
  }
}

/* ── Dark mode — Travel Hub ───────────────────────────── */
@media (prefers-color-scheme: dark) {
  .vtygia-section__title { color: #eee; }
  .vtygia-live__row      { background: #1a1a1a; border-color: #2a2a2a; }
  .vtygia-live__amount   { color: #eee; }
  .vtygia-cost__item     { background: #161616; border-color: #2a2a2a; }
  .vtygia-cost__label    { color: #999; }
  .vtygia-denom__item    { background: #1c1a14; border-color: #3a331f; }
  .vtygia-denom__vnd     { color: #aaa; }
  .vtygia-calc           { background: #161616; border-color: #2a2a2a; }
  .vtygia-calc__row      { border-bottom-color: #2a2a2a; }
  .vtygia-calc__label    { color: #ccc; }
  .vtygia-calc__input    { background: #0e0e0e; border-color: #333; color: #eee; }
  .vtygia-exchange__item { border-color: #2a2a2a; }
  .vtygia-exchange__desc { color: #999; }
  .vtygia-tour__card     { border-color: #2a2a2a; }
  .vtygia-tour__title    { color: #eee; }
  .vtygia-place__chip    { background: #1a1f2a; color: #eee; border-color: #2a3142; }
  .vtygia-article__item  { border-bottom-color: #2a2a2a; }
  .vtygia-article__date  { color: #777; }
  .vtygia-explore__chip  { background: #161616; border-color: #333; color: #ccc; }
  .vtygia-link__chip     { background: #1a1f2a; color: #eee; border-color: #2a3142; }
  .vtygia-flights .vtygia-link__chip { background: #122436; border-color: #1d3a52; }
  .vtygia-weather .vtygia-link__chip { background: #12261d; border-color: #1d3e2e; }
  .vtygia-map .vtygia-link__chip     { background: #2a1d12; border-color: #4a341f; }
}
