/* ============================================================
   RU4M Backoffice — Documentation Theme
   Aesthetic: Refined Command Center
   Brand: Navy #1B2A5B + Gradient #2ccf6a → #0985cc
   ============================================================ */

@import url('https://fonts.googleapis.com/css2?family=Plus+Jakarta+Sans:wght@500;600;700;800&display=swap');

/* ── Brand Tokens ── */
:root {
  --ru4m-green: #2ccf6a;
  --ru4m-blue: #0985cc;
  --ru4m-navy: #1B2A5B;
  --ru4m-navy-light: #2D4080;
  --ru4m-navy-dark: #111D42;
  --ru4m-gradient: linear-gradient(180deg, #2ccf6a, #0985cc);
  --ru4m-gradient-h: linear-gradient(135deg, #2ccf6a, #0985cc);
  --ru4m-gradient-subtle: linear-gradient(135deg, rgba(44, 207, 106, 0.08), rgba(9, 133, 204, 0.08));

  --md-primary-fg-color: #1B2A5B;
  --md-primary-fg-color--light: #2D4080;
  --md-primary-fg-color--dark: #111D42;
  --md-accent-fg-color: #2ccf6a;
  --md-accent-fg-color--transparent: rgba(44, 207, 106, 0.1);

  --surface-card: rgba(255, 255, 255, 0.7);
  --surface-card-hover: rgba(255, 255, 255, 0.9);
  --border-subtle: rgba(27, 42, 91, 0.08);
  --border-accent: rgba(9, 133, 204, 0.2);
  --shadow-sm: 0 1px 3px rgba(27, 42, 91, 0.06);
  --shadow-md: 0 4px 16px rgba(27, 42, 91, 0.08);
  --shadow-lg: 0 8px 32px rgba(27, 42, 91, 0.12);
  --shadow-glow: 0 0 40px rgba(44, 207, 106, 0.1);
}

[data-md-color-scheme="slate"] {
  --md-primary-fg-color: #2D4080;
  --md-primary-fg-color--light: #4060B0;
  --md-primary-fg-color--dark: #1B2A5B;
  --md-accent-fg-color: #3ddb7a;
  --md-accent-fg-color--transparent: rgba(61, 219, 122, 0.1);

  --surface-card: rgba(255, 255, 255, 0.04);
  --surface-card-hover: rgba(255, 255, 255, 0.07);
  --border-subtle: rgba(255, 255, 255, 0.06);
  --border-accent: rgba(61, 219, 122, 0.15);
  --shadow-sm: 0 1px 3px rgba(0, 0, 0, 0.2);
  --shadow-md: 0 4px 16px rgba(0, 0, 0, 0.25);
  --shadow-lg: 0 8px 32px rgba(0, 0, 0, 0.3);
  --shadow-glow: 0 0 40px rgba(44, 207, 106, 0.06);
  --ru4m-gradient-subtle: linear-gradient(135deg, rgba(44, 207, 106, 0.05), rgba(9, 133, 204, 0.05));
}

/* ── Global Heading Font ── */
.md-typeset h1,
.md-typeset h2,
.md-typeset h3,
.md-typeset h4 {
  font-family: "Plus Jakarta Sans", var(--md-text-font-family);
}

/* ── Header ── */
.md-header {
  background: linear-gradient(180deg, #111D42, var(--ru4m-navy));
  box-shadow: 0 2px 12px rgba(0, 0, 0, 0.15);
}

/* Gradient accent stripe between header and tabs */
.md-header::after {
  content: "";
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  height: 2px;
  background: var(--ru4m-gradient-h);
  opacity: 0.6;
  z-index: 1;
}

.md-header__button.md-logo img {
  height: 1.8rem;
  width: auto;
}

/* Header title */
.md-header__topic {
  font-family: "Plus Jakarta Sans", var(--md-text-font-family);
  font-weight: 700;
  letter-spacing: -0.01em;
}

/* ── Tabs Bar ── */
.md-tabs {
  background-color: var(--md-primary-fg-color--dark);
  border-bottom: 1px solid rgba(255, 255, 255, 0.06);
}

[data-md-color-scheme="slate"] .md-tabs {
  background-color: #0a1225;
}

/* Tab items */
.md-tabs__link {
  font-family: "Plus Jakarta Sans", var(--md-text-font-family);
  font-weight: 500;
  font-size: 0.78rem;
  letter-spacing: 0.01em;
  opacity: 0.65;
  transition: all 0.2s ease;
  position: relative;
}

.md-tabs__link:hover {
  opacity: 1;
  background: rgba(255, 255, 255, 0.05);
}

/* Active tab — gradient underline */
.md-tabs__link--active {
  opacity: 1;
  font-weight: 600;
}

.md-tabs__link--active::after {
  content: "";
  position: absolute;
  bottom: 0;
  left: 0.8rem;
  right: 0.8rem;
  height: 2px;
  background: var(--ru4m-gradient-h);
  border-radius: 2px 2px 0 0;
}

/* ── Search Bar — Pill Shape ── */
.md-search__form {
  border-radius: 20px;
  background: rgba(255, 255, 255, 0.08);
  border: 1px solid rgba(255, 255, 255, 0.1);
  transition: all 0.25s ease;
}

.md-search__form:focus-within {
  background: rgba(255, 255, 255, 0.12);
  border-color: rgba(44, 207, 106, 0.3);
  box-shadow: 0 0 0 3px rgba(44, 207, 106, 0.08);
}

[data-md-color-scheme="default"] .md-search__form {
  border-radius: 20px;
}

/* Search icon and input */
.md-search__input {
  font-family: "DM Sans", var(--md-text-font-family);
  font-size: 0.85rem;
}

.md-search__input::placeholder {
  opacity: 0.5;
}

/* ── Content Images (desktop screenshots) ── */
.md-content img {
  max-width: 800px;
  width: 100%;
  display: block;
  margin: 1rem auto;
  border-radius: 10px;
  box-shadow: var(--shadow-md);
}

[data-md-color-scheme="slate"] .md-content img {
  box-shadow: var(--shadow-lg);
  filter: brightness(0.95);
}

/* ── Step Numbering (inner pages) ── */
.md-typeset h2,
.md-typeset h3 {
  border-left: 3px solid var(--ru4m-green);
  padding-left: 0.8rem;
}

/* Remove green border from special sections */
.quick-start-section h2,
.help-banner h2 {
  border-left: none;
  padding-left: 0;
}

/* ── Admonitions ── */
.md-typeset .admonition.tip,
.md-typeset details.tip {
  border-color: var(--ru4m-green);
}
.md-typeset .tip > .admonition-title,
.md-typeset .tip > summary {
  background-color: rgba(44, 207, 106, 0.1);
}
.md-typeset .admonition.info,
.md-typeset details.info {
  border-color: var(--ru4m-blue);
}
.md-typeset .info > .admonition-title,
.md-typeset .info > summary {
  background-color: rgba(9, 133, 204, 0.1);
}

/* ── Nav & Search ── */
.md-nav__link--active {
  color: var(--ru4m-green) !important;
  font-weight: 600;
}
.md-search-result mark {
  background-color: rgba(44, 207, 106, 0.2);
  color: inherit;
}

/* ── Horizontal Rules ── */
.md-typeset hr {
  border: none;
  height: 1px;
  background: var(--border-subtle);
  opacity: 1;
}

/* ── Scrollbar ── */
.md-sidebar__scrollwrap::-webkit-scrollbar-thumb {
  background: var(--ru4m-gradient);
  border-radius: 4px;
}

/* ============================================================
   HOMEPAGE
   ============================================================ */

/* Hide the h1 (title is in hero) */
.hero-title {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
}

/* ── Hero Section ── */
.hero {
  position: relative;
  text-align: center;
  padding: 5rem 2rem 3rem;
  /*max-width: 860px;*/
  margin: 0 auto;
  overflow: visible;
}

/* Animated gradient orbs */
.hero::before,
.hero::after {
  content: "";
  position: absolute;
  border-radius: 50%;
  filter: blur(80px);
  opacity: 0.15;
  z-index: -1;
  animation: orb-drift 12s ease-in-out infinite alternate;
}

.hero::before {
  width: 400px;
  height: 400px;
  background: var(--ru4m-green);
  top: -100px;
  right: -120px;
}

.hero::after {
  width: 350px;
  height: 350px;
  background: var(--ru4m-blue);
  bottom: -80px;
  left: -100px;
  animation-delay: -6s;
}

[data-md-color-scheme="slate"] .hero::before,
[data-md-color-scheme="slate"] .hero::after {
  opacity: 0.08;
}

@keyframes orb-drift {
  0% { transform: translate(0, 0) scale(1); }
  100% { transform: translate(30px, -20px) scale(1.1); }
}

/* Overline label */
.hero-overline {
  display: inline-block;
  font-family: "Plus Jakarta Sans", var(--md-text-font-family);
  font-size: 0.7rem;
  font-weight: 700;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  background: var(--ru4m-gradient-h);
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
  margin-bottom: 1.2rem;
  opacity: 0;
  animation: fade-up 0.6s ease forwards;
}

.hero-heading {
  font-family: "Plus Jakarta Sans", var(--md-text-font-family);
  font-size: 3rem;
  font-weight: 800;
  line-height: 1.1;
  letter-spacing: -0.03em;
  margin: 0 0 1.4rem;
  color: var(--md-default-fg-color);
  opacity: 0;
  animation: fade-up 0.6s ease 0.1s forwards;
}

.hero-heading .gradient {
  background: var(--ru4m-gradient-h);
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
}

.hero-subtitle {
  font-size: 1.1rem;
  line-height: 1.6;
  color: var(--md-default-fg-color--light);
  margin-bottom: 2.2rem;
  max-width: 560px;
  margin-left: auto;
  margin-right: auto;
  opacity: 0;
  animation: fade-up 0.6s ease 0.2s forwards;
}

.hero-buttons {
  display: flex;
  gap: 0.75rem;
  justify-content: center;
  flex-wrap: wrap;
  opacity: 0;
  animation: fade-up 0.6s ease 0.3s forwards;
}

.hero-buttons .md-button {
  border-radius: 10px;
  padding: 0.65rem 1.8rem;
  font-family: "Plus Jakarta Sans", var(--md-text-font-family);
  font-weight: 600;
  font-size: 0.9rem;
  letter-spacing: 0.01em;
  transition: all 0.25s ease;
}

.hero-buttons .md-button--primary {
  background: var(--ru4m-gradient-h);
  border: none;
  color: #fff;
  box-shadow: 0 4px 16px rgba(44, 207, 106, 0.25);
}

.hero-buttons .md-button--primary:hover {
  box-shadow: 0 6px 24px rgba(44, 207, 106, 0.35);
  transform: translateY(-1px);
}

/* Ghost/outline secondary button */
.hero-buttons .md-button:not(.md-button--primary) {
  background: transparent;
  border: 1.5px solid var(--border-accent);
  color: var(--md-default-fg-color);
}

.hero-buttons .md-button:not(.md-button--primary):hover {
  border-color: var(--ru4m-blue);
  background: rgba(9, 133, 204, 0.05);
  transform: translateY(-1px);
}

@keyframes fade-up {
  from {
    opacity: 0;
    transform: translateY(16px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

/* ── Feature Cards — 3x2 Grid ── */
.feature-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 1rem;
  margin: 3rem 0;
}

.feature-card {
  background: var(--surface-card);
  border: 1px solid var(--border-subtle);
  border-radius: 14px;
  padding: 1.6rem;
  transition: all 0.3s ease;
  position: relative;
  overflow: hidden;
  -webkit-backdrop-filter: blur(8px);
  backdrop-filter: blur(8px);
  opacity: 0;
  animation: fade-up 0.5s ease forwards;
}

/* Staggered entrance */
.feature-card:nth-child(1) { animation-delay: 0.15s; }
.feature-card:nth-child(2) { animation-delay: 0.22s; }
.feature-card:nth-child(3) { animation-delay: 0.29s; }
.feature-card:nth-child(4) { animation-delay: 0.36s; }
.feature-card:nth-child(5) { animation-delay: 0.43s; }
.feature-card:nth-child(6) { animation-delay: 0.50s; }

/* Gradient border on hover */
.feature-card::before {
  content: "";
  position: absolute;
  inset: 0;
  border-radius: 14px;
  padding: 1px;
  background: var(--ru4m-gradient-h);
  mask: linear-gradient(#fff 0 0) content-box, linear-gradient(#fff 0 0);
  mask-composite: exclude;
  -webkit-mask: linear-gradient(#fff 0 0) content-box, linear-gradient(#fff 0 0);
  -webkit-mask-composite: xor;
  opacity: 0;
  transition: opacity 0.3s ease;
  pointer-events: none;
}

.feature-card:hover::before {
  opacity: 1;
}

.feature-card:hover {
  transform: translateY(-4px);
  box-shadow: var(--shadow-lg);
  border-color: transparent;
}

.feature-card h3 {
  border-left: none;
  padding-left: 0;
  margin-top: 0;
  font-family: "Plus Jakarta Sans", var(--md-text-font-family);
  font-size: 1.05rem;
  font-weight: 700;
  letter-spacing: -0.01em;
}

.feature-card p {
  font-size: 0.88rem;
  line-height: 1.55;
  color: var(--md-default-fg-color--light);
}

.feature-card a {
  font-size: 0.85rem;
  font-weight: 600;
  background-image: var(--ru4m-gradient-h);
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
  transition: opacity 0.2s;
}

.feature-card a:hover {
  opacity: 0.8;
}

@media (max-width: 768px) {
  .feature-grid {
    display: flex;
    overflow-x: auto;
    scroll-snap-type: x mandatory;
    -webkit-overflow-scrolling: touch;
    gap: 0.75rem;
    padding-bottom: 0.75rem;
    /* Fade hint that more cards exist off-screen */
    mask-image: linear-gradient(to right, #000 85%, transparent);
    -webkit-mask-image: linear-gradient(to right, #000 85%, transparent);
  }
  .feature-card {
    min-width: 260px;
    max-width: 280px;
    flex-shrink: 0;
    scroll-snap-align: start;
  }
}

/* ── Quick Start — Timeline ── */
.quick-start-section {
  position: relative;
  background: var(--ru4m-gradient-subtle);
  border: 1px solid var(--border-subtle);
  border-radius: 18px;
  padding: 2.5rem 2rem;
  margin: 3rem 0;
  overflow: hidden;
}

.quick-start-section::before {
  content: "";
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 2px;
  background: var(--ru4m-gradient-h);
  opacity: 0.5;
}

.quick-start-section h2 {
  font-family: "Plus Jakarta Sans", var(--md-text-font-family);
  font-weight: 700;
  letter-spacing: -0.02em;
  margin-top: 0;
  text-align: center;
}

.quick-start {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 1.2rem;
  margin: 2rem 0 0;
  position: relative;
}

/* Connecting line behind steps — positioned via step-num */
.quick-start::before {
  display: none;
}

.quick-start-step {
  text-align: center;
  padding: 0.8rem 0.5rem;
  position: relative;
  z-index: 1;
}

.quick-start-step .step-num {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 38px;
  height: 38px;
  border-radius: 50%;
  background: var(--ru4m-gradient-h);
  color: #fff;
  font-family: "Plus Jakarta Sans", var(--md-text-font-family);
  font-weight: 700;
  font-size: 0.95rem;
  margin-bottom: 1rem;
  position: relative;
  box-shadow: 0 4px 12px rgba(44, 207, 106, 0.2);
  z-index: 1;
}

/* Connecting line — stretches to fill gap between step circles */
.quick-start-step:not(:last-child) .step-num::before {
  content: "";
  position: absolute;
  top: 50%;
  left: 100%;
  width: calc(100% + 1.2rem - 38px);
  height: 2px;
  background: var(--ru4m-gradient-h);
  opacity: 0.25;
  transform: translateY(-50%);
  z-index: -1;
  pointer-events: none;
}

/* Pulse ring */
.quick-start-step .step-num::after {
  content: "";
  position: absolute;
  inset: -4px;
  border-radius: 50%;
  border: 2px solid var(--ru4m-green);
  opacity: 0;
  animation: pulse-ring 3s ease-in-out infinite;
}

.quick-start-step:nth-child(1) .step-num::after { animation-delay: 0s; }
.quick-start-step:nth-child(2) .step-num::after { animation-delay: 0.75s; }
.quick-start-step:nth-child(3) .step-num::after { animation-delay: 1.5s; }
.quick-start-step:nth-child(4) .step-num::after { animation-delay: 2.25s; }

@keyframes pulse-ring {
  0% { opacity: 0; transform: scale(1); }
  20% { opacity: 0.4; }
  100% { opacity: 0; transform: scale(1.6); }
}

.quick-start-step h4 {
    font-family: "Plus Jakarta Sans", var(--md-text-font-family);
    font-weight: 700;
    margin: 0.3rem 0;
    font-size: 0.92rem;
    letter-spacing: -0.01em;
}

.quick-start-step h4 a {
    display: none!important;
}

.quick-start-step p {
  font-size: 0.82rem;
  color: var(--md-default-fg-color--light);
  margin: 0.3rem 0 0.5rem;
  line-height: 1.45;
}

@media (max-width: 768px) {
  .quick-start-section {
    padding: 1.5rem 1rem;
    overflow-x: auto;
  }
  .quick-start {
    display: flex;
    overflow-x: auto;
    scroll-snap-type: x mandatory;
    -webkit-overflow-scrolling: touch;
    gap: 0.75rem;
    padding-bottom: 0.5rem;
  }
  .quick-start::before {
    display: none;
  }
  .quick-start-step {
    min-width: 170px;
    flex-shrink: 0;
    scroll-snap-align: start;
  }
}

/* ── Help Banner ── */
.help-banner {
  position: relative;
  border-radius: 16px;
  padding: 2.5rem 2rem;
  text-align: center;
  margin: 3rem 0 1rem;
  background: var(--ru4m-navy);
  overflow: hidden;
  color: rgba(255, 255, 255, 0.9);
}

.help-banner::before {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(135deg, rgba(44, 207, 106, 0.15) 0%, transparent 50%, rgba(9, 133, 204, 0.15) 100%);
  pointer-events: none;
}

/* Noise texture overlay */
.help-banner::after {
  content: "";
  position: absolute;
  inset: 0;
  opacity: 0.03;
  background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 256 256' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.9' numOctaves='4' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E");
  pointer-events: none;
}

.help-banner h2 {
  position: relative;
  font-family: "Plus Jakarta Sans", var(--md-text-font-family);
  font-weight: 700;
  font-size: 1.3rem;
  color: #fff;
  margin: 0 0 0.5rem;
  letter-spacing: -0.02em;
}

.help-banner p {
  position: relative;
  font-size: 0.92rem;
  color: rgba(255, 255, 255, 0.7);
  margin: 0;
  max-width: 500px;
  margin-left: auto;
  margin-right: auto;
  line-height: 1.55;
}

.help-banner a {
  color: var(--ru4m-green);
  text-decoration: underline;
  text-underline-offset: 2px;
}

.help-banner a:hover {
  color: #fff;
}

.help-banner h2 a.headerlink {
  display: none;
}

/* Legacy .help-card fallback (in case markdown uses it) */
.help-card {
  display: none;
}

/* ── Mobile Hero ── */
@media (max-width: 768px) {
  .hero {
    padding: 3rem 1rem 2rem;
  }
  .hero::before {
    width: 250px;
    height: 250px;
    right: -80px;
  }
  .hero::after {
    width: 200px;
    height: 200px;
    left: -60px;
  }
  .hero-heading {
    font-size: 2rem;
    letter-spacing: -0.02em;
  }
  .hero-subtitle {
    font-size: 0.95rem;
  }
  .hero-buttons .md-button {
    padding: 0.55rem 1.3rem;
    font-size: 0.85rem;
  }
}

/* ============================================================
   CUSTOM FOOTER
   ============================================================ */

.md-footer-meta__inner {
  display: block;
}

.ru4m-footer {
  display: flex;
  gap: 6rem;
  padding: 2.5rem 1rem 1.5rem;
  color: var(--md-footer-fg-color--lighter);
  font-size: 0.78rem;
  line-height: 1.7;
}

@media (max-width: 768px) {
  .ru4m-footer {
    flex-direction: column;
    gap: 2rem;
    align-items: center;
    text-align: center;
  }
}

.ru4m-footer__col {
  max-width: 280px;
}

.ru4m-footer h4 {
  color: #fff;
  font-family: "Plus Jakarta Sans", var(--md-text-font-family);
  font-size: 0.85rem;
  font-weight: 700;
  margin: 0 0 0.6rem;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.ru4m-footer p {
  margin: 0.15rem 0;
}

.ru4m-footer a {
  color: var(--md-footer-fg-color--light);
  text-decoration: none;
}

.ru4m-footer a:hover {
  color: var(--ru4m-green);
}

.ru4m-footer ul,
.ru4m-footer ul li {
  list-style: none;
  padding: 0;
  margin: 0;
  margin-left: 0 !important;
}

.ru4m-footer ul li {
  margin: 0.25rem 0;
}

.ru4m-footer__bottom {
  background: rgba(0, 0, 0, 0.2);
  text-align: center;
  padding: 0.7rem 0;
  font-size: 0.72rem;
  color: var(--md-footer-fg-color--lighter);
  letter-spacing: 0.02em;
}

/* ── Accessibility: Reduced Motion ── */
@media (prefers-reduced-motion: reduce) {
  .hero::before,
  .hero::after {
    animation: none;
  }
  .hero-overline,
  .hero-heading,
  .hero-subtitle,
  .hero-buttons,
  .feature-card {
    animation: none;
    opacity: 1;
  }
  .quick-start-step .step-num::after {
    animation: none;
  }
  .feature-card:hover {
    transform: none;
  }
  .hero-buttons .md-button--primary:hover,
  .hero-buttons .md-button:not(.md-button--primary):hover {
    transform: none;
  }
}