/* ============================================
   MELOWEE Learn – Custom Theme
   Deep Purple / Amber on Dark
   ============================================ */

:root {
  --ml-purple: #7c4dff;
  --ml-purple-light: #b388ff;
  --ml-amber: #ffab40;
  --ml-amber-dark: #ff6d00;
  --ml-bg-dark: #1a1a2e;
  --ml-bg-card: #16213e;
  --ml-text: #e0e0e0;
  --ml-radius: 12px;
}

/* ---- Hero Section ---- */
.hero {
  text-align: center;
  padding: 4rem 2rem 3rem;
  background: linear-gradient(135deg, var(--ml-bg-dark) 0%, #0f3460 100%);
  border-radius: var(--ml-radius);
  margin-bottom: 2rem;
}

.hero h1 {
  font-size: 2.8rem;
  margin-bottom: 0.5rem;
  background: linear-gradient(135deg, var(--ml-purple-light), var(--ml-amber));
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.hero h3 {
  font-weight: 400;
  opacity: 0.85;
  margin-bottom: 1.5rem;
}

/* ---- Feature Grid ---- */
.features-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  gap: 1.5rem;
  margin: 2rem 0;
}

.feature-card {
  padding: 1.8rem;
  border-radius: var(--ml-radius);
  border: 1px solid rgba(124, 77, 255, 0.2);
  background: var(--ml-bg-card);
  transition: transform 0.2s ease, border-color 0.2s ease;
}

.feature-card:hover {
  transform: translateY(-4px);
  border-color: var(--ml-purple);
}

.feature-card h3 {
  margin-top: 0;
  font-size: 1.1rem;
}

/* ---- Widget Container ---- */
.widget-container {
  width: 100%;
  max-width: 800px;
  margin: 1.5rem auto;
  border-radius: var(--ml-radius);
  overflow: hidden;
  border: 1px solid rgba(124, 77, 255, 0.3);
  background: var(--ml-bg-dark);
}

.widget-container canvas {
  display: block;
}

/* ---- Knowledge Graph ---- */
.graph-container {
  display: flex;
  gap: 1rem;
  height: 70vh;
  min-height: 500px;
}

.graph-sidebar {
  width: 220px;
  flex-shrink: 0;
  padding: 1rem;
  border-radius: var(--ml-radius);
  background: var(--ml-bg-card);
  border: 1px solid rgba(124, 77, 255, 0.2);
  overflow-y: auto;
}

.graph-sidebar h3 {
  margin-top: 0;
  font-size: 1rem;
  color: var(--ml-purple-light);
}

.graph-sidebar h4 {
  margin: 1rem 0 0.5rem;
  font-size: 0.85rem;
  color: var(--ml-amber);
}

.graph-sidebar label {
  display: block;
  padding: 0.3rem 0;
  font-size: 0.85rem;
  cursor: pointer;
}

.graph-search input {
  width: 100%;
  padding: 0.5rem;
  border-radius: 6px;
  border: 1px solid rgba(124, 77, 255, 0.3);
  background: rgba(0, 0, 0, 0.3);
  color: var(--ml-text);
  font-size: 0.85rem;
  margin-bottom: 0.8rem;
}

.graph-search input:focus {
  outline: none;
  border-color: var(--ml-purple);
}

.graph-canvas {
  flex: 1;
  border-radius: var(--ml-radius);
  border: 1px solid rgba(124, 77, 255, 0.2);
  background: var(--ml-bg-dark);
}

.legend-dot {
  display: inline-block;
  width: 10px;
  height: 10px;
  border-radius: 50%;
  margin-right: 4px;
  vertical-align: middle;
}

/* ---- Responsive ---- */
@media (max-width: 768px) {
  .graph-container {
    flex-direction: column;
    height: auto;
  }

  .graph-sidebar {
    width: 100%;
  }

  .graph-canvas {
    height: 60vh;
  }

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

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

/* ---- Tables ---- */
.md-typeset table:not([class]) {
  border-radius: 8px;
  overflow: hidden;
}

/* ---- Admonitions ---- */
.md-typeset .admonition,
.md-typeset details {
  border-radius: 8px;
}

/* ---- Narrower Sidebars + Subtle Separation ---- */

:root {
  --md-sidebar-width: 8.5rem;
}

.md-sidebar__scrollwrap {
  padding: 0.4rem 0;
}

.md-sidebar--primary .md-sidebar__scrollwrap {
  border-right: 1px solid rgba(124, 77, 255, 0.10);
  background: rgba(22, 33, 62, 0.25);
}

.md-sidebar--secondary .md-sidebar__scrollwrap {
  border-left: 1px solid rgba(124, 77, 255, 0.10);
  background: rgba(22, 33, 62, 0.25);
}

.md-sidebar .md-nav {
  font-size: 0.65rem;
}

.md-sidebar .md-nav__link {
  padding: 0.25em 0.5em;
}

/* ---- Mermaid override for dark theme ---- */
.mermaid {
  background: transparent !important;
}
