/* Google Docs-inspired Clean & Professional Styling */

/* Clean white background with subtle grays - Authentic Google Docs palette */
:root {
  --md-default-bg-color: #ffffff;
  --md-default-fg-color: #202124;
  --md-primary-fg-color: #1a73e8;
  --md-accent-fg-color: #1a73e8;
  --md-code-bg-color: #f8f9fa;
  --md-code-fg-color: #c5221f;
}

/* Typography - Google Docs style */
.md-typeset {
  font-weight: 400;
  line-height: 1.6;
  letter-spacing: 0;
  color: #202124;
  max-width: 900px;
  font-size: 14px;
}

.md-typeset h1 {
  font-weight: 400;
  letter-spacing: 0;
  margin-bottom: 1.5rem;
  margin-top: 0;
  color: #202124;
  font-size: 2.25em;
  line-height: 1.3;
  border-bottom: none;
  padding-bottom: 0;
}

.md-typeset h2 {
  font-weight: 400;
  letter-spacing: 0;
  margin-top: 2rem;
  margin-bottom: 1rem;
  padding-bottom: 0.5rem;
  border-bottom: 1px solid #e8eaed;
  color: #202124;
  font-size: 1.5em;
  line-height: 1.4;
}

.md-typeset h3 {
  font-weight: 500;
  margin-top: 1.5rem;
  margin-bottom: 0.75rem;
  color: #202124;
  font-size: 1.25em;
  line-height: 1.4;
}

.md-typeset h4 {
  font-weight: 500;
  margin-top: 1.25rem;
  margin-bottom: 0.5rem;
  color: #5f6368;
  font-size: 1.1em;
}

/* Code blocks - clean and minimal - Google Docs style */
.md-typeset code {
  background-color: #f1f3f4;
  border-radius: 3px;
  padding: 0.2em 0.4em;
  font-size: 0.9em;
  border: none;
  font-weight: 400;
  color: #c5221f;
  font-family: 'Roboto Mono', monospace;
  box-shadow: none;
}

.md-typeset code:not(pre code) {
  background-color: #f1f3f4;
  color: #c5221f;
  padding: 0.15em 0.35em;
}

.md-typeset pre {
  background-color: #f8f9fa;
  border-radius: 4px;
  border: 1px solid #e8eaed;
  box-shadow: none;
  margin: 1.5em 0;
  padding: 1em;
}

.md-typeset pre code {
  background-color: transparent;
  border-radius: 0;
  padding: 0;
  font-size: 0.875em;
  line-height: 1.6;
  border: none;
  box-shadow: none;
  display: block;
  overflow-x: auto;
  color: #202124;
}

/* Tables - Google Docs style */
.md-typeset table:not([class]) {
  border-radius: 0;
  overflow: visible;
  box-shadow: none;
  border: 1px solid #e8eaed;
  margin: 1.5em 0;
  border-collapse: collapse;
}

.md-typeset table:not([class]) th {
  background-color: #f8f9fa;
  color: #202124;
  font-weight: 500;
  padding: 0.75em 1em;
  text-transform: none;
  letter-spacing: 0;
  font-size: 0.9em;
  border-bottom: 1px solid #e8eaed;
  border-right: 1px solid #e8eaed;
}

.md-typeset table:not([class]) th:last-child {
  border-right: none;
}

.md-typeset table:not([class]) td {
  padding: 0.75em 1em;
  border-bottom: 1px solid #e8eaed;
  border-right: 1px solid #e8eaed;
  transition: background-color 0.15s ease;
}

.md-typeset table:not([class]) td:last-child {
  border-right: none;
}

.md-typeset table:not([class]) tr:last-child td {
  border-bottom: 1px solid #e8eaed;
}

.md-typeset table:not([class]) tr:hover td {
  background-color: #f8f9fa;
}

/* Links - Authentic Google Docs blue */
.md-typeset a {
  color: #1a73e8;
  text-decoration: none;
  transition: color 0.2s ease;
  border-bottom: none;
  font-weight: 400;
}

