/* ============================================================
   CHART PAGE — Premium Dark Theme  |  history.html
   ============================================================ */

.chart-page {
  background: var(--bg);
  color: var(--text);
  min-height: 100vh;
}

/* ---- HEADER ---- */
.chart-header {
  background: var(--header-bg);
  border-bottom: 1px solid var(--border);
  padding: 20px 0 16px;
  text-align: center;
  position: relative;
  overflow: hidden;
}
.chart-header-glow {
  position: absolute; top: -40px; left: 50%;
  transform: translateX(-50%);
  width: 500px; height: 160px;
  background: radial-gradient(ellipse, rgba(230,57,70,0.18) 0%, transparent 70%);
  pointer-events: none;
}
.chart-header .container { position: relative; z-index: 1; }

.chart-back-btn {
  display: inline-block; color: var(--muted);
  font-size: 13px; font-weight: 600; text-decoration: none;
  border: 1px solid var(--border); border-radius: 20px;
  padding: 5px 14px; margin-bottom: 12px; transition: all 0.2s ease;
}
.chart-back-btn:hover { color: var(--white); border-color: var(--muted); background: rgba(255,255,255,0.06); }

.chart-title {
  font-family: 'Rajdhani', sans-serif; font-size: 32px; font-weight: 700;
  color: var(--gold); text-transform: uppercase; letter-spacing: 3px; margin: 0;
  text-shadow: 0 0 20px rgba(255,215,0,0.35); line-height: 1.1;
}
.chart-subtitle { font-size: 13px; color: var(--muted); margin-top: 6px; font-style: italic; }

