/**
 * Hub Page Styles
 * Styles specific to the Magic Internet Math hub/landing page
 */

/* Course Grid */
.courses-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
  gap: 2rem;
  margin-top: 1.5rem;
}

/* Course Cards */
.course-card {
  background: linear-gradient(135deg, rgba(99, 102, 241, 0.1) 0%, rgba(6, 182, 212, 0.05) 100%);
  border: 1px solid rgba(99, 102, 241, 0.2);
  border-radius: 1.5rem;
  padding: 2rem;
  text-decoration: none;
  transition: all 0.3s ease;
  display: flex;
  flex-direction: column;
}

.course-card:hover {
  transform: translateY(-4px);
  border-color: rgba(99, 102, 241, 0.4);
  box-shadow: 0 20px 40px rgba(0, 0, 0, 0.3);
  cursor: pointer;
}

.course-icon {
  width: 64px;
  height: 64px;
  border-radius: 1rem;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 2rem;
  margin-bottom: 1.5rem;
  background: linear-gradient(135deg, rgba(99, 102, 241, 0.2) 0%, rgba(99, 102, 241, 0.1) 100%);
}

.course-title {
  font-size: 1.5rem;
  font-weight: 700;
  color: #f1f5f9;
  margin-bottom: 0.75rem;
}

.course-description {
  color: #94a3b8;
  line-height: 1.6;
  margin-bottom: 1.5rem;
  flex-grow: 1;
}

.course-meta {
  display: flex;
  gap: 1rem;
  flex-wrap: wrap;
}

.course-tag {
  font-size: 0.75rem;
  padding: 0.25rem 0.75rem;
  border-radius: 9999px;
  background: rgba(148, 163, 184, 0.1);
  color: #94a3b8;
}

/* Level Sections */
.level-section {
  margin-top: 3rem;
}

.level-header {
  display: flex;
  align-items: center;
  gap: 1rem;
  margin-bottom: 1.5rem;
}

.level-description {
  color: #64748b;
  font-size: 0.9rem;
}

/* Level Badges */
.level-badge {
  padding: 0.5rem 1rem;
  border-radius: 0.5rem;
  font-weight: 600;
  font-size: 0.875rem;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.level-badge.featured {
  background: linear-gradient(135deg, rgba(251, 191, 36, 0.2) 0%, rgba(251, 191, 36, 0.1) 100%);
  color: #fbbf24;
  border: 1px solid rgba(251, 191, 36, 0.3);
}

.level-badge.beginner {
  background: linear-gradient(135deg, rgba(34, 197, 94, 0.2) 0%, rgba(34, 197, 94, 0.1) 100%);
  color: #4ade80;
  border: 1px solid rgba(34, 197, 94, 0.3);
}

.level-badge.subject {
  background: linear-gradient(135deg, rgba(99, 102, 241, 0.2) 0%, rgba(99, 102, 241, 0.1) 100%);
  color: #818cf8;
  border: 1px solid rgba(99, 102, 241, 0.3);
}

/* Section-specific icon colors */

/* Featured section - gold/amber accent */
[data-section="featured"] .course-icon {
  background: linear-gradient(135deg, rgba(251, 191, 36, 0.2) 0%, rgba(251, 191, 36, 0.1) 100%);
}

/* Featured cards get a subtle gold border */
[data-section="featured"] .course-card {
  border-color: rgba(251, 191, 36, 0.2);
}

[data-section="featured"] .course-card:hover {
  border-color: rgba(251, 191, 36, 0.4);
}

/* Beginners section - green theme */
[data-section="beginners"] .course-icon {
  background: linear-gradient(135deg, rgba(34, 197, 94, 0.2) 0%, rgba(34, 197, 94, 0.1) 100%);
}

/* Calculus section - orange theme */
[data-section="calculus"] .course-icon {
  background: linear-gradient(135deg, rgba(249, 115, 22, 0.2) 0%, rgba(249, 115, 22, 0.1) 100%);
}

/* Algebra section - purple theme */
[data-section="algebra"] .course-icon {
  background: linear-gradient(135deg, rgba(139, 92, 246, 0.2) 0%, rgba(139, 92, 246, 0.1) 100%);
}

/* Geometry section - pink theme */
[data-section="geometry"] .course-icon {
  background: linear-gradient(135deg, rgba(236, 72, 153, 0.2) 0%, rgba(236, 72, 153, 0.1) 100%);
}

/* History section - amber theme */
[data-section="history"] .course-icon {
  background: linear-gradient(135deg, rgba(245, 158, 11, 0.2) 0%, rgba(245, 158, 11, 0.1) 100%);
}

/* Seminal Works section - deep amber/gold theme for classical texts */
[data-section="seminal"] .course-icon {
  background: linear-gradient(135deg, rgba(217, 119, 6, 0.2) 0%, rgba(217, 119, 6, 0.1) 100%);
}

[data-section="seminal"] .course-card {
  border-color: rgba(217, 119, 6, 0.2);
}

[data-section="seminal"] .course-card:hover {
  border-color: rgba(217, 119, 6, 0.4);
}

/* Hero Section */
.hero-subtitle {
  font-size: 1.25rem;
  color: #94a3b8;
  max-width: 600px;
  margin: 0 auto 1rem;
  line-height: 1.6;
}

/* Section Headers */
.section-title {
  font-size: 1.75rem;
  font-weight: 700;
  color: #f1f5f9;
  margin-bottom: 0.5rem;
}

.section-subtitle {
  color: #64748b;
  margin-bottom: 2rem;
}

/* Progress Dashboard */
#progress-dashboard {
  margin-top: 3rem;
}

.progress-stats-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 1.5rem;
  margin-top: 2rem;
}

.progress-courses-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 1.5rem;
  margin-top: 2rem;
}

