/* ==========================================================================
   Global Styles & Variables
   ========================================================================== */

:root {
    --bg-color: #111827; /* Tailwind's gray-900 */
    --sidebar-bg: #1f2937; /* Tailwind's gray-800 */
    --header-bg: rgba(31, 41, 55, 0.8);
    --border-color: #374151; /* Tailwind's gray-700 */
    --text-color: #d1d5db; /* Tailwind's gray-300 */
    --text-strong-color: #f9fafb; /* Tailwind's gray-50 */
    --link-color: #818cf8; /* Tailwind's indigo-400 */
    --link-hover-color: #a78bfa; /* Tailwind's violet-400 */
    --accent-color: #6366f1; /* Tailwind's indigo-500 */
    --pre-bg-color: #0d1117;
    --code-text-color: #c9d1d9;
    --font-sans: 'Inter', -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, "Noto Sans", sans-serif;
    --font-mono: 'Fira Code', ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, "Liberation Mono", "Courier New", monospace;
}

body {
    background-color: var(--bg-color);
    color: var(--text-color);
    font-family: var(--font-sans);
    font-size: 16px;
    line-height: 1.6;
    margin: 0;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

h1, h2, h3, h4, h5, h6 {
    color: var(--text-strong-color);
    font-weight: 700;
    line-height: 1.3;
    margin: 1.5em 0 0.5em;
}

h1 { font-size: 2.25rem; }
h2 { font-size: 1.75rem; }
h3 { font-size: 1.25rem; }

p { margin: 0 0 1em; }

a {
    color: var(--link-color);
    text-decoration: none;
    transition: color 0.2s ease;
}

a:hover {
    color: var(--link-hover-color);
    text-decoration: underline;
}

*:focus-visible {
    outline: 2px solid var(--accent-color);
    outline-offset: 2px;
    border-radius: 4px;
}


/* ==========================================================================
   Header
   ========================================================================== */

.doc-header {
    background-color: var(--header-bg);
    backdrop-filter: blur(8px);
    border-bottom: 1px solid var(--border-color);
    padding: 0 1.5rem;
    position: sticky;
    top: 0;
    z-index: 50;
    width: 100%;
    box-sizing: border-box;
}

.header-container {
    display: flex;
    align-items: center;
    justify-content: space-between;
    height: 4rem;
    max-width: 90rem;
    margin: 0 auto;
}

@media (max-width: 767px) {
    .doc-header {
        padding: 0 1rem;
    }
}

.logo {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    font-size: 1.25rem;
    font-weight: 600;
    color: var(--text-strong-color);
}
.logo:hover { text-decoration: none; }

.logo img {
    height: 28px;
    width: 28px;
}

.header-nav {
    display: none;
    gap: 1.5rem;
}

.header-actions {
    display: flex;
    align-items: center;
    gap: 1rem;
}

.search-wrapper {
    display: none; /* Hidden on mobile by default */
    position: relative;
    align-items: center;
}

.search-icon {
    position: absolute;
    left: 0.75rem;
    color: var(--text-color);
    width: 1rem;
    height: 1rem;
}

.search-input {
    background-color: var(--sidebar-bg);
    border: 1px solid var(--border-color);
    border-radius: 8px;
    color: var(--text-strong-color);
    padding: 0.5rem 0.75rem 0.5rem 2.25rem;
    width: 12rem;
    transition: all 0.2s ease;
}
.search-input:focus {
    border-color: var(--accent-color);
    background-color: var(--bg-color);
}

.version-picker {
    display: none; /* Hidden on mobile by default */
    align-items: center;
    gap: 0.25rem;
    background-color: var(--sidebar-bg);
    border: 1px solid var(--border-color);
    padding: 0.5rem 0.75rem;
    border-radius: 8px;
    cursor: pointer;
}

.mobile-menu-toggle, .mobile-menu-close, .docs-nav-toggle {
    background: none;
    border: none;
    color: var(--text-color);
    cursor: pointer;
    padding: 0.5rem;
    display: block; /* Make it visible */
}
.mobile-menu-toggle .lucide, .mobile-menu-close .lucide {
    width: 1.5rem;
    height: 1.5rem;
}

@media (max-width: 767px) {
    .docs-nav-toggle {
        display: block;
    }
}

/* ==========================================================================
   Page Layout & Sidebar
   ========================================================================== */
.page-wrapper {
    display: flex;
    max-width: 90rem;
    margin: 0 auto;
}

.sidebar {
    background-color: var(--bg-color);
    width: 280px;
    flex-shrink: 0;
    border-right: 1px solid var(--border-color);
    height: calc(100vh - 4rem);
    position: fixed;
    top: 4rem;
    left: -280px; /* Hidden by default on mobile */
    transition: left 0.3s ease;
    z-index: 40;
    overflow-y: auto;
}
.sidebar.open {
    left: 0;
}

.sidebar-nav {
    padding: 1.5rem;
}

.sidebar-close-container {
    display: flex;
    justify-content: flex-end;
    margin-bottom: 1rem;
}

.sidebar-nav ul {
    list-style: none;
    padding: 0;
    margin: 0 0 1.5rem;
}

.sidebar-nav .section-title {
    color: var(--text-strong-color);
    font-weight: 600;
    font-size: 0.875rem;
    padding: 0.5rem 0;
    margin-bottom: 0.5rem;
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.sidebar-nav a {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.5rem 1rem;
    border-radius: 6px;
    color: var(--text-color);
    font-weight: 500;
}

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

.sidebar-nav a.active-link {
    background-color: var(--accent-color);
    color: white;
}

.nav-icon {
    width: 1rem;
    height: 1rem;
}


/* ==========================================================================
   Main Content
   ========================================================================== */

.main-content {
    flex-grow: 1;
    padding: 2rem 1.5rem;
}

.content-container {
    max-width: 48rem;
    margin: 0 auto;
}

@media (max-width: 767px) {
    .content-container {
        padding: 0 1rem;
    }
}

.page-title {
    font-size: 2.5rem;
    font-weight: 800;
    letter-spacing: -0.02em;
    margin-top: 0;
}

.page-intro {
    font-size: 1.125rem;
    color: var(--text-color);
    margin-bottom: 3rem;
}

/* ==========================================================================
   Installation Panel & Tabs
   ========================================================================== */

.installation-panel {
    background-color: var(--sidebar-bg);
    border: 1px solid var(--border-color);
    border-radius: 12px;
    padding: 1.5rem;
}

.panel-title {
    font-size: 1.5rem;
    margin-top: 0;
}
.panel-subtitle {
    margin-bottom: 1.5rem;
}

.tabs {
    display: flex;
    border-bottom: 1px solid var(--border-color);
    margin-bottom: 1rem;
}

.tab-button {
    background: none;
    border: none;
    color: var(--text-color);
    padding: 0.75rem 1rem;
    cursor: pointer;
    font-size: 1rem;
    font-weight: 500;
    border-bottom: 2px solid transparent;
    margin-bottom: -1px; /* Overlap border */
}

.tab-button.active {
    color: var(--text-strong-color);
    border-bottom-color: var(--accent-color);
}

.tab-content {
    display: none;
}
.tab-content.active {
    display: block;
}

pre {
    background-color: var(--pre-bg-color);
    border: 1px solid var(--border-color);
    border-radius: 8px;
    padding: 1rem;
    overflow-x: auto;
    font-family: var(--font-mono);
    font-size: 0.9rem;
}

code {
    font-family: var(--font-mono);
    color: var(--code-text-color);
}

.api-endpoint {
    margin-bottom: 2rem;
}

.api-endpoint p {
    margin-bottom: 0.5rem;
    font-weight: 600;
    color: var(--text-strong-color);
}

.code-block-wrapper {
    position: relative;
}

.code-block-wrapper pre {
    padding-right: 40px; /* Space for the button */
}

.copy-button {
    position: absolute;
    top: 50%;
    right: 10px;
    transform: translateY(-50%);
    background: none;
    border: none;
    color: var(--text-color);
    cursor: pointer;
    padding: 5px;
    border-radius: 4px;
}

.copy-button:hover {
    background-color: var(--sidebar-bg);
}

.copy-button .fa-check {
    color: var(--accent-color);
}

/* ==========================================================================
   Responsive Design
   ========================================================================== */

@media (max-width: 767px) {
  body.no-scroll {
    overflow: hidden;
  }

  .main-content {
    padding: 2rem 1rem;
    margin-left: 0;
  }

  .sidebar {
    left: -280px; /* Fully hidden by default */
  }

  .sidebar.open {
    left: 0;
    width: 280px;
  }

  pre {
    white-space: pre-wrap;
    word-wrap: break-word;
  }
}
@media (min-width: 768px) {
    .header-nav {
        display: none; /* Hide on docs pages */
    }
    .mobile-menu-toggle {
        display: none;
    }
    .search-wrapper {
        display: flex;
    }
    .version-picker {
        display: flex;
    }
    .mobile-menu-toggle {
        display: none;
    }
    .sidebar {
        left: 0;
        background-color: var(--sidebar-bg);
    }
    .sidebar-close-container {
        display: none;
    }
    .main-content {
        margin-left: 280px; /* Sidebar width */
        padding: 2.5rem;
    }
}

@media (min-width: 1024px) {
    .main-content {
        padding: 3rem 4rem;
    }
}
