/* BRISMA Enhanced Styles - Comprehensive GitHub Pages */

/* ========================================
   Animated Counters
   ======================================== */
.counter-animated {
  display: inline-block;
  font-variant-numeric: tabular-nums;
}

.stat-value.animating {
  transition: opacity 0.2s;
}

/* Stats Grid - Expanded */
.hero-stats-expanded {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 2rem;
  max-width: 900px;
  margin: 2rem auto;
  padding: 0 1rem;
}

.hero-stats-expanded .stat {
  background: rgba(255,255,255,0.1);
  padding: 1.25rem;
  border-radius: 0.75rem;
  backdrop-filter: blur(4px);
}

@media (max-width: 768px) {
  .hero-stats-expanded {
    grid-template-columns: repeat(2, 1fr);
    gap: 1rem;
  }
}

@media (max-width: 480px) {
  .hero-stats-expanded {
    grid-template-columns: 1fr;
  }
}

/* ========================================
   Methodology Cards
   ======================================== */
.methodology-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 1.5rem;
  margin: 2rem 0;
}

.method-card {
  background: var(--bg-white);
  border-radius: 0.75rem;
  padding: 1.5rem;
  box-shadow: 0 2px 8px rgba(0,0,0,0.08);
  border-left: 4px solid var(--mlpurple);
  transition: all 0.3s ease;
  cursor: pointer;
  text-decoration: none;
  color: var(--text-dark);
  display: block;
}

.method-card:hover {
  box-shadow: 0 8px 24px rgba(0,0,0,0.15);
  transform: translateY(-4px);
  border-left-color: var(--mlblue);
}

.method-card .method-number {
  display: inline-block;
  width: 32px;
  height: 32px;
  background: var(--mlpurple);
  color: white;
  border-radius: 50%;
  text-align: center;
  line-height: 32px;
  font-weight: bold;
  font-size: 0.9rem;
  margin-bottom: 0.75rem;
}

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

.method-card .method-formula {
  background: #f1f5f9;
  padding: 0.5rem 0.75rem;
  border-radius: 0.5rem;
  font-family: 'Consolas', 'Monaco', monospace;
  font-size: 0.85rem;
  color: var(--mlpurple);
  margin: 0.75rem 0;
  overflow-x: auto;
}

.method-card p {
  color: var(--text-muted);
  font-size: 0.9rem;
  margin-bottom: 0;
}

.method-card .method-link {
  display: inline-block;
  margin-top: 1rem;
  font-size: 0.85rem;
  color: var(--mlblue);
  text-decoration: none;
  font-weight: 500;
}

.method-card .method-link:hover {
  text-decoration: underline;
}

/* ========================================
   Dual Dashboard Preview
   ======================================== */
.dual-dashboard {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 2rem;
  margin: 2rem 0;
}

.dashboard-preview {
  background: var(--bg-white);
  border-radius: 0.75rem;
  overflow: hidden;
  box-shadow: 0 4px 12px rgba(0,0,0,0.1);
}

