/* ============================================================
   Bard Santner Microfinance Bank — Rate Board styles
   Brand: Pantone 172 C (orange) #F68A43, Pantone 2768 C (navy) #37365A
   Optimized for large-format TV signage; responsive to laptop & mobile.
   ============================================================ */

:root {
  --orange: #F68A43;
  --orange-dark: #E4762E;
  --navy: #37365A;
  --navy-deep: #2B2A47;
  --navy-800: #201F38;
  --ink: #1c1b30;
  --paper: #f7f8fb;
  --line: rgba(255, 255, 255, 0.10);
  --buy: #ffd9b8;   /* warm tint for buying */
  --sell: #ffffff;
  --good: #34c759;
  --warn: #ffcc00;
  --bad: #ff453a;

  /* Fluid sizing driven by viewport so the board fills any screen. */
  --pad: clamp(12px, 2vw, 40px);
  --radius: clamp(10px, 1vw, 20px);

  font-family: "Avenir", "Avenir Next", "Nunito Sans", "Segoe UI", system-ui, -apple-system, Roboto, Helvetica, Arial, sans-serif;
}

* { box-sizing: border-box; margin: 0; padding: 0; }

html, body { height: 100%; }

body {
  background:
    radial-gradient(1200px 600px at 15% -10%, rgba(246, 138, 67, 0.18), transparent 60%),
    radial-gradient(1000px 700px at 100% 120%, rgba(246, 138, 67, 0.10), transparent 55%),
    linear-gradient(160deg, var(--navy) 0%, var(--navy-deep) 55%, var(--navy-800) 100%);
  color: #fff;
  min-height: 100vh;
  overflow: hidden; /* signage: never scroll */
}

/* ---- Board shell: full-viewport vertical layout ---- */
.board {
  height: 100vh;
  width: 100vw;
  display: flex;
  flex-direction: column;
  padding: var(--pad);
  gap: clamp(8px, 1.2vh, 20px);
}

/* ---------------------- Header ---------------------- */
.board__header {
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  align-items: center;
  gap: var(--pad);
  padding-bottom: clamp(8px, 1.2vh, 18px);
  border-bottom: 3px solid var(--orange);
}

.brand { display: flex; align-items: center; }

.brand__logo {
  height: clamp(53px, 8.75vh, 120px);
  width: auto;
  /* Logo already contains navy text on transparent bg; lift it onto a chip
     so it stays legible on the dark board. */
  background: #ffffff;
  padding: clamp(6px, 0.9vh, 14px) clamp(10px, 1.3vw, 22px);
  border-radius: var(--radius);
  box-shadow: 0 6px 22px rgba(0, 0, 0, 0.28);
}

.header__title { text-align: center; }

.header__title h1 {
  font-size: clamp(20px, 3vw, 52px);
  font-weight: 800;
  letter-spacing: 0.02em;
  text-transform: uppercase;
  line-height: 1.05;
}

