/* styles.css – modernized, theme-safe */

/* =========================
   Font
   ========================= */

@font-face {
  font-family: 'Quicksand';
  font-style: normal;
  font-weight: 400 600;
  font-display: swap;
  src: url('/fonts/quicksand/quicksand-regular.woff2') format('woff2');
}

/* =========================
   Base
   ========================= */

body {
  font-family: 'Quicksand', "Segoe UI", "SF Pro", "Ubuntu", Arial, sans-serif;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  min-height: 100vh;
}

/* =========================
   Header / Navigation
   ========================= */

header {
  padding: 16px 24px;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

header h1 {
  margin: 0;
  font-size: 1.4em;
  font-weight: 600;
}

header h1 a {
  color: inherit;
  text-decoration: none;
}

nav a {
  margin-left: 18px;
  text-decoration: none;
  font-weight: 600;
}

nav a:hover {
  text-decoration: underline;
}

/* remove visited state in nav */
nav a:visited {
  color: inherit;
}

.gear-btn {
  background: none;
  border: none;
  font-size: 1.3em;
  cursor: pointer;
}

/* =========================
   Controls
   ========================= */

.controls {
  display: none;
  padding: 12px 24px;
  flex-wrap: wrap;
  justify-content: center;
  gap: 12px 24px;
  font-size: 0.95em;
}

.controls.open {
  display: flex;
}

/* Modern ghost-style action button */
button {
  background: transparent;
  border: 1px solid rgba(100,116,139,0.35);
  border-radius: 8px;
  padding: 6px 12px;
  font-size: 0.8em;
  font-weight: 600;
  color: inherit;
  cursor: pointer;
}

button:hover {
  background: rgba(100,116,139,0.08);
}


/* Modernize settings form */
fieldset {
  border: 1px solid rgba(148,163,184,0.25);
  border-radius: 8px;
}

legend {
  padding: 0 6px;
  font-weight: 600;
  color: #64748b;
}


/* =========================
   Charts / Cards
   ========================= */

.charts {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  margin: 28px;
  gap: 28px;
  flex: 1;
}

.chart-box {
  flex: 1 1 45%;
  max-width: 620px;
  padding: 20px 22px;
  border-radius: 14px;
  text-align: center;
  transition: box-shadow 0.15s ease;
}

.chart-box h2 {
  margin: 0 0 12px 0;
  font-size: 1.15em;
  font-weight: 600;
}

.market-status {
  min-height: 1.5em;
  font-size: 0.85em;
}

.chart-box img {
  width: 100%;
  height: auto;
  border-radius: 10px;
  max-width: 600px;
  cursor: pointer;
}

.chart-info-strong {
  font-size: 0.85em;
  font-weight: 600;
  margin-top: 10px;
}

.chart-info-small {
  font-size: 0.8em;
  margin-top: 4px;
}

/* =========================
   Commentary
   ========================= */

.commentary-block {
  margin-top: 18px;
  text-align: left;
  line-height: 1.6;
  font-size: 0.8em;
}

.commentary-block div {
  margin-bottom: 14px;
}

/* =========================
   Tables (safe softening)
   ========================= */

table {
  width: 100%;
  border-collapse: collapse;
}

th {
  text-align: left;
  padding: 10px 12px;
  font-weight: 600;
}

td {
  padding: 12px;
  font-size: 0.85em;
}

/* =========================
   Sidebar
   ========================= */

.sidebar {
  width: 240px;
  min-height: 100vh;
  padding: 18px;
}

.sidebar a {
  display: block;
  text-decoration: none;
  margin: 10px 0;
  font-weight: 600;
}

.sidebar a:hover {
  text-decoration: underline;
}

/* remove visited styling */
.sidebar a:visited {
  color: inherit;
}

.user-console {
  display: flex;
  flex-direction: row;
}

.user-console .main {
  flex: 1 1 auto;
  padding: 20px;
}

/* =========================
   Footer
   ========================= */

footer {
  padding: 24px;
  font-size: 0.85em;
  margin-top: auto;
}

/* =========================
   Theme: Light
   ========================= */

.theme-light body {
  background: #f9fafb;
  color: #334155;
}

.theme-light header,
.theme-light footer {
  background: #0f172a;
  color: #ffffff;
}

.theme-light nav a,
.theme-light .gear-btn {
  color: #e5e7eb;
}

.theme-light nav a:hover,
.theme-light .gear-btn:hover {
  color: #ffffff;
}

.theme-light .chart-box {
  background: #ffffff;
  box-shadow: 0 6px 20px rgba(0,0,0,0.06);
}

.theme-light .chart-box:hover {
  box-shadow: 0 10px 28px rgba(0,0,0,0.08);
}

.theme-light th {
  color: #475569;
  border-bottom: 1px solid #e5e7eb;
}

.theme-light td {
  color: #334155;
}

.theme-light .sidebar {
  background: #111827;
  color: #e5e7eb;
}

.theme-light .sidebar a {
  color: #e5e7eb;
}

.theme-light .sidebar a:hover {
  color: #ffffff;
}

/* =========================
   Theme: Dark
   ========================= */

.theme-dark body {
  background: #0b1020;
  color: #e5e7eb;
}

.theme-dark header,
.theme-dark footer {
  background: #020617;
  color: #e5e7eb;
}

.theme-dark nav a,
.theme-dark .gear-btn {
  color: #cbd5f5;
}

.theme-dark nav a:hover,
.theme-dark .gear-btn:hover {
  color: #ffffff;
}

.theme-dark .chart-box {
  background: #111827;
  box-shadow: 0 8px 24px rgba(0,0,0,0.6);
}

.theme-dark th {
  color: #cbd5f5;
  border-bottom: 1px solid #334155;
}

.theme-dark td {
  color: #e5e7eb;
}

.theme-dark .sidebar {
  background: #020617;
  color: #cbd5f5;
}

.theme-dark .sidebar a {
  color: #cbd5f5;
}

.theme-dark .sidebar a:hover {
  color: #ffffff;
}

/* =========================
   Utility
   ========================= */

.text-green-600 { color: #16a34a; }
.text-red-600 { color: #dc2626; }
.text-sky-500 { color: #0ea5e9; }
.font-semibold { font-weight: 600; }

/* =========================
   Responsive
   ========================= */

@media (max-width: 768px) {
  .charts {
    margin: 12px;
    gap: 14px;
  }
  .chart-box {
    flex: 1 1 100%;
    padding: 16px;
  }
  .sidebar {
    width: 40%;
    min-width: 150px;
  }
}

@media (max-width: 480px) {
  .sidebar {
    width: 30%;
    min-width: 120px;
  }
}
