/* ═══════════════════════════════════════════════════════════════════════════════
   ARVUTIVÕRKUDE ALUSED - Custom Styles
   ═══════════════════════════════════════════════════════════════════════════════ */

:root {
  --md-primary-fg-color: #5e35b1;
  --md-primary-fg-color--light: #7e57c2;
  --md-primary-fg-color--dark: #4527a0;
  --md-accent-fg-color: #ff9100;
}

[data-md-color-scheme="slate"] {
  --md-primary-fg-color: #7e57c2;
}

/* ─────────────────────────────────────────────────────────────────────────────
   HERO CONTAINER
   ───────────────────────────────────────────────────────────────────────────── */

.mdx-container {
  padding-top: 1rem;
  background:
    url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 1123 258'><path d='M1124,2c0,0 0,256 0,256l-1125,0l0,-48c0,0 16,5 55,5c116,0 197,-92 325,-92c121,0 114,46 254,46c140,0 214,-167 572,-166Z' style='fill: white' /></svg>") no-repeat bottom,
    linear-gradient(
      to bottom,
      #5e35b1,
      #7c4dff 99%,
      var(--md-default-bg-color) 99%
    );
}

[data-md-color-scheme="slate"] .mdx-container {
  background:
    url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 1123 258'><path d='M1124,2c0,0 0,256 0,256l-1125,0l0,-48c0,0 16,5 55,5c116,0 197,-92 325,-92c121,0 114,46 254,46c140,0 214,-167 572,-166Z' style='fill: %231e1e2e' /></svg>") no-repeat bottom,
    linear-gradient(
      to bottom,
      #7e57c2,
      #5e35b1 99%,
      var(--md-default-bg-color) 99%
    );
}

/* ─────────────────────────────────────────────────────────────────────────────
   HERO
   ───────────────────────────────────────────────────────────────────────────── */

.mdx-hero {
  margin: 0 1rem;
  color: white;
}

.mdx-hero h1 {
  margin-bottom: 1rem;
  font-weight: 700;
  font-size: 2.5rem;
  color: white;
}

.mdx-hero p {
  font-size: 1.2rem;
  opacity: 0.9;
}

.mdx-hero strong {
  color: #b388ff;
}

.mdx-hero__content {
  padding-bottom: 6rem;
}

.mdx-hero__image {
  display: none;
}

@media screen and (min-width: 60em) {
  .mdx-hero {
    display: flex;
    align-items: stretch;
  }

  .mdx-hero__content {
    max-width: 24rem;
    padding-bottom: 14vw;
    margin-top: 3.5rem;
  }

  .mdx-hero__image {
    display: block;
    order: 1;
    width: 38rem;
    transform: translateX(4rem);
  }

  .mdx-hero__image img {
    width: 100%;
    height: auto;
  }
}

@media screen and (min-width: 76.25em) {
  .mdx-hero__image {
    transform: translateX(8rem);
  }
}

.mdx-hero .md-button {
  margin-top: 0.5rem;
  margin-right: 0.5rem;
  color: white;
  border-color: rgba(255,255,255,0.5);
}

.mdx-hero .md-button:hover {
  color: white;
  background-color: rgba(255,255,255,0.1);
  border-color: white;
}

.mdx-hero .md-button--primary {
  color: #5e35b1;
  background-color: white;
  border-color: white;
}

.mdx-hero .md-button--primary:hover {
  color: #4527a0;
  background-color: #f5f5f5;
}

/* ─────────────────────────────────────────────────────────────────────────────
   FEATURES SECTION
   ───────────────────────────────────────────────────────────────────────────── */

.mdx-features {
  padding: 3rem 0;
}

.mdx-features__grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 1.5rem;
}

.mdx-features__item {
  display: flex;
  gap: 1rem;
  padding: 1.25rem;
  border: 1px solid var(--md-default-fg-color--lightest);
  border-radius: 0.75rem;
  transition: all 0.2s ease;
  text-decoration: none;
  color: inherit;
}

.mdx-features__item:hover {
  border-color: var(--md-primary-fg-color);
  box-shadow: 0 4px 20px rgba(0,0,0,0.08);
  transform: translateY(-2px);
}

