/* ========================================
   LOOPHOLEMAXING.COM — Shared Styles
   ======================================== */

/* Reset & Base */
*, *::before, *::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

:root {
  /* Core Palette */
  --bg-primary: #0a0a0f;
  --bg-secondary: #0d1117;
  --bg-card: #161b22;
  --bg-card-hover: #1c2129;
  --border: #21262d;
  --border-light: #30363d;

  /* Text */
  --text-primary: #f0f0f5;
  --text-secondary: #8b8b9e;
  --text-muted: #6e7681;

  /* Accents */
  --accent-blue: #3b82f6;
  --accent-blue-hover: #2563eb;
  --accent-blue-glow: rgba(59, 130, 246, 0.15);
  --accent-orange: #f7931a;
  --accent-orange-glow: rgba(247, 147, 26, 0.15);
  --accent-cyan: #58a6ff;
  --green: #3fb950;
  --red: #f85149;
  --purple: #d2a8ff;
  --yellow: #d29922;

  /* Typography */
  --font-body: system-ui, -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  --font-mono: 'Fira Code', 'SF Mono', 'Cascadia Code', 'JetBrains Mono', 'Consolas', monospace;

  /* Spacing */
  --space-xs: 4px;
  --space-sm: 8px;
  --space-md: 16px;
  --space-lg: 24px;
  --space-xl: 32px;
  --space-2xl: 48px;
  --space-3xl: 64px;
  --space-4xl: 96px;

  /* Sizing */
  --max-width: 1200px;
  --sidebar-width: 260px;

  /* Transitions */
  --transition-fast: 150ms ease;
  --transition-base: 250ms ease;
  --transition-slow: 400ms ease;
}

html {
  scroll-behavior: smooth;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

body {
  font-family: var(--font-body);
  background: var(--bg-primary);
  color: var(--text-primary);
  line-height: 1.6;
  overflow-x: hidden;
}

a {
  color: var(--accent-cyan);
  text-decoration: none;
  transition: color var(--transition-fast);
}

a:hover {
  color: var(--accent-blue);
}

img {
  max-width: 100%;
  height: auto;
  display: block;
}

/* ========================================
   SHARED COMPONENTS
   ======================================== */

/* Top Header Bar */
.top-header {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 1000;
  background: rgba(10, 10, 15, 0.85);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  border-bottom: 1px solid var(--border);
  height: 56px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 var(--space-lg);
}

.logo {
  font-size: 14px;
  font-weight: 800;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  color: var(--text-primary);
  text-decoration: none;
}

.logo:hover {
  color: var(--accent-blue);
}

.nav-links {
  display: flex;
  gap: var(--space-lg);
  list-style: none;
}

.nav-links a {
  font-size: 13px;
  font-weight: 500;
  color: var(--text-secondary);
  letter-spacing: 0.03em;
  transition: color var(--transition-fast);
}

.nav-links a:hover {
  color: var(--text-primary);
}

.nav-links a.active {
  color: var(--accent-blue);
}

/* Footer */
.site-footer {
  border-top: 1px solid var(--border);
  padding: var(--space-2xl) var(--space-lg);
  text-align: center;
  color: var(--text-muted);
  font-size: 13px;
  line-height: 1.8;
}

.site-footer a {
  color: var(--text-secondary);
}

.site-footer a:hover {
  color: var(--accent-cyan);
}

.footer-tagline {
  color: var(--text-secondary);
  font-style: italic;
  margin-top: var(--space-sm);
}

/* Buttons */
.btn-primary {
  display: inline-flex;
  align-items: center;
  gap: var(--space-sm);
  padding: 12px 28px;
  background: var(--accent-blue);
  color: #fff;
  font-size: 15px;
  font-weight: 600;
  border: none;
  border-radius: 8px;
  cursor: pointer;
  transition: all var(--transition-base);
  text-decoration: none;
}

.btn-primary:hover {
  background: var(--accent-blue-hover);
  color: #fff;
  transform: translateY(-1px);
  box-shadow: 0 8px 24px rgba(59, 130, 246, 0.25);
}

.btn-secondary {
  display: inline-flex;
  align-items: center;
  gap: var(--space-sm);
  padding: 10px 24px;
  background: transparent;
  color: var(--text-secondary);
  font-size: 14px;
  font-weight: 500;
  border: 1px solid var(--border);
  border-radius: 8px;
  cursor: pointer;
  transition: all var(--transition-base);
  text-decoration: none;
}

.btn-secondary:hover {
  border-color: var(--accent-cyan);
  color: var(--accent-cyan);
}

/* Cards */
.card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: var(--space-lg);
  transition: all var(--transition-base);
}

