/* ==========================================================================
   TRADING AI AGENT SKILLS - LIGHT MODE STYLESHEET
   100% WCAG AAA COMPLIANT HIGH-CONTRAST LIGHT THEME
   MOBILE-VIEW FIRST ARCHITECTURE
   ========================================================================== */

/* --- CSS Reset & Custom Properties --- */
:root {
  /* High-Contrast Color Palette (Light Theme Only) */
  --bg-primary: #f8fafc;          /* Slate 50 - Ultra clean canvas */
  --bg-surface: #ffffff;          /* Pure White - High contrast card base */
  --bg-subtle: #f1f5f9;           /* Slate 100 - Secondary backgrounds */
  --bg-elevated: #ffffff;

  /* Typography Colors - Strictly Deep & High Contrast (No washed-out gray) */
  --text-main: #0f172a;           /* Slate 900 - Primary text (Contrast > 15:1) */
  --text-body: #1e293b;           /* Slate 800 - Body paragraphs (Contrast > 12:1) */
  --text-muted: #334155;          /* Slate 700 - Subtitles & metadata (Contrast > 9:1) */
  --text-label: #475569;          /* Slate 600 - Form labels */
  --text-inverse: #ffffff;        /* Pure White on dark buttons */

  /* Structural Borders */
  --border-strong: #0f172a;       /* Solid Black/Slate border */
  --border-card: #cbd5e1;         /* Slate 300 - Distinct card boundaries */
  --border-subtle: #e2e8f0;       /* Slate 200 - Dividers */

  /* Semantic State Colors (High Contrast Tints & Inks) */
  --primary-blue: #1d4ed8;        /* Blue 700 - Primary accent */
  --primary-hover: #1e40af;       /* Blue 800 */
  --primary-bg: #eff6ff;          /* Blue 50 */
  --primary-border: #93c5fd;      /* Blue 300 */
  --primary-text: #1e3a8a;        /* Blue 900 */

  --success-green: #047857;       /* Emerald 700 - Profit & Buy */
  --success-bg: #ecfdf5;          /* Emerald 50 */
  --success-border: #6ee7b7;      /* Emerald 300 */
  --success-text: #064e3b;        /* Emerald 900 */

  --danger-red: #b91c1c;          /* Red 700 - Loss & Sell */
  --danger-bg: #fef2f2;           /* Red 50 */
  --danger-border: #fca5a5;       /* Red 300 */
  --danger-text: #7f1d1d;         /* Red 900 */

  --warning-amber: #b45309;       /* Amber 700 */
  --warning-bg: #fffbeb;          /* Amber 50 */
  --warning-border: #fcd34d;      /* Amber 300 */
  --warning-text: #78350f;        /* Amber 900 */

  --purple-accent: #6d28d9;       /* Purple 700 */
  --purple-bg: #faf5ff;          /* Purple 50 */
  --purple-border: #d8b4fe;       /* Purple 300 */
  --purple-text: #4c1d95;        /* Purple 900 */

  /* Terminal Code Block (High-Contrast Dark Container) */
  --code-bg: #0f172a;             /* Slate 900 */
  --code-text: #f8fafc;           /* White */
  --code-accent: #38bdf8;         /* Cyan 400 */
  --code-keyword: #a78bfa;        /* Purple 400 */
  --code-string: #4ade80;         /* Green 400 */

  /* Layout & Elevations */
  --radius-sm: 6px;
  --radius-md: 10px;
  --radius-lg: 16px;
  --shadow-sm: 0 1px 3px rgba(15, 23, 42, 0.08);
  --shadow-md: 0 4px 8px -1px rgba(15, 23, 42, 0.1), 0 2px 4px -2px rgba(15, 23, 42, 0.06);
  --shadow-lg: 0 10px 20px -3px rgba(15, 23, 42, 0.12), 0 4px 6px -4px rgba(15, 23, 42, 0.08);
  --font-sans: system-ui, -apple-system, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  --font-mono: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace;
}

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

html {
  font-size: 16px;
  scroll-behavior: smooth;
  background-color: var(--bg-primary);
  color: var(--text-body);
}

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

