/* --- VARIAVEIS GLOBAIS E TEMA --- */
:root {
    /* Cores Primitivas */
    --primary-color: #005fcc;
    --primary-hover: #004a9e;
    --text-on-primary: #ffffff;
    --selection-color: rgba(0, 95, 204, 0.25);

    /* Tema Light (Padrão) */
    --bg-color: #f0f2f5;
    --text-color: #1f1f1f;
    --editor-bg-color: #ffffff;
    --toolbar-bg-color: #f7f7f7;
    --border-color: #cccccc;
    --scrollbar-thumb-color: #a0a0a0;
    --scrollbar-thumb-hover-color: #808080;
    --menubar-hover-bg: rgba(0, 0, 0, 0.1);
    --tab-bg: #ececec;
    --tab-text-color: #555555;
    --tab-border-color: #cccccc;
    --tab-active-text-color: #1f1f1f;
    --tab-close-hover-bg: rgba(0, 0, 0, 0.1);
    --modal-bg: #ffffff;
    --sidebar-bg: #f0f2f5;
    --file-tree-hover-bg: rgba(0, 0, 0, 0.05);
    --welcome-hover-bg: rgba(0, 0, 0, 0.05);
    --search-input-bg: #ffffff;
    --search-mark-bg: #ffda0a;
    --search-mark-color: #000;
}

body[data-theme-base="dark"] {
    --bg-color: #2d2d2d;
    --text-color: #e8e8e8;
    --editor-bg-color: #1e1e1e;
    --toolbar-bg-color: #333333;
    --border-color: #4f4f4f;
    --scrollbar-thumb-color: #555555;
    --scrollbar-thumb-hover-color: #777777;
    --menubar-hover-bg: rgba(255, 255, 255, 0.1);
    --tab-bg: #2d2d2d;
    --tab-text-color: #b0b0b0;
    --tab-border-color: #404040;
    --tab-active-text-color: #e8e8e8;
    --tab-close-hover-bg: rgba(255, 255, 255, 0.2);
    --modal-bg: #1e1e1e;
    --sidebar-bg: #252526;
    --file-tree-hover-bg: rgba(255, 255, 255, 0.05);
    --welcome-hover-bg: rgba(255, 255, 255, 0.08);
    --search-input-bg: #3c3c3c;
    --search-mark-bg: #f6a624;
    --search-mark-color: #000;
}

@media (prefers-color-scheme: dark) {
    body:not([data-theme-base="light"]) {
        /* Aplica o tema dark se for a preferência do sistema E nenhum tema explícito for definido */
        --bg-color: #2d2d2d;
        --text-color: #e8e8e8;
        --editor-bg-color: #1e1e1e;
        --toolbar-bg-color: #333333;
        --border-color: #4f4f4f;
        --scrollbar-thumb-color: #555555;
        --scrollbar-thumb-hover-color: #777777;
        --menubar-hover-bg: rgba(255, 255, 255, 0.1);
        --tab-bg: #2d2d2d;
        --tab-text-color: #b0b0b0;
        --tab-border-color: #404040;
        --tab-active-text-color: #e8e8e8;
        --tab-close-hover-bg: rgba(255, 255, 255, 0.2);
        --modal-bg: #1e1e1e;
        --sidebar-bg: #252526;
        --file-tree-hover-bg: rgba(255, 255, 255, 0.05);
        --welcome-hover-bg: rgba(255, 255, 255, 0.08);
        --search-input-bg: #3c3c3c;
        --search-mark-bg: #f6a624;
        --search-mark-color: #000;
    }
}


/* --- ESTILOS BASE E LOADING --- */
body {
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
    background-color: var(--bg-color);
    color: var(--text-color);
    margin: 0;
    display: flex;
    flex-direction: column;
    height: 100vh;
    overflow: hidden;
}

#loading-screen {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: #1e1e1e;
    z-index: 9999;
    display: flex;
    justify-content: center;
    align-items: center;
    transition: opacity 0.5s ease-out;
    opacity: 1;
}

#loading-screen--hidden {
    opacity: 0;
    pointer-events: none;
}

