/* ==========================================================================
   MUDODO CHAIN — MASTER STYLESHEET
   Light Theme Default, Institutional Fintech Aesthetics, Glassmorphism
   ========================================================================== */

:root {
  /* Color Palette - Light Theme Default */
  --bg-primary: #f8fafc;
  --bg-secondary: #f1f5f9;
  --bg-surface: rgba(255, 255, 255, 0.88);
  --bg-surface-elevated: #ffffff;
  --bg-glass: rgba(255, 255, 255, 0.65);
  --bg-glass-card: rgba(255, 255, 255, 0.75);
  
  --border-subtle: rgba(226, 232, 240, 0.8);
  --border-focus: #0ea5e9;
  --border-glass: rgba(255, 255, 255, 0.6);
  
  --text-primary: #0f172a;
  --text-secondary: #475569;
  --text-muted: #64748b;
  --text-inverse: #ffffff;
  
  --brand-cyan: #06b6d4;
  --brand-cyan-light: #e0f2fe;
  --brand-blue: #2563eb;
  --brand-violet: #7c3aed;
  --brand-gold: #f59e0b;
  
  --bull-green: #10b981;
  --bull-green-bg: rgba(16, 185, 129, 0.1);
  --bear-red: #ef4444;
  --bear-red-bg: rgba(239, 68, 68, 0.1);
  
  --shadow-sm: 0 1px 3px rgba(0, 0, 0, 0.05);
  --shadow-md: 0 4px 12px -2px rgba(15, 23, 42, 0.08);
  --shadow-lg: 0 12px 28px -4px rgba(15, 23, 42, 0.12);
  --shadow-glow: 0 0 20px rgba(6, 182, 212, 0.25);
  
  --radius-sm: 6px;
  --radius-md: 10px;
  --radius-lg: 16px;
  --radius-xl: 24px;
  --radius-full: 9999px;

  --transition-fast: 0.15s ease;
  --transition-normal: 0.25s ease;
  --transition-smooth: 0.4s cubic-bezier(0.16, 1, 0.3, 1);
}

/* Dark Theme Overrides */
[data-theme="dark"] {
  --bg-primary: #070d17;
  --bg-secondary: #0f172a;
  --bg-surface: rgba(15, 23, 42, 0.85);
  --bg-surface-elevated: #1e293b;
  --bg-glass: rgba(15, 23, 42, 0.65);
  --bg-glass-card: rgba(30, 41, 59, 0.7);
  
  --border-subtle: rgba(51, 65, 85, 0.6);
  --border-focus: #38bdf8;
  --border-glass: rgba(255, 255, 255, 0.08);
  
  --text-primary: #f8fafc;
  --text-secondary: #cbd5e1;
  --text-muted: #94a3b8;
  --text-inverse: #0f172a;
  
  --brand-cyan: #38bdf8;
  --brand-cyan-light: rgba(56, 189, 248, 0.15);
  --brand-blue: #60a5fa;
  --brand-violet: #a78bfa;
  
  --bull-green: #34d399;
  --bull-green-bg: rgba(52, 211, 153, 0.15);
  --bear-red: #f87171;
  --bear-red-bg: rgba(248, 113, 113, 0.15);
  
  --shadow-sm: 0 1px 3px rgba(0, 0, 0, 0.4);
  --shadow-md: 0 4px 14px rgba(0, 0, 0, 0.5);
  --shadow-lg: 0 14px 32px rgba(0, 0, 0, 0.6);
  --shadow-glow: 0 0 24px rgba(56, 189, 248, 0.3);
}

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

