/* BRISMA GitHub Pages - Main Stylesheet */

:root {
  --mlpurple: #3333B2;
  --mlblue: #0066CC;
  --mlorange: #FF7F0E;
  --mlgreen: #2CA02C;
  --mlred: #D62728;
  --mllavender: #ADADE0;
  --bg-light: #f5f5f5;
  --bg-white: #ffffff;
  --text-dark: #1e293b;
  --text-muted: #64748b;
  --sidebar-width: 260px;
  --header-height: 56px;
}

* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

body {
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, sans-serif;
  color: var(--text-dark);
  background: var(--bg-light);
  line-height: 1.6;
}

/* Sidebar */
.sidebar {
  position: fixed;
  left: 0;
  top: 0;
  bottom: 0;
  width: var(--sidebar-width);
  background: linear-gradient(180deg, var(--mlpurple) 0%, var(--mlblue) 100%);
  color: white;
  overflow-y: auto;
  padding: 0;
  z-index: 1000;
  display: flex;
  flex-direction: column;
}

.sidebar-logo {
  text-align: center;
  padding: 1.5rem 1rem;
  font-size: 1.75rem;
  font-weight: bold;
  border-bottom: 1px solid rgba(255,255,255,0.2);
  background: rgba(0,0,0,0.1);
}

.sidebar-logo a {
  color: white;
  text-decoration: none;
}

.sidebar-nav {
  flex: 1;
  padding: 1rem 0;
  overflow-y: auto;
}

.nav-item {
  display: block;
  padding: 0.75rem 1.25rem;
  color: rgba(255,255,255,0.9);
  text-decoration: none;
  transition: background 0.2s, padding-left 0.2s;
  font-size: 0.9rem;
}

.nav-item:hover {
  background: rgba(255,255,255,0.15);
  padding-left: 1.5rem;
}

.nav-item.active {
  background: rgba(255,255,255,0.2);
  border-left: 3px solid white;
}

.nav-section {
  padding: 1rem 1.25rem 0.5rem;
  font-size: 0.7rem;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: rgba(255,255,255,0.5);
  margin-top: 0.5rem;
}

.nav-subsection {
  padding-left: 2rem;
  font-size: 0.85rem;
  color: rgba(255,255,255,0.7);
}

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

.nav-toggle::after {
  content: '\25BC';
  font-size: 0.6rem;
  transition: transform 0.2s;
}

.nav-toggle.collapsed::after {
  transform: rotate(-90deg);
}

.nav-group {
  max-height: 500px;
  overflow: hidden;
  transition: max-height 0.3s ease;
}

.nav-group.collapsed {
  max-height: 0;
}

/* Main Content */
.main-content {
  margin-left: var(--sidebar-width);
  min-height: 100vh;
}

/* Hero Section */
.hero {
  background: linear-gradient(135deg, var(--mlpurple) 0%, var(--mlblue) 100%);
  color: white;
  padding: 4rem 2rem;
  text-align: center;
}

.hero h1 {
  font-size: 3rem;
  margin-bottom: 0.5rem;
  font-weight: 700;
}

.hero .subtitle {
  font-size: 1.25rem;
  opacity: 0.9;
  margin-bottom: 2rem;
  max-width: 600px;
  margin-left: auto;
  margin-right: auto;
}

.hero-stats {
  display: flex;
  justify-content: center;
  gap: 3rem;
  margin: 2rem 0;
  flex-wrap: wrap;
}

.stat {
  text-align: center;
}

.stat-value {
  font-size: 2.5rem;
  font-weight: bold;
  display: block;
}

