/* Reset & Base Styles */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

:root {
    --primary: #6366f1;
    --primary-dark: #4f46e5;
    --secondary: #8b5cf6;
    --success: #10b981;
    --warning: #f59e0b;
    --error: #ef4444;
    --bg-dark: #0f172a;
    --bg-darker: #020617;
    --bg-light: #1e293b;
    --text-primary: #f1f5f9;
    --text-secondary: #94a3b8;
    --border: #334155;
    --code-bg: #1e293b;
}

body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
    background: var(--bg-dark);
    color: var(--text-primary);
    line-height: 1.6;
}

.container {
    max-width: 1400px;
    margin: 0 auto;
    padding: 0 2rem;
}

/* Header */
.header {
    background: var(--bg-darker);
    border-bottom: 1px solid var(--border);
    padding: 1.5rem 0;
    position: sticky;
    top: 0;
    z-index: 100;
}

.header .container {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

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

.logo h1 {
    font-size: 1.5rem;
    font-weight: 700;
    background: linear-gradient(135deg, var(--primary), var(--secondary));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
}

.version {
    background: var(--primary);
    color: white;
    padding: 0.25rem 0.75rem;
    border-radius: 9999px;
    font-size: 0.75rem;
    font-weight: 600;
}

.header-nav {
    display: flex;
    gap: 2rem;
    align-items: center;
}

.header-nav a {
    color: var(--text-secondary);
    text-decoration: none;
    font-weight: 500;
    transition: color 0.3s;
}

.header-nav a:hover {
    color: var(--primary);
}

.btn-sandbox {
    background: var(--primary);
    color: white !important;
    padding: 0.5rem 1.5rem;
    border-radius: 0.5rem;
    font-weight: 600;
    transition: background 0.3s;
}

.btn-sandbox:hover {
    background: var(--primary-dark);
}

/* Main Container */
.main-container {
    display: grid;
    grid-template-columns: 280px 1fr;
    gap: 2rem;
    max-width: 1400px;
    margin: 0 auto;
    padding: 2rem;
}

/* Sidebar */
.sidebar {
    position: sticky;
    top: 100px;
    height: calc(100vh - 120px);
    overflow-y: auto;
}

.sidebar-content {
    background: var(--bg-light);
    border: 1px solid var(--border);
    border-radius: 0.75rem;
    padding: 1.5rem;
}

.sidebar-content h3 {
    font-size: 0.875rem;
    font-weight: 700;
    text-transform: uppercase;
    color: var(--text-secondary);
    margin-bottom: 1rem;
}

.nav-menu {
    list-style: none;
}

.nav-menu > li {
    margin-bottom: 0.5rem;
}

.nav-menu a {
    display: block;
    color: var(--text-secondary);
    text-decoration: none;
    padding: 0.5rem 0.75rem;
    border-radius: 0.375rem;
    transition: all 0.3s;
    font-size: 0.875rem;
}

.nav-menu a:hover,
.nav-menu a.active {
    background: var(--primary);
    color: white;
}

.nav-section > span {
    display: block;
    color: var(--text-primary);
    font-weight: 600;
    padding: 0.5rem 0.75rem;
    font-size: 0.875rem;
}

.nav-submenu {
    list-style: none;
    margin-left: 1rem;
    margin-top: 0.25rem;
}

/* Content */
.content {
    max-width: 900px;
}

.section {
    margin-bottom: 4rem;
}

.section h1 {
    font-size: 2.5rem;
    font-weight: 700;
    margin-bottom: 1rem;
    background: linear-gradient(135deg, var(--primary), var(--secondary));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
}

.section h2 {
    font-size: 1.75rem;
    font-weight: 600;
    margin-top: 2rem;
    margin-bottom: 1rem;
    color: var(--text-primary);
}

.section h3 {
    font-size: 1.25rem;
    font-weight: 600;
    margin-top: 1.5rem;
    margin-bottom: 0.75rem;
    color: var(--text-primary);
}

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

.section ul {
    color: var(--text-secondary);
    margin-left: 1.5rem;
    margin-bottom: 1rem;
}

.section ol {
    color: var(--text-secondary);
    margin-left: 1.5rem;
    margin-bottom: 1rem;
}

.lead {
    font-size: 1.125rem;
    color: var(--text-secondary);
}

/* Info Cards */
.info-cards {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 1.5rem;
    margin: 2rem 0;
}

.info-card {
    background: var(--bg-light);
    border: 1px solid var(--border);
    border-radius: 0.75rem;
    padding: 1.5rem;
    text-align: center;
    transition: transform 0.3s, border-color 0.3s;
}

.info-card:hover {
    transform: translateY(-4px);
    border-color: var(--primary);
}

.card-icon {
    font-size: 2.5rem;
    margin-bottom: 0.75rem;
}

.info-card h3 {
    font-size: 1.125rem;
    font-weight: 600;
    margin-bottom: 0.5rem;
    color: var(--text-primary);
}

.info-card p {
    font-size: 0.875rem;
    color: var(--text-secondary);
    margin: 0;
}

/* Alerts */
.alert {
    padding: 1rem 1.25rem;
    border-radius: 0.5rem;
    margin: 1.5rem 0;
    border-left: 4px solid;
}

.alert-info {
    background: rgba(99, 102, 241, 0.1);
    border-color: var(--primary);
    color: var(--text-primary);
}

.alert-warning {
    background: rgba(245, 158, 11, 0.1);
    border-color: var(--warning);
    color: var(--text-primary);
}

.alert strong {
    font-weight: 600;
}

/* Code Blocks */
.code-block {
    background: var(--code-bg);
    border: 1px solid var(--border);
    border-radius: 0.5rem;
    margin: 1.5rem 0;
    overflow: hidden;
}

.code-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0.75rem 1rem;
    background: var(--bg-darker);
    border-bottom: 1px solid var(--border);
}

