﻿:root > * {
  --md-primary-fg-color: #9169D1;
  --md-primary-fg-color--light: #a887db;
  --md-primary-fg-color--dark: #7a4eb3;

  /* FIX 1: Accent color alinhado ao roxo do projeto */
  --md-accent-fg-color: #7a4eb3;
  --md-accent-fg-color--transparent: rgba(122, 78, 179, 0.1);
}

/* --- LOGO --- */
.md-header__button.md-logo img {
  height: 3.2rem;
  width: auto;
}

.md-nav__button.md-logo img {
  height: 3rem;
  margin-bottom: 10px;
}

/* --- HEADER & BUSCA --- */
.md-header__inner {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
}

.md-search {
    flex: 1;
    display: flex;
    justify-content: center;
}

.md-search__inner {
    width: 30rem;
    margin: 0 auto;
}

.md-search__form {
    background-color: rgba(0, 0, 0, 0.1) !important;
    border-radius: 20px !important;
    border: 1px solid rgba(145, 105, 209, 0.3);
    transition: none !important;
}

.md-search__input:focus + .md-search__form {
    background-color: #ffffff !important;
    width: 100% !important;
    box-shadow: 0 4px 12px rgba(145, 105, 209, 0.25);
    border-color: #9169D1;
}

.md-header__title, .md-header__source {
    flex: 0 0 12rem;
}

/* --- TEMA (SUNNY) --- */
.md-header__option {
    order: 1;
    margin-left: auto;
}

.md-header__source {
    order: 2;
}

.md-header__button.md-icon[for="__palette"] {
    color: white;
}

.md-header__button.md-icon[for="__palette"] svg {
    width: 1.25rem;
    height: 1.25rem;
    transform: scale(1.1);
}

.md-header__button.md-icon[for="__palette"]:hover {
    color: #ffcc00;
    filter: drop-shadow(0 0 5px rgba(255, 204, 0, 0.4));
}

/* --- TABELAS --- */
.md-typeset table:not([class]) {
    border-radius: 0.4rem;
    overflow: hidden;
    border: 1px solid rgba(145, 105, 209, 0.1);
}

.md-typeset table:not([class]) th {
    background-color: #9169D1;
    color: white;
}

.md-typeset table:not([class]) tr:nth-child(2n) {
    background-color: rgba(145, 105, 209, 0.05);
}

.md-typeset table:not([class]) tr:hover {
    background-color: rgba(145, 105, 209, 0.15);
}

/* Esconde o código bruto das extensões (os seletores qué aparecem na imagem) */
.md-typeset .grid.cards > ul > li > p:first-child {
    display: none;
}

/* Garante qué a lista não tenha marcadores (bolinhas) */
.md-typeset .grid.cards > ul {
    list-style: none !important;
}

/* Ajuste dos ícones dentro dos cards */
.md-typeset .grid.cards li .twemoji, 
.md-typeset .grid.cards li .ot-icon {
    display: block;
    margin-bottom: 0.5rem;
    color: #9169D1;
}

/* Remové a linha horizontal padrão se ela estiver quebrando o layout */
.md-typeset .grid.cards li hr {
    margin: 0.5rem 0;
    border-bottom: 1px solid rgba(145, 105, 209, 0.1);
}

/* Diagramas Mermaid: compacto no conteúdo, ampliavel em tela cheia. */
.md-typeset .diagram-frame {
    width: 100%;
    margin: 1.2rem 0;
    border: 1px solid rgba(145, 105, 209, 0.22);
    border-radius: 0.4rem;
    background: var(--md-default-bg-color);
    overflow: hidden;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.04);
}

.md-typeset .diagram-toolbar {
    display: flex;
    justify-content: flex-end;
    gap: 0.5rem;
    padding: 0.45rem 0.6rem;
    border-bottom: 1px solid rgba(145, 105, 209, 0.16);
    background: rgba(145, 105, 209, 0.06);
}

.md-typeset .diagram-fullscreen-button,
.diagram-modal-close {
    appearance: none;
    border: 1px solid rgba(145, 105, 209, 0.45);
    border-radius: 0.35rem;
    background: #9169D1;
    color: #ffffff;
    font: inherit;
    font-size: 0.72rem;
    font-weight: 700;
    line-height: 1;
    padding: 0.48rem 0.7rem;
    cursor: pointer;
}

