/* Mermaid Modal Styles */
.mermaid-modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    background: rgba(2, 12, 27, 0.98); /* Void Black */
    z-index: 9999;
    display: flex;
    justify-content: center;
    align-items: center;
    opacity: 0;
    transition: opacity 0.3s ease;
    pointer-events: none;
}

.mermaid-modal-overlay.active {
    opacity: 1;
    pointer-events: auto;
}

.mermaid-modal-content {
    width: 95%;
    height: 95%;
    display: flex;
    justify-content: center;
    align-items: center;
    overflow: hidden;
    position: relative;
}

.mermaid-modal-close {
    position: absolute;
    top: 20px;
    right: 20px;
    width: 40px;
    height: 40px;
    background: #bd34fe; /* Cortex Purple */
    border-radius: 50%;
    display: flex;
    justify-content: center;
    align-items: center;
    cursor: pointer;
    box-shadow: 0 0 10px rgba(189, 52, 254, 0.4);
    z-index: 10000;
    font-size: 24px;
    color: #020c1b;
    transition: background 0.2s;
}

.mermaid-modal-close:hover {
    background: #64ffda; /* Synapse Cyan */
}

/* Hover effect for diagrams on page */
.mermaid {
    cursor: zoom-in;
    transition: transform 0.2s ease;
    border: 1px solid transparent;
    border-radius: 8px;
    padding: 10px;
    position: relative;
}

.mermaid:hover {
    background-color: rgba(100, 255, 218, 0.05); /* Cyan tint */
    border-color: rgba(100, 255, 218, 0.2);
}

/* Click to expand instruction */
.mermaid-interactive::after {
    content: "Click to expand";
    position: absolute;
    bottom: 10px;
    right: 10px;
    background: rgba(189, 52, 254, 0.9); /* Cortex Purple */
    color: white;
    padding: 5px 10px;
    border-radius: 4px;
    font-size: 12px;
    opacity: 0;
    transition: opacity 0.3s ease;
    pointer-events: none;
    z-index: 10;
}

.mermaid-interactive:hover::after {
    opacity: 1;
}

/* Ensure modal SVG takes full space but preserves aspect ratio */
.mermaid-modal-content svg {
    max-width: none !important;
    max-height: none !important;
    height: 100%;
    width: 100%;
    display: block;
}

/* --- FintraOS Brand Overrides --- */

:root {
  /* Brand Colors */
  --color-void: #020c1b;
  --color-cyan: #64ffda;
  --color-purple: #bd34fe;
  --color-amber: #ffbd2e;
  --color-foreground: #e2e8f0;

  /* Fonts */
  --font-display: 'Space Grotesk', sans-serif;
  --font-sans: 'Inter', sans-serif;
  --font-mono: 'JetBrains Mono', monospace;
}

/* Material Theme Overrides for Void Theme */
[data-md-color-scheme="slate"] {
  --md-primary-fg-color:        #020c1b;
  --md-primary-fg-color--light: #020c1b;
  --md-primary-fg-color--dark:  #000000;
  --md-accent-fg-color:         #64ffda;
  
  /* Background Overrides */
  --md-default-bg-color:        #020c1b;
  --md-default-fg-color:        #e2e8f0;
  --md-default-fg-color--light: #94a3b8;
  --md-default-fg-color--lighter: #64748b;
  
  /* Paper / Card backgrounds */
  --md-paper-bg-color:          rgba(2, 12, 27, 0.7); 
  --md-bg-color:                #020c1b;

  /* Code blocks - Make them darker/transparent to avoid grey box look */
  --md-code-bg-color: rgba(0, 0, 0, 0.5);
  --md-code-fg-color: #64ffda;
}

/* Force Background Colors on main elements & Add Grid Texture */
html, body {
    background-color: var(--color-void) !important;
    background-image: 
        linear-gradient(rgba(255, 255, 255, 0.03) 1px, transparent 1px),
        linear-gradient(90deg, rgba(255, 255, 255, 0.03) 1px, transparent 1px);
    background-size: 40px 40px;
    background-attachment: fixed;
}