.code-header span {
    font-size: 0.875rem;
    font-weight: 600;
    color: var(--text-secondary);
}

.copy-btn {
    background: var(--primary);
    color: white;
    border: none;
    padding: 0.375rem 0.875rem;
    border-radius: 0.375rem;
    font-size: 0.75rem;
    font-weight: 600;
    cursor: pointer;
    transition: background 0.3s;
}

.copy-btn:hover {
    background: var(--primary-dark);
}

.copy-btn.copied {
    background: var(--success);
}

.code-block pre {
    margin: 0;
    padding: 1rem;
    overflow-x: auto;
}

.code-block code {
    font-family: 'Fira Code', 'Courier New', monospace;
    font-size: 0.875rem;
    line-height: 1.6;
}

/* Endpoint Card */
.endpoint-card {
    background: var(--bg-light);
    border: 1px solid var(--border);
    border-radius: 0.75rem;
    padding: 1.5rem;
    margin: 1.5rem 0;
}

.endpoint-header {
    display: flex;
    align-items: center;
    gap: 1rem;
    margin-bottom: 0.75rem;
}

.method {
    padding: 0.375rem 0.875rem;
    border-radius: 0.375rem;
    font-size: 0.75rem;
    font-weight: 700;
    text-transform: uppercase;
}

.method-post {
    background: rgba(16, 185, 129, 0.2);
    color: var(--success);
}

.method-get {
    background: rgba(99, 102, 241, 0.2);
    color: var(--primary);
}

.endpoint-url {
    font-family: 'Fira Code', monospace;
    font-size: 0.875rem;
    color: var(--text-primary);
    font-weight: 600;
}

.endpoint-card p {
    margin: 0;
    color: var(--text-secondary);
}

/* Tables */
.params-table {
    width: 100%;
    border-collapse: collapse;
    margin: 1.5rem 0;
    background: var(--bg-light);
    border: 1px solid var(--border);
    border-radius: 0.5rem;
    overflow: hidden;
}

.params-table thead {
    background: var(--bg-darker);
}

.params-table th {
    padding: 0.875rem 1rem;
    text-align: left;
    font-weight: 600;
    font-size: 0.875rem;
    color: var(--text-primary);
    border-bottom: 1px solid var(--border);
}

.params-table td {
    padding: 0.875rem 1rem;
    font-size: 0.875rem;
    color: var(--text-secondary);
    border-bottom: 1px solid var(--border);
}

.params-table tbody tr:last-child td {
    border-bottom: none;
}

.params-table tbody tr:hover {
    background: rgba(99, 102, 241, 0.05);
}

.params-table code {
    background: var(--code-bg);
    padding: 0.25rem 0.5rem;
    border-radius: 0.25rem;
    font-family: 'Fira Code', monospace;
    font-size: 0.875rem;
    color: var(--primary);
}

/* Badges */
.badge {
    padding: 0.25rem 0.75rem;
    border-radius: 9999px;
    font-size: 0.75rem;
    font-weight: 600;
}

.badge-success {
    background: rgba(16, 185, 129, 0.2);
    color: var(--success);
}

.badge-warning {
    background: rgba(245, 158, 11, 0.2);
    color: var(--warning);
}

.badge-error {
    background: rgba(239, 68, 68, 0.2);
    color: var(--error);
}

/* Footer */
.footer {
    background: var(--bg-darker);
    border-top: 1px solid var(--border);
    padding: 2rem 0;
    margin-top: 4rem;
}

.footer .container {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.footer p {
    color: var(--text-secondary);
    margin: 0;
}

.footer-links {
    display: flex;
    gap: 2rem;
}

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

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

/* Scrollbar */
::-webkit-scrollbar {
    width: 8px;
    height: 8px;
}

::-webkit-scrollbar-track {
    background: var(--bg-dark);
}

::-webkit-scrollbar-thumb {
    background: var(--border);
    border-radius: 4px;
}

::-webkit-scrollbar-thumb:hover {
    background: var(--primary);
}

/* Responsive */
@media (max-width: 1024px) {
    .main-container {
        grid-template-columns: 1fr;
    }

    .sidebar {
        position: static;
        height: auto;
    }

    .header-nav {
        gap: 1rem;
    }
}

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

    .main-container {
        padding: 1rem;
    }

    .section h1 {
        font-size: 2rem;
    }

    .info-cards {
        grid-template-columns: 1fr;
    }

    .header .container {
        flex-direction: column;
        gap: 1rem;
    }

    .footer .container {
        flex-direction: column;
        gap: 1rem;
        text-align: center;
    }
}