[data-md-color-scheme="slate"] .mdx-features__item:hover {
  box-shadow: 0 4px 20px rgba(0,0,0,0.3);
}

.mdx-features__icon {
  flex-shrink: 0;
  width: 2.5rem;
  height: 2.5rem;
}

.mdx-features__icon svg {
  width: 100%;
  height: 100%;
}

.mdx-features__icon.icon-blue { color: #448aff; }
.mdx-features__icon.icon-amber { color: #ffab00; }
.mdx-features__icon.icon-green { color: #00c853; }
.mdx-features__icon.icon-purple { color: #7c4dff; }
.mdx-features__icon.icon-red { color: #ff5252; }

.mdx-features__text h3 {
  margin: 0 0 0.25rem 0;
  font-size: 1rem;
  font-weight: 600;
}

.mdx-features__text p {
  margin: 0;
  font-size: 0.875rem;
  opacity: 0.7;
}

/* ─────────────────────────────────────────────────────────────────────────────
   MERMAID DIAGRAMS
   ───────────────────────────────────────────────────────────────────────────── */

.md-typeset .mermaid {
  max-width: 600px;
  margin: 1rem auto;
  display: block;
}

/* ─────────────────────────────────────────────────────────────────────────────
   IMAGES (content pages)
   ───────────────────────────────────────────────────────────────────────────── */

.md-content img {
  max-width: 600px;
  height: auto;
  display: block;
  margin: 2rem auto;
  border-radius: 0.5rem;
  box-shadow: 0 4px 15px rgba(0, 0, 0, 0.1);
}

[data-md-color-scheme="slate"] .md-content img {
  box-shadow: 0 4px 15px rgba(0, 0, 0, 0.4);
}

.md-typeset {
  font-size: 0.72rem;
  line-height: 1.45;
}

.md-typeset h1 { font-size: 1.5rem; margin-top: 0; margin-bottom: 0.4rem; }
.md-typeset h2 { font-size: 1.15rem; margin-top: 1.2rem; margin-bottom: 0.3rem; }
.md-typeset h3 { font-size: 0.95rem; margin-top: 1rem; margin-bottom: 0.25rem; }
.md-typeset p { margin-top: 0.3em; margin-bottom: 0.3em; }
.md-typeset ul, .md-typeset ol { margin-top: 0.2em; margin-bottom: 0.2em; }
.md-typeset li { margin-bottom: 0.1em; }
.md-typeset hr { margin-top: 0.8em; margin-bottom: 0.8em; }
.md-typeset pre { margin-top: 0.4em; margin-bottom: 0.4em; }
.md-typeset pre > code { font-size: 0.68rem; line-height: 1.4; border-radius: 0.5rem; }

.md-typeset table:not([class]) td,
.md-typeset table:not([class]) th { padding: 0.4em 0.6em; font-size: 0.7rem; }
.md-typeset table:not([class]) { border-radius: 0.5rem; overflow: hidden; }
.md-typeset table:not([class]) th { background: linear-gradient(135deg, #5e35b1 0%, #7c4dff 100%); color: white; }

.md-typeset table:not([class]) + p > em:first-child {
  display: block;
  margin-top: -0.5em;
  font-size: 0.75rem;
  color: var(--md-default-fg-color--light);
}

.md-typeset .md-typeset__scrollwrap + p > em:first-child {
  display: block;
  margin-top: -0.8em;
  font-size: 0.75rem;
  color: var(--md-default-fg-color--light);
}

.md-typeset .admonition, .md-typeset details {
  margin-top: 0.5em; margin-bottom: 0.5em; font-size: 0.7rem; border-radius: 0.5rem;
}

.md-typeset figcaption {
  font-size: 0.75rem; color: var(--md-default-fg-color--light);
  font-style: italic; text-align: center; margin-top: 0.5rem;
}

.md-typeset .footnotes {
  font-size: 0.75rem; border-top: 1px solid var(--md-default-fg-color--lightest);
  margin-top: 2.5rem; padding-top: 1rem;
}
.md-typeset .footnotes li { font-size: 0.75rem; }
.md-typeset .footnote-ref { font-weight: 600; }

.md-typeset blockquote { margin-top: 0.4em; margin-bottom: 0.4em; padding-left: 0.8em; }