/* ---- RESULT HERO ---- */
.result-hero {
  background: var(--boston-bg);
  border-top: 3px solid var(--gold); border-bottom: 1px solid var(--border);
  padding: 24px 0;
}
.result-hero-inner { text-align: center; }
.result-hero-label {
  font-family: 'Rajdhani', sans-serif; font-size: 22px; font-weight: 700;
  color: var(--blue); text-transform: uppercase; letter-spacing: 1px; margin-bottom: 6px;
}
.result-hero-value {
  font-family: 'Rajdhani', sans-serif; font-size: 42px; font-weight: 700;
  color: var(--gold); text-shadow: 0 0 24px rgba(255,215,0,0.45);
  letter-spacing: 2px; margin-bottom: 16px; line-height: 1;
}
.result-refresh-btn {
  background: linear-gradient(135deg, #b8860b, var(--gold), #b8860b);
  border: none; color: #000; font-size: 14px; font-weight: 700;
  padding: 10px 28px; border-radius: 25px; cursor: pointer;
  font-family: 'Poppins', sans-serif; transition: all 0.25s ease;
  box-shadow: 0 4px 16px rgba(255,215,0,0.35);
}
.result-refresh-btn:hover { transform: translateY(-2px); box-shadow: 0 8px 24px rgba(255,215,0,0.5); }

/* ---- NAV STRIP ---- */
.chart-nav-strip {
  background: var(--bg2); border-bottom: 1px solid var(--border);
  padding: 10px 0; text-align: center;
}
.chart-nav-strip.bottom { border-bottom: none; border-top: 1px solid var(--border); }
.chart-nav-link { color: var(--gold); font-size: 13px; font-weight: 600; text-decoration: none; padding: 0 6px; transition: color 0.2s ease; }
.chart-nav-link:hover { color: var(--text); }
.chart-nav-sep { color: var(--muted); margin: 0 8px; }

/* ---- TABLE WRAPPER ---- */
.chart-main { padding: 28px 0; }
.chart-table-wrap { overflow-x: auto; border-radius: 12px; border: 1px solid var(--border); }

/* ============================================================
   CHART TABLE
   ============================================================ */
.chart-table {
  width: 100%;
  border-collapse: collapse;
  background: var(--bg2);
  min-width: 700px;
  table-layout: fixed;
}

.chart-table thead {
  background: linear-gradient(90deg, #1a0000, #3d0000, #1a0000);
}

.chart-table th {
  color: var(--gold);
  font-size: 12px;
  font-weight: 700;
  font-family: 'Rajdhani', sans-serif;
  padding: 12px 4px;
  text-align: center;
  border: 1px solid var(--border);
  text-transform: uppercase;
  letter-spacing: 1px;
}

.chart-th-date {
  width: 88px;
  min-width: 88px;
  color: var(--white) !important;
  background: rgba(255,215,0,0.07);
}

.chart-table td {
  background: var(--bg2);
  border: 1px solid var(--border);
  padding: 0;
  text-align: center;
  vertical-align: middle;
}

.chart-table tbody tr:nth-child(even) td { background: var(--bg); }
.chart-table tbody tr:hover td { background: rgba(255,215,0,0.04); transition: background 0.15s; }

.chart-date-cell {
  font-size: 9.5px;
  font-weight: 600;
  color: var(--muted);
  line-height: 1.5;
  padding: 6px 3px !important;
  background: rgba(255,255,255,0.025) !important;
}

/* ============================================================
   JODI CHART CELLS  (view=jodi)
   ============================================================ */
.chart-jodi-cell {
  font-family: 'Rajdhani', sans-serif;
  font-size: 28px;
  font-weight: 700;
  color: var(--text);
  display: block;
  padding: 12px 4px;
}
.chart-jodi-cell.red {
  color: #ff3333;
  text-shadow: 0 0 10px rgba(255,50,50,0.5);
}

/* ============================================================
   PANEL CHART CELLS  (view=panel)

   Each cell renders:
     <div class="chart-panel-cell">
       <div class="chart-panel-left">   ← open pana digits stacked
         <span>6</span>
         <span>4</span>
         <span>5</span>
       </div>
       <div class="chart-panel-jodi">23</div>   ← jodi center
       <div class="chart-panel-right">  ← close pana digits stacked
         <span>1</span>
         <span>7</span>
         <span>1</span>
       </div>
     </div>
   ============================================================ */

.chart-panel-cell {
  display: flex;
  flex-direction: row;
  align-items: center;
  justify-content: center;
  gap: 4px;
  padding: 8px 3px;
  min-height: 76px;
  width: 100%;
  box-sizing: border-box;
}

/* Open Pana — left */
.chart-panel-left {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  width: 22px;
}

/* Close Pana — right */
.chart-panel-right {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  width: 22px;
}

/* Each pana digit */
.chart-panel-left span,
.chart-panel-right span {
  font-family: 'Rajdhani', sans-serif;
  font-size: 16px;
  font-weight: 800;
  color: rgba(255, 255, 255, 0.92);
  line-height: 1.3;
  display: block;
  width: 100%;
  text-align: center;
}

/* Jodi — center highlight */
.chart-panel-jodi {
  font-family: 'Rajdhani', sans-serif;
  font-size: 28px;
  font-weight: 900;
  color: #ffd700;
  min-width: 34px;
  text-align: center;
  text-shadow: 0 0 14px rgba(255,215,0,0.55), 0 0 2px rgba(255,215,0,0.3);
  line-height: 1;
  flex-shrink: 0;
}

.chart-panel-jodi.red {
  color: #ff4444;
  text-shadow: 0 0 14px rgba(255,60,60,0.65), 0 0 2px rgba(255,60,60,0.3);
}

/* Missing pana placeholder */
.pana-star {
  font-size: 12px !important;
  font-weight: 400 !important;
  color: rgba(255,255,255,0.2) !important;
  line-height: 1.3 !important;
}

/* Empty cell placeholder */
.chart-panel-empty {
  color: rgba(255,255,255,0.18);
  font-size: 14px;
  font-family: 'Rajdhani', sans-serif;
  font-weight: 600;
}

/* Loading row */
.chart-loading {
  color: rgba(255,255,255,0.35);
  font-size: 15px;
  padding: 40px !important;
  text-align: center;
}

/* ---- FOOTER ---- */
.chart-footer {
  background: #08080f;
  border-top: 1px solid rgba(255,255,255,0.06);
  padding: 20px 0;
  text-align: center;
}
.chart-footer-name { font-family: 'Rajdhani', sans-serif; font-size: 20px; font-weight: 700; color: #ffd700; margin-bottom: 6px; }
.chart-footer-copy { font-size: 12px; color: rgba(255,255,255,0.2); }

/* ============================================================
   RESPONSIVE
   ============================================================ */
@media (max-width: 768px) {
  .chart-title       { font-size: 24px; }
  .result-hero-value { font-size: 32px; }
  .result-hero-label { font-size: 18px; }
  .chart-table       { min-width: 500px; }

  .chart-table th,
  .chart-table td    { font-size: 10px; padding: 1px; }

  .chart-th-date     { width: 70px; min-width: 70px; }
  .chart-jodi-cell   { font-size: 20px; padding: 8px 2px; }

  .chart-panel-cell  { gap: 3px; padding: 6px 1px; min-height: 64px; }
  .chart-panel-jodi  { font-size: 20px; min-width: 26px; }
  .chart-panel-left,
  .chart-panel-right { width: 18px; }
  .chart-panel-left span,
  .chart-panel-right span { font-size: 13px; line-height: 1.25; font-weight: 700; }
}

@media (max-width: 480px) {
  .chart-table       { min-width: 380px; }
  .chart-th-date     { width: 60px; min-width: 60px; }
  .chart-panel-cell  { gap: 2px; padding: 4px 0; min-height: 56px; }
  .chart-panel-jodi  { font-size: 17px; min-width: 22px; }
  .chart-panel-left,
  .chart-panel-right { width: 14px; }
  .chart-panel-left span,
  .chart-panel-right span { font-size: 11px; line-height: 1.2; }
}