.spinner {
    border: 6px solid rgba(255, 255, 255, 0.2);
    border-top: 6px solid var(--primary-color, #005fcc);
    border-radius: 50%;
    width: 50px;
    height: 50px;
    animation: spin 1s linear infinite;
}

@keyframes spin {
    0% {
        transform: rotate(0deg);
    }

    100% {
        transform: rotate(360deg);
    }
}

/* --- UTILITARIOS --- */
.custom-scrollbar {
    scrollbar-width: thin;
    scrollbar-color: var(--scrollbar-thumb-color) transparent;
}

.custom-scrollbar::-webkit-scrollbar {
    height: 4px;
    width: 4px;
}

.custom-scrollbar::-webkit-scrollbar-track {
    background: transparent;
}

.custom-scrollbar::-webkit-scrollbar-thumb {
    background-color: var(--scrollbar-thumb-color);
    border-radius: 2px;
}

.custom-scrollbar::-webkit-scrollbar-thumb:hover {
    background-color: var(--scrollbar-thumb-hover-color);
}

.btn:focus-visible,
.menubar__button:focus-visible,
.tab-bar__tab:focus-visible,
.file-tree__item:focus-visible,
.icon-btn:focus-visible,
.welcome-screen__button:focus-visible,
.context-menu__item:focus-visible,
.dropdown-menu__item:focus-visible,
.nav-select:focus-visible {
    outline: 2px solid var(--primary-color);
    outline-offset: 2px;
    box-shadow: none;
}

.hidden-input {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    border: 0;
}

.text-right {
    text-align: right;
}

/* --- LAYOUT PRINCIPAL --- */
.editor-layout {
    flex-grow: 1;
    display: flex;
    flex-direction: column;
    background-color: var(--editor-bg-color);
    overflow: hidden;
    position: relative;
}

.editor-layout__drag-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 95, 204, 0.2);
    border: 4px dashed var(--primary-color);
    z-index: 999;
    display: none;
    justify-content: center;
    align-items: center;
    font-size: 24px;
    font-weight: bold;
    color: var(--primary-color);
    pointer-events: none;
}

.editor-layout--drag-active .editor-layout__drag-overlay {
    display: flex;
}

.editor-layout__workspace {
    display: flex;
    flex-grow: 1;
    overflow: hidden;
    position: relative;
}

.editor-layout__main {
    flex-grow: 1;
    display: flex;
    flex-direction: column;
    overflow: hidden;
    min-width: 0;
}

.editor-layout__area {
    flex-grow: 1;
    position: relative;
    overflow: hidden;
}

/* --- MENUBAR --- */
.menubar {
    background-color: var(--toolbar-bg-color);
    border-bottom: 1px solid var(--border-color);
    padding: 5px 15px;
    display: flex;
    align-items: center;
    gap: 5px;
    height: 30px;
}

.menubar__group {
    position: relative;
}

.menubar__button {
    background: none;
    border: none;
    padding: 6px 10px;
    cursor: pointer;
    font-size: 13px;
    color: inherit;
    border-radius: 4px;
}

.menubar__button:hover {
    background-color: var(--menubar-hover-bg);
}

.menubar__dropdown {
    display: none;
    position: absolute;
    background-color: var(--editor-bg-color);
    min-width: 220px;
    box-shadow: 0 8px 16px rgba(0, 0, 0, 0.2);
    z-index: 20;
    border-radius: 4px;
    border: 1px solid var(--border-color);
    padding: 5px 0;
    top: 100%;
    left: 0;
}

.menubar__dropdown--show {
    display: block;
}

.dropdown-menu__item {
    color: inherit;
    padding: 8px 15px;
    display: flex;
    align-items: center;
    gap: 10px;
    width: 100%;
    text-align: left;
    background: none;
    border: none;
    font-size: 13px;
    cursor: pointer;
}

.dropdown-menu__item:hover {
    background-color: var(--primary-color);
    color: var(--text-on-primary);
}

.dropdown-menu__separator {
    height: 1px;
    background-color: var(--border-color);
    margin: 4px 0;
}

.dropdown-menu__item .material-symbols-outlined,
.menubar__button .material-symbols-outlined {
    font-size: 18px;
    vertical-align: middle;
}

.dropdown-menu__label {
    padding: 5px 15px;
    display: block;
    font-size: 12px;
    font-weight: bold;
}

/* --- BARRA DE ABAS (TAB-BAR) --- */
.tab-bar {
    display: flex;
    background-color: var(--toolbar-bg-color);
    border-bottom: 1px solid var(--border-color);
    padding: 0;
    gap: 1px;
    overflow-x: auto;
}

.tab-bar__tab {
    display: flex;
    align-items: center;
    padding: 8px 15px;
    background-color: var(--tab-bg);
    border: none;
    border-right: 1px solid var(--tab-border-color);
    color: var(--tab-text-color);
    font-size: 13px;
    cursor: pointer;
    min-width: 120px;
    max-width: 200px;
    position: relative;
    user-select: none;
}

