:root {
    --primary: #4f46e5;
    --primary-hover: #4338ca;
    --bg-main: #f8fafc;
    --sidebar-bg: #ffffff;
    --header-bg: #ffffff;
    --card-bg: #ffffff;
    --text-main: #1e293b;
    --text-muted: #64748b;
    --border-color: #e2e8f0;
    --code-bg: #0f172a;
    --code-text: #e2e8f0;
    --sidebar-width: 280px;
    --header-height: 64px;
    --shadow: 0 4px 6px -1px rgb(0 0 0 / 0.05);
    --transition: all 0.2s ease-in-out;
}

* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

html {
    scroll-behavior: smooth;
}

body {
    font-family: 'Inter', sans-serif;
    background-color: var(--bg-main);
    color: var(--text-main);
    line-height: 1.6;
}

/* Master Grid Structure */
.docs-wrapper {
    display: flex;
    min-height: 100vh;
}

/* Sidebar Styling */
.docs-sidebar {
    width: var(--sidebar-width);
    background-color: var(--sidebar-bg);
    border-right: 1px solid var(--border-color);
    position: fixed;
    top: 0;
    bottom: 0;
    left: 0;
    display: flex;
    flex-direction: column;
    z-index: 100;
    transition: transform 0.3s ease;
}

.sidebar-header {
    padding: 1.5rem;
    border-bottom: 1px solid var(--border-color);
}

.logo-area {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    margin-bottom: 1rem;
}

.logo-area h2 {
    font-size: 1.25rem;
    font-weight: 700;
}

.search-box input {
    width: 100%;
    padding: 0.5rem 0.75rem;
    border: 1px solid var(--border-color);
    border-radius: 6px;
    background: var(--bg-main);
    font-size: 0.9rem;
    color: var(--text-main);
    outline: none;
    transition: var(--transition);
}

.search-box input:focus {
    border-color: var(--primary);
    box-shadow: 0 0 0 2px rgba(79, 70, 229, 0.1);
}

.sidebar-nav {
    flex: 1;
    overflow-y: auto;
    padding: 1.5rem 0;
}

.sidebar-nav ul {
    list-style: none;
    display: flex;
    flex-direction: column;
    gap: 0.25rem;
}

.sidebar-nav a {
    display: block;
    padding: 0.6rem 1.5rem;
    color: var(--text-muted);
    text-decoration: none;
    font-size: 0.95rem;
    font-weight: 500;
    border-left: 3px solid transparent;
    transition: var(--transition);
}

.sidebar-nav a:hover, .sidebar-nav a.active {
    color: var(--primary);
    background-color: #f1f5f9;
    border-left-color: var(--primary);
}

/* Main Display Container */
.docs-main-container {
    margin-left: var(--sidebar-width);
    flex: 1;
    display: flex;
    flex-direction: column;
}

/* Top Header */
.docs-header {
    height: var(--header-height);
    background-color: var(--header-bg);
    border-bottom: 1px solid var(--border-color);
    position: sticky;
    top: 0;
    z-index: 90;
    display: flex;
    align-items: center;
}