.md-typeset a:hover {
  color: #1557b0;
  text-decoration: underline;
}

.md-typeset a:visited {
  color: #9334e6;
}

.md-typeset a:visited:hover {
  color: #7b2cbf;
}

/* Navigation - clean and minimal */
.md-nav__title {
  font-weight: 500;
  letter-spacing: 0;
  font-size: 0.875em;
  text-transform: none;
  color: #5f6368;
}

.md-nav__link {
  transition: background-color 0.15s ease;
  border-radius: 0;
  margin: 0;
  padding: 0.5em 1em;
  font-weight: 400;
  color: #202124;
}

.md-nav__link:hover {
  background-color: #f1f3f4;
}

.md-nav__link--active {
  background-color: #e8f0fe;
  color: #1a73e8;
  font-weight: 500;
  border-left: 3px solid #1a73e8;
  padding-left: calc(1em - 3px);
}

/* Admonitions - subtle and clean */
.md-typeset .admonition {
  border-radius: 4px;
  border-left: 4px solid;
  box-shadow: none;
  margin: 1.5em 0;
  border-top: none;
  border-right: none;
  border-bottom: none;
  background-color: #f8f9fa;
}

.md-typeset .admonition-title {
  font-weight: 500;
  padding: 0.75em 1em;
  border-radius: 0;
  margin: 0;
  background-color: transparent;
}

.md-typeset .admonition > .admonition-title + * {
  margin-top: 0;
}

/* Search - clean input */
.md-search__form {
  border-radius: 24px;
  background-color: #f1f3f4;
  transition: all 0.2s ease;
  border: 1px solid transparent;
}

.md-search__form:hover {
  background-color: #e8eaed;
  border-color: transparent;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
}

.md-search__form:focus-within {
  background-color: #ffffff;
  border-color: #1a73e8;
  box-shadow: 0 1px 3px rgba(26, 115, 232, 0.2);
}

/* Search input field */
.md-search__input {
  color: #202124;
}

.md-search__input::placeholder {
  color: #5f6368;
  opacity: 1;
}

/* Search button in header - ensure visibility */
.md-header__button[for="__search"] {
  color: #5f6368;
}

.md-header__button[for="__search"]:hover {
  color: #202124;
  background-color: #f1f3f4;
}

.md-header__button[for="__search"] svg {
  fill: currentColor;
}

/* Header - clean white */
.md-header {
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.1);
  backdrop-filter: none;
  background-color: #ffffff;
  border-bottom: 1px solid #e8eaed;
}

.md-header__title {
  font-weight: 400;
  letter-spacing: 0;
  color: #202124;
}

/* Header buttons - ensure visibility in light mode */
.md-header__button {
  color: #5f6368;
  transition: color 0.2s ease, background-color 0.2s ease;
}

.md-header__button:hover {
  color: #202124;
  background-color: #f1f3f4;
}

.md-header__button:focus {
  color: #1a73e8;
  outline: 2px solid #1a73e8;
  outline-offset: 2px;
  border-radius: 2px;
}

/* Theme toggle button - ensure it's always visible */
.md-header__button.md-icon svg {
  fill: currentColor;
}

/* GitHub repository icon - ensure visibility in light mode */
.md-header__source {
  color: #5f6368;
}

.md-source {
  color: #5f6368;
  transition: color 0.2s ease, background-color 0.2s ease;
}

.md-source:hover {
  color: #202124;
  background-color: #f1f3f4;
}

.md-source__icon {
  color: #5f6368;
}

.md-source__icon svg {
  fill: currentColor;
}

.md-source__repository {
  color: #5f6368;
}

/* Blockquotes - minimal */
.md-typeset blockquote {
  border-left: 3px solid #dadce0;
  border-radius: 0;
  background-color: transparent;
  padding: 0 1em;
  margin: 1.5em 0;
  box-shadow: none;
  font-style: normal;
  color: #5f6368;
}