html {
  font-family: -apple-system, BlinkMacSystemFont, "SF Pro Display", "Segoe UI", Roboto, "Helvetica Neue", sans-serif;
  font-size: 16px;
  line-height: 1.5;
  color: var(--text-primary);
  background-color: var(--bg-primary);
  scroll-behavior: smooth;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

body {
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  overflow-x: hidden;
  background-image: 
    radial-gradient(circle at 15% 10%, rgba(6, 182, 212, 0.08) 0%, transparent 40%),
    radial-gradient(circle at 85% 60%, rgba(124, 58, 237, 0.06) 0%, transparent 45%);
  background-attachment: fixed;
  transition: background-color var(--transition-normal), color var(--transition-normal);
}

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

button, input, select, textarea {
  font-family: inherit;
  font-size: inherit;
  color: inherit;
}

button {
  cursor: pointer;
  border: none;
  background: none;
  outline: none;
}

img, svg {
  display: block;
  max-width: 100%;
}

.container {
  width: 100%;
  max-width: 1280px;
  margin: 0 auto;
  padding: 0 1.5rem;
}

/* ==========================================================================
   Header & Navigation
   ========================================================================== */
.site-header {
  position: sticky;
  top: 0;
  z-index: 10000;
  background: var(--bg-glass);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  border-bottom: 1px solid var(--border-glass);
  transition: background var(--transition-normal), border var(--transition-normal);
}

.header-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 4.5rem;
}

.brand-link {
  display: flex;
  align-items: center;
  gap: 0.75rem;
}

.brand-logo-img {
  height: 38px;
  width: auto;
}

.nav-links {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  list-style: none;
}

.nav-link {
  padding: 0.5rem 0.85rem;
  border-radius: var(--radius-md);
  font-size: 0.925rem;
  font-weight: 500;
  color: var(--text-secondary);
  transition: all var(--transition-fast);
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
}

.nav-link:hover {
  color: var(--brand-blue);
  background: rgba(37, 99, 235, 0.06);
}

.nav-link.active {
  color: var(--brand-blue);
  background: rgba(37, 99, 235, 0.1);
  font-weight: 600;
}

.header-actions {
  display: flex;
  align-items: center;
  gap: 0.75rem;
}

.theme-toggle-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 2.5rem;
  height: 2.5rem;
  border-radius: var(--radius-md);
  background: var(--bg-surface);
  border: 1px solid var(--border-subtle);
  color: var(--text-secondary);
  transition: all var(--transition-fast);
}

.theme-toggle-btn:hover {
  color: var(--brand-cyan);
  border-color: var(--brand-cyan);
  box-shadow: var(--shadow-sm);
}

/* User Profile Header Badge */
.user-menu-btn {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.4rem 0.85rem;
  border-radius: var(--radius-full);
  background: var(--bg-surface);
  border: 1px solid var(--border-subtle);
  font-size: 0.875rem;
  font-weight: 600;
  box-shadow: var(--shadow-sm);
  transition: all var(--transition-fast);
}

.user-menu-btn:hover {
  border-color: var(--brand-cyan);
}

.user-avatar {
  width: 24px;
  height: 24px;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--brand-cyan), var(--brand-violet));
  display: flex;
  align-items: center;
  justify-content: center;
  color: #fff;
  font-size: 0.75rem;
  font-weight: 700;
}

/* Mobile Toggle & Backdrop */
.mobile-nav-toggle {
  display: none;
  width: 2.75rem;
  height: 2.75rem;
  align-items: center;
  justify-content: center;
  border-radius: var(--radius-md);
  background: var(--bg-surface);
  border: 1px solid var(--border-subtle);
  color: var(--text-primary);
  font-size: 1.35rem;
  cursor: pointer;
  z-index: 10000000;
  transition: all var(--transition-fast);
}

.mobile-nav-backdrop {
  display: none;
  position: fixed;
  inset: 0;
  width: 100vw;
  height: 100vh;
  height: 100dvh;
  background: rgba(0, 0, 0, 0.75);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  z-index: 9999990;
  opacity: 0;
  transition: opacity var(--transition-fast);
}

.mobile-nav-backdrop.open {
  display: block;
  opacity: 1;
}

/* ==========================================================================
   Live Ticker Tape Banner
   ========================================================================== */
.ticker-tape-container {
  background: var(--bg-surface);
  border-bottom: 1px solid var(--border-subtle);
  overflow: hidden;
  user-select: none;
  font-size: 0.825rem;
  display: flex;
  align-items: center;
  height: 2.5rem;
}

.ticker-tape-label {
  flex-shrink: 0;
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  padding: 0 1rem;
  font-weight: 700;
  color: var(--brand-cyan);
  background: var(--bg-surface-elevated);
  height: 100%;
  border-right: 1px solid var(--border-subtle);
  z-index: 2;
}

