:root {
    --primary-color: #4a90e2;
    --secondary-color: #1a1a1a;
    --background-color: #121212;
    --text-color: #ffffff;
    --border-color: #333333;
    --font-family: system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
    --heading-font: system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
    --font-size-base: 16px;
    --spacing-unit: 1rem;
}

* {
    margin: 0;
    padding: 0; 
    box-sizing: border-box;
}

body {
    font-family: var(--font-family);
    font-size: var(--font-size-base);
    line-height: 1.6;
    color: var(--text-color);
    background-color: var(--background-color);
    overflow-x: hidden;
}

.container {
    display: flex;
    min-height: 100vh;
}

.sidebar {
    width: 300px;
    background-color: var(--secondary-color);
    padding: calc(var(--spacing-unit) * 2);
    padding-top: calc(var(--spacing-unit) * 4); /* Espaço para o botão de menu */
    border-right: 1px solid var(--border-color);
    overflow-y: auto;
    transition: transform 0.3s ease, box-shadow 0.3s ease;
    height: 100vh;
    position: sticky;
    top: 0;
    z-index: 999;
}

.main-content {
    flex: 1;
    padding: calc(var(--spacing-unit) * 2);
    overflow-y: auto;
    transition: opacity 0.3s ease;
}

/* Botão de menu estilo ChatGPT */
.menu-toggle {
    position: fixed;
    top: 1rem;
    left: 1rem;
    z-index: 1000;
    background: transparent;
    border: none;
    color: var(--text-color);
    width: 44px;
    height: 44px;
    border-radius: 0.375rem;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background-color 0.2s, transform 0.2s;
}

.menu-toggle:hover {
    background-color: rgba(255, 255, 255, 0.1);
}

.menu-toggle:active {
    transform: scale(0.95);
}

/* Hamburger ícone transformável */
.menu-toggle i {
    font-size: 1.5rem;
    transition: transform 0.3s ease;
}

/* Quando o menu está aberto, rotacionar o ícone */
.menu-toggle[aria-expanded="true"] .fa-bars {
    transform: rotate(90deg);
    opacity: 0;
    display: none;
}

.menu-toggle .fa-times {
    position: absolute;
    opacity: 0;
    transform: rotate(-90deg);
    display: none;
}

.menu-toggle[aria-expanded="true"] .fa-times {
    transform: rotate(0);
    opacity: 1;
    display: block;
}

/* Overlay para o menu mobile */
.menu-overlay {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-color: rgba(0, 0, 0, 0.5);
    z-index: 998;
    opacity: 0;
    transition: opacity 0.3s ease;
    pointer-events: none;
}

.menu-overlay.active {
    opacity: 1;
    pointer-events: auto;
}

/* Cabeçalho do sidebar no mobile */
.sidebar-header {
    display: none;
    align-items: center;
    justify-content: space-between;
    padding-bottom: var(--spacing-unit);
    margin-bottom: var(--spacing-unit);
    border-bottom: 1px solid var(--border-color);
}

.sidebar-close {
    background: transparent;
    border: none;
    color: var(--text-color);
    font-size: 1.5rem;
    cursor: pointer;
    padding: 5px;
    border-radius: 4px;
}

.sidebar-close:hover {
    background-color: rgba(255, 255, 255, 0.1);
}

/* Media Queries */
@media (max-width: 768px) {
    .container {
        flex-direction: column;
    }

    .menu-toggle {
        color: var(--text-color);
        background-color: var(--secondary-color);
        border: 1px solid var(--border-color);
    }

    .menu-overlay {
        display: block;
    }

    .sidebar {
        position: fixed;
        left: 0;
        top: 0;
        height: 100vh;
        transform: translateX(-100%);
        width: 300px;
        max-width: 85vw;
        padding-top: calc(var(--spacing-unit) * 4);
        box-shadow: none;
    }

    .sidebar.active {
        transform: translateX(0);
        box-shadow: 0 0 20px rgba(0, 0, 0, 0.4);
    }

    .sidebar-header {
        display: flex;
    }

    .main-content {
        padding-top: calc(var(--spacing-unit) * 4);
        margin-left: 0;
        width: 100%;
    }

    body.menu-open {
        overflow: hidden;
    }

    .search-toggle {
        top: auto;
        bottom: 1rem;
    }
    
    .search-container {
        max-height: 90vh;
    }
    
    .search-results {
        max-height: calc(90vh - 130px);
    }
    
    .desktop-only {
        display: none !important;
    }
    
    .search-footer {
        justify-content: flex-end;
        padding: 10px;
    }
}

