:root {
    --bg: #0d1117;
    --bg-secondary: #161b22;
    --bg-tertiary: #21262d;
    --border: #30363d;
    --text: #f0f6fc;
    --text-secondary: #8b949e;
    --accent: #58a6ff;
    --accent-hover: #79c0ff;
    --code-bg: #010409;
    --sidebar-width: 270px;
    --header-height: 64px;
    --radius: 8px;
}

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

html {
    scroll-behavior: smooth;
    scroll-padding-top: 80px;
}

body {
    background: var(--bg);
    color: var(--text);
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Helvetica, Arial, sans-serif;
    line-height: 1.6;
    overflow-x: hidden;
}

a {
    color: inherit;
    text-decoration: none;
}

button,
input,
select {
    font: inherit;
}

/* ================================
   HEADER & DRIVER SELECTOR
================================ */

header {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: var(--header-height);
    z-index: 1000;
    display: flex;
    align-items: center;
    border-bottom: 1px solid var(--border);
    background: rgba(13, 17, 23, 0.95);
    backdrop-filter: blur(12px);
}

.header-inner {
    width: 100%;
    max-width: 1400px;
    margin: 0 auto;
    padding: 0 20px;
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.brand {
    display: flex;
    align-items: center;
    gap: 12px;
    font-size: 17px;
    font-weight: 600;
}

.brand-icon {
    width: 32px;
    height: 32px;
    display: grid;
    place-items: center;
    border: 1px solid var(--border);
    border-radius: 8px;
    background: var(--bg-secondary);
}

.brand .badge {
    color: var(--text-secondary);
    font-size: 12px;
    background: var(--bg-tertiary);
    padding: 2px 6px;
    border-radius: 4px;
}

.header-controls {
    display: flex;
    align-items: center;
    gap: 16px;
}

.driver-select {
    background: var(--bg-tertiary);
    color: var(--text);
    border: 1px solid var(--border);
    padding: 4px 8px;
    border-radius: 6px;
    outline: none;
    cursor: pointer;
    font-size: 13px;
}

.menu-button {
    display: none;
    padding: 6px 10px;
    border: 1px solid var(--border);
    border-radius: 6px;
    background: var(--bg-secondary);
    color: var(--text);
    cursor: pointer;
}

/* ================================
   SIDEBAR & OVERLAY
================================ */

.sidebar-overlay {
    display: none;
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.6);
    backdrop-filter: blur(4px);
    z-index: 1050;
    opacity: 0;
    transition: opacity 0.25s ease;
}

.sidebar-overlay.visible {
    display: block;
    opacity: 1;
}

aside.sidebar {
    position: fixed;
    top: var(--header-height);
    left: 0;
    bottom: 0;
    width: var(--sidebar-width);
    overflow-y: auto;
    border-right: 1px solid var(--border);
    background: var(--bg);
    padding: 20px 16px;
    z-index: 1100;
    transition: transform 0.25s ease-in-out;
}

.sidebar-header {
    display: none;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 16px;
    padding-bottom: 8px;
    border-bottom: 1px solid var(--border);
}

.close-sidebar-button {
    background: none;
    border: none;
    color: var(--text-secondary);
    font-size: 18px;
    cursor: pointer;
}

.sidebar-title {
    display: block;
    margin: 16px 0 6px;
    color: var(--text-secondary);
    font-size: 11px;
    font-weight: 700;
    letter-spacing: 0.08em;
    text-transform: uppercase;
}

.nav-group:first-child .sidebar-title {
    margin-top: 0;
}

.sidebar nav a {
    padding: 6px 10px;
    border-radius: 6px;
    color: var(--text-secondary);
    font-size: 14px;
    display: block;
    transition: background 0.15s, color 0.15s;
}

.sidebar nav a:hover {
    background: var(--bg-secondary);
    color: var(--text);
}

.sidebar nav a.active {
    border-left: 2px solid var(--accent);
    background: var(--bg-secondary);
    color: var(--accent);
    font-weight: 600;
}

/* SEARCH */
.search {
    position: relative;
    margin-bottom: 16px;
}

.search input {
    width: 100%;
    padding: 8px 12px;
    border: 1px solid var(--border);
    border-radius: 7px;
    outline: none;
    background: var(--bg-secondary);
    color: var(--text);
    font-size: 13px;
}

.search input:focus {
    border-color: var(--accent);
}

.search-results {
    display: none;
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    margin-top: 6px;
    max-height: 220px;
    overflow-y: auto;
    border: 1px solid var(--border);
    border-radius: 7px;
    background: var(--bg-secondary);
    z-index: 20;
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.4);
}

.search-result {
    display: block;
    padding: 8px 12px;
    border-bottom: 1px solid var(--border);
    font-size: 13px;
    color: var(--text-secondary);
}

.search-result:last-child {
    border-bottom: none;
}

.search-result:hover {
    background: var(--bg-tertiary);
    color: var(--text);
}

/* ================================
   MAIN CONTENT
================================ */

main.content {
    margin-left: var(--sidebar-width);
    padding-top: var(--header-height);
    width: calc(100% - var(--sidebar-width));
    max-width: 960px;
    padding-left: 32px;
    padding-right: 32px;
    box-sizing: border-box;
}

/* Correção de centralização para páginas sem sidebar (Landing Page) */
/* Centralização total para páginas sem sidebar */
main.content.full-width-content {
    margin-left: auto !important;
    margin-right: auto !important;
    width: 100%;
    max-width: 1000px;
    padding-left: 20px;
    padding-right: 20px;

    /* Centralização vertical do bloco principal na tela */
    min-height: calc(100vh - var(--header-height));
    display: flex;
    flex-direction: column;
    justify-content: center;
}