.header-content {
    width: 100%;
    padding: 0 2.5rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.menu-toggle {
    display: none;
    background: none;
    border: none;
    font-size: 1.25rem;
    cursor: pointer;
    color: var(--text-main);
}

.current-title {
    font-weight: 600;
    color: var(--text-muted);
}

.header-links {
    display: flex;
    gap: 1.5rem;
}

.header-links a {
    text-decoration: none;
    color: var(--text-muted);
    font-size: 0.9rem;
    font-weight: 500;
    transition: var(--transition);
}

.header-links a:hover {
    color: var(--primary);
}

/* Content Body */
.docs-content {
    padding: 3rem 2.5rem;
    max-width: 900px;
    flex: 1;
}

.doc-section {
    margin-bottom: 3.5rem;
    scroll-margin-top: calc(var(--header-height) + 2rem);
}

.doc-section h1 {
    font-size: 2.25rem;
    margin-bottom: 1rem;
}

.doc-section h2 {
    font-size: 1.75rem;
    margin-bottom: 1rem;
    padding-bottom: 0.5rem;
    border-bottom: 1px solid var(--border-color);
}

.doc-section p {
    color: var(--text-muted);
    margin-bottom: 1rem;
    font-size: 1.05rem;
}

.doc-section ul {
    margin-bottom: 1.5rem;
    padding-left: 1.5rem;
    color: var(--text-muted);
}

.doc-section li {
    margin-bottom: 0.5rem;
}

/* Info Boxes & Code Blocks */
.info-box {
    background-color: #eff6ff;
    border-left: 4px solid var(--primary);
    padding: 1rem 1.25rem;
    border-radius: 0 8px 8px 0;
    color: #1e3a8a;
    font-size: 0.95rem;
    margin-top: 1.5rem;
}

.code-box {
    background: var(--code-bg);
    color: var(--code-text);
    border-radius: 8px;
    padding: 1.25rem;
    font-family: 'Fira Code', monospace;
    font-size: 0.9rem;
    position: relative;
    display: flex;
    justify-content: space-between;
    align-items: center;
    overflow-x: auto;
    margin: 1.25rem 0;
    box-shadow: var(--shadow);
}

.code-box code {
    white-space: pre-wrap;
}

.copy-btn {
    background: rgba(255, 255, 255, 0.1);
    color: white;
    border: none;
    padding: 0.35rem 0.75rem;
    border-radius: 6px;
    cursor: pointer;
    font-size: 0.8rem;
    transition: var(--transition);
}

.copy-btn:hover {
    background: rgba(255, 255, 255, 0.25);
}

/* API Tables */
.api-method {
    margin-top: 1.5rem;
}

.api-method h3 {
    font-size: 1.1rem;
    margin-bottom: 0.5rem;
    font-family: 'Fira Code', monospace;
}

.api-table {
    width: 100%;
    border-collapse: collapse;
    margin-top: 0.75rem;
    background: var(--card-bg);
    border: 1px solid var(--border-color);
    border-radius: 8px;
    overflow: hidden;
}

.api-table th, .api-table td {
    padding: 0.75rem 1rem;
    text-align: left;
    border-bottom: 1px solid var(--border-color);
    font-size: 0.9rem;
}

.api-table th {
    background: #f1f5f9;
    color: var(--text-main);
    font-weight: 600;
}

.api-table td {
    color: var(--text-muted);
}

.api-table tr:last-child td {
    border-bottom: none;
}

/* FAQ Items */
.faq-item {
    margin-bottom: 1.5rem;
}

.faq-item h4 {
    font-size: 1.05rem;
    margin-bottom: 0.3rem;
    color: var(--text-main);
}

/* Footer */
.docs-footer {
    border-top: 1px solid var(--border-color);
    padding-top: 2rem;
    margin-top: 4rem;
    color: var(--text-muted);
    font-size: 0.85rem;
}

/* Floating Scroll Top */
.top-btn {
    position: fixed;
    bottom: 2rem;
    right: 2rem;
    background: var(--primary);
    color: white;
    border: none;
    width: 42px;
    height: 42px;
    border-radius: 50%;
    cursor: pointer;
    display: none;
    align-items: center;
    justify-content: center;
    box-shadow: 0 4px 12px rgba(79, 70, 229, 0.3);
    transition: var(--transition);
    z-index: 99;
}

.top-btn:hover {
    background: var(--primary-hover);
    transform: translateY(-2px);
}

/* Responsive Scaling */
@media (max-width: 1024px) {
    .docs-sidebar {
        transform: translateX(-100%);
    }
    .docs-sidebar.active {
        transform: translateX(0);
    }
    .docs-main-container {
        margin-left: 0;
    }
    .menu-toggle {
        display: block;
    }
    .docs-content {
        padding: 2rem 1.5rem;
    }
    .header-content {
        padding: 0 1.5rem;
    }
}