.md-typeset blockquote::before {
  display: none;
}

/* Subtle transitions */
* {
  transition: background-color 0.15s ease, color 0.15s ease, border-color 0.15s ease;
}

/* Code highlighting */
.highlight {
  border-radius: 4px;
  overflow: hidden;
  margin: 1.5em 0;
}

/* Content spacing */
.md-content {
  padding-bottom: 3rem;
  background-color: #ffffff;
}

.md-content__inner {
  margin: 2rem 0;
}

/* Tabs styling */
.md-typeset .tabbed-set {
  border-radius: 4px;
  overflow: hidden;
  border: 1px solid #e8eaed;
}

.md-typeset .tabbed-content {
  padding: 1.5em;
  background-color: #ffffff;
  border-radius: 0;
}

/* Responsive design */
@media screen and (min-width: 76.25em) {
  .md-main__inner {
    max-width: 1200px;
  }
  
  .md-content {
    max-width: 900px;
  }
}

/* Dark mode - Google Docs dark theme inspired */
[data-md-color-scheme="slate"] {
  --md-default-bg-color: #202124;
  --md-default-fg-color: #e8eaed;
  --md-primary-fg-color: #8ab4f8;
  --md-accent-fg-color: #8ab4f8;
  --md-code-bg-color: #303134;
  --md-code-fg-color: #f28b82;
}

/* Dark mode content area - fix white background issue */
[data-md-color-scheme="slate"] body {
  background-color: #202124;
}

[data-md-color-scheme="slate"] .md-content {
  background-color: #202124 !important;
}

[data-md-color-scheme="slate"] .md-main {
  background-color: #202124;
}

[data-md-color-scheme="slate"] .md-main__inner {
  background-color: #202124;
}

[data-md-color-scheme="slate"] .md-content__inner {
  background-color: #202124;
}

[data-md-color-scheme="slate"] .md-typeset {
  color: #e8eaed;
}

[data-md-color-scheme="slate"] .md-typeset h1,
[data-md-color-scheme="slate"] .md-typeset h2,
[data-md-color-scheme="slate"] .md-typeset h3 {
  color: #e8eaed;
}

[data-md-color-scheme="slate"] .md-typeset h2 {
  border-bottom-color: #5f6368;
}

[data-md-color-scheme="slate"] .md-typeset h4 {
  color: #bdc1c6;
}

[data-md-color-scheme="slate"] .md-typeset code {
  background-color: #303134;
  color: #f28b82;
}

[data-md-color-scheme="slate"] .md-typeset pre {
  background-color: #303134;
  border-color: #5f6368;
}

[data-md-color-scheme="slate"] .md-typeset pre code {
  color: #e8eaed;
}

[data-md-color-scheme="slate"] .md-typeset table:not([class]) {
  border-color: #5f6368;
}

[data-md-color-scheme="slate"] .md-typeset table:not([class]) th {
  background-color: #303134;
  color: #e8eaed;
  border-color: #5f6368;
}

[data-md-color-scheme="slate"] .md-typeset table:not([class]) td {
  border-color: #5f6368;
}

[data-md-color-scheme="slate"] .md-typeset table:not([class]) tr:hover td {
  background-color: #303134;
}

[data-md-color-scheme="slate"] .md-nav__link {
  color: #e8eaed;
}

[data-md-color-scheme="slate"] .md-nav__link:hover {
  background-color: #303134;
}

[data-md-color-scheme="slate"] .md-nav__link--active {
  background-color: #1e3a5f;
  color: #8ab4f8;
}

[data-md-color-scheme="slate"] .md-typeset .admonition {
  background-color: #303134;
  border-color: #5f6368;
}

[data-md-color-scheme="slate"] .md-typeset blockquote {
  border-left-color: #5f6368;
  color: #bdc1c6;
}

/* Dark mode - ensure all text elements are visible */
[data-md-color-scheme="slate"] .md-typeset p {
  color: #e8eaed;
}