/* Headings with Maximum Legibility */
h1, h2, h3, h4, h5, h6 {
  color: var(--text-main);
  font-weight: 800;
  line-height: 1.25;
  letter-spacing: -0.02em;
}

h1 { font-size: 1.85rem; }
h2 { font-size: 1.5rem; margin-bottom: 0.75rem; }
h3 { font-size: 1.2rem; }
h4 { font-size: 1.05rem; }

p {
  color: var(--text-body);
  margin-bottom: 1rem;
  font-size: 0.98rem;
}

a {
  color: var(--primary-blue);
  text-decoration: underline;
  text-underline-offset: 3px;
  font-weight: 600;
}

a:hover {
  color: var(--primary-hover);
}

/* Container */
.container {
  width: 100%;
  padding-right: 1.25rem;
  padding-left: 1.25rem;
  margin-right: auto;
  margin-left: auto;
  max-width: 1200px;
}

/* --- NAVIGATION BAR (Mobile-View First) --- */
.navbar {
  position: sticky;
  top: 0;
  z-index: 1000;
  background-color: var(--bg-surface);
  border-bottom: 2px solid var(--border-card);
  box-shadow: var(--shadow-sm);
  padding: 0.75rem 0;
}

.nav-container {
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.brand {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  text-decoration: none;
  color: var(--text-main);
  font-weight: 800;
  font-size: 1.1rem;
}

.brand-icon {
  width: 32px;
  height: 32px;
  background: var(--text-main);
  color: var(--text-inverse);
  border-radius: var(--radius-sm);
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 900;
  font-size: 1rem;
}

.nav-actions {
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.lang-btn {
  background: var(--bg-subtle);
  border: 1.5px solid var(--border-card);
  color: var(--text-main);
  padding: 0.35rem 0.65rem;
  font-size: 0.85rem;
  font-weight: 700;
  border-radius: var(--radius-sm);
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 0.3rem;
  transition: all 0.2s ease;
}

.lang-btn:hover {
  background: var(--border-subtle);
  border-color: var(--text-main);
}

.mobile-menu-toggle {
  background: var(--bg-surface);
  border: 1.5px solid var(--border-card);
  color: var(--text-main);
  padding: 0.4rem 0.6rem;
  font-size: 1.1rem;
  border-radius: var(--radius-sm);
  cursor: pointer;
  display: inline-flex;
}

.nav-links {
  display: none; /* Hidden on mobile by default */
  flex-direction: column;
  position: absolute;
  top: 100%;
  left: 0;
  right: 0;
  background: var(--bg-surface);
  border-bottom: 2px solid var(--border-card);
  padding: 1rem 1.25rem;
  box-shadow: var(--shadow-lg);
  gap: 0.75rem;
}

.nav-links.open {
  display: flex;
}

.nav-link {
  color: var(--text-main);
  font-weight: 700;
  text-decoration: none;
  font-size: 0.95rem;
  padding: 0.5rem 0;
  border-bottom: 1px solid var(--border-subtle);
}

.nav-link:hover {
  color: var(--primary-blue);
}

/* --- BUTTONS --- */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  font-family: var(--font-sans);
  font-weight: 700;
  font-size: 0.95rem;
  padding: 0.65rem 1.25rem;
  border-radius: var(--radius-md);
  cursor: pointer;
  text-decoration: none;
  transition: all 0.2s ease;
  min-height: 44px; /* Touch target size */
  text-align: center;
}

.btn-primary {
  background-color: var(--text-main);
  color: var(--text-inverse);
  border: 2px solid var(--text-main);
  box-shadow: var(--shadow-sm);
}

.btn-primary:hover {
  background-color: #1e293b;
  border-color: #1e293b;
  color: #ffffff;
  transform: translateY(-1px);
}

.btn-accent {
  background-color: var(--primary-blue);
  color: var(--text-inverse);
  border: 2px solid var(--primary-blue);
}

.btn-accent:hover {
  background-color: var(--primary-hover);
  border-color: var(--primary-hover);
  color: #ffffff;
}

.btn-outline {
  background-color: var(--bg-surface);
  color: var(--text-main);
  border: 2px solid var(--border-card);
}

.btn-outline:hover {
  background-color: var(--bg-subtle);
  border-color: var(--text-main);
}

.btn-block {
  width: 100%;
}

/* --- BADGES & TAGS --- */
.badge {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  font-size: 0.78rem;
  font-weight: 800;
  padding: 0.25rem 0.6rem;
  border-radius: 9999px;
  letter-spacing: 0.02em;
}

.badge-blue {
  background-color: var(--primary-bg);
  color: var(--primary-text);
  border: 1.5px solid var(--primary-border);
}

.badge-green {
  background-color: var(--success-bg);
  color: var(--success-text);
  border: 1.5px solid var(--success-border);
}

.badge-amber {
  background-color: var(--warning-bg);
  color: var(--warning-text);
  border: 1.5px solid var(--warning-border);
}

.badge-purple {
  background-color: var(--purple-bg);
  color: var(--purple-text);
  border: 1.5px solid var(--purple-border);
}

.badge-dark {
  background-color: var(--bg-subtle);
  color: var(--text-main);
  border: 1.5px solid var(--border-card);
}

/* --- HERO SECTION --- */
.hero {
  padding: 2.5rem 0 2rem 0;
  background: var(--bg-surface);
  border-bottom: 2px solid var(--border-card);
}

.hero-content {
  display: flex;
  flex-direction: column;
  gap: 1.25rem;
}

.hero-headline {
  font-size: 2.1rem;
  line-height: 1.2;
  color: var(--text-main);
  font-weight: 900;
}

.hero-headline span {
  color: var(--primary-blue);
  text-decoration: underline;
  text-decoration-color: var(--primary-border);
  text-underline-offset: 6px;
}

.hero-description {
  font-size: 1.05rem;
  color: var(--text-body);
  line-height: 1.6;
}

.hero-cta {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
}

.command-box {
  background: var(--code-bg);
  color: var(--code-text);
  border-radius: var(--radius-md);
  padding: 0.75rem 1rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-family: var(--font-mono);
  font-size: 0.88rem;
  border: 2px solid var(--text-main);
  box-shadow: var(--shadow-md);
  overflow-x: auto;
}

.command-text {
  color: var(--code-accent);
  white-space: nowrap;
}

.copy-btn {
  background: rgba(255, 255, 255, 0.15);
  border: 1px solid rgba(255, 255, 255, 0.3);
  color: #ffffff;
  padding: 0.35rem 0.65rem;
  border-radius: var(--radius-sm);
  font-size: 0.75rem;
  font-weight: 700;
  cursor: pointer;
  transition: all 0.2s ease;
}

.copy-btn:hover {
  background: var(--primary-blue);
  border-color: var(--primary-blue);
}

.stat-pills {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 0.6rem;
  margin-top: 1rem;
}

.stat-pill-item {
  background: var(--bg-surface);
  border: 1.5px solid var(--border-card);
  padding: 0.65rem 0.75rem;
  border-radius: var(--radius-md);
  display: flex;
  flex-direction: column;
}

.stat-num {
  font-size: 1.25rem;
  font-weight: 900;
  color: var(--text-main);
}

.stat-label {
  font-size: 0.78rem;
  font-weight: 700;
  color: var(--text-muted);
}

/* --- INTERACTIVE SIMULATION DEMO (Paper Trade Widget) --- */
.demo-section {
  padding: 3rem 0;
  background-color: var(--bg-primary);
}

.section-header {
  text-align: center;
  margin-bottom: 2rem;
}

.section-tag {
  margin-bottom: 0.5rem;
}

.section-title {
  font-size: 1.65rem;
  color: var(--text-main);
  margin-bottom: 0.5rem;
}

.section-subtitle {
  color: var(--text-muted);
  font-size: 1rem;
  max-width: 680px;
  margin: 0 auto;
}

.trade-widget {
  background: var(--bg-surface);
  border: 2px solid var(--border-card);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-lg);
  overflow: hidden;
}