.tab-bar__tab--active {
    background-color: var(--editor-bg-color);
    color: var(--tab-active-text-color);
    border-top: 2px solid var(--primary-color);
}

.tab-bar__tab--active .material-symbols-outlined {
    color: inherit !important;
}

.tab-bar__name {
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    margin-right: 8px;
    pointer-events: none;
}

.tab-bar__close {
    font-size: 16px;
    opacity: 0;
    border-radius: 50%;
    padding: 2px;
    margin-left: auto;
}

.tab-bar__tab:hover .tab-bar__close,
.tab-bar__tab--active .tab-bar__close {
    opacity: 1;
}

.tab-bar__close:hover {
    background-color: var(--tab-close-hover-bg);
    color: #cf222e;
}

.tab-bar__dirty-indicator {
    font-size: 20px;
    line-height: 10px;
    color: inherit;
    margin-left: 5px;
    display: none;
    pointer-events: none;
}

.tab-bar__tab--dirty .tab-bar__dirty-indicator {
    display: block;
}

.tab-bar__tab--dirty .tab-bar__close {
    display: none;
}

.tab-bar__tab--dirty:hover .tab-bar__close {
    display: block;
}

.tab-bar__tab--dirty:hover .tab-bar__dirty-indicator {
    display: none;
}

.tab-bar__tab.dragging {
    opacity: 0.5;
    background: #e0e0e0;
}

.tab-bar__tab.drag-over-before {
    border-left: 2px solid var(--primary-color);
}

.tab-bar__tab.drag-over-after {
    border-right: 2px solid var(--primary-color);
}

.tab-bar__add-button {
    background: none;
    border: none;
    color: inherit;
    cursor: pointer;
    padding: 0 10px;
    display: flex;
    align-items: center;
}

.tab-bar__add-button .material-symbols-outlined {
    font-size: 20px;
}

.tab-bar__add-button:hover {
    background-color: rgba(0, 0, 0, 0.05);
}

/* --- ÁREA DO EDITOR E VIEWERS --- */
#monaco-editor-container {
    width: 100%;
    height: 100%;
}

.viewer__info {
    width: 250px;
    flex-shrink: 0;
    border-left: 1px solid var(--border-color);
    padding: 15px;
    overflow-y: auto;
    font-size: 13px;
    box-sizing: border-box;
}

.viewer__info h3 {
    margin-top: 0;
    padding-bottom: 10px;
    border-bottom: 1px solid var(--border-color);
    font-size: 16px;
}

.viewer-metadata {
    list-style: none;
    padding: 0;
    margin: 0;
    word-break: break-all;
}

.viewer-metadata__item {
    display: flex;
    flex-direction: column;
    padding: 8px 0;
    border-bottom: 1px solid rgba(128, 128, 128, 0.1);
}

.viewer-metadata__item:last-child {
    border-bottom: none;
}

.viewer-metadata__key {
    color: inherit;
    opacity: 0.7;
    margin-bottom: 4px;
    font-size: 11px;
    text-transform: uppercase;
}

.viewer-metadata__value {
    color: inherit;
}

#image-viewer-container {
    width: 100%;
    height: 100%;
    display: flex;
    flex-direction: row;
    background-color: var(--bg-color);
    color: var(--text-color);
}

.image-viewer__main {
    flex-grow: 1;
    display: flex;
    justify-content: center;
    align-items: center;
    padding: 20px;
    box-sizing: border-box;
    overflow: auto;
}

#image-viewer-img {
    max-width: 100%;
    max-height: 100%;
    object-fit: contain;
    user-select: none;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.2);
}

#media-viewer-container {
    width: 100%;
    height: 100%;
    display: flex;
    flex-direction: row;
    background-color: var(--bg-color);
    color: var(--text-color);
}

.media-viewer__main {
    flex-grow: 1;
    display: flex;
    justify-content: center;
    align-items: center;
    padding: 20px;
    box-sizing: border-box;
    overflow: auto;
    background-color: #000;
}

#media-viewer-container video,
#media-viewer-container audio {
    max-width: 100%;
    max-height: 100%;
    outline: none;
}

#media-viewer-container audio {
    width: 80%;
    max-width: 600px;
}

/* --- BARRA DE STATUS --- */
.status-bar {
    height: 22px;
    background-color: var(--primary-color);
    color: var(--text-on-primary);
    font-size: 12px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 15px;
}