[data-md-color-scheme="slate"] .md-typeset li {
  color: #e8eaed;
}

[data-md-color-scheme="slate"] .md-typeset ul,
[data-md-color-scheme="slate"] .md-typeset ol {
  color: #e8eaed;
}

/* Dark mode - fix "On this page" sidebar */
[data-md-color-scheme="slate"] .md-sidebar--secondary {
  background-color: #202124;
}

[data-md-color-scheme="slate"] .md-nav--secondary .md-nav__title {
  color: #bdc1c6;
}

[data-md-color-scheme="slate"] .md-nav--secondary .md-nav__link {
  color: #bdc1c6;
}

[data-md-color-scheme="slate"] .md-nav--secondary .md-nav__link:hover {
  color: #e8eaed;
  background-color: #303134;
}

[data-md-color-scheme="slate"] .md-search__form {
  background-color: #303134;
}

[data-md-color-scheme="slate"] .md-search__form:hover {
  background-color: #3c4043;
}

/* Search input in dark mode */
[data-md-color-scheme="slate"] .md-search__input {
  color: #e8eaed;
}

[data-md-color-scheme="slate"] .md-search__input::placeholder {
  color: #bdc1c6;
}

/* Search button in dark mode */
[data-md-color-scheme="slate"] .md-header__button[for="__search"] {
  color: #bdc1c6;
}

[data-md-color-scheme="slate"] .md-header__button[for="__search"]:hover {
  color: #e8eaed;
  background-color: #303134;
}

[data-md-color-scheme="slate"] .md-header {
  background-color: #202124;
  border-bottom-color: #5f6368;
}

[data-md-color-scheme="slate"] .md-header__title {
  color: #e8eaed;
}

/* Header buttons in dark mode */
[data-md-color-scheme="slate"] .md-header__button {
  color: #bdc1c6;
}

[data-md-color-scheme="slate"] .md-header__button:hover {
  color: #e8eaed;
  background-color: #303134;
}

[data-md-color-scheme="slate"] .md-header__button:focus {
  color: #8ab4f8;
  outline-color: #8ab4f8;
}

/* GitHub repository icon in dark mode */
[data-md-color-scheme="slate"] .md-header__source {
  color: #bdc1c6;
}

[data-md-color-scheme="slate"] .md-source {
  color: #bdc1c6;
}

[data-md-color-scheme="slate"] .md-source:hover {
  color: #e8eaed;
  background-color: #303134;
}

[data-md-color-scheme="slate"] .md-source__icon {
  color: #bdc1c6;
}

[data-md-color-scheme="slate"] .md-source__repository {
  color: #bdc1c6;
}

[data-md-color-scheme="slate"] .md-typeset a {
  color: #8ab4f8;
}

[data-md-color-scheme="slate"] .md-typeset a:hover {
  color: #aecbfa;
}

/* Focus states for accessibility - Google Docs style */
.md-typeset a:focus,
.md-nav__link:focus {
  outline: 2px solid #1a73e8;
  outline-offset: 2px;
  border-radius: 2px;
}

[data-md-color-scheme="slate"] .md-typeset a:focus,
[data-md-color-scheme="slate"] .md-nav__link:focus {
  outline-color: #8ab4f8;
}

/* Print styles */
@media print {
  .md-typeset {
    max-width: 100%;
  }
  
  .md-typeset h1 {
    page-break-after: avoid;
  }
  
  .md-typeset h2,
  .md-typeset h3 {
    page-break-after: avoid;
  }
}

/* Task lists */
.md-typeset .task-list-item {
  list-style-type: none;
}

.md-typeset .task-list-item input[type="checkbox"] {
  margin-right: 0.5em;
}

/* Footnotes */
.md-typeset .footnote {
  font-size: 0.875em;
  color: #5f6368;
}

[data-md-color-scheme="slate"] .md-typeset .footnote {
  color: #bdc1c6;
}