/* Add atmospheric glows */
body::before {
    content: "";
    position: fixed;
    top: -20vh;
    left: -20vw;
    width: 60vw;
    height: 60vh;
    background: radial-gradient(circle, rgba(100, 255, 218, 0.08) 0%, transparent 70%);
    pointer-events: none;
    z-index: 0;
}

body::after {
    content: "";
    position: fixed;
    bottom: -20vh;
    right: -20vw;
    width: 60vw;
    height: 60vh;
    background: radial-gradient(circle, rgba(189, 52, 254, 0.08) 0%, transparent 70%);
    pointer-events: none;
    z-index: 0;
}

.md-main, .md-content {
    background-color: transparent !important; /* Let body texture show through */
}

/* Import Google Fonts */
@import url('https://fonts.googleapis.com/css2?family=Inter:wght@400;500;700&family=JetBrains+Mono:wght@400;500&family=Space+Grotesk:wght@500;700&display=swap');

/* Apply Fonts */
body {
    font-family: var(--font-sans);
}

h1, h2, h3, .md-header__title {
    font-family: var(--font-display) !important;
    letter-spacing: -0.02em;
}

pre, code, .md-code {
    font-family: var(--font-mono) !important;
}

/* Header Styling - Glassmorphism */
.md-header {
  background-color: rgba(2, 12, 27, 0.85) !important;
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border-bottom: 1px solid rgba(255, 255, 255, 0.05);
}

.md-tabs {
  background-color: rgba(2, 12, 27, 0.85) !important;
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border-bottom: 1px solid rgba(255, 255, 255, 0.05);
}

/* Gradient Headers */
h1 {
  background: linear-gradient(to right, #e2e8f0, #64ffda);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  display: inline-block;
}

/* Text Logo Styling */
.md-header__button.md-logo img,
.md-header__button.md-logo svg {
    display: none; /* Hide image and default svg logo */
}

.md-header__button.md-logo {
    display: flex;
    align-items: center;
    font-family: var(--font-display);
    font-weight: 700;
    font-size: 1.2rem;
    letter-spacing: -0.03em;
    text-decoration: none;
}

.md-header__button.md-logo::before {
    content: "Fintra";
    color: var(--color-foreground);
}

.md-header__button.md-logo::after {
    content: "OS";
    color: var(--color-cyan);
}

/* Hide the site title text since we have the text logo */
.md-header__title .md-header__topic:first-child {
    display: none;
}

/* Search Input */
.md-search__input {
    background-color: rgba(255, 255, 255, 0.05) !important;
    border: 1px solid rgba(255, 255, 255, 0.1) !important;
    color: var(--color-foreground) !important;
}

/* Navigation Links */
.md-nav__link--active {
    color: var(--color-cyan) !important;
    font-weight: 700;
}

/* Content Links */
.md-content a {
    color: var(--color-cyan);
    text-decoration: none;
    border-bottom: 1px solid transparent;
    transition: border-color 0.2s;
}

.md-content a:hover {
    color: var(--color-cyan);
    border-bottom-color: var(--color-cyan);
}

/* Admonitions / Callouts - Bioluminescent Glass */
.md-typeset .admonition, 
.md-typeset details {
    background-color: rgba(2, 12, 27, 0.6) !important;
    backdrop-filter: blur(5px);
    -webkit-backdrop-filter: blur(5px);
    border: 1px solid rgba(255, 255, 255, 0.08) !important;
    box-shadow: 0 4px 30px rgba(0, 0, 0, 0.1);
}

.md-typeset .admonition.note,
.md-typeset details.note {
    border-left-color: var(--color-cyan) !important;
}

.md-typeset .admonition.warning,
.md-typeset details.warning {
    border-left-color: var(--color-amber) !important;
}

.md-typeset .admonition.info,
.md-typeset details.info {
    border-left-color: var(--color-purple) !important;
}

/* Table Styling */
.md-typeset table:not([class]) {
    background-color: rgba(0, 0, 0, 0.2);
    border-radius: 8px;
    border: 1px solid rgba(255, 255, 255, 0.05);
}

.md-typeset table:not([class]) th {
    color: var(--color-foreground);
    background-color: rgba(255, 255, 255, 0.02);
}


