/* public_html/css/style.css - FINAL FIXED VERSION */

:root {
  /* VIBRANT PALETTE */
  --primary: #d32f2f;       
  --primary-dark: #991b1b;
  --gold: #f59e0b;          
  --gold-grad: linear-gradient(135deg, #f59e0b 0%, #b45309 100%);
  --green: #16a34a;        
  --dark: #111827;          
  
  --bg-body: #fff1f2;       
  --bg-card: #ffffff;
  --text-main: #0f172a;
  --text-muted: #64748b;
  --border: #fee2e2;
  --nav-height: 60px;
}

/* --- 1. BASE & RESET --- */
*, *::before, *::after { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }
body {
  margin: 0; font-family: 'Inter', -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  background-color: var(--bg-body); color: var(--text-main);
  line-height: 1.5;
  padding-bottom: calc(var(--nav-height) + 20px); 
}
a { text-decoration: none; color: inherit; transition: 0.2s; }
img { max-width: 100%; display: block; }
ul, ol { list-style: none; padding: 0; margin: 0; }

/* --- 2. HEADER SYSTEM --- */
.site-header {
  background: white; border-bottom: 2px solid var(--gold);
  position: sticky; top: 0; z-index: 100;
  height: 55px; display: flex; align-items: center;
  box-shadow: 0 2px 8px rgba(0,0,0,0.05);
}
.header-inner {
  width: 100%; max-width: 1000px; margin: 0 auto; padding: 0 16px;
  display: flex; justify-content: space-between; align-items: center;
}
.brand-link { display: flex; align-items: center; }
.brand-text { font-weight: 900; font-size: 1.5rem; color: var(--primary); text-transform: uppercase; letter-spacing: -0.5px; }
.brand-text span { color: var(--gold); }

/* Desktop Nav */
.desktop-nav { display: none; gap: 24px; font-weight: 700; font-size: 0.9rem; text-transform: uppercase; }
.desktop-nav a:hover { color: var(--primary); }
.header-actions .icon-btn { font-size: 1.3rem; color: var(--text-muted); padding: 8px; }

/* Disclaimer Bar */
.legal-disclaimer {
  background: #fffbeb; color: #78350f; font-size: 0.7rem;
  padding: 8px; text-align: center; border-bottom: 1px solid #fcd34d;
}
.legal-disclaimer a { text-decoration: underline; font-weight: 700; }

/* Auto Refresh Bar */
.refresh-timer-bar {
  background: #111827; color: #e2e8f0; font-size: 0.75rem; height: 30px;
  display: flex; align-items: center; justify-content: center;
  position: relative; overflow: hidden;
}
.timer-text { position: relative; z-index: 2; font-weight: 600; }
.timer-text span { color: var(--gold); font-weight: 800; }
.timer-progress {
  position: absolute; left: 0; top: 0; bottom: 0;
  background: rgba(245, 158, 11, 0.3); width: 100%; z-index: 1;
}

/* --- 3. MOBILE BOTTOM NAV --- */
.bottom-nav {
  position: fixed; bottom: 0; left: 0; width: 100%;
  background: #0f172a;
  display: flex; justify-content: space-around;
  padding: 8px 0 20px;
  z-index: 1000; border-top: 3px solid var(--gold);
  box-shadow: 0 -4px 10px rgba(0,0,0,0.2);
  height: var(--nav-height);
}
.nav-btn {
  display: flex; flex-direction: column; align-items: center;
  color: #94a3b8; font-size: 0.65rem;
  width: 20%; font-weight: 500; justify-content: center;
}
.nav-btn i { font-size: 1.2rem; margin-bottom: 2px; }
.nav-btn.active { color: var(--gold); font-weight: 700; }
.nav-btn.active i { color: var(--gold); transform: translateY(-2px); }

/* CENTER REFRESH BUTTON (POP-OUT) */
.nav-btn.center-btn { transform: translateY(-20px); }
.nav-btn.center-btn i {
  width: 50px; height: 50px;
  background: var(--gold-grad); color: white;
  border-radius: 50%; display: flex; align-items: center; justify-content: center;
  border: 4px solid #0f172a; font-size: 1.3rem;
  box-shadow: 0 0 0 2px var(--gold);
  animation: spinOnLoad 0.6s ease-out;
}
.nav-btn.center-btn span { margin-top: 4px; color: var(--gold); font-weight: 800; }
@keyframes spinOnLoad { from { transform: rotate(-360deg); } to { transform: rotate(0); } }

/* --- 4. HOMEPAGE COMPONENTS --- */
.main-container { max-width: 1000px; margin: 0 auto; padding: 16px; }

/* Ticker */
.ticker-wrap {
  background: var(--gold-grad); color: white;
  padding: 8px 12px; font-weight: 600; font-size: 0.85rem;
  display: flex; align-items: center; gap: 10px;
}
.ticker-badge { background: white; color: #b45309; padding: 2px 6px; border-radius: 4px; font-weight: 800; font-size: 0.7rem; }

/* Hero Card */
.hero-card {
  background: linear-gradient(135deg, #dc2626 0%, #991b1b 100%);
  color: white; border-radius: 16px; padding: 24px;
  text-align: center; margin-bottom: 24px; border: 2px solid #fca5a5;
  position: relative; box-shadow: 0 10px 20px -5px rgba(220, 38, 38, 0.5);
}
.hero-result { font-size: 4rem; font-weight: 900; line-height: 1; margin: 10px 0; color: #fffbeb; text-shadow: 0 4px 0 #7f1d1d; }
.hero-card.is-live { animation: pulse-gold 2s infinite; }
@keyframes pulse-gold {
  0% { box-shadow: 0 0 0 0 rgba(245, 158, 11, 0.7); border-color: var(--gold); }
  70% { box-shadow: 0 0 0 15px rgba(245, 158, 11, 0); border-color: white; }
  100% { box-shadow: 0 0 0 0 rgba(245, 158, 11, 0); border-color: var(--gold); }
}

/* Results Grid */
.section-head {
  display: flex; justify-content: space-between; align-items: center;
  margin: 24px 0 12px; padding-bottom: 5px; border-bottom: 2px solid #fed7aa;
}
.sec-title { color: #9a3412; font-weight: 800; font-size: 1.1rem; margin: 0; text-transform: uppercase; }
.sec-badge { background: #fff7ed; color: #c2410c; padding: 2px 8px; border-radius: 6px; font-size: 0.75rem; font-weight: 700; border: 1px solid #fed7aa; }

.result-grid { display: grid; gap: 10px; }
@media(min-width: 600px) { .result-grid { grid-template-columns: 1fr 1fr; } }

.result-card {
  background: white; border: 1px solid #fed7aa;
  border-radius: 12px; padding: 12px 16px;
  display: flex; justify-content: space-between; align-items: center;
  box-shadow: 0 2px 4px rgba(0,0,0,0.02);
}
.rc-score { font-size: 1.8rem; font-weight: 900; color: var(--green); line-height: 1; }
.action-btn {
  width: 40px; height: 40px; border-radius: 8px;
  display: flex; align-items: center; justify-content: center; font-size: 1.2rem;
}
.btn-wa { background: #25d366; color: white; }
.btn-chart { background: #f1f5f9; color: var(--text-muted); margin-left: 8px; }

/* --- 5. CHART PAGE STYLES --- */
.chart-top-result {
  background: white; border: 2px solid #fed7aa;
  border-radius: 12px; padding: 16px; margin-bottom: 20px;
  display: flex; justify-content: space-between; gap: 10px;
  box-shadow: 0 4px 6px -1px rgba(245, 158, 11, 0.1);
}
.ctr-box {
  flex: 1; text-align: center;
  background: #fff7ed; border-radius: 8px; padding: 10px 4px;
  border: 1px solid #ffedd5;
}
.ctr-label { font-size: 0.7rem; font-weight: 700; color: #9a3412; text-transform: uppercase; display: block; margin-bottom: 4px; }
.ctr-value { font-size: 1.6rem; font-weight: 900; color: var(--primary); font-family: monospace; line-height: 1; }
.ctr-box.today { background: #fff1f2; border-color: #fecaca; }
.ctr-box.today .ctr-label { color: #991b1b; }

/* Table Wrapper */
.table-wrapper {
  background: white; border: 2px solid var(--gold); border-radius: 8px;
  overflow-x: auto; -webkit-overflow-scrolling: touch; margin-top: 10px;
}
.data-table { width: 100%; border-collapse: separate; border-spacing: 0; }
.data-table th, .data-table td { padding: 12px 10px; text-align: center; border-bottom: 1px solid #fee2e2; }
.data-table th {
  background: #fff7ed; color: #9a3412; font-weight: 800; font-size: 0.75rem;
  text-transform: uppercase; position: sticky; top: 0; z-index: 10;
}
.col-date {
  position: sticky; left: 0; z-index: 20;
  background: #fff1f2; border-right: 2px solid #fed7aa;
  width: 50px; text-align: center; font-weight: 700; color: var(--primary);
}
.data-table thead th.col-date { z-index: 30; background: #fed7aa; color: #7c2d12; }
.data-table td { font-family: monospace; font-size: 1.15rem; font-weight: 700; color: #0f172a; }
.row-today td { background: #fef2f2 !important; color: var(--primary); }

/* --- 6. FOOTER (FIXED) --- */
.site-footer {
  background: #111827; /* Dark Background */
  color: #9ca3af;
  padding: 40px 16px 100px;
  font-size: 0.9rem;
  border-top: 4px solid var(--primary);
  margin-top: auto;
}
.footer-inner {
  max-width: 1000px;
  margin: 0 auto;
  padding: 0 10px;
}
.footer-grid {
  display: grid;
  gap: 30px;
}
.f-head {
  color: white; font-weight: 700; text-transform: uppercase; font-size: 1rem;
  margin-bottom: 16px; border-left: 4px solid var(--gold); padding-left: 12px;
}
.f-links { list-style: none !important; padding: 0 !important; margin: 0 !important; }
.f-links li { margin-bottom: 12px; }
.f-links a { display: block; color: #d1d5db; transition: 0.2s; text-decoration: none; }
.f-links a:hover { color: var(--gold); padding-left: 5px; }

.f-tag {
  background: #333; color: #ccc; padding: 6px 12px;
  border-radius: 4px; font-size: 0.75rem; border: 1px solid #444;
  margin-right: 6px; margin-bottom: 6px; display: inline-block;
  text-decoration: none;
}

/* --- 7. EXTRAS --- */
.install-app-btn {
    position: fixed; bottom: 90px; right: 16px;
    background: var(--primary); color: white;
    border: none; padding: 10px 20px; border-radius: 30px;
    font-weight: 700; box-shadow: 0 4px 15px rgba(220, 38, 38, 0.4);
    display: flex; align-items: center; gap: 8px; z-index: 999;
    animation: bounce 2s infinite; cursor: pointer;
}
@keyframes bounce { 0%, 100% {transform: translateY(0);} 50% {transform: translateY(-8px);} }

/* DESKTOP FIXES */
@media(min-width: 768px) {
  .bottom-nav { display: none; }
  .desktop-nav { display: flex; }
  body { padding-bottom: 0; background-color: #f1f5f9; }
  .main-container {
    background: white; min-height: 100vh;
    box-shadow: 0 0 30px rgba(0,0,0,0.05); margin-top: 20px; border-radius: 12px;
  }
  .site-footer { padding-bottom: 40px; }
  .footer-grid { grid-template-columns: repeat(3, 1fr); align-items: start; }
}