.progress-stat-card {
  text-align: center;
  padding: 1.5rem;
}

.progress-stat-value {
  font-size: 2.5rem;
  font-weight: 700;
}

.progress-stat-label {
  color: #94a3b8;
  font-size: 0.875rem;
}

.progress-course-card {
  padding: 1.5rem;
}

.progress-course-title {
  color: #f1f5f9;
  margin-bottom: 0.5rem;
}

.hub-progress-bar-container {
  height: 8px;
  background: rgba(148, 163, 184, 0.2);
  border-radius: 4px;
  overflow: hidden;
}

.hub-progress-bar-fill {
  height: 100%;
  width: 0%;
  transition: width 0.5s;
}

.progress-count {
  color: #94a3b8;
  font-size: 0.75rem;
  margin-top: 0.5rem;
}

/* Leaderboard Section */
.leaderboard-section {
  margin-top: 4rem;
  padding-top: 2rem;
  border-top: 1px solid var(--border);
}

.leaderboard-links {
  display: flex;
  gap: 0.75rem;
  flex-wrap: wrap;
}

/* =============================================================================
   FEATURED CONTENT VISUALIZATION
   ============================================================================= */

.featured-section {
  margin-top: 3rem;
}

#featured-content-inline {
  margin: 2.5rem 0;
}

.featured-viz-card {
  background: linear-gradient(135deg, rgba(99, 102, 241, 0.08) 0%, rgba(236, 72, 153, 0.05) 100%);
  border: 1px solid rgba(99, 102, 241, 0.2);
  border-radius: 1.5rem;
  padding: 2rem;
  overflow: hidden;
}

.featured-viz-header {
  text-align: center;
  margin-bottom: 1.5rem;
}

.featured-viz-title {
  font-size: 1.5rem;
  font-weight: 700;
  color: #f1f5f9;
  margin-bottom: 0.5rem;
}

.featured-viz-subtitle {
  color: #94a3b8;
  font-size: 1rem;
}

.featured-viz-content {
  margin: 1.5rem 0;
  display: flex;
  justify-content: center;
  overflow-x: auto;
}

.cardinality-svg {
  width: 100%;
  max-width: 800px;
  height: auto;
  min-height: 200px;
}

.featured-viz-controls {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 2rem;
  margin: 1.5rem 0;
  flex-wrap: wrap;
}

.control-group {
  display: flex;
  align-items: center;
  gap: 1rem;
}

.control-label {
  color: #94a3b8;
  font-size: 0.875rem;
}

.control-value {
  color: #f1f5f9;
  font-weight: 600;
  font-size: 0.875rem;
  min-width: 70px;
}

.viz-slider {
  -webkit-appearance: none;
  appearance: none;
  width: 150px;
  height: 6px;
  background: rgba(99, 102, 241, 0.3);
  border-radius: 3px;
  outline: none;
  cursor: pointer;
}

.viz-slider::-webkit-slider-thumb {
  -webkit-appearance: none;
  appearance: none;
  width: 18px;
  height: 18px;
  background: linear-gradient(135deg, #6366f1 0%, #8b5cf6 100%);
  border-radius: 50%;
  cursor: pointer;
  transition: transform 0.2s;
}

.viz-slider::-webkit-slider-thumb:hover {
  transform: scale(1.2);
}

.viz-slider::-moz-range-thumb {
  width: 18px;
  height: 18px;
  background: linear-gradient(135deg, #6366f1 0%, #8b5cf6 100%);
  border-radius: 50%;
  border: none;
  cursor: pointer;
}

.viz-btn {
  padding: 0.5rem 1.25rem;
  border-radius: 0.5rem;
  font-weight: 600;
  font-size: 0.875rem;
  background: linear-gradient(135deg, rgba(99, 102, 241, 0.2) 0%, rgba(99, 102, 241, 0.1) 100%);
  color: #818cf8;
  border: 1px solid rgba(99, 102, 241, 0.3);
  cursor: pointer;
  transition: all 0.2s;
}

.viz-btn:hover {
  background: linear-gradient(135deg, rgba(99, 102, 241, 0.3) 0%, rgba(99, 102, 241, 0.2) 100%);
  border-color: rgba(99, 102, 241, 0.5);
}

.viz-btn.active {
  background: linear-gradient(135deg, rgba(236, 72, 153, 0.2) 0%, rgba(236, 72, 153, 0.1) 100%);
  color: #f472b6;
  border-color: rgba(236, 72, 153, 0.3);
}

.featured-viz-explanation {
  text-align: center;
  max-width: 600px;
  margin: 0 auto;
  padding-top: 1rem;
  border-top: 1px solid rgba(148, 163, 184, 0.1);
}

.featured-viz-explanation p {
  color: #94a3b8;
  font-size: 0.9rem;
  line-height: 1.6;
  margin-bottom: 0.75rem;
}

.featured-viz-explanation .math {
  font-family: "Times New Roman", serif;
  font-style: italic;
  color: #c4b5fd;
}

.featured-viz-explanation .aleph {
  font-style: normal;
}

.featured-viz-explanation .hint {
  font-size: 0.8rem;
  color: #64748b;
  margin-bottom: 0;
}

/* Connection line hover effect */
.connection-line {
  transition: stroke 0.2s, stroke-width 0.2s, opacity 0.2s;
}

.number-group {
  cursor: pointer;
  transition: transform 0.2s;
}

/* Responsive */
@media (max-width: 640px) {
  .featured-viz-card {
    padding: 1.25rem;
  }

  .featured-viz-title {
    font-size: 1.25rem;
  }

  .featured-viz-controls {
    flex-direction: column;
    gap: 1rem;
  }

  .viz-slider {
    width: 200px;
  }
}