@media (max-width: 480px) {
    :root {
        --font-size-base: 14px;
        --spacing-unit: 0.75rem;
    }

    .main-content {
        padding: var(--spacing-unit);
        padding-top: calc(var(--spacing-unit) * 4);
    }
    
    .menu-toggle {
        width: 40px;
        height: 40px;
    }
}

/* Scrollbar styling */
::-webkit-scrollbar {
    width: 8px;
}

::-webkit-scrollbar-track {
    background: var(--secondary-color);
}

::-webkit-scrollbar-thumb {
    background: #444;
    border-radius: 4px;
    transition: background 0.3s;
}

::-webkit-scrollbar-thumb:hover {
    background: #555;
}

/* Loading animation */
@keyframes pulse {
    0% { opacity: 0.6; }
    50% { opacity: 1; }
    100% { opacity: 0.6; }
}

.loading {
    display: flex;
    justify-content: center;
    align-items: center;
    height: 200px;
    font-size: 1.2rem;
    color: var(--primary-color);
    animation: pulse 1.5s infinite;
    text-align: center;
}

.loading::before {
    content: "";
    display: block;
    width: 30px;
    height: 30px;
    border-radius: 50%;
    border: 3px solid rgba(74, 144, 226, 0.3);
    border-top-color: var(--primary-color);
    margin-right: 10px;
    animation: spin 1s linear infinite;
}

@keyframes spin {
    to { transform: rotate(360deg); }
}

pre {
    background: #2a2a2a;
    padding: 15px;
    border-radius: 4px;
    overflow-x: auto;
    color: #e0e0e0;
    margin: 1em 0;
}

code {
    background: #2a2a2a;
    padding: 2px 4px;
    border-radius: 3px;
    color: #e0e0e0;
    font-family: monospace;
}

.error {
    padding: 20px;
    background-color: rgba(255, 50, 50, 0.2);
    color: #ff6b6b;
    border: 1px solid rgba(255, 50, 50, 0.3);
    border-radius: 6px;
    margin: 20px 0;
}

/* Estilo de formatação do conteúdo markdown */
h1, h2, h3, h4, h5, h6 {
    font-family: var(--heading-font);
    margin-top: 1.5em;
    margin-bottom: 0.75em;
    color: var(--text-color);
}

h1 {
    font-size: 2em;
    border-bottom: 1px solid var(--border-color);
    padding-bottom: 0.5rem;
}

h2 {
    font-size: 1.75em;
}

h3 {
    font-size: 1.5em;
}

p {
    margin-bottom: 1rem;
}

a {
    color: var(--primary-color);
    text-decoration: none;
}

a:hover {
    text-decoration: underline;
}

ul, ol {
    margin-left: 1.5rem;
    margin-bottom: 1rem;
}

li {
    margin-bottom: 0.5rem;
}

blockquote {
    border-left: 4px solid var(--primary-color);
    padding-left: 1rem;
    margin-left: 0;
    color: #b0b0b0;
    font-style: italic;
}

/* Admin tools */
.admin-tools {
    position: fixed;
    top: 1rem;
    right: 1rem;
    z-index: 1000;
    display: flex;
    gap: 0.5rem;
}

.tool-button {
    width: 40px;
    height: 40px;
    background-color: var(--primary-color);
    color: white;
    border-radius: 0.375rem;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background-color 0.2s, transform 0.2s;
    text-decoration: none;
}

.tool-button:hover {
    background-color: var(--secondary-color);
    transform: scale(1.05);
}

.tool-button:active {
    transform: scale(0.95);
}