.widget-header {
  background: var(--bg-subtle);
  border-bottom: 2px solid var(--border-card);
  padding: 0.85rem 1.25rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.widget-title {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  font-size: 0.95rem;
  font-weight: 800;
  color: var(--text-main);
}

.widget-body {
  padding: 1.25rem;
}

.widget-header-badges {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  flex-wrap: wrap;
}


/* --- SKILLS GRID EXPLORER --- */
.skills-section {
  padding: 3rem 0;
  background-color: var(--bg-surface);
  border-top: 2px solid var(--border-card);
  border-bottom: 2px solid var(--border-card);
}

.skill-filters {
  display: flex;
  gap: 0.4rem;
  overflow-x: auto;
  padding-bottom: 0.75rem;
  margin-bottom: 1.5rem;
}

.filter-btn {
  background: var(--bg-surface);
  border: 1.5px solid var(--border-card);
  color: var(--text-main);
  font-weight: 700;
  font-size: 0.82rem;
  padding: 0.4rem 0.8rem;
  border-radius: 9999px;
  white-space: nowrap;
  cursor: pointer;
  transition: all 0.2s ease;
}

.filter-btn.active {
  background: var(--text-main);
  color: var(--text-inverse);
  border-color: var(--text-main);
}

.skills-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 1rem;
}