.dashboard-preview-header {
  padding: 1rem 1.5rem;
  background: linear-gradient(135deg, var(--mlpurple), var(--mlblue));
  color: white;
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.dashboard-preview-header h3 {
  margin: 0;
  font-size: 1rem;
}

.dashboard-preview-header .badge {
  background: rgba(255,255,255,0.2);
  padding: 0.25rem 0.75rem;
  border-radius: 1rem;
  font-size: 0.75rem;
}

.dashboard-preview-body {
  padding: 0;
  height: 350px;
  position: relative;
}

.dashboard-preview-body iframe {
  width: 100%;
  height: 100%;
  border: none;
}

.dashboard-preview-footer {
  padding: 1rem 1.5rem;
  background: var(--bg-light);
  text-align: center;
}

.dashboard-preview-footer .btn {
  font-size: 0.85rem;
  padding: 0.5rem 1.25rem;
}

@media (max-width: 1024px) {
  .dual-dashboard {
    grid-template-columns: 1fr;
  }
}

/* ========================================
   Chart Gallery with Filters
   ======================================== */
.gallery-section {
  margin: 3rem 0;
}

.filter-bar {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  margin-bottom: 1.5rem;
  padding: 1rem;
  background: var(--bg-white);
  border-radius: 0.75rem;
  box-shadow: 0 2px 8px rgba(0,0,0,0.06);
}

.filter-btn {
  padding: 0.5rem 1rem;
  border: 2px solid var(--mllavender);
  background: white;
  border-radius: 2rem;
  font-size: 0.85rem;
  cursor: pointer;
  transition: all 0.2s;
  color: var(--mlpurple);
  font-weight: 500;
}

.filter-btn:hover {
  border-color: var(--mlblue);
  color: var(--mlblue);
}

.filter-btn.active {
  background: var(--mlpurple);
  border-color: var(--mlpurple);
  color: white;
}

.filter-count {
  margin-left: 0.25rem;
  opacity: 0.7;
  font-weight: normal;
}

.chart-gallery {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 1.25rem;
}

.chart-thumbnail {
  background: var(--bg-white);
  border-radius: 0.75rem;
  overflow: hidden;
  box-shadow: 0 2px 8px rgba(0,0,0,0.08);
  transition: all 0.3s ease;
  text-decoration: none;
  color: var(--text-dark);
  display: block;
  position: relative;
}

.chart-thumbnail:hover {
  box-shadow: 0 8px 24px rgba(0,0,0,0.15);
  transform: translateY(-4px);
}

.chart-thumbnail[data-category] {
  /* Allow filtering */
}

.chart-thumbnail.hidden {
  display: none;
}

.chart-thumbnail-preview {
  width: 100%;
  height: 160px;
  background: linear-gradient(135deg, #e2e8f0 0%, #f1f5f9 100%);
  display: flex;
  align-items: center;
  justify-content: center;
  position: relative;
  overflow: hidden;
}

.chart-thumbnail-preview img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.chart-thumbnail-preview .chart-icon {
  font-size: 3rem;
  opacity: 0.3;
}

.chart-thumbnail-overlay {
  position: absolute;
  inset: 0;
  background: rgba(51, 51, 178, 0.9);
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 0;
  transition: opacity 0.3s;
}

.chart-thumbnail:hover .chart-thumbnail-overlay {
  opacity: 1;
}

.chart-thumbnail-overlay span {
  color: white;
  font-weight: 600;
  font-size: 0.9rem;
}

.chart-thumbnail-info {
  padding: 1rem;
}

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

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

.chart-thumbnail .chart-category-badge {
  position: absolute;
  top: 0.75rem;
  right: 0.75rem;
  padding: 0.2rem 0.5rem;
  background: rgba(255,255,255,0.9);
  border-radius: 0.25rem;
  font-size: 0.7rem;
  color: var(--mlpurple);
  font-weight: 500;
  text-transform: uppercase;
}

/* Data source badges */
.chart-thumbnail .data-badge {
  position: absolute;
  top: 0.75rem;
  left: 0.75rem;
  padding: 0.2rem 0.5rem;
  border-radius: 0.25rem;
  font-size: 0.65rem;
  font-weight: 600;
  text-transform: uppercase;
}

.data-badge.simulated {
  background: var(--mllavender);
  color: var(--mlpurple);
}

.data-badge.real {
  background: var(--mlgreen);
  color: white;
}

/* ========================================
   Timeline Component
   ======================================== */
.timeline {
  position: relative;
  max-width: 900px;
  margin: 2rem auto;
  padding-left: 2rem;
}

.timeline::before {
  content: '';
  position: absolute;
  left: 15px;
  top: 0;
  bottom: 0;
  width: 3px;
  background: linear-gradient(180deg, var(--mlpurple) 0%, var(--mlblue) 100%);
  border-radius: 2px;
}

.timeline-item {
  position: relative;
  margin-bottom: 2rem;
  padding-left: 2rem;
}

.timeline-item::before {
  content: '';
  position: absolute;
  left: -2rem;
  top: 0.25rem;
  width: 16px;
  height: 16px;
  background: white;
  border: 3px solid var(--mlpurple);
  border-radius: 50%;
}

.timeline-item:hover::before {
  background: var(--mlpurple);
}

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

.timeline-item:hover .timeline-content {
  box-shadow: 0 4px 16px rgba(0,0,0,0.12);
}

.timeline-date {
  font-size: 0.8rem;
  color: var(--mlblue);
  font-weight: 600;
  margin-bottom: 0.5rem;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.timeline-content h4 {
  margin: 0 0 0.5rem 0;
  font-size: 1.05rem;
  color: var(--text-dark);
}

.timeline-content p {
  margin: 0;
  color: var(--text-muted);
  font-size: 0.9rem;
}

.timeline-content a {
  display: inline-block;
  margin-top: 0.75rem;
  font-size: 0.85rem;
  color: var(--mlblue);
  text-decoration: none;
  font-weight: 500;
}

.timeline-content a:hover {
  text-decoration: underline;
}

/* ========================================
   Formula Display Cards
   ======================================== */
.formula-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
  gap: 1.5rem;
  margin: 2rem 0;
}

.formula-box {
  background: var(--bg-white);
  border-radius: 0.75rem;
  padding: 1.5rem;
  box-shadow: 0 2px 8px rgba(0,0,0,0.08);
  border-top: 4px solid var(--mlpurple);
  transition: all 0.3s ease;
}

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

.formula-box h4 {
  color: var(--mlblue);
  margin-bottom: 0.75rem;
  font-size: 1rem;
}

.formula-display {
  background: linear-gradient(135deg, #f8fafc 0%, #f1f5f9 100%);
  padding: 1rem;
  border-radius: 0.5rem;
  font-family: 'Cambria Math', 'Times New Roman', serif;
  font-size: 1.1rem;
  text-align: center;
  color: var(--mlpurple);
  margin-bottom: 0.75rem;
  border: 1px solid #e2e8f0;
}

.formula-box .formula-note {
  color: var(--text-muted);
  font-size: 0.85rem;
  margin: 0;
}

/* ========================================
   Documentation Hub Enhanced
   ======================================== */
.doc-hub-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 1.5rem;
  margin: 2rem 0;
}

.doc-hub-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);
  display: flex;
  gap: 1rem;
  transition: all 0.3s ease;
}

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