/* --- MENU DE CONTEXTO --- */
#context-menu {
    display: none;
    position: absolute;
    z-index: 1000;
    background: var(--editor-bg-color);
    border: 1px solid var(--border-color);
    box-shadow: 2px 2px 5px rgba(0, 0, 0, 0.2);
    border-radius: 4px;
    padding: 5px 0;
    min-width: 150px;
}

.context-menu__item {
    padding: 8px 15px;
    cursor: pointer;
    font-size: 13px;
}

.context-menu__item:hover {
    background-color: var(--primary-color);
    color: var(--text-on-primary);
}

/* --- MODAIS --- */
.modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.5);
    z-index: 100;
    display: none;
    justify-content: center;
    align-items: center;
}

.modal__content {
    background: var(--modal-bg);
    padding: 20px;
    border-radius: 6px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3);
    width: 90%;
    max-width: 800px;
    display: flex;
    flex-direction: column;
}

.modal__content--diff-view {
    height: 95vh;
    width: 98vw;
    max-width: none;
}

.modal__content--large {
    width: 1200px;
    max-width: 98vw;
    height: 95vh;
    max-height: 98vh;
}

.modal__content--small {
    max-width: 400px;
}

#diff-editor-container {
    flex-grow: 1;
    border: 1px solid var(--border-color);
    margin: 10px 0;
}

.btn {
    padding: 8px 16px;
    border-radius: 4px;
    border: none;
    cursor: pointer;
    font-size: 13px;
}

.btn--primary {
    background-color: var(--primary-color);
    color: var(--text-on-primary);
}

.btn--secondary {
    background-color: #5a6268;
    color: white;
    margin-left: 10px;
}

.modal-header-flex {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.modal-header-flex h3 {
    margin: 0;
}

.comparison-list {
    max-height: 200px;
    overflow-y: auto;
    margin-bottom: 15px;
}

/* --- TOAST (NOTIFICAÇÃO) --- */
.toast {
    position: fixed;
    bottom: 30px;
    right: 30px;
    background: #333;
    color: white;
    padding: 10px 20px;
    border-radius: 4px;
    opacity: 0;
    transition: opacity 0.3s;
    pointer-events: none;
    z-index: 2000;
}

.toast--show {
    opacity: 1;
}

/* --- SIDEBAR E ÁRVORE DE ARQUIVOS --- */
.nav-select {
    margin: 5px 15px;
    width: calc(100% - 30px);
    padding: 4px;
    background: var(--bg-color);
    border: 1px solid var(--border-color);
    color: inherit;
}

.sidebar {
    width: 250px;
    background-color: var(--sidebar-bg);
    border-right: 1px solid var(--border-color);
    display: flex;
    flex-direction: column;
    flex-shrink: 0;
}

.sidebar--hidden {
    display: none;
}

#sidebar-resizer {
    width: 5px;
    cursor: col-resize;
    background-color: transparent;
    flex-shrink: 0;
    z-index: 10;
    transition: background-color 0.2s;
}

#sidebar-resizer:hover {
    background-color: rgba(0, 95, 204, 0.5);
}

body.resizing-sidebar {
    cursor: col-resize;
    user-select: none;
}

body.resizing-sidebar .editor-layout__main {
    pointer-events: none;
}

.sidebar__header {
    padding: 8px 10px;
    font-size: 11px;
    font-weight: bold;
    text-transform: uppercase;
    display: flex;
    justify-content: space-between;
    align-items: center;
    background-color: var(--toolbar-bg-color);
    border-bottom: 1px solid var(--border-color);
    flex-shrink: 0;
}

.file-tree {
    flex-grow: 1;
    overflow-y: auto;
    padding: 5px 0;
}

.file-tree__item {
    padding: 3px 10px;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 5px;
    font-size: 13px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    user-select: none;
}

.file-tree__item:hover {
    background-color: var(--file-tree-hover-bg);
}

.file-tree__item--active {
    background-color: var(--file-tree-active-bg);
    color: var(--primary-color);
}

.file-tree__children {
    padding-left: 15px;
    display: none;
}

.file-tree__children--expanded {
    display: block;
}

.icon-btn {
    background: none;
    border: none;
    cursor: pointer;
    color: inherit;
    padding: 0;
    display: flex;
    align-items: center;
}

.icon-btn:hover {
    color: var(--primary-color);
}

.icon-btn--small .material-symbols-outlined {
    font-size: 16px;
}

/* --- PAINEL DE BUSCA --- */
.search-panel {
    display: flex;
    flex-direction: column;
    flex-grow: 1;
    overflow: hidden;
}