/* Estilos para o botão de pesquisa */
.search-toggle {
    position: fixed;
    top: 1rem;
    right: 1rem;
    z-index: 1000;
    background: var(--secondary-color);
    border: 1px solid var(--border-color);
    color: var(--text-color);
    width: 44px;
    height: 44px;
    border-radius: 0.375rem;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background-color 0.2s, transform 0.2s;
}

.search-toggle:hover {
    background-color: rgba(255, 255, 255, 0.1);
}

.search-toggle:active {
    transform: scale(0.95);
}

/* Modal de pesquisa */
.search-modal {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-color: rgba(0, 0, 0, 0.7);
    z-index: 2000;
    align-items: flex-start;
    justify-content: center;
    padding-top: 5vh;
    opacity: 0;
    transition: opacity 0.3s;
}

.search-modal.active {
    display: flex;
    opacity: 1;
}

.search-container {
    width: 100%;
    max-width: 600px;
    max-height: 80vh;
    background-color: var(--background-color);
    border-radius: 8px;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.5);
    overflow: hidden;
    display: flex;
    flex-direction: column;
    margin: 0 20px;
    transform: translateY(-20px);
    transition: transform 0.3s ease;
}

.search-modal.active .search-container {
    transform: translateY(0);
}

.search-header {
    padding: 12px 16px;
    border-bottom: 1px solid var(--border-color);
    display: flex;
    align-items: center;
}

.search-input-container {
    flex: 1;
    position: relative;
    display: flex;
    align-items: center;
}

.search-icon {
    position: absolute;
    left: 10px;
    color: #666;
    font-size: 14px;
}

#searchInput {
    width: 100%;
    background-color: var(--secondary-color);
    border: 1px solid var(--border-color);
    color: var(--text-color);
    padding: 8px 12px 8px 32px;
    border-radius: 4px;
    font-size: 16px;
}

#searchInput:focus {
    outline: none;
    border-color: var(--primary-color);
}

.search-clear {
    background: transparent;
    border: none;
    color: #666;
    margin-left: 8px;
    cursor: pointer;
    padding: 5px;
    display: none;
}

.search-clear.visible {
    display: block;
}

.search-close {
    background: transparent;
    border: none;
    color: var(--text-color);
    margin-left: 16px;
    cursor: pointer;
    width: 30px;
    height: 30px;
    border-radius: 4px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.search-close:hover {
    background-color: rgba(255, 255, 255, 0.1);
}

.search-results {
    overflow-y: auto;
    max-height: calc(80vh - 130px);
    padding: 8px 0;
}

.search-result-group {
    margin-bottom: 12px;
}

.search-result-group-title {
    padding: 4px 16px;
    font-size: 12px;
    color: #888;
    text-transform: uppercase;
    font-weight: bold;
}

.search-result-item {
    padding: 8px 16px;
    cursor: pointer;
    display: flex;
    align-items: center;
    border-left: 3px solid transparent;
    transition: background-color 0.2s;
}

.search-result-item:hover, .search-result-item.active {
    background-color: rgba(255, 255, 255, 0.05);
    border-left-color: var(--primary-color);
}

.search-result-icon {
    color: #666;
    margin-right: 12px;
    font-size: 14px;
    min-width: 20px;
    text-align: center;
}

.search-result-content {
    flex: 1;
}

.search-result-title {
    font-weight: bold;
    margin-bottom: 2px;
}

.search-result-path {
    font-size: 12px;
    color: #888;
}

.search-result-highlight {
    color: var(--primary-color);
    font-weight: bold;
}

.search-footer {
    padding: 8px 16px;
    border-top: 1px solid var(--border-color);
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-size: 12px;
    color: #888;
}

.search-shortcuts kbd {
    display: inline-block;
    padding: 2px 4px;
    background-color: var(--secondary-color);
    border: 1px solid var(--border-color);
    border-radius: 3px;
    margin: 0 2px;
    font-family: monospace;
    font-size: 11px;
}

.search-no-results {
    padding: 24px 16px;
    text-align: center;
    color: #888;
}

body.menu-open {
    overflow: hidden;
}

body.search-open {
    overflow: hidden;
} 