.doc-hub-card .doc-icon {
  width: 48px;
  height: 48px;
  background: linear-gradient(135deg, var(--mllavender) 0%, #ddd 100%);
  border-radius: 0.5rem;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.5rem;
  flex-shrink: 0;
}

.doc-hub-card .doc-info h4 {
  margin: 0 0 0.25rem 0;
  font-size: 1rem;
  color: var(--mlblue);
}

.doc-hub-card .doc-info p {
  margin: 0;
  font-size: 0.85rem;
  color: var(--text-muted);
}

/* ========================================
   Enhanced Footer
   ======================================== */
.footer-enhanced {
  background: linear-gradient(135deg, var(--mlpurple) 0%, var(--mlblue) 100%);
  color: white;
  padding: 3rem 2rem;
}

.footer-content {
  max-width: 1200px;
  margin: 0 auto;
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 2rem;
  text-align: center;
}

.footer-section h4 {
  font-size: 0.9rem;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  margin-bottom: 1rem;
  opacity: 0.9;
}

.footer-section p {
  font-size: 0.85rem;
  opacity: 0.8;
  margin: 0.5rem 0;
}

.footer-section a {
  color: white;
  text-decoration: none;
  opacity: 0.8;
  transition: opacity 0.2s;
}

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

.footer-tech-stack {
  display: flex;
  justify-content: center;
  gap: 1rem;
  flex-wrap: wrap;
}

.tech-badge {
  background: rgba(255,255,255,0.15);
  padding: 0.35rem 0.75rem;
  border-radius: 1rem;
  font-size: 0.8rem;
}

.footer-bottom {
  max-width: 1200px;
  margin: 2rem auto 0;
  padding-top: 1.5rem;
  border-top: 1px solid rgba(255,255,255,0.2);
  text-align: center;
  font-size: 0.8rem;
  opacity: 0.7;
}

@media (max-width: 768px) {
  .footer-content {
    grid-template-columns: 1fr;
    gap: 1.5rem;
  }
}

/* ========================================
   Section Separators
   ======================================== */
.section-with-bg {
  background: var(--bg-light);
  padding: 3rem 2rem;
  margin: 0 -2rem;
}

.section-divider {
  height: 4px;
  background: linear-gradient(90deg, var(--mlpurple) 0%, var(--mlblue) 50%, var(--mlpurple) 100%);
  border-radius: 2px;
  margin: 3rem 0;
}

/* ========================================
   Utility Classes
   ======================================== */
.text-gradient {
  background: linear-gradient(135deg, var(--mlpurple) 0%, var(--mlblue) 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.card-hover {
  transition: all 0.3s ease;
}

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

.lazy-iframe {
  background: var(--bg-light);
  min-height: 200px;
}

/* ========================================
   Responsive Adjustments
   ======================================== */
@media (max-width: 640px) {
  .filter-bar {
    justify-content: center;
  }

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

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

  .timeline {
    padding-left: 1rem;
  }

  .timeline-item {
    padding-left: 1.5rem;
  }
}
