:root {
    --api-bg-dark: #121212;
    --api-bg-content: #1e1e1e;
    --api-bg-code: #0d0d0d;
    --api-text-primary: #e0e0e0;
    --api-text-secondary: #b0b0b0;
    --api-accent-primary: #00aaff;
    --api-accent-secondary: #00ffcc;
    --api-border-color: #333333;
    --api-font-primary: 'Inter', sans-serif;
    --api-font-code: 'Fira Code', monospace;

    --primary-color: #00d4ff;
    --secondary-color: #0052d4;
    --text-primary: #ffffff;
    --text-secondary: #adb5bd;
    --bg-dark: #0a0a0a;
    --bg-card: #1a1a1a;
    --border-color: #2a2a2a;
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

html {
    scroll-behavior: smooth;
}

body.api-docs-body {
    font-family: var(--api-font-primary);
    background-color: var(--api-bg-dark);
    color: var(--api-text-primary);
    line-height: 1.7;
    font-size: 16px;
    padding-top: 70px; /* Default height of .header */
}

/* Estilos importados/adaptados do style.css para header e footer */
.header {
    position: fixed;
    top: 0;
    left:0;
    width: 100%;
    background: rgba(10, 10, 10, 0.85); /* Mais opaco para melhor leitura na doc */
    backdrop-filter: blur(10px);
    border-bottom: 1px solid var(--border-color);
    z-index: 1100; /* Acima do sidebar da API */
    transition: all 0.3s ease;
    padding: 0; /* Reset padding as nav-container will handle it */
}

.nav-container {
    max-width: 1400px; /* Max width para consistência */
    margin: 0 auto;
    padding: 1rem 2rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.logo {
    font-size: 1.5rem;
    font-weight: 800;
    font-family: 'Poppins', sans-serif;
    background: linear-gradient(45deg, var(--primary-color), var(--secondary-color));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.nav-menu {
    display: flex;
    list-style: none;
    gap: 1.8rem; /* Leve ajuste */
}

.nav-menu a {
    color: var(--text-secondary);
    text-decoration: none;
    font-weight: 500;
    transition: color 0.3s ease;
    font-size: 0.95rem;
}

.nav-menu a:hover,
.nav-menu a.active-link { /* Para link da página atual */
    color: var(--primary-color);
}

.login-btn {
    background: linear-gradient(45deg, var(--primary-color), var(--secondary-color));
    color: white !important; /* Prioridade na cor */
    padding: 0.7rem 1.4rem; /* Leve ajuste */
    border: none;
    border-radius: 8px;
    font-weight: 600;
    cursor: pointer;
    transition: transform 0.3s ease, box-shadow 0.3s ease;
    text-decoration: none;
    display: inline-block;
    font-size: 0.9rem;
}

.login-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 20px rgba(0, 212, 255, 0.25);
}

.mobile-menu-toggle {
    display: none;
    background: none;
    border: none;
    color: var(--text-primary);
    font-size: 1.5rem;
    cursor: pointer;
}

.footer {
    background: var(--bg-card);
    border-top: 1px solid var(--border-color);
    padding: 3rem 2rem 1.5rem; /* Ajuste no padding inferior */
    color: var(--text-secondary);
}

.footer-container {
    max-width: 1400px; /* Max width */
    margin: 0 auto;
}

.footer-content {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); /* Ajuste minmax */
    gap: 2.5rem; /* Ajuste gap */
    margin-bottom: 2.5rem; /* Ajuste margin */
}

.footer-section h3 {
    font-size: 1.1rem; /* Ajuste tamanho */
    font-weight: 700;
    margin-bottom: 1rem;
    color: var(--text-primary);
    font-family: 'Poppins', sans-serif;
}
.footer-section p {
    font-size: 0.9rem;
    line-height: 1.6;
}

.footer-links {
    list-style: none;
}

.footer-links li {
    margin-bottom: 0.6rem; /* Ajuste margin */
}

.footer-links a {
    color: var(--text-secondary);
    text-decoration: none;
    transition: color 0.3s ease;
    font-size: 0.9rem;
}

.footer-links a:hover {
    color: var(--primary-color);
}

.social-links {
    display: flex;
    gap: 0.8rem; /* Ajuste gap */
}

.social-links a {
    width: 38px; /* Ajuste tamanho */
    height: 38px;
    background: linear-gradient(45deg, var(--primary-color), var(--secondary-color));
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    text-decoration: none;
    transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.social-links a:hover {
    transform: translateY(-3px);
    box-shadow: 0 5px 15px rgba(0, 212, 255, 0.2);
}
.social-links a i {
    font-size: 0.9rem;
}

.footer-bottom {
    border-top: 1px solid var(--border-color);
    padding-top: 1.5rem; /* Ajuste padding */
    text-align: center;
    font-size: 0.85rem; /* Ajuste tamanho */
}
/* Fim dos estilos adaptados de header e footer */


.api-docs-page-container {
    padding-top: 70px; /* Match .header height or slightly more if it changes */
}

.api-header-docs { /* Renomeado para evitar conflito com .header global */
    background-color: var(--api-bg-content);
    padding: 1.5rem 2rem;
    border-bottom: 1px solid var(--api-border-color);
    text-align: center;
    position: sticky;
    top: 70px; /* Altura do .header global */
    z-index: 1000;
}

.api-header-docs h1 {
    font-size: 1.8rem;
    font-weight: 600;
    color: var(--api-accent-primary);
}

.api-container {
    display: flex;
    max-width: 1400px;
    margin: 0 auto;
}

.api-sidebar {
    width: 280px;
    background-color: var(--api-bg-content);
    border-right: 1px solid var(--api-border-color);
    padding: 2rem 0;
    /* Altura considera o .header e .api-header-docs */
    height: calc(100vh - 70px - 77px); /* header global + header docs */
    position: sticky;
    top: calc(70px + 77px); /* header global + header docs height */
    overflow-y: auto;
}

.api-sidebar nav ul {
    list-style: none;
}

.api-sidebar nav ul li a {
    display: block;
    padding: 0.8rem 1.5rem;
    color: var(--api-text-secondary);
    text-decoration: none;
    font-size: 0.95rem;
    transition: all 0.2s ease-in-out;
    border-left: 3px solid transparent;
}

.api-sidebar nav ul li a:hover {
    color: var(--api-accent-primary);
    background-color: rgba(0, 170, 255, 0.05);
    border-left-color: var(--api-accent-primary);
}

.api-sidebar nav ul li a.active {
    color: var(--api-accent-secondary);
    font-weight: 500;
    border-left-color: var(--api-accent-secondary);
    background-color: rgba(0, 255, 204, 0.08);
}

.api-content {
    flex-grow: 1;
    padding: 2.5rem 3rem;
    max-width: calc(100% - 280px);
}

.api-content section {
    margin-bottom: 3.5rem;
    /* padding-top removido pois o scrollIntoView cuidará do offset */
}

.api-content h2 {
    font-size: 2rem;
    font-weight: 700;
    color: var(--api-accent-secondary);
    margin-bottom: 1.5rem;
    padding-bottom: 0.5rem;
    border-bottom: 2px solid var(--api-border-color);
}

.api-content h3 {
    font-size: 1.5rem;
    color: var(--api-accent-primary);
    margin-top: 2rem;
    margin-bottom: 1rem;
}

.api-content p {
    margin-bottom: 1rem;
    color: var(--api-text-secondary);
}

.api-content strong {
    color: var(--api-text-primary);
    font-weight: 600;
}

.api-content ul:not(.nav-menu):not(.footer-links) { /* Especificidade para evitar conflito */
    list-style-position: inside;
    padding-left: 1rem;
    margin-bottom: 1rem;
}

.api-content ul:not(.nav-menu):not(.footer-links) li {
    margin-bottom: 0.5rem;
    color: var(--api-text-secondary);
}

.api-content code:not(pre code) {
    background-color: var(--api-bg-code);
    color: var(--api-accent-secondary);
    padding: 0.2em 0.4em;
    border-radius: 4px;
    font-family: var(--api-font-code);
    font-size: 0.9em;
}

.api-content pre {
    background-color: var(--api-bg-code);
    border: 1px solid var(--api-border-color);
    border-radius: 8px;
    padding: 1.5rem;
    overflow-x: auto;
    margin-bottom: 1.5rem;
    box-shadow: 0 4px 15px rgba(0,0,0,0.2);
}

.api-content pre code {
    font-family: var(--api-font-code);
    font-size: 0.9rem;
    color: var(--api-text-primary);
    background: none;
    padding: 0;
    white-space: pre;
}

/* Scrollbar styling */
::-webkit-scrollbar {
    width: 8px;
    height: 8px;
}
::-webkit-scrollbar-track {
    background: var(--api-bg-dark); /* Alterado para bg mais escuro */
}
::-webkit-scrollbar-thumb {
    background: var(--api-accent-primary);
    border-radius: 4px;
}
::-webkit-scrollbar-thumb:hover {
    background: var(--api-accent-secondary);
}

/* Toast styles (copiado e adaptado de style.css ou toast.css) */
#toast-container {
    position: fixed;
    bottom: 20px;
    right: 20px;
    z-index: 2000; /* Acima de outros elementos */
    display: flex;
    flex-direction: column-reverse; /* Novas mensagens aparecem acima */
    gap: 10px;
}

.toast {
    background-color: #333;
    color: white;
    padding: 15px 25px;
    border-radius: 8px;
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.3);
    opacity: 0;
    transform: translateY(20px);
    transition: opacity 0.3s ease, transform 0.3s ease;
    font-size: 0.95rem;
    max-width: 350px;
    border-left: 5px solid var(--primary-color);
}