.md-typeset .diagram-fullscreen-button:hover,
.diagram-modal-close:hover {
    background: #7a4eb3;
}

.md-typeset .diagram-canvas {
    max-width: 100%;
    overflow: auto;
    padding: 0.8rem;
}

.md-typeset .diagram-canvas .mermaid {
    width: max-content;
    min-width: 100%;
    max-width: none;
    text-align: center;
}

.md-typeset .diagram-canvas .mermaid svg {
    max-width: 100% !important;
    height: auto !important;
}

.diagram-modal-open {
    overflow: hidden;
}

.diagram-modal {
    position: fixed;
    inset: 0;
    z-index: 9999;
    display: flex;
    flex-direction: column;
    background: var(--md-default-bg-color);
}

.diagram-modal-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
    padding: 0.8rem 1rem;
    border-bottom: 1px solid rgba(145, 105, 209, 0.2);
    background: #9169D1;
    color: #ffffff;
}

.diagram-modal-title {
    font-weight: 700;
}

.diagram-modal-body {
    flex: 1;
    overflow: auto;
    padding: 1.5rem;
}

.diagram-modal-content {
    min-width: 1800px;
    text-align: center;
}

.diagram-modal-content svg {
    max-width: none !important;
    width: 1800px !important;
    height: auto !important;
}

.diagram-modal-content .er.entityBox,
.diagram-modal-content .er.attributeBoxOdd,
.diagram-modal-content .er.attributeBoxEven {
    stroke-width: 1.3px;
}

/* FAQ em formato accordion. */
.md-typeset details {
    border: 0;
    border-bottom: 1px solid rgba(0, 0, 0, 0.12);
    border-radius: 0;
    box-shadow: none;
    margin: 0;
    padding: 0;
    background: transparent;
}

.md-typeset details > summary {
    display: flex;
    align-items: center;
    justify-content: space-between;
    min-height: 3.2rem;
    padding: 0.85rem 0;
    font-weight: 700;
    cursor: pointer;
}

.md-typeset details > summary::after {
    content: "⌄";
    flex: 0 0 auto;
    margin-left: 1rem;
    color: var(--md-default-fg-color);
    font-size: 1.15rem;
    transition: transform 0.16s ease;
}

.md-typeset details[open] > summary::after {
    transform: rotate(180deg);
}

.md-typeset details > summary::marker,
.md-typeset details > summary::-webkit-details-marker {
    display: none;
}

.md-typeset details > p,
.md-typeset details > ul,
.md-typeset details > ol {
    margin: 0 0 1rem;
    padding-right: 2rem;
}

/* Overrides finais do FAQ para remover o estilo padrão do Material. */
.md-typeset details,
.md-typeset details[open] {
    border: 0 !important;
    border-bottom: 1px solid rgba(0, 0, 0, 0.12) !important;
    border-radius: 0 !important;
    box-shadow: none !important;
    background: transparent !important;
    outline: 0 !important;
    padding: 0 !important;
}

.md-typeset details > summary,
.md-typeset details[open] > summary {
    display: flex !important;
    align-items: center !important;
    justify-content: space-between !important;
    min-height: 3.2rem !important;
    padding: 0.85rem 0 !important;
    background: transparent !important;
    border: 0 !important;
    outline: 0 !important;
    box-shadow: none !important;
    font-weight: 700 !important;
}

.md-typeset details > summary:focus,
.md-typeset details > summary:focus-visible {
    background: transparent !important;
    outline: 0 !important;
    box-shadow: none !important;
}

.md-typeset details > summary::before,
.md-typeset details[open] > summary::before {
    display: none !important;
    content: none !important;
}

.md-typeset details > summary::after {
    content: "v" !important;
    position: static !important;
    flex: 0 0 auto !important;
    margin-left: 1rem !important;
    color: var(--md-default-fg-color) !important;
    font-size: 0.9rem !important;
    font-weight: 700 !important;
    transform: none !important;
}

.md-typeset details[open] > summary::after {
    transform: rotate(180deg) !important;
}