.ticker-track {
  display: flex;
  gap: 2rem;
  white-space: nowrap;
  animation: ticker-scroll 35s linear infinite;
  padding-left: 1rem;
}

.ticker-track:hover {
  animation-play-state: paused;
}

.ticker-item {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  cursor: pointer;
}

.ticker-sym {
  font-weight: 600;
  color: var(--text-primary);
}

.ticker-price {
  font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
}

.ticker-chg {
  font-size: 0.75rem;
  font-weight: 600;
  padding: 0.1rem 0.35rem;
  border-radius: 4px;
}

.ticker-chg.up {
  color: var(--bull-green);
  background: var(--bull-green-bg);
}

.ticker-chg.down {
  color: var(--bear-red);
  background: var(--bear-red-bg);
}

@keyframes ticker-scroll {
  0% { transform: translateX(0); }
  100% { transform: translateX(-50%); }
}

/* ==========================================================================
   Buttons & Controls
   ========================================================================== */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  padding: 0.65rem 1.35rem;
  border-radius: var(--radius-md);
  font-weight: 600;
  font-size: 0.925rem;
  transition: all var(--transition-fast);
  border: 1px solid transparent;
  white-space: nowrap;
}

.btn-primary {
  background: linear-gradient(135deg, var(--brand-cyan) 0%, var(--brand-blue) 100%);
  color: #ffffff;
  box-shadow: 0 4px 14px rgba(6, 182, 212, 0.3);
}

.btn-primary:hover {
  transform: translateY(-1px);
  box-shadow: 0 6px 20px rgba(37, 99, 235, 0.4);
}

.btn-secondary {
  background: var(--bg-surface);
  color: var(--text-primary);
  border: 1px solid var(--border-subtle);
  box-shadow: var(--shadow-sm);
}

.btn-secondary:hover {
  background: var(--bg-secondary);
  border-color: var(--brand-blue);
  color: var(--brand-blue);
}

.btn-danger {
  background: var(--bear-red-bg);
  color: var(--bear-red);
  border: 1px solid rgba(239, 68, 68, 0.3);
}

.btn-danger:hover {
  background: var(--bear-red);
  color: #fff;
}

.btn-sm {
  padding: 0.4rem 0.75rem;
  font-size: 0.825rem;
  border-radius: var(--radius-sm);
}

.btn-lg {
  padding: 0.85rem 1.75rem;
  font-size: 1.05rem;
  border-radius: var(--radius-lg);
}

/* ==========================================================================
   Hero Section
   ========================================================================== */
.hero-section {
  padding: 4rem 0 3rem;
  position: relative;
}

.hero-grid {
  display: grid;
  grid-template-columns: 1.15fr 0.85fr;
  align-items: center;
  gap: 3rem;
}

.hero-badge {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.35rem 0.85rem;
  border-radius: var(--radius-full);
  background: var(--brand-cyan-light);
  color: var(--brand-blue);
  font-size: 0.825rem;
  font-weight: 700;
  letter-spacing: 0.5px;
  margin-bottom: 1.25rem;
  border: 1px solid rgba(6, 182, 212, 0.3);
}

.hero-title {
  font-size: 3.25rem;
  line-height: 1.15;
  font-weight: 800;
  letter-spacing: -0.025em;
  color: var(--text-primary);
  margin-bottom: 1.25rem;
}

.text-gradient {
  background: linear-gradient(135deg, var(--brand-cyan), var(--brand-blue) 60%, var(--brand-violet));
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
}

.hero-description {
  font-size: 1.15rem;
  color: var(--text-secondary);
  line-height: 1.6;
  margin-bottom: 2rem;
  max-width: 580px;
}

.hero-actions {
  display: flex;
  align-items: center;
  gap: 1rem;
  flex-wrap: wrap;
  margin-bottom: 2.5rem;
}

.hero-stats-row {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 1.25rem;
  padding-top: 1.5rem;
  border-top: 1px solid var(--border-subtle);
}

.stat-item h4 {
  font-size: 1.5rem;
  font-weight: 800;
  color: var(--text-primary);
}

.stat-item p {
  font-size: 0.825rem;
  color: var(--text-muted);
}

.hero-visual {
  position: relative;
}

