/* ==============================
   BRAND THEME (Bridge)
   Goal: Keep it readable + TV-ready while still feeling on-brand.
   Uses brand colors as accents (header + frame + subtle lines),
   not as full-saturation backgrounds everywhere.
============================== */

/* =========================================================
   SCROLLBAR HARD LOCK (TV SAFE)
   ========================================================= */

html, body {
  margin: 0;
  padding: 0;
  height: 100%;
  overflow: hidden; /* removes both scrollbars */
}

* {
  box-sizing: border-box;
}



:root{
  --brand-blue: #003c6b;
  --brand-green: #037645;

  /* Readability-first neutrals */
  --bg: #0b0f14;          /* page background */
  --grid-shell: rgba(0,60,107,0.28);  /* subtle blue surround */
  --panel: #0e141b;       /* quadrant background */
  --panel-2: #101a22;
  --line: rgba(255,255,255,0.08);

  --text: #f2f2f2;
  --muted: rgba(242,242,242,0.65);
}

/* ==============================
   BASE
============================== */

body {
  margin: 0;
  background-color: #003c6b; /* brand blue */
  color: #f2f2f2;
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
}

/* ==============================
   HEADER
============================== */
.header {
  height: 60px;
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  align-items: center;
  padding: 0 25px;

  background: #0e141b;
  border-bottom: 1px solid rgba(255,255,255,0.08);
  box-shadow: 0 2px 8px rgba(0,0,0,0.35);
}

.header-left {
  display: flex;
  align-items: center;
}

.header-center {
  text-align: center;
}

.header-right {
  display: flex;
  justify-content: flex-end;
  align-items: center;
}

.dashboard-title {
  font-size: 50px;
  font-weight: 600;
  letter-spacing: 1px;
  color: #dddddd;
}

.logo {
  height: 50px;
  opacity: 1;
}

#clock {
  font-size: 18px;
  color: var(--text);
}

/* ==============================
   GRID SHELL
============================== */
.grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  grid-template-rows: 1fr 1fr;

  height: calc(100dvh - 60px);
  min-height: calc(100dvh - 60px);
  max-height: calc(100dvh - 60px);

  gap: 10px;
  padding: 10px;
  box-sizing: border-box;
}

/* ==============================
   QUADRANTS
============================== */

.quadrant {
  background-color: #0e141b;  /* dark readable panel */
  border-radius: 8px;

  display: flex;
  justify-content: center;
  align-items: center;
  min-width: 0;
  min-height: 0;

  box-shadow: inset 0 0 0 1px rgba(255,255,255,0.06);
}

.main {
  display: flex;
  flex-direction: column;
  justify-content: flex-start;
  align-items: stretch;
}

/* ==============================
   Q2 TITLE ROW
============================== */

.title-row {
  width: 100%;
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  align-items: center;
  margin-top: 10px;
  margin-left: 15px;
  margin-right: 18px;
}
.q2-title {
  padding: 6px 14px;
  font-size: 25px;
  font-weight: 600;
  letter-spacing: 1px;
  color: #e0e0e0;

  display: inline-block;
  justify-self: start;

  background-color: rgba(255,255,255,0.06);
  border-radius: 4px;
  box-shadow: inset 0 0 0 1px rgba(255,255,255,0.10);

}

.q2-title::after{
  content:"";
  display:block;
  height: 3px;
  margin-top: 6px;
  border-radius: 2px;
  background: linear-gradient(90deg, var(--brand-blue), var(--brand-green));
  opacity: 0.9;
}

#asset-name {
  grid-column: 2;
  justify-self: center;
  font-size: 50px;
  margin: 0;
  letter-spacing: 1px;
  color: rgba(242,242,242,0.75);
  white-space: nowrap;
}

/* ==============================
   Q2 PRICE BLOCK
============================== */

#price {
  font-size: 40px;
  margin: 4px 0;
  font-weight: 100;
}

#change {
  font-size: 40px;
}

/* flash animations for ticker rows */

.ticker-values {
  transition: opacity 0.3s ease;
}

.flash-up {
  animation: flashGreen 0.6s ease;
}

.flash-down {
  animation: flashRed 0.6s ease;
}

@keyframes flashGreen {
  0%   { background-color: rgba(0,255,127,0.35); }
  100% { background-color: transparent; }
}

@keyframes flashRed {
  0%   { background-color: rgba(255,76,76,0.35); }
  100% { background-color: transparent; }
}

/* ==============================
   Q1 & Q3 STRUCTURE
============================== */

#q1,
#q3 {
  display: flex;
  flex-direction: column;
  justify-content: flex-start;
  align-items: stretch;
  padding: 16px;
  box-sizing: border-box;
}

.quad-inner {
  width: 100%;
}

/* ==============================
   Q1 & Q3 TITLES (match Q2/Q4)
============================== */

.quad-title {
  padding: 6px 14px;
  margin-bottom: 18px;

  font-size: 25px;
  font-weight: 600;
  letter-spacing: 1px;
  color: #e0e0e0;

  display: inline-block;
  align-self: flex-start;

  /* Neutral chip with brand accent underline */
  background-color: rgba(255,255,255,0.06);
  border-radius: 4px;
  box-shadow: inset 0 0 0 1px rgba(255,255,255,0.10);
  position: relative;
}

.quad-title::after{
  content:"";
  display:block;
  height: 3px;
  margin-top: 6px;
  border-radius: 2px;
  background: linear-gradient(90deg, var(--brand-blue), var(--brand-green));
  opacity: 0.9;
}

/* ===============================
   Q3 HEADER (Single Line Layout)
============================== */