.header__subtitle {
  margin-top: 0.25em;
  font-size: clamp(11px, 1.2vw, 22px);
  color: var(--orange);
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.clock { text-align: right; justify-self: end; }

.clock__time {
  font-size: clamp(20px, 3.2vw, 56px);
  font-weight: 800;
  font-variant-numeric: tabular-nums;
  line-height: 1;
  color: #fff;
}

.clock__date {
  margin-top: 0.3em;
  font-size: clamp(11px, 1.2vw, 22px);
  font-weight: 600;
  color: rgba(255, 255, 255, 0.75);
}

/* ---------------------- Rates ---------------------- */
.rates {
  flex: 1 1 auto;
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: var(--pad);
  min-height: 0; /* allow children to shrink within flex */
}

.rate-col {
  display: flex;
  flex-direction: column;
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  overflow: hidden;
}

/* Column heading row */
.rate-col__head {
  display: grid;
  grid-template-columns: 2.2fr 1fr 1fr;
  align-items: center;
  gap: clamp(6px, 1vw, 16px);
  padding: clamp(8px, 1.3vh, 18px) clamp(12px, 1.4vw, 26px);
  background: linear-gradient(180deg, var(--orange) 0%, var(--orange-dark) 100%);
  color: #fff;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  font-size: clamp(11px, 1.15vw, 22px);
}

.rate-col__head .col-num { text-align: right; }

.rate-col__body {
  flex: 1 1 auto;
  display: grid;
  grid-auto-rows: 1fr; /* rows share the column height evenly */
}

/* Individual currency row */
.rate-row {
  display: grid;
  grid-template-columns: 2.2fr 1fr 1fr;
  align-items: center;
  gap: clamp(6px, 1vw, 16px);
  padding: clamp(6px, 1vh, 16px) clamp(12px, 1.4vw, 26px);
  border-top: 1px solid var(--line);
}
.rate-row:first-child { border-top: none; }
.rate-row:nth-child(even) { background: rgba(255, 255, 255, 0.03); }

.cur {
  display: flex;
  align-items: center;
  gap: clamp(8px, 1vw, 18px);
  min-width: 0;
}

.cur__flag {
  height: clamp(24px, 3.4vh, 52px);
  width: clamp(36px, 5vw, 78px);
  /* fixed slot width keeps names aligned; contain avoids cropping each flag */
  object-fit: contain;
  object-position: center;
  border-radius: 5px;
  flex: 0 0 auto;
}

.cur__meta { min-width: 0; }

.cur__name {
  font-size: clamp(13px, 1.5vw, 30px);
  font-weight: 700;
  line-height: 1.1;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.cur__code {
  font-size: clamp(10px, 1.05vw, 20px);
  font-weight: 700;
  letter-spacing: 0.1em;
  color: var(--orange);
}

.num {
  text-align: right;
  font-variant-numeric: tabular-nums;
  font-weight: 800;
  font-size: clamp(15px, 1.9vw, 38px);
  line-height: 1;
}
.num--sell { color: #fff; }
.num--buy { color: var(--buy); }

/* Subtle flash when a value changes on refresh */
@keyframes valueFlash {
  0%   { background: rgba(246, 138, 67, 0.55); }
  100% { background: transparent; }
}
.num.flash {
  animation: valueFlash 1.2s ease-out;
  border-radius: 6px;
}

/* ---------------------- Status ---------------------- */
.status {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.6em;
  font-size: clamp(10px, 1vw, 18px);
  color: rgba(255, 255, 255, 0.72);
  font-weight: 600;
}
.status__dot {
  width: 0.8em;
  height: 0.8em;
  border-radius: 50%;
  background: var(--warn);
  box-shadow: 0 0 0 0 rgba(255, 204, 0, 0.6);
}
.status__dot--live { background: var(--good); }
.status__dot--stale { background: var(--warn); }
.status__dot--error { background: var(--bad); }

/* ---------------------- Footer ---------------------- */
.board__footer {
  border-top: 3px solid var(--orange);
  padding-top: clamp(8px, 1.2vh, 18px);
  text-align: center;
}

.contact {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: center;
  gap: 0.6em;
  font-size: clamp(11px, 1.25vw, 24px);
  font-weight: 700;
  color: #fff;
}
.contact__sep { color: var(--orange); }
.contact__item { white-space: nowrap; }

.disclaimer {
  margin-top: 0.6em;
  font-size: clamp(9px, 0.95vw, 17px);
  line-height: 1.35;
  color: rgba(255, 255, 255, 0.62);
  max-width: 1400px;
  margin-left: auto;
  margin-right: auto;
}

.copyright {
  margin-top: 0.5em;
  font-size: clamp(10px, 1.05vw, 19px);
  font-weight: 700;
  color: var(--orange);
}

/* ============================================================
   Responsive: stack to a single column on narrow screens (phones)
   ============================================================ */
@media (max-width: 760px), (max-aspect-ratio: 3/4) {
  body { overflow: auto; }
  .board { height: auto; min-height: 100vh; }

  .board__header {
    grid-template-columns: 1fr;
    justify-items: center;
    text-align: center;
    gap: 12px;
  }
  .clock { justify-self: center; text-align: center; }

  .rates { grid-template-columns: 1fr; }

  .cur__name { white-space: normal; }
}

/* Portrait tablets / medium screens: keep two columns but relax nowrap */
@media (min-width: 761px) and (max-width: 1100px) {
  .header__title h1 { font-size: clamp(18px, 3.4vw, 34px); }
}