.search-panel__form {
    display: flex;
    padding: 8px;
    border-bottom: 1px solid var(--border-color);
    flex-shrink: 0;
}

#global-search-input {
    flex-grow: 1;
    background-color: var(--search-input-bg);
    color: inherit;
    border: 1px solid var(--border-color);
    padding: 5px 8px;
    border-radius: 3px;
    outline: none;
}

#global-search-input:focus {
    border-color: var(--primary-color);
}

#global-search-submit-btn {
    margin-left: 5px;
    padding: 4px;
}

.search-panel__results {
    flex-grow: 1;
    overflow-y: auto;
    padding: 5px 0;
    font-size: 13px;
}

.search-result__file {
    padding: 4px 10px;
    font-weight: bold;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 5px;
}

.search-result__file:hover {
    background-color: var(--file-tree-hover-bg);
}

.search-result__matches {
    padding-left: 15px;
    display: none;
}

.search-result__matches--expanded {
    display: block;
}

.search-result__match-item {
    padding: 2px 10px 2px 20px;
    white-space: pre;
    overflow: hidden;
    text-overflow: ellipsis;
    cursor: pointer;
    display: flex;
    gap: 10px;
}

.search-result__match-item:hover {
    background-color: var(--primary-color);
    color: var(--text-on-primary);
}

.search-result__line-number {
    opacity: 0.7;
    text-align: right;
    min-width: 30px;
    user-select: none;
}

.search-result__line-content {
    flex-grow: 1;
}

.search-result__line-content mark {
    background-color: var(--search-mark-bg);
    color: var(--search-mark-color);
    font-weight: bold;
    border-radius: 2px;
}

/* --- TELA DE BOAS-VINDAS --- */
#welcome-screen {
    width: 100%;
    height: 100%;
    display: none;
    justify-content: center;
    align-items: center;
    flex-direction: column;
    background-color: var(--editor-bg-color);
    color: var(--text-color);
    overflow-y: auto;
    user-select: none;
}

.welcome-screen__container {
    max-width: 800px;
    width: 90%;
    padding: 20px;
}

.welcome-screen__title {
    font-size: 3em;
    font-weight: 300;
    text-align: center;
    margin-bottom: 40px;
    color: var(--primary-color);
}

.welcome-screen__columns {
    display: flex;
    gap: 40px;
}

.welcome-screen__column {
    flex: 1;
}

.welcome-screen__subtitle {
    font-size: 1.2em;
    font-weight: 600;
    border-bottom: 1px solid var(--border-color);
    padding-bottom: 10px;
    margin-bottom: 15px;
}

.welcome-screen__list {
    list-style: none;
    padding: 0;
    margin: 0;
}

.welcome-screen__button,
.welcome-screen__list-item {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 10px;
    border-radius: 5px;
    cursor: pointer;
    transition: background-color 0.2s;
    width: 100%;
    text-align: left;
    font-size: 14px;
    background: none;
    border: none;
    color: inherit;
}

.welcome-screen__button .material-symbols-outlined,
.welcome-screen__list-item .material-symbols-outlined {
    font-size: 20px;
}

.welcome-screen__button:hover,
.welcome-screen__list-item:hover {
    background-color: var(--welcome-hover-bg);
}