.stat-label {
  font-size: 0.875rem;
  opacity: 0.8;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.hero-buttons {
  margin-top: 2rem;
  display: flex;
  justify-content: center;
  gap: 1rem;
  flex-wrap: wrap;
}

/* Buttons */
.btn {
  display: inline-block;
  padding: 0.875rem 1.75rem;
  border-radius: 0.5rem;
  text-decoration: none;
  font-weight: 600;
  font-size: 0.95rem;
  transition: transform 0.2s, box-shadow 0.2s;
  cursor: pointer;
  border: none;
}

.btn:hover {
  transform: translateY(-2px);
  box-shadow: 0 4px 12px rgba(0,0,0,0.2);
}

.btn-primary {
  background: white;
  color: var(--mlpurple);
}

.btn-secondary {
  background: transparent;
  border: 2px solid white;
  color: white;
}

.btn-blue {
  background: var(--mlblue);
  color: white;
}

/* Content Area */
.content {
  padding: 3rem 2rem;
  max-width: 1400px;
  margin: 0 auto;
}

.section-title {
  font-size: 1.75rem;
  color: var(--mlpurple);
  margin-bottom: 1.5rem;
  padding-bottom: 0.75rem;
  border-bottom: 3px solid var(--mlpurple);
}

.section-subtitle {
  font-size: 1.25rem;
  color: var(--mlblue);
  margin: 2rem 0 1rem;
}

/* Feature Cards */
.features {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 1.5rem;
  margin-bottom: 3rem;
}

.feature-card {
  background: var(--bg-white);
  border-radius: 0.75rem;
  padding: 1.75rem;
  box-shadow: 0 2px 8px rgba(0,0,0,0.08);
  transition: box-shadow 0.2s, transform 0.2s;
}

.feature-card:hover {
  box-shadow: 0 8px 24px rgba(0,0,0,0.12);
  transform: translateY(-2px);
}

.feature-card h3 {
  color: var(--mlblue);
  margin-bottom: 0.75rem;
  font-size: 1.1rem;
}

.feature-card p {
  color: var(--text-muted);
  font-size: 0.9rem;
  line-height: 1.5;
}

/* Quick Links */
.quick-links {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 1rem;
}

.quick-link {
  display: flex;
  align-items: center;
  gap: 1rem;
  padding: 1.25rem;
  background: var(--bg-white);
  border-radius: 0.5rem;
  text-decoration: none;
  color: var(--text-dark);
  box-shadow: 0 1px 4px rgba(0,0,0,0.08);
  transition: box-shadow 0.2s, transform 0.2s;
}

.quick-link:hover {
  box-shadow: 0 4px 16px rgba(0,0,0,0.12);
  transform: translateY(-2px);
}

.quick-link-icon {
  font-size: 1.75rem;
  width: 48px;
  height: 48px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--bg-light);
  border-radius: 0.5rem;
}

.quick-link-text {
  font-weight: 500;
  font-size: 0.95rem;
}

/* Chart Gallery */
.chart-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(320px, 1fr));
  gap: 1.5rem;
}

.chart-card {
  background: var(--bg-white);
  border-radius: 0.75rem;
  overflow: hidden;
  box-shadow: 0 2px 8px rgba(0,0,0,0.08);
  transition: box-shadow 0.2s;
}

.chart-card:hover {
  box-shadow: 0 8px 24px rgba(0,0,0,0.12);
}

.chart-thumb {
  width: 100%;
  height: 200px;
  object-fit: cover;
  background: var(--bg-light);
  display: block;
}

.chart-info {
  padding: 1rem;
}

.chart-info h4 {
  font-size: 0.95rem;
  color: var(--text-dark);
  margin-bottom: 0.25rem;
}

.chart-info p {
  font-size: 0.8rem;
  color: var(--text-muted);
}

/* Chart Embed */
.chart-embed {
  background: var(--bg-white);
  border-radius: 0.75rem;
  overflow: hidden;
  margin-bottom: 2rem;
  box-shadow: 0 2px 8px rgba(0,0,0,0.08);
}