.card:hover {
  border-color: var(--border-light);
  background: var(--bg-card-hover);
}

/* Section headings */
.section-label {
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.15em;
  text-transform: uppercase;
  color: var(--accent-blue);
  margin-bottom: var(--space-sm);
}

.section-title {
  font-size: 32px;
  font-weight: 700;
  color: var(--text-primary);
  line-height: 1.2;
  margin-bottom: var(--space-md);
}

.section-subtitle {
  font-size: 16px;
  color: var(--text-secondary);
  line-height: 1.6;
  max-width: 640px;
}

/* Tables */
.data-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 14px;
  border: 1px solid var(--border);
  border-radius: 8px;
  overflow: hidden;
}

.data-table thead {
  background: var(--bg-secondary);
  position: sticky;
  top: 0;
  z-index: 1;
}

.data-table th {
  padding: 10px 14px;
  text-align: left;
  font-weight: 600;
  font-size: 12px;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--text-secondary);
  border-bottom: 1px solid var(--border);
  white-space: nowrap;
}

.data-table td {
  padding: 10px 14px;
  border-bottom: 1px solid var(--border);
  color: var(--text-primary);
  font-family: var(--font-mono);
  font-size: 13px;
}

.data-table tbody tr:nth-child(even) {
  background: rgba(22, 27, 34, 0.5);
}

.data-table tbody tr:hover {
  background: rgba(22, 27, 34, 0.8);
}

/* Value colors */
.positive { color: var(--green); }
.negative { color: var(--red); }
.neutral { color: var(--purple); }
.warning { color: var(--yellow); }
.highlight { color: var(--accent-orange); }
.blue { color: var(--accent-cyan); }

/* Chart images */
.chart-img {
  width: 100%;
  border-radius: 8px;
  border: 1px solid var(--border);
  margin: var(--space-md) 0;
}

/* Scroll to top button */
.scroll-top {
  position: fixed;
  bottom: 24px;
  right: 24px;
  width: 40px;
  height: 40px;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 8px;
  color: var(--text-secondary);
  font-size: 18px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 0;
  visibility: hidden;
  transition: all var(--transition-base);
  z-index: 999;
}

.scroll-top.visible {
  opacity: 1;
  visibility: visible;
}

.scroll-top:hover {
  background: var(--accent-blue);
  border-color: var(--accent-blue);
  color: #fff;
}

/* Responsive utilities */
@media (max-width: 768px) {
  .section-title { font-size: 24px; }
  .section-subtitle { font-size: 14px; }
  .data-table { font-size: 12px; }
  .data-table th, .data-table td { padding: 8px 10px; }
}

/* ================================================
   LIVE MARKET + IQ SYSTEM — MOBILE RESPONSIVENESS
   ================================================ */
@media (max-width: 768px) {
  /* Collapse 2-col grids in new tabs */
  #live-market [style*="grid-template-columns:1fr 1fr"],
  #iq-system [style*="grid-template-columns:1fr 1fr"],
  #iq-system [style*="grid-template-columns:1fr 1fr 1fr"] {
    display: flex !important;
    flex-direction: column !important;
  }

  /* Hourly candle strip scrollable on mobile */
  #hourly-candles {
    min-width: 400px;
  }

  /* Live header bar stack on mobile */
  #live-market > div:first-of-type {
    flex-direction: column !important;
    align-items: flex-start !important;
    gap: 12px !important;
  }

  /* IQ score hero reduce font size */
  #iq-system [style*="font-size:96px"] {
    font-size: 64px !important;
  }
}