.welcome-screen__list-item-name {
    font-weight: bold;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.welcome-screen__list-item-path {
    font-size: 12px;
    opacity: 0.7;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.welcome-screen__no-recents {
    padding: 10px;
    font-style: italic;
    opacity: 0.7;
    text-align: center;
}

/* --- MUDANÇA: Estilos para múltiplas pastas na barra lateral --- */
.file-tree {
    flex-grow: 1;
    overflow-y: auto;
    padding: 0;
    display: flex;
    flex-direction: column;
}

.file-tree__root-folder {
    display: flex;
    flex-direction: column;
    border-bottom: 1px solid var(--border-color);
}

.file-tree__root-folder:last-child {
    border-bottom: none;
    flex-grow: 1;
}

.file-tree__folder-content {
    padding: 5px 0;
    overflow-y: auto;
}

.sidebar__header {
    height: auto;
    min-height: 28px;
    padding: 6px 10px;
}

.close-folder-btn .material-symbols-outlined {
    font-size: 18px;
}

.close-folder-btn:hover {
    color: #cf222e;
}

/* --- COMPARAÇÃO DE PASTAS --- */
.compare-folders__selection {
    display: flex;
    flex-direction: column;
    gap: 15px;
    margin: 10px 0;
}

.compare-folders__input-group {
    display: flex;
    flex-direction: column;
    gap: 5px;
}

.compare-folders__input-group label {
    font-size: 12px;
    opacity: 0.8;
}

.flex-row {
    display: flex;
    gap: 10px;
    width: 100%;
}

.path-input {
    flex-grow: 1;
    padding: 6px 10px;
    border: 1px solid var(--border-color);
    border-radius: 4px;
    background: var(--bg-color);
    color: var(--text-color);
    outline: none;
    font-size: 13px;
}

.compare-folders__results {
    border: 1px solid var(--border-color);
    border-radius: 4px;
    background-color: var(--editor-bg-color);
}

.compare-item:hover {
    background-color: var(--menubar-hover-bg);
}

.compare-item span {
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

/* --- ANÁLISE DE PROJETO --- */
.modal__content--fullscreen {
    width: 98vw !important;
    height: 96vh !important;
    max-width: none !important;
    margin: 2vh auto !important;
    transition: all 0.3s ease;
}

.modal__content--fullscreen #project-analysis-content {
    max-height: 85vh !important;
}

.analysis-card {
    background: var(--toolbar-bg-color);
    padding: 15px;
    border-radius: 8px;
    border: 1px solid var(--border-color);
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.05);
}

.treemap-node {
    overflow: hidden;
    transition: all 0.2s ease;
    cursor: default;
}

.treemap-node:hover {
    box-shadow: inset 0 0 0 2px rgba(255, 255, 255, 0.3);
    z-index: 5;
}

/* Badges de Segurança */
.badge {
    padding: 2px 6px;
    border-radius: 4px;
    font-size: 10px;
    font-weight: bold;
    color: #fff;
    text-transform: uppercase;
}

.badge.critical {
    background-color: #d00;
}

.badge.high {
    background-color: #ff9800;
}

.badge.medium {
    background-color: #2196f3;
}

.badge.low {
    background-color: #9e9e9e;
}



.analysis-card h4 {
    margin-top: 0;
    margin-bottom: 10px;
    border-bottom: 1px solid var(--border-color);
    padding-bottom: 5px;
    font-size: 14px;
}

.analysis-section-title {
    font-size: 16px;
    font-weight: bold;
    margin: 20px 0 10px 0;
    color: var(--primary-color);
    border-left: 4px solid var(--primary-color);
    padding-left: 10px;
}

.analysis-list {
    list-style: none;
    padding: 0;
    margin: 0;
    overflow-y: auto;
    flex-grow: 1;
}

.analysis-list li {
    padding: 6px 0;
    border-bottom: 1px solid rgba(128, 128, 128, 0.1);
    font-size: 13px;
    display: flex;
    justify-content: space-between;
    gap: 10px;
}

.analysis-list li:last-child {
    border-bottom: none;
}

.analysis-list-item-main {
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.analysis-list-item-sub {
    opacity: 0.6;
    font-size: 11px;
    margin-left: auto;
    white-space: nowrap;
}

.chart-container {
    position: relative;
    height: 200px;
    width: 100%;
}

.analysis-list-header {
    border-top-left-radius: 4px;
    border-top-right-radius: 4px;
    user-select: none;
}

.analysis-list-header span:hover {
    color: var(--primary-color);
}

.analysis-list-header span.active-sort {
    color: var(--primary-color);
}

.analysis-list-header span .sort-indicator {
    font-size: 14px;
    vertical-align: middle;
    margin-left: 4px;
    opacity: 0.8;
}


/* Status de Dependências */
.dep-status {
    display: flex;
    align-items: center;
    gap: 5px;
    font-weight: 500;
}

.dep-status--ok {
    color: #28a745;
}

.dep-status--error {
    color: #dc3545;
}

.dep-status--warning {
    color: #ffc107;
}

.dep-status .material-symbols-outlined {
    font-size: 14px;
}

/* Melhorias nos Cards */
.analysis-card--critical {
    border-color: #dc3545 !important;
    background-color: rgba(220, 53, 69, 0.05);
}

.analysis-card__header {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 5px;
    opacity: 0.8;
}

.analysis-card__icon {
    font-size: 16px;
}

/* --- Heatmap --- */
.heatmap-container {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(13px, 1fr));
    gap: 3px;
    height: auto;
    max-height: 200px;
    overflow-y: auto;
    align-content: start;
    padding: 2px;
}

.heatmap-item {
    width: 100%;
    aspect-ratio: 1;
    border-radius: 2px;
    cursor: pointer;
    transition: transform 0.1s;
    position: relative;
}

.heatmap-item:hover {
    transform: scale(1.4);
    z-index: 10;
    box-shadow: 0 0 0 1px #fff;
}

#heatmap-floating-tooltip {
    position: fixed;
    z-index: 9999;
    background: rgba(30, 30, 30, 0.95);
    color: #fff;
    padding: 10px 14px;
    border-radius: 8px;
    font-size: 12px;
    pointer-events: none;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.6);
    border: 1px solid rgba(255, 255, 255, 0.15);
    backdrop-filter: blur(4px);
    max-width: 320px;
    line-height: 1.5;
    display: none;
}