.hero-artwork-frame {
  background: var(--bg-glass-card);
  border-radius: var(--radius-xl);
  border: 1px solid var(--border-glass);
  box-shadow: var(--shadow-lg);
  padding: 0.5rem;
  overflow: hidden;
  backdrop-filter: blur(12px);
}

/* ==========================================================================
   Card System & Glass Elements
   ========================================================================== */
.card {
  background: var(--bg-surface);
  border-radius: var(--radius-lg);
  border: 1px solid var(--border-subtle);
  padding: 1.5rem;
  box-shadow: var(--shadow-sm);
  transition: all var(--transition-normal);
  position: relative;
}

.card:hover {
  box-shadow: var(--shadow-md);
  border-color: rgba(6, 182, 212, 0.4);
}

.card-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 1.25rem;
}

.card-title {
  font-size: 1.15rem;
  font-weight: 700;
  color: var(--text-primary);
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.card-subtitle {
  font-size: 0.85rem;
  color: var(--text-muted);
}

/* ==========================================================================
   Market Tables & Grids
   ========================================================================== */
.market-table-wrap {
  overflow-x: auto;
  border-radius: var(--radius-md);
  border: 1px solid var(--border-subtle);
  background: var(--bg-surface);
}

.market-table {
  width: 100%;
  border-collapse: collapse;
  text-align: left;
  font-size: 0.9rem;
}

.market-table th {
  background: var(--bg-secondary);
  padding: 0.75rem 1rem;
  font-size: 0.775rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  color: var(--text-muted);
  border-bottom: 1px solid var(--border-subtle);
}

.market-table td {
  padding: 0.9rem 1rem;
  border-bottom: 1px solid var(--border-subtle);
  color: var(--text-primary);
  vertical-align: middle;
}

.market-table tr:last-child td {
  border-bottom: none;
}

.market-table tr:hover td {
  background: rgba(37, 99, 235, 0.03);
}

.asset-cell {
  display: flex;
  align-items: center;
  gap: 0.75rem;
}

.asset-icon-placeholder {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  background: var(--bg-secondary);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.75rem;
  font-weight: 800;
  color: var(--brand-blue);
  border: 1px solid var(--border-subtle);
}

.asset-name {
  font-weight: 700;
  display: block;
}

.asset-code {
  font-size: 0.775rem;
  color: var(--text-muted);
}

.price-cell {
  font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
  font-weight: 700;
}

/* ==========================================================================
   Badges, Indicators & Statuses
   ========================================================================== */
.badge {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  padding: 0.2rem 0.55rem;
  border-radius: var(--radius-full);
  font-size: 0.75rem;
  font-weight: 700;
}

.badge-live {
  background: var(--bull-green-bg);
  color: var(--bull-green);
  border: 1px solid rgba(16, 185, 129, 0.3);
}

.badge-delayed {
  background: rgba(245, 158, 11, 0.12);
  color: var(--brand-gold);
  border: 1px solid rgba(245, 158, 11, 0.3);
}

.badge-closed {
  background: var(--bg-secondary);
  color: var(--text-muted);
  border: 1px solid var(--border-subtle);
}

.badge-simulated {
  background: rgba(124, 58, 237, 0.1);
  color: var(--brand-violet);
  border: 1px solid rgba(124, 58, 237, 0.3);
}

/* ==========================================================================
   Forms & Inputs
   ========================================================================== */
.form-group {
  margin-bottom: 1.25rem;
}

.form-label {
  display: block;
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--text-secondary);
  margin-bottom: 0.4rem;
}

.form-control {
  width: 100%;
  padding: 0.7rem 0.95rem;
  border-radius: var(--radius-md);
  border: 1px solid var(--border-subtle);
  background: var(--bg-surface-elevated);
  color: var(--text-primary);
  font-size: 0.95rem;
  transition: all var(--transition-fast);
}

.form-control:focus {
  outline: none;
  border-color: var(--brand-cyan);
  box-shadow: 0 0 0 3px rgba(6, 182, 212, 0.2);
}

.form-help {
  font-size: 0.775rem;
  color: var(--text-muted);
  margin-top: 0.3rem;
}

/* ==========================================================================
   Modals & Dialogs
   ========================================================================== */
