/* =====================================================================
   Live Gold Price Comparison — standalone terminal page.
   Uses the same CSS variables as style.css (--gold, --bg, --green, etc.)
   plus layout specific to this page's card/table hybrid design.
   ===================================================================== */

.lc-body {
  min-height: 100vh;
  padding-bottom: 24px;
}

/* ---------------------------------------------------------------- Header */
.lc-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 14px 16px;
  border-bottom: 1px solid var(--border);
  background: rgba(10, 14, 23, 0.9);
  backdrop-filter: blur(10px);
  position: sticky;
  top: 0;
  z-index: 20;
}
.lc-header-left { display: flex; align-items: center; gap: 12px; min-width: 0; }
.lc-hamburger {
  width: 38px; height: 38px; flex-shrink: 0; border-radius: 10px;
  background: var(--card); border: 1px solid var(--border);
  color: var(--text); font-size: 18px; cursor: pointer;
  display: flex; align-items: center; justify-content: center;
}
.lc-logo {
  width: 34px; height: 34px; flex-shrink: 0; border-radius: 9px;
  background: linear-gradient(135deg, var(--gold-bright), #a9791f);
  display: flex; align-items: center; justify-content: center;
  color: #1a1305; font-size: 16px;
}
.lc-title-block { min-width: 0; }
.lc-title { font-size: 15px; font-weight: 800; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.lc-subtitle { font-size: 11px; color: var(--text-muted); white-space: nowrap; }

.lc-status-badge {
  display: flex; align-items: center; gap: 6px; flex-shrink: 0;
  background: var(--green-dim); color: var(--green);
  padding: 6px 12px; border-radius: 999px; font-size: 11px; font-weight: 800;
  letter-spacing: .04em;
}
.lc-status-badge.error { background: var(--red-dim); color: var(--red); }
.lc-status-dot {
  width: 7px; height: 7px; border-radius: 50%; background: currentColor;
  animation: lc-pulse 1.6s ease-in-out infinite;
}
@keyframes lc-pulse { 0%,100% { opacity: 1; } 50% { opacity: .35; } }

/* ---------------------------------------------------------------- Summary cards */
.lc-summary-row {
  display: grid; grid-template-columns: repeat(2, 1fr); gap: 8px;
  padding: 12px 16px 4px;
}
@media (min-width: 700px) { .lc-summary-row { grid-template-columns: repeat(4, 1fr); } }
.lc-summary-card {
  display: flex; align-items: center; gap: 10px;
  background: var(--card); border: 1px solid var(--border);
  border-radius: 12px; padding: 10px 12px;
}
.lc-summary-card i { font-size: 16px; color: var(--gold); flex-shrink: 0; }
.lc-summary-label { font-size: 10.5px; color: var(--text-muted); font-weight: 600; }
.lc-summary-value { font-size: 13px; font-weight: 700; margin-top: 1px; }
.lc-status-open { color: var(--green); }

/* ---------------------------------------------------------------- Desktop table head (hidden on mobile) */
.lc-table-head {
  display: none;
  padding: 12px 16px;
  margin: 12px 16px 0;
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: 12px 12px 0 0;
  font-size: 11.5px; text-transform: uppercase; letter-spacing: .05em;
  color: var(--gold-bright); font-weight: 700;
}
@media (min-width: 900px) {
  .lc-table-head {
    display: grid;
    grid-template-columns: 1.3fr 1fr 0.9fr 1.4fr 0.9fr 1fr 1.3fr;
    align-items: center;
    gap: 10px;
  }
  .lc-col-usd, .lc-col-order { text-align: center; }
}
.lc-col i { margin-right: 4px; opacity: .8; }

/* ---------------------------------------------------------------- Rows container */
.lc-rows {
  padding: 10px 16px 0;
  display: flex;
  flex-direction: column;
  gap: 10px;
}
@media (min-width: 900px) {
  .lc-rows {
    padding: 0 16px;
    gap: 0;
    border: 1px solid var(--border);
    border-top: none;
    border-radius: 0 0 12px 12px;
    overflow: hidden;
  }
}

/* ---------------------------------------------------------------- One row */
.lc-row {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: 14px;
  padding: 14px;
  will-change: transform;
}
@media (min-width: 900px) {
  .lc-row {
    border-radius: 0;
    border-left: none; border-right: none; border-top: none;
    padding: 10px 4px;
  }
  .lc-row:last-child { border-bottom: none; }
}

/* Two layout blocks per row: mobile card, desktop table row. Only one is
   visible at a time — both hold the same data-field elements so JS can
   update every value once and have it apply to whichever is shown. */
.lc-row-desktop { display: none; }
@media (min-width: 900px) {
  .lc-row-mobile { display: none; }
  .lc-row-desktop {
    display: grid;
    grid-template-columns: 1.3fr 1fr 0.9fr 1.4fr 0.9fr 1fr 1.3fr;
    align-items: center;
    gap: 10px;
  }
  .lc-row-desktop .lc-col-usd,
  .lc-row-desktop .lc-col-order { text-align: center; }
  .lc-row-desktop .lc-market { flex-direction: row; }
  .lc-row-desktop .lc-market.lc-market-right { flex-direction: row-reverse; text-align: right; }
}

/* Mobile: 3-section layout (left market / center order-profit / right market) */
.lc-row-mobile-grid {
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  align-items: center;
  gap: 8px;
}

.lc-market {
  display: flex; flex-direction: column; gap: 2px;
}
.lc-market.lc-market-right { text-align: right; align-items: flex-end; }
.lc-market-flag { font-size: 20px; line-height: 1; }
.lc-market-name { font-size: 12.5px; font-weight: 700; }
.lc-market-currency { font-size: 10.5px; color: var(--text-muted); font-weight: 600; }
.lc-market-local { font-size: 13px; font-weight: 700; color: var(--text-dim); margin-top: 2px; }
.lc-market-usd { font-size: 15px; font-weight: 800; color: var(--gold-bright); }

/* Center: profit + place order */
.lc-center {
  display: flex; flex-direction: column; align-items: center; gap: 6px;
  padding: 4px 2px;
}
.lc-profit {
  display: flex; align-items: center; gap: 4px;
  font-size: 19px; font-weight: 800;
  transition: transform .25s ease;
}
.lc-profit.text-up { color: var(--green); }
.lc-profit.text-down { color: var(--red); }
.lc-profit.text-neutral { color: var(--text-muted); }
.lc-profit-label {
  font-size: 9.5px; text-transform: uppercase; letter-spacing: .08em;
  color: var(--text-muted); font-weight: 700; margin-top: -4px;
}
.lc-place-order-btn {
  background: linear-gradient(135deg, var(--gold-bright), #b3891f);
  color: #1a1305; border: none; border-radius: 9px;
  font-size: 12px; font-weight: 800; letter-spacing: .02em;
  padding: 9px 18px; cursor: pointer; width: 100%;
  transition: filter .12s, transform .08s;
  min-height: 40px;
}
.lc-place-order-btn:hover { filter: brightness(1.08); }
.lc-place-order-btn:active { transform: scale(0.97); }
@media (min-width: 900px) { .lc-place-order-btn { padding: 8px 14px; } }

/* Flash animation on value change */
@keyframes lc-flash-green {
  0% { background: rgba(34,197,94,0.35); }
  100% { background: transparent; }
}
@keyframes lc-flash-red {
  0% { background: rgba(239,68,68,0.35); }
  100% { background: transparent; }
}
.lc-flash-up { animation: lc-flash-green 700ms ease-out; border-radius: 6px; }
.lc-flash-down { animation: lc-flash-red 700ms ease-out; border-radius: 6px; }

/* ---------------------------------------------------------------- Footer */
.lc-footer {
  margin: 16px 16px 0;
  padding: 12px 14px;
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: 12px;
  display: flex; flex-wrap: wrap; gap: 10px;
  align-items: center; justify-content: space-between;
  font-size: 11.5px; color: var(--text-muted);
}
.lc-footer-refresh { display: flex; align-items: center; gap: 6px; font-weight: 600; }
.lc-footer-legend { display: flex; gap: 14px; font-weight: 600; }
.lc-footer-legend span { display: flex; align-items: center; gap: 3px; }

/* ---------------------------------------------------------------- Connection error notice */
.lc-connection-error {
  margin: 10px 16px 0;
  padding: 10px 14px;
  background: var(--red-dim);
  color: var(--red);
  border-radius: 10px;
  font-size: 12px;
  font-weight: 600;
  display: none;
  align-items: center;
  gap: 8px;
}
.lc-connection-error.show { display: flex; }

/* ---------------------------------------------------------------- Sidebar override
   This page has no permanent sidebar-reserved layout (it's meant to fill
   the whole screen edge-to-edge), so the shared sidebar component is
   forced off-canvas here on EVERY screen size, not just mobile — unlike
   the normal app shell where it's always visible on desktop. Higher
   specificity (body.lc-body ...) wins over style.css's base rule. */
body.lc-body .sidebar {
  transform: translateX(-100%);
  transition: transform .25s ease;
}
body.lc-body .sidebar.open {
  transform: translateX(0);
}