.skill-card {
  background: var(--bg-surface);
  border: 2px solid var(--border-card);
  border-radius: var(--radius-md);
  padding: 1.25rem;
  box-shadow: var(--shadow-sm);
  display: flex;
  flex-direction: column;
  transition: transform 0.2s ease, border-color 0.2s ease;
}

.skill-card:hover {
  transform: translateY(-2px);
  border-color: var(--text-main);
  box-shadow: var(--shadow-md);
}

.skill-card-top {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  margin-bottom: 0.75rem;
}

.skill-name {
  font-size: 1.1rem;
  font-weight: 800;
  color: var(--text-main);
  margin-bottom: 0.2rem;
}

.skill-path {
  font-family: var(--font-mono);
  font-size: 0.75rem;
  color: var(--primary-blue);
  font-weight: 700;
}

.skill-desc {
  font-size: 0.9rem;
  color: var(--text-body);
  margin-bottom: 0.85rem;
  flex-grow: 1;
}

.skill-features {
  list-style: none;
  border-top: 1px solid var(--border-subtle);
  padding-top: 0.75rem;
  margin-bottom: 0.85rem;
}

.skill-features li {
  font-size: 0.82rem;
  color: var(--text-muted);
  display: flex;
  align-items: center;
  gap: 0.4rem;
  margin-bottom: 0.35rem;
  font-weight: 600;
}

.skill-features li::before {
  content: "✔";
  color: var(--success-green);
  font-weight: 900;
}

/* --- FEATURE BREAKDOWN SECTIONS --- */
.features-section {
  padding: 3rem 0;
  background-color: var(--bg-primary);
}

.feature-block {
  background: var(--bg-surface);
  border: 2px solid var(--border-card);
  border-radius: var(--radius-lg);
  padding: 1.5rem;
  margin-bottom: 1.5rem;
  box-shadow: var(--shadow-sm);
}

.feature-block h3 {
  font-size: 1.25rem;
  color: var(--text-main);
  margin-bottom: 0.5rem;
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.feature-meta {
  margin-bottom: 0.75rem;
}

/* Comparison Table */
.table-responsive {
  width: 100%;
  overflow-x: auto;
  margin-top: 1rem;
  border: 1.5px solid var(--border-card);
  border-radius: var(--radius-md);
}

.compare-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.85rem;
  background: #ffffff;
}

.compare-table th {
  background: var(--bg-subtle);
  color: var(--text-main);
  font-weight: 800;
  padding: 0.75rem;
  border-bottom: 2px solid var(--border-card);
  text-align: left;
}

.compare-table td {
  padding: 0.75rem;
  border-bottom: 1px solid var(--border-subtle);
  color: var(--text-body);
}

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