/* --- AI ANALYSIS STYLES --- */
.analysis-ai-section {
    margin-bottom: 25px;
    animation: fadeIn 0.8s ease-out;
}

.ai-analysis-card {
    background: linear-gradient(135deg, rgba(156, 39, 176, 0.05) 0%, rgba(33, 150, 243, 0.05) 100%) !important;
    border: 1px solid rgba(156, 39, 176, 0.3) !important;
    box-shadow: 0 4px 15px rgba(156, 39, 176, 0.1);
    position: relative;
    overflow: hidden;
}

.ai-analysis-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 4px;
    height: 100%;
    background: linear-gradient(to bottom, #9c27b0, #2196f3);
}

.ai-analysis-header {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 15px;
    padding-bottom: 10px;
    border-bottom: 1px solid rgba(128, 128, 128, 0.15);
}

.ai-title {
    font-size: 16px;
    font-weight: 700;
    background: linear-gradient(90deg, #9c27b0, #2196f3);
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
    letter-spacing: 0.5px;
}

.ai-pulse {
    color: #9c27b0;
    animation: ai-pulse 2s infinite;
}

@keyframes ai-pulse {
    0% {
        transform: scale(1);
        opacity: 0.8;
    }

    50% {
        transform: scale(1.2);
        opacity: 1;
        text-shadow: 0 0 10px rgba(156, 39, 176, 0.5);
    }

    100% {
        transform: scale(1);
        opacity: 0.8;
    }
}

.ai-analysis-content {
    font-size: 14px;
    line-height: 1.6;
    color: var(--text-color);
}

.ai-loading {
    padding: 30px;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 15px;
    text-align: center;
}

.ai-shimmer {
    width: 60px;
    height: 4px;
    background: #e0e0e0;
    border-radius: 2px;
    position: relative;
    overflow: hidden;
}

.ai-shimmer::after {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, #9c27b0, transparent);
    animation: shimmer 1.5s infinite;
}

@keyframes shimmer {
    100% {
        left: 100%;
    }
}

.ai-analysis-footer {
    margin-top: 15px;
    padding-top: 10px;
    border-top: 1px dashed rgba(128, 128, 128, 0.2);
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-size: 11px;
    opacity: 0.7;
}

.ai-error {
    color: #f44336;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 8px;
    padding: 20px;
}

.markdown-body h1,
.markdown-body h2,
.markdown-body h3 {
    margin-top: 1.5em;
    margin-bottom: 0.5em;
    color: var(--primary-color);
}

.markdown-body ul {
    padding-left: 20px;
}

.markdown-body li {
    margin-bottom: 5px;
}

.btn--outline {
    background: transparent;
    border: 1px solid var(--primary-color);
    color: var(--primary-color);
}

.btn--outline:hover {
    background: var(--primary-color);
    color: #fff;
}

@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(10px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.ai-code-block {
    background: #1a1a1a;
    border-radius: 6px;
    margin: 15px 0;
    overflow: hidden;
    border: 1px solid rgba(255, 255, 255, 0.1);
}

.ai-code-header {
    background: #333;
    padding: 4px 10px;
    font-size: 10px;
    text-transform: uppercase;
    color: #aaa;
    border-bottom: 1px solid rgba(255, 255, 255, 0.05);
}

.ai-code-block code {
    display: block;
    padding: 12px;
    color: #e0e0e0;
    font-family: 'Consolas', 'Monaco', monospace;
    font-size: 13px;
    overflow-x: auto;
    white-space: pre;
}

.ai-inline-code {
    background: rgba(156, 39, 176, 0.15);
    color: #d1c4e9;
    padding: 2px 5px;
    border-radius: 4px;
    font-family: monospace;
    font-size: 0.9em;
}

.markdown-body p {
    margin-bottom: 12px;
}

.markdown-body h1,
.markdown-body h2,
.markdown-body h3 {
    border-bottom: 1px solid rgba(128, 128, 128, 0.2);
    padding-bottom: 5px;
}

/* --- AI CHAT PANEL --- */
#right-panel {
    background-color: var(--sidebar-bg);
    border-left: 1px solid var(--border-color);
    display: flex;
    flex-direction: column;
    width: 300px;
    flex-shrink: 0;
}

#right-panel-resizer {
    width: 5px;
    cursor: col-resize;
    background-color: transparent;
    flex-shrink: 0;
    z-index: 10;
}