.chart-embed-header {
  padding: 1rem 1.5rem;
  background: var(--bg-light);
  border-bottom: 1px solid #e2e8f0;
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.chart-embed-header h3 {
  font-size: 1rem;
  color: var(--text-dark);
}

.chart-embed-header a {
  font-size: 0.85rem;
  color: var(--mlblue);
  text-decoration: none;
}

.chart-embed iframe {
  width: 100%;
  height: 550px;
  border: none;
  display: block;
}

/* Steps (Example 1) */
.step {
  background: var(--bg-white);
  border-radius: 0.75rem;
  padding: 1.5rem;
  margin-bottom: 1.5rem;
  box-shadow: 0 2px 8px rgba(0,0,0,0.08);
}

.step-header {
  display: flex;
  align-items: center;
  gap: 1rem;
  margin-bottom: 1rem;
  cursor: pointer;
}

.step-number {
  width: 40px;
  height: 40px;
  background: var(--mlpurple);
  color: white;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: bold;
  font-size: 1.1rem;
}

.step-title {
  font-size: 1.1rem;
  color: var(--text-dark);
  flex: 1;
}

.step-toggle {
  color: var(--text-muted);
  font-size: 0.8rem;
}

.step-content {
  padding-left: 56px;
}

.step-desc {
  color: var(--text-muted);
  margin-bottom: 1rem;
  font-size: 0.95rem;
}

.step-code {
  background: #1e293b;
  color: #e2e8f0;
  padding: 1rem;
  border-radius: 0.5rem;
  overflow-x: auto;
  font-family: 'Consolas', 'Monaco', monospace;
  font-size: 0.85rem;
  line-height: 1.5;
  max-height: 300px;
  overflow-y: auto;
}

.step-code.collapsed {
  max-height: 100px;
}

/* Documentation Cards */
.doc-cards {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
  gap: 1.5rem;
}

.doc-card {
  background: var(--bg-white);
  border-radius: 0.75rem;
  padding: 1.5rem;
  box-shadow: 0 2px 8px rgba(0,0,0,0.08);
  text-decoration: none;
  color: var(--text-dark);
  transition: box-shadow 0.2s, transform 0.2s;
  display: block;
}

.doc-card:hover {
  box-shadow: 0 8px 24px rgba(0,0,0,0.12);
  transform: translateY(-2px);
}

.doc-card h4 {
  color: var(--mlblue);
  margin-bottom: 0.5rem;
  font-size: 1.1rem;
}

.doc-card p {
  color: var(--text-muted);
  font-size: 0.9rem;
}

.doc-card .doc-type {
  display: inline-block;
  padding: 0.25rem 0.75rem;
  background: var(--bg-light);
  border-radius: 1rem;
  font-size: 0.75rem;
  color: var(--text-muted);
  margin-top: 0.75rem;
}

/* Footer */
.footer {
  background: var(--bg-white);
  padding: 2rem;
  text-align: center;
  color: var(--text-muted);
  font-size: 0.875rem;
  border-top: 1px solid #e2e8f0;
}

.footer a {
  color: var(--mlblue);
  text-decoration: none;
}

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

/* Mobile Header */
.mobile-header {
  display: none;
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  height: var(--header-height);
  background: var(--mlpurple);
  color: white;
  align-items: center;
  padding: 0 1rem;
  z-index: 999;
}

.hamburger {
  font-size: 1.5rem;
  cursor: pointer;
  margin-right: 1rem;
  padding: 0.25rem;
}

.mobile-header-title {
  font-weight: bold;
  font-size: 1.1rem;
}

/* Backdrop */
.backdrop {
  display: none;
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(0,0,0,0.5);
  z-index: 998;
}

.backdrop.active {
  display: block;
}

/* Category Badges */
.category-badge {
  display: inline-block;
  padding: 0.25rem 0.75rem;
  background: var(--mllavender);
  color: var(--mlpurple);
  border-radius: 1rem;
  font-size: 0.75rem;
  font-weight: 500;
  margin-bottom: 1rem;
}

/* Responsive */
@media (max-width: 1024px) {
  .sidebar {
    transform: translateX(-100%);
    transition: transform 0.3s ease;
  }

  .sidebar.open {
    transform: translateX(0);
  }

  .main-content {
    margin-left: 0;
  }

  .mobile-header {
    display: flex;
  }

  .main-content {
    padding-top: var(--header-height);
  }

  .hero {
    padding: 3rem 1.5rem;
  }

  .hero h1 {
    font-size: 2rem;
  }

  .hero-stats {
    gap: 1.5rem;
  }

  .stat-value {
    font-size: 2rem;
  }

  .content {
    padding: 2rem 1rem;
  }

  .chart-embed iframe {
    height: 400px;
  }
}

@media (max-width: 640px) {
  .hero-stats {
    flex-direction: column;
    gap: 1rem;
  }

  .features {
    grid-template-columns: 1fr;
  }

  .quick-links {
    grid-template-columns: 1fr;
  }

  .chart-grid {
    grid-template-columns: 1fr;
  }

  .step-content {
    padding-left: 0;
    margin-top: 1rem;
  }
}

/* Utility Classes */
.text-center { text-align: center; }
.text-muted { color: var(--text-muted); }
.mb-1 { margin-bottom: 0.5rem; }
.mb-2 { margin-bottom: 1rem; }
.mb-3 { margin-bottom: 1.5rem; }
.mt-2 { margin-top: 1rem; }
.mt-3 { margin-top: 1.5rem; }