/* --- SECURITY CARD --- */
.security-banner {
  background: #ffffff;
  border: 2px solid var(--border-strong);
  border-radius: var(--radius-lg);
  padding: 1.5rem;
  margin: 2.5rem 0;
  box-shadow: var(--shadow-md);
}

.security-header {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  margin-bottom: 0.75rem;
}

.security-badge-icon {
  width: 40px;
  height: 40px;
  background: #fef2f2;
  border: 2px solid var(--danger-border);
  color: var(--danger-red);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.2rem;
  font-weight: 900;
}

.security-list {
  list-style: none;
  margin-top: 0.75rem;
}

.security-list li {
  font-size: 0.9rem;
  color: var(--text-body);
  margin-bottom: 0.5rem;
  display: flex;
  align-items: baseline;
  gap: 0.5rem;
}

.security-list li strong {
  color: var(--text-main);
}

/* --- INSTALLATION TABS --- */
.install-tabs {
  display: flex;
  gap: 0.5rem;
  margin-bottom: 0.75rem;
  overflow-x: auto;
}

.install-tab-btn {
  background: var(--bg-surface);
  border: 2px solid var(--border-card);
  color: var(--text-main);
  font-weight: 800;
  font-size: 0.85rem;
  padding: 0.45rem 0.85rem;
  border-radius: var(--radius-sm);
  cursor: pointer;
}

.install-tab-btn.active {
  background: var(--text-main);
  color: var(--text-inverse);
  border-color: var(--text-main);
}

.code-container {
  background: var(--code-bg);
  border: 2px solid var(--text-main);
  border-radius: var(--radius-md);
  padding: 1rem;
  color: var(--code-text);
  font-family: var(--font-mono);
  font-size: 0.85rem;
  overflow-x: auto;
}

/* --- FOOTER --- */
.footer {
  background-color: var(--bg-surface);
  border-top: 2px solid var(--border-card);
  padding: 2.5rem 0 1.5rem 0;
  color: var(--text-muted);
}

.footer-top {
  display: flex;
  flex-direction: column;
  gap: 1.5rem;
  margin-bottom: 2rem;
}

.footer-brand {
  font-size: 1.1rem;
  font-weight: 900;
  color: var(--text-main);
}

.footer-bottom {
  border-top: 1px solid var(--border-subtle);
  padding-top: 1rem;
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
  font-size: 0.8rem;
  color: var(--text-muted);
}

/* ==========================================================================
   RESPONSIVE BREAKPOINTS (Scaling up from Mobile)
   ========================================================================== */

/* Tablets (min-width: 640px) */
@media (min-width: 640px) {
  h1 { font-size: 2.3rem; }
  h2 { font-size: 1.75rem; }
  
  .hero-cta {
    flex-direction: row;
    align-items: center;
  }
  
  .btn-block {
    width: auto;
  }
  
  .stat-pills {
    grid-template-columns: repeat(4, 1fr);
  }
  
  .skills-grid {
    grid-template-columns: repeat(2, 1fr);
  }

  .instrument-selector {
    grid-template-columns: repeat(4, 1fr);
  }
}

/* Desktops (min-width: 1024px) */
@media (min-width: 1024px) {
  .mobile-menu-toggle {
    display: none;
  }
  
  .nav-links {
    display: flex;
    position: static;
    flex-direction: row;
    background: transparent;
    border-bottom: none;
    padding: 0;
    box-shadow: none;
    gap: 1.5rem;
  }
  
  .nav-link {
    padding: 0;
    border-bottom: none;
  }
  
  .hero {
    padding: 4rem 0 3rem 0;
  }
  
  .hero-grid {
    display: grid;
    grid-template-columns: 1.2fr 0.8fr;
    gap: 2.5rem;
    align-items: center;
  }
  
  .skills-grid {
    grid-template-columns: repeat(3, 1fr);
  }
  
  .footer-top {
    flex-direction: row;
    justify-content: space-between;
  }
  
  .footer-bottom {
    flex-direction: row;
    justify-content: space-between;
  }
}