#right-panel-resizer:hover {
    background-color: rgba(0, 95, 204, 0.5);
}

.chat-header {
    display: flex;
    align-items: center;
    padding: 10px;
    border-bottom: 1px solid var(--border-color);
    background-color: var(--toolbar-bg-color);
    font-weight: bold;
    font-size: 13px;
    gap: 8px;
}

.chat-title {
    flex-grow: 1;
}

.chat-messages {
    flex-grow: 1;
    overflow-y: auto;
    padding: 15px;
    display: flex;
    flex-direction: column;
    gap: 15px;
}

.chat-message {
    display: flex;
    gap: 10px;
    max-width: 100%;
}

.chat-message--user {
    flex-direction: row-reverse;
}

.chat-message--user .chat-bubble {
    background-color: var(--primary-color);
    color: var(--text-on-primary);
    border-radius: 12px 12px 0 12px;
}

.chat-message--ai .chat-bubble {
    background-color: var(--editor-bg-color);
    border: 1px solid var(--border-color);
    border-radius: 12px 12px 12px 0;
}

.chat-bubble {
    padding: 10px 14px;
    font-size: 13px;
    line-height: 1.5;
    max-width: 85%;
    word-wrap: break-word;
    box-shadow: 0 1px 2px rgba(0, 0, 0, 0.1);
}

.chat-avatar span {
    font-size: 20px;
    opacity: 0.7;
    margin-top: 5px;
}

.chat-input-area {
    padding: 10px;
    border-top: 1px solid var(--border-color);
    display: flex;
    gap: 8px;
    background-color: var(--toolbar-bg-color);
    align-items: flex-end;
}

#chat-input {
    flex-grow: 1;
    background: var(--search-input-bg);
    border: 1px solid var(--border-color);
    color: inherit;
    border-radius: 4px;
    padding: 8px;
    font-family: inherit;
    resize: none;
    max-height: 150px;
    min-height: 36px;
    line-height: 20px;
}

#chat-input:focus {
    outline: 2px solid var(--primary-color);
    outline-offset: -1px;
}

.send-btn {
    background-color: var(--primary-color);
    color: var(--text-on-primary);
    width: 36px;
    height: 36px;
    border-radius: 4px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.send-btn:hover {
    background-color: var(--primary-hover);
}

/* Chat Markdown Styles */
.chat-code-block {
    background: rgba(0, 0, 0, 0.1);
    padding: 8px;
    border-radius: 4px;
    overflow-x: auto;
    font-family: monospace;
    margin: 5px 0;
}

.chat-inline-code {
    background: rgba(0, 0, 0, 0.1);
    padding: 2px 4px;
    border-radius: 3px;
    font-family: monospace;
}

.chat-action-btn {
    display: flex;
    align-items: center;
    gap: 6px;
    background-color: var(--primary-color);
    color: white;
    border: none;
    padding: 6px 12px;
    border-radius: 4px;
    cursor: pointer;
    font-size: 12px;
    margin-top: 8px;
    transition: background-color 0.2s;
    width: 100%;
    justify-content: center;
}

.chat-action-btn:hover {
    background-color: var(--primary-hover);
}

.chat-action-btn.applied {
    background-color: #28a745;
    cursor: default;
    opacity: 0.9;
}

.chat-action-btn:disabled {
    cursor: not-allowed;
    opacity: 0.7;
}

.typing-indicator span {
    display: inline-block;
    width: 6px;
    height: 6px;
    background-color: currentColor;
    border-radius: 50%;
    margin-right: 3px;
    animation: typing 1s infinite;
}

.typing-indicator span:nth-child(2) {
    animation-delay: 0.2s;
}

.typing-indicator span:nth-child(3) {
    animation-delay: 0.4s;
}

@keyframes typing {

    0%,
    100% {
        transform: translateY(0);
        opacity: 0.6;
    }

    50% {
        transform: translateY(-4px);
        opacity: 1;
    }
}