.toast.show {
    opacity: 1;
    transform: translateY(0);
}

.toast-success { border-left-color: #28a745; background-color: #202020; }
.toast-error { border-left-color: #dc3545; background-color: #202020; }
.toast-info { border-left-color: var(--primary-color); background-color: #202020; } /* Padrão */
.toast-warning { border-left-color: #ffc107; background-color: #202020; color: #111; }


/* Responsive adjustments */
@media (max-width: 992px) {
    body.api-docs-body {
      /* padding-top pode precisar de ajuste se a altura do header mudar no mobile */
    }

    .nav-menu {
        display: none; /* Esconde o menu principal */
        flex-direction: column;
        position: absolute;
        top: 100%; /* Abaixo do header */
        left: 0;
        width: 100%;
        background: rgba(10, 10, 10, 0.98); /* Fundo sólido para o menu mobile */
        padding: 1rem 0;
        border-top: 1px solid var(--border-color);
    }
    .nav-menu.active {
        display: flex; /* Mostra quando ativo */
    }
    .nav-menu li {
        text-align: center;
        padding: 0.8rem 0;
    }
    .mobile-menu-toggle {
        display: block; /* Mostra o botão de menu mobile */
    }
    
    .api-docs-page-container {
        padding-top: 60px; /* Ajustar se altura do header mudar */
    }
    .api-header-docs {
        top: 60px; /* Ajustar se altura do header mudar */
        padding: 1rem 1.5rem;
    }
    .api-header-docs h1 {
        font-size: 1.5rem;
    }

    .api-container {
        flex-direction: column;
    }
    .api-sidebar {
        width: 100%;
        height: auto;
        position: static; /* Não mais sticky no mobile */
        border-right: none;
        border-bottom: 1px solid var(--api-border-color);
        padding: 1rem 0;
        /* Reset de altura e top */
        height: auto;
        top: auto; 
    }
    .api-sidebar nav ul {
        display: flex;
        flex-wrap: wrap;
        justify-content: center;
        padding: 0 1rem;
    }
    .api-sidebar nav ul li a {
        padding: 0.6rem 1rem;
        border-left: none;
        border-bottom: 3px solid transparent;
        font-size: 0.9rem;
    }
    .api-sidebar nav ul li a:hover,
    .api-sidebar nav ul li a.active {
        border-left-color: transparent;
        border-bottom-color: var(--api-accent-primary);
    }
    .api-sidebar nav ul li a.active {
        border-bottom-color: var(--api-accent-secondary);
    }
    .api-content {
        padding: 2rem 1.5rem;
        max-width: 100%;
    }
    .api-content h2 {
        font-size: 1.8rem;
    }
}

@media (max-width: 600px) {
    body.api-docs-body {
      /* padding-top pode precisar de ajuste */
    }
    .nav-container {
        padding: 0.8rem 1rem;
    }
    .logo {
        font-size: 1.3rem;
    }
    .login-btn {
        padding: 0.6rem 1.2rem;
        font-size: 0.85rem;
    }

    .api-docs-page-container {
        padding-top: 55px; /* Ajustar se altura do header mudar */
    }
    .api-header-docs {
        top: 55px; /* Ajustar se altura do header mudar */
        padding: 0.8rem 1rem;
    }
    .api-header-docs h1 {
        font-size: 1.3rem;
    }
    .api-content {
        padding: 1.5rem 1rem;
    }
    .api-content h2 {
        font-size: 1.6rem;
    }
    .api-content pre {
        padding: 1rem;
    }
    .api-content pre code {
        font-size: 0.85rem;
    }

    .footer-content {
        grid-template-columns: 1fr; /* Uma coluna no mobile */
        text-align: center;
    }
    .footer-section {
        margin-bottom: 1.5rem;
    }
    .social-links {
        justify-content: center;
    }
}