/* Garante que os cards e seções fiquem centralizados */
.hero-center {
    text-align: center;
}

.driver-grid {
    justify-content: center;
}

.hero-label {
    margin-bottom: 8px;
    color: var(--accent);
    font-family: monospace;
    font-size: 12px;
    font-weight: bold;
}

h1 {
    font-size: clamp(32px, 5vw, 44px);
    letter-spacing: -0.03em;
    margin-bottom: 12px;
}

.lead {
    font-size: 17px;
    color: var(--text-secondary);
    margin-bottom: 24px;
}

section {
    padding: 40px 0;
    border-bottom: 1px solid var(--border);
}

#installation,
#section-terms,
#section-privacy,
#dependencies {
    border-bottom: none;
}

section:last-child {
    border-bottom: none;
}

h2 {
    margin-bottom: 16px;
    font-size: 24px;
}

h3 {
    margin: 20px 0 10px;
    font-size: 17px;
}

p {
    margin-bottom: 16px;
    color: var(--text-secondary);
}

code:not(pre code) {
    padding: 2px 6px;
    border-radius: 5px;
    background: var(--bg-tertiary);
    color: var(--accent);
    font-family: monospace;
    font-size: 0.88em;
}

/* CODE & TABLES */
.code-wrapper {
    position: relative;
    margin: 16px 0 20px;
    max-width: 100%;
}

pre {
    overflow-x: auto;
    padding: 16px;
    border: 1px solid var(--border);
    border-radius: var(--radius);
    background: var(--code-bg);
    color: #e6edf3;
    font-family: "SFMono-Regular", Consolas, monospace;
    font-size: 13px;
    line-height: 1.6;
}

.copy-button {
    position: absolute;
    top: 10px;
    right: 10px;
    padding: 4px 8px;
    border: 1px solid var(--border);
    border-radius: 6px;
    background: var(--bg-secondary);
    color: var(--text-secondary);
    font-size: 12px;
    cursor: pointer;
}

.copy-button:hover {
    border-color: var(--accent);
    color: var(--text);
}

.table-wrapper {
    overflow-x: auto;
    margin: 20px 0;
}

table {
    width: 100%;
    border-collapse: collapse;
    font-size: 13px;
    min-width: 500px;
}

th,
td {
    padding: 10px 12px;
    border: 1px solid var(--border);
    text-align: left;
}

th {
    background: var(--bg-secondary);
}

td {
    color: var(--text-secondary);
}

/* FOOTER */
footer {
    margin-top: 40px;
    padding: 24px 0;
    border-top: 1px solid var(--border);
    color: var(--text-secondary);
    font-size: 13px;
    display: flex;
    justify-content: space-between;
}

footer a {
    color: var(--accent);
}

/* RESPONSIVE */
@media (max-width: 900px) {
    .menu-button {
        display: block;
    }

    aside.sidebar {
        top: 0;
        transform: translateX(-100%);
        width: 280px;
        height: 100vh;
        box-shadow: 4px 0 24px rgba(0, 0, 0, 0.5);
    }

    aside.sidebar.open {
        transform: translateX(0);
    }

    .sidebar-header {
        display: flex;
    }

    main.content {
        margin-left: 0;
        width: 100%;
        padding-left: 20px;
        padding-right: 20px;
    }

    footer {
        flex-direction: column;
        gap: 8px;
        text-align: center;
    }
}

/* ================================
   FOOTER
================================ */

footer {
    display: flex;

    justify-content: center;

    gap: 10px;

    width: 100%;

    margin-top: 50px;
    padding-top: 25px;

    border-top: 1px solid var(--border);

    color: #555;

    font-family: "Courier New", monospace;

    font-size: 11px;
}

.footer-main {
    display: flex;

    justify-content: center;
    align-items: center;

    gap: 10px;

    margin-bottom: 15px;
}

.footer-main span:first-child {
    color: var(--green);
}

.footer-links {
    display: flex;

    justify-content: center;

    gap: 20px;
}

.footer-links a {
    color: #555;

    text-decoration: none;

    transition: color 0.2s ease;
}

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

/* Banner de Consentimento de Cookies */
.cookie-banner {
    position: fixed;
    bottom: 20px;
    right: 20px;
    left: 20px;
    max-width: 500px;
    margin: 0 auto;
    background-color: #161b22;
    border: 1px solid #30363d;
    border-radius: 8px;
    padding: 16px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.5);
    z-index: 9999;
    font-size: 0.9rem;
    color: #c9d1d9;
}

.cookie-content p {
    margin: 0 0 12px 0;
    line-height: 1.4;
}

.cookie-content a {
    color: #58a6ff;
    text-decoration: underline;
}

.cookie-buttons {
    display: flex;
    justify-content: flex-end;
    gap: 10px;
}

.btn-cookie {
    padding: 6px 14px;
    border-radius: 6px;
    font-size: 0.85rem;
    cursor: pointer;
    border: 1px solid transparent;
    font-weight: 600;
}

.btn-accept {
    background-color: #238636;
    color: #ffffff;
    border-color: rgba(240, 246, 252, 0.1);
}

.btn-accept:hover {
    background-color: #2ea043;
}

.btn-reject {
    background-color: #21262d;
    color: #c9d1d9;
    border-color: #30363d;
}

.btn-reject:hover {
    background-color: #30363d;
}

/* ======================== 
    Listas 
===========================*/
.obs {
    margin-bottom: 16px;
    color: var(--text-secondary);
}

ul {
    list-style: none;
    padding: 0;
}

li {
    margin-bottom: 8px;
    font-family: sans-serif;
    font-size: smaller;
}

strong {
    color: #0066cc;
}