.modal-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(15, 23, 42, 0.65);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  z-index: 999;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 1.5rem;
  opacity: 0;
  pointer-events: none;
  transition: opacity var(--transition-normal);
}

.modal-backdrop.open {
  opacity: 1;
  pointer-events: auto;
}

.modal-dialog {
  background: var(--bg-surface-elevated);
  border-radius: var(--radius-xl);
  border: 1px solid var(--border-glass);
  box-shadow: var(--shadow-lg);
  max-width: 540px;
  width: 100%;
  max-height: 90vh;
  overflow-y: auto;
  transform: translateY(20px) scale(0.97);
  transition: transform var(--transition-normal);
}

.modal-backdrop.open .modal-dialog {
  transform: translateY(0) scale(1);
}

.modal-header {
  padding: 1.25rem 1.5rem;
  border-bottom: 1px solid var(--border-subtle);
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.modal-title {
  font-size: 1.25rem;
  font-weight: 700;
  color: var(--text-primary);
}

.modal-close {
  color: var(--text-muted);
  font-size: 1.5rem;
  line-height: 1;
  padding: 0.25rem;
}

.modal-close:hover {
  color: var(--text-primary);
}

.modal-body {
  padding: 1.5rem;
}

.modal-footer {
  padding: 1rem 1.5rem;
  border-top: 1px solid var(--border-subtle);
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 0.75rem;
}

/* ==========================================================================
   Educational Hub & Quiz Interface
   ========================================================================== */
.module-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
  gap: 1.5rem;
}

.module-card {
  background: var(--bg-surface);
  border-radius: var(--radius-lg);
  border: 1px solid var(--border-subtle);
  padding: 1.5rem;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  box-shadow: var(--shadow-sm);
  transition: all var(--transition-normal);
}

.module-card:hover {
  transform: translateY(-3px);
  box-shadow: var(--shadow-md);
  border-color: var(--brand-cyan);
}

.module-num {
  font-size: 0.75rem;
  font-weight: 800;
  color: var(--brand-cyan);
  letter-spacing: 1px;
  text-transform: uppercase;
}

.quiz-option {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 0.85rem 1rem;
  border-radius: var(--radius-md);
  border: 1px solid var(--border-subtle);
  background: var(--bg-surface);
  cursor: pointer;
  transition: all var(--transition-fast);
  margin-bottom: 0.75rem;
}

.quiz-option:hover {
  border-color: var(--brand-blue);
  background: rgba(37, 99, 235, 0.05);
}

.quiz-option.selected {
  border-color: var(--brand-blue);
  background: rgba(37, 99, 235, 0.1);
}

.quiz-option.correct {
  border-color: var(--bull-green);
  background: var(--bull-green-bg);
  color: var(--bull-green);
  font-weight: 600;
}

.quiz-option.wrong {
  border-color: var(--bear-red);
  background: var(--bear-red-bg);
  color: var(--bear-red);
}

/* ==========================================================================
   Footer
   ========================================================================== */
.site-footer {
  margin-top: auto;
  background: var(--bg-surface);
  border-top: 1px solid var(--border-subtle);
  padding: 3.5rem 0 2rem;
  font-size: 0.875rem;
  color: var(--text-secondary);
}

.footer-grid {
  display: grid;
  grid-template-columns: 1.5fr repeat(3, 1fr);
  gap: 2.5rem;
  margin-bottom: 2.5rem;
}

.footer-brand-desc {
  margin: 1rem 0;
  line-height: 1.6;
  max-width: 340px;
  color: var(--text-muted);
}

.footer-heading {
  font-size: 0.875rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 1px;
  color: var(--text-primary);
  margin-bottom: 1.15rem;
}

.footer-links {
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 0.6rem;
}

.footer-links a:hover {
  color: var(--brand-cyan);
}

.footer-bottom {
  padding-top: 2rem;
  border-top: 1px solid var(--border-subtle);
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 1rem;
}

.footer-disclaimer-box {
  background: var(--bg-secondary);
  border-radius: var(--radius-md);
  padding: 1.25rem;
  margin-bottom: 2rem;
  font-size: 0.8rem;
  line-height: 1.5;
  color: var(--text-muted);
  border-left: 3px solid var(--brand-gold);
}