.q3-header {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: flex-start;
  margin-bottom: 18px;
  min-height: 40px;
}

/* LEFT TITLE */
.q3-title {
  padding: 6px 14px;
  font-size: 25px;
  font-weight: 600;
  letter-spacing: 1px;
  color: #e0e0e0;

  background-color: rgba(255,255,255,0.06);
  border-radius: 4px;
  box-shadow: inset 0 0 0 1px rgba(255,255,255,0.10);
  position: relative;
}

.q3-title::after{
  content:"";
  display:block;
  height: 3px;
  margin-top: 6px;
  border-radius: 2px;
  background: linear-gradient(90deg, var(--brand-blue), var(--brand-green));
  opacity: 0.9;
}

/* CENTER DOUGHCON */
#doughcon-indicator {
  position: absolute;
  left: 50%;
  transform: translateX(-50%);
  font-weight: 800;
  letter-spacing: 2px;
  font-size: 18px;
}

/* RIGHT LEGEND BOX */
.doughcon-legend-box {
  position: absolute;
  right: 0;
  display: flex;
  gap: 6px;
  background: rgba(255,255,255,0.05);
  padding: 6px 10px;
  border-radius: 6px;
  box-shadow: inset 0 0 0 1px rgba(255,255,255,0.10);
}

/* Individual Level Indicators */
.legend-item {
  font-weight: 700;
  font-size: 14px;
  padding: 2px 6px;
  border-radius: 4px;
}

/* Color Coding */
.level-1 { color: #ff0000; }
.level-2 { color: #ff5c00; }
.level-3 { color: #ffae00; }
.level-4 { color: #00c853; }
.level-5 { color: #2196f3; }

/* ==============================
   TOP SPIKES ROW
============================== */

.event-spike-row {
  display: flex;
  justify-content: space-between;
  gap: 20px;
  margin-top: 30px;
  margin-bottom: 30px;
}

.spike-item {
  flex: 1;
  background: rgba(255,255,255,0.05);
  padding: 10px 12px;
  border-radius: 6px;
  box-shadow: inset 0 0 0 1px rgba(255,255,255,0.08);
  font-size: 16px;
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.spike-name {
  font-weight: 600;
}

/* ==============================
   SPIKE INDICATOR
============================== */

.spike-percent {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 18px;
  font-weight: 700;
  color: #ff4c4c;
}

/* Small red triangle */
.spike-arrow {
  width: 0;
  height: 0;
  border-left: 6px solid transparent;
  border-right: 6px solid transparent;
  border-bottom: 10px solid #ff0000;
}

/* Percent value */
.spike-value {
  font-weight: 700;
}

/* "Spike" text */
.spike-label {
  font-size: 14px;
  font-weight: 600;
  opacity: 0.85;
  letter-spacing: 0.5px;
}

/* ==============================
   MARKETS LIST
============================== */

.event-markets {
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.market-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  background: rgba(255,255,255,0.04);
  padding: 10px 14px;
  border-radius: 6px;
  box-shadow: inset 0 0 0 1px rgba(255,255,255,0.07);
  gap: 14px;
}

.market-left {
  display: flex;
  align-items: center;
  gap: 12px;
  flex: 1;
  min-width: 0;
}

.market-image {
  width: 42px;
  height: 42px;
  object-fit: cover;
  border-radius: 6px;
  flex-shrink: 0;
}

.market-question {
  font-size: 17px;
  font-weight: 600;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.market-region {
  font-size: 14px;
  opacity: 0.6;
  margin-left: 12px;
}

.market-price {
  font-size: 22px;
  font-weight: 700;
  color: #00ff7f;
  flex-shrink: 0;
}

/* ==============================
   Q4 LAYOUT
============================== */

#q4 {
  display: flex;
  flex-direction: column;
  justify-content: flex-start;
  align-items: stretch;
  padding: 16px;
  box-sizing: border-box;
  overflow: hidden;
}

.news-title {
  padding: 6px 14px;
  margin-bottom: 18px;

  font-size: 25px;
  font-weight: 600;
  letter-spacing: 1px;
  color: #e0e0e0;

  display: inline-block;
  align-self: flex-start;

  background-color: rgba(255,255,255,0.06);
  border-radius: 4px;
  box-shadow: inset 0 0 0 1px rgba(255,255,255,0.10);
  position: relative;
}

.news-title::after{
  content:"";
  display:block;
  height: 3px;
  margin-top: 6px;
  border-radius: 2px;
  background: linear-gradient(90deg, var(--brand-blue), var(--brand-green));
  opacity: 0.9;
}

/* ==============================
   Q4 NEWS ITEMS
============================== */

#news-container {
  flex: 1;
  min-height: 0;
  display: flex;
  flex-direction: column;
  justify-content: space-evenly;
  gap: 0;
}

.news-item {
  opacity: 0;
  transition: opacity 0.5s ease-in-out;
  padding-bottom: 2px;
}

.news-item.show {
  opacity: 1;
}

.news-item .news-time {
  display: block;
  font-size: 13px;
  color: rgba(242,242,242,0.55);
  margin-bottom: 6px;
  letter-spacing: 0.5px;
  padding-top: 8px;

}

/* Headline link */
.news-item a {
  display: block;
  color: var(--text);
  text-decoration: none;
  font-size: 25px;
  font-weight: 500;
  line-height: 1.35;
  padding-bottom: 8px;

  border-bottom: 1px solid rgba(255,255,255,0.07);

  white-space: normal;
  overflow-wrap: anywhere;
  word-break: normal;
}

.news-item a:hover {
  text-decoration: underline;
}