@import url('https://fonts.googleapis.com/css2?family=Inter:wght@300;400;500;600;700;800&family=Fira+Code:wght@400;500&display=swap');

:root {
    /* Light Theme Variables */
    --bg-main: #f8fafc;
    --bg-card: #ffffff;
    --bg-sidebar: #ffffff;
    --bg-header: rgba(255, 255, 255, 0.8);
    --bg-code: #0f172a;
    --bg-inline-code: #f1f5f9;
    --bg-hover: #f1f5f9;
    --bg-active: #e0e7ff;
    
    --text-main: #334155;
    --text-heading: #0f172a;
    --text-muted: #64748b;
    --text-code: #f8fafc;
    --text-inline-code: #0f172a;
    
    --border-color: #e2e8f0;
    --border-hover: #cbd5e1;
    
    --accent-primary: #6366f1;
    --accent-hover: #4f46e5;
    --accent-light: #e0e7ff;
    
    /* Callout Colors */
    --tip-bg: #f0fdf4;
    --tip-border: #22c55e;
    --tip-text: #166534;
    
    --note-bg: #eff6ff;
    --note-border: #3b82f6;
    --note-text: #1e3a8a;
    
    --warning-bg: #fffbeb;
    --warning-border: #f59e0b;
    --warning-text: #92400e;
    
    --important-bg: #fef2f2;
    --important-border: #ef4444;
    --important-text: #991b1b;
    
    --shadow-sm: 0 1px 2px 0 rgba(0, 0, 0, 0.05);
    --shadow-md: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -1px rgba(0, 0, 0, 0.06);
    --shadow-lg: 0 10px 15px -3px rgba(0, 0, 0, 0.1), 0 4px 6px -2px rgba(0, 0, 0, 0.05);
    --radius-sm: 6px;
    --radius-md: 12px;
    --radius-lg: 16px;
    
    --sidebar-width: 280px;
    --header-height: 70px;
}

[data-theme="dark"] {
    /* Dark Theme Variables */
    --bg-main: #0f172a;
    --bg-card: #1e293b;
    --bg-sidebar: #1e293b;
    --bg-header: rgba(30, 41, 59, 0.8);
    --bg-code: #0b0f19;
    --bg-inline-code: #334155;
    --bg-hover: #334155;
    --bg-active: rgba(99, 102, 241, 0.2);
    
    --text-main: #cbd5e1;
    --text-heading: #f8fafc;
    --text-muted: #94a3b8;
    --text-code: #f8fafc;
    --text-inline-code: #f8fafc;
    
    --border-color: #334155;
    --border-hover: #475569;
    
    --accent-primary: #818cf8;
    --accent-hover: #6366f1;
    --accent-light: rgba(99, 102, 241, 0.2);
    
    /* Callout Colors Dark */
    --tip-bg: rgba(34, 197, 94, 0.1);
    --tip-border: #22c55e;
    --tip-text: #86efac;
    
    --note-bg: rgba(59, 130, 246, 0.1);
    --note-border: #3b82f6;
    --note-text: #93c5fd;
    
    --warning-bg: rgba(245, 158, 11, 0.1);
    --warning-border: #f59e0b;
    --warning-text: #fcd34d;
    
    --important-bg: rgba(239, 68, 68, 0.1);
    --important-border: #ef4444;
    --important-text: #fca5a5;
    
    --shadow-md: 0 4px 6px -1px rgba(0, 0, 0, 0.3), 0 2px 4px -1px rgba(0, 0, 0, 0.2);
    --shadow-lg: 0 10px 15px -3px rgba(0, 0, 0, 0.4), 0 4px 6px -2px rgba(0, 0, 0, 0.2);
}

* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
    transition: background-color 0.3s ease, border-color 0.3s ease, color 0.3s ease;
}

body {
    font-family: 'Inter', sans-serif;
    background-color: var(--bg-main);
    color: var(--text-main);
    line-height: 1.6;
    font-size: 16px;
    display: flex;
    min-height: 100vh;
    overflow-x: hidden;
}

/* Header */
.doc-header {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    height: var(--header-height);
    background: var(--bg-header);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border-bottom: 1px solid var(--border-color);
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 32px;
    z-index: 100;
}

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

.logo-container {
    display: flex;
    align-items: center;
    gap: 12px;
    text-decoration: none;
}

.logo-icon {
    width: 40px;
    height: 40px;
    background: linear-gradient(135deg, #25D366, #128C7E);
    border-radius: var(--radius-sm);
    display: flex;
    align-items: center;
    justify-content: center;
    color: #fff;
    font-size: 24px;
    box-shadow: var(--shadow-sm);
}

.logo-text {
    font-size: 20px;
    font-weight: 700;
    color: var(--text-heading);
    letter-spacing: -0.5px;
}

.logo-badge {
    background: linear-gradient(135deg, var(--accent-primary), var(--accent-hover));
    color: #fff;
    font-size: 11px;
    font-weight: 800;
    padding: 4px 8px;
    border-radius: 20px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.header-right {
    display: flex;
    align-items: center;
    gap: 20px;
}

.search-box {
    position: relative;
    width: 260px;
}

.search-box input {
    width: 100%;
    padding: 10px 16px 10px 40px;
    border-radius: 20px;
    border: 1px solid var(--border-color);
    background-color: var(--bg-card);
    color: var(--text-main);
    font-size: 14px;
    outline: none;
    transition: all 0.2s ease;
}

.search-box input:focus {
    border-color: var(--accent-primary);
    box-shadow: 0 0 0 3px var(--accent-light);
}

.search-icon {
    position: absolute;
    left: 14px;
    top: 50%;
    transform: translateY(-50%);
    color: var(--text-muted);
    pointer-events: none;
}

.theme-toggle {
    background: var(--bg-hover);
    border: 1px solid var(--border-color);
    width: 42px;
    height: 42px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--text-heading);
    cursor: pointer;
    transition: all 0.2s ease;
}

.theme-toggle:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow-sm);
}

.nav-toggle-btn {
    display: none;
    background: none;
    border: none;
    font-size: 24px;
    color: var(--text-heading);
    cursor: pointer;
}

/* Sidebar */
.doc-sidebar {
    position: fixed;
    top: var(--header-height);
    left: 0;
    bottom: 0;
    width: var(--sidebar-width);
    background-color: var(--bg-sidebar);
    border-right: 1px solid var(--border-color);
    padding: 24px 16px;
    overflow-y: auto;
    z-index: 90;
}

.sidebar-nav {
    list-style: none;
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.nav-item {
    border-radius: var(--radius-sm);
    overflow: hidden;
}

.nav-link {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 10px 16px;
    color: var(--text-muted);
    text-decoration: none;
    font-weight: 500;
    font-size: 15px;
    border-radius: var(--radius-sm);
    transition: all 0.2s ease;
}

.nav-link:hover {
    color: var(--accent-primary);
    background-color: var(--bg-hover);
}

.nav-link.active {
    color: var(--accent-primary);
    background-color: var(--accent-light);
    font-weight: 600;
}

.nav-link i {
    font-size: 18px;
    width: 20px;
}

/* Main Content */
.doc-main {
    flex: 1;
    margin-left: var(--sidebar-width);
    margin-top: var(--header-height);
    padding: 48px 64px;
    max-width: 1200px;
}

/* Section Styling */
.doc-section {
    margin-bottom: 64px;
    scroll-margin-top: calc(var(--header-height) + 32px);
}

h1, h2, h3, h4 {
    color: var(--text-heading);
    font-weight: 700;
    letter-spacing: -0.5px;
}

h1 {
    font-size: 36px;
    margin-bottom: 16px;
    line-height: 1.2;
}

h2 {
    font-size: 28px;
    margin-top: 48px;
    margin-bottom: 24px;
    padding-bottom: 12px;
    border-bottom: 1px solid var(--border-color);
}

h3 {
    font-size: 20px;
    margin-top: 32px;
    margin-bottom: 16px;
}

p {
    margin-bottom: 16px;
}

a {
    color: var(--accent-primary);
    text-decoration: none;
    font-weight: 500;
}

a:hover {
    text-decoration: underline;
}

ul, ol {
    margin-bottom: 24px;
    padding-left: 24px;
}

li {
    margin-bottom: 8px;
}

/* Premium Cards */
.card {
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    padding: 32px;
    margin-bottom: 32px;
    box-shadow: var(--shadow-sm);
    transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.card:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow-md);
}

.card-title {
    font-size: 22px;
    margin-bottom: 16px;
    display: flex;
    align-items: center;
    gap: 12px;
}

/* Callout Alerts */
.callout {
    display: flex;
    gap: 16px;
    padding: 20px 24px;
    border-radius: var(--radius-md);
    border-left: 5px solid;
    margin: 24px 0;
    font-size: 15px;
}

.callout i {
    font-size: 24px;
    flex-shrink: 0;
}

.callout-title {
    font-weight: 700;
    margin-bottom: 6px;
    font-size: 16px;
}

.callout-tip {
    background-color: var(--tip-bg);
    border-left-color: var(--tip-border);
    color: var(--tip-text);
}

.callout-note {
    background-color: var(--note-bg);
    border-left-color: var(--note-border);
    color: var(--note-text);
}

.callout-warning {
    background-color: var(--warning-bg);
    border-left-color: var(--warning-border);
    color: var(--warning-text);
}

.callout-important {
    background-color: var(--important-bg);
    border-left-color: var(--important-border);
    color: var(--important-text);
}

/* Code & Snippets */
code {
    font-family: 'Fira Code', monospace;
    background-color: var(--bg-inline-code);
    color: var(--text-inline-code);
    padding: 3px 6px;
    border-radius: 4px;
    font-size: 14px;
}

pre {
    background-color: var(--bg-code);
    border-radius: var(--radius-md);
    padding: 20px;
    overflow-x: auto;
    margin: 24px 0;
    position: relative;
    box-shadow: var(--shadow-md);
}

pre code {
    background: none;
    color: var(--text-code);
    padding: 0;
    font-size: 14px;
    line-height: 1.5;
}

.copy-btn {
    position: absolute;
    top: 12px;
    right: 12px;
    background: rgba(255, 255, 255, 0.1);
    border: 1px solid rgba(255, 255, 255, 0.2);
    color: #fff;
    padding: 6px 12px;
    border-radius: var(--radius-sm);
    font-size: 12px;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 6px;
    transition: all 0.2s ease;
}

.copy-btn:hover {
    background: rgba(255, 255, 255, 0.2);
}

/* Screenshots */
.doc-screenshot {
    max-width: 100%;
    height: auto;
    border-radius: var(--radius-md);
    border: 1px solid var(--border-color);
    box-shadow: var(--shadow-md);
    margin: 24px 0;
    display: block;
    transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.doc-screenshot:hover {
    transform: scale(1.01);
    box-shadow: var(--shadow-lg);
}

/* Gateway Tabs */
.tabs-container {
    margin: 32px 0;
}

.tabs-header {
    display: flex;
    gap: 8px;
    border-bottom: 1px solid var(--border-color);
    padding-bottom: 0;
    margin-bottom: 24px;
    overflow-x: auto;
}

.tab-btn {
    background: none;
    border: none;
    padding: 14px 24px;
    font-size: 16px;
    font-weight: 600;
    color: var(--text-muted);
    cursor: pointer;
    border-bottom: 3px solid transparent;
    display: flex;
    align-items: center;
    gap: 10px;
    transition: all 0.2s ease;
}

.tab-btn:hover {
    color: var(--accent-primary);
    background-color: var(--bg-hover);
    border-radius: var(--radius-sm) var(--radius-sm) 0 0;
}

.tab-btn.active {
    color: var(--accent-primary);
    border-bottom-color: var(--accent-primary);
}

.tab-content {
    display: none;
    animation: fadeIn 0.3s ease;
}

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

@keyframes fadeIn {
    from { opacity: 0; transform: translateY(8px); }
    to { opacity: 1; transform: translateY(0); }
}

/* Variable Chips */
.chips-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
    gap: 16px;
    margin: 24px 0;
}

.chip-card {
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    padding: 16px 20px;
    border-radius: var(--radius-sm);
    display: flex;
    align-items: center;
    justify-content: space-between;
    box-shadow: var(--shadow-sm);
}

.chip-tag {
    font-family: 'Fira Code', monospace;
    font-weight: 700;
    color: var(--accent-primary);
    background: var(--accent-light);
    padding: 4px 10px;
    border-radius: 4px;
    font-size: 14px;
}

.chip-label {
    font-weight: 600;
    color: var(--text-heading);
    font-size: 15px;
}

/* Steps Grid */
.steps-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 24px;
    margin: 32px 0;
}

.step-card {
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    padding: 28px;
    border-radius: var(--radius-md);
    position: relative;
}

.step-num {
    position: absolute;
    top: -16px;
    left: 28px;
    background: linear-gradient(135deg, var(--accent-primary), var(--accent-hover));
    color: #fff;
    width: 36px;
    height: 36px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 800;
    font-size: 16px;
    box-shadow: var(--shadow-md);
}

.step-card h4 {
    margin-top: 8px;
    margin-bottom: 12px;
    font-size: 18px;
}

/* Accordion / FAQ */
.faq-container {
    display: flex;
    flex-direction: column;
    gap: 16px;
    margin: 32px 0;
}

.faq-item {
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    overflow: hidden;
}

.faq-header {
    padding: 20px 24px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    cursor: pointer;
    font-weight: 600;
    font-size: 17px;
    color: var(--text-heading);
}

.faq-header i {
    transition: transform 0.3s ease;
}

.faq-item.active .faq-header i {
    transform: rotate(180deg);
}

.faq-body {
    padding: 0 24px 20px 24px;
    display: none;
    color: var(--text-muted);
}

.faq-item.active .faq-body {
    display: block;
    animation: fadeIn 0.3s ease;
}

/* Footer */
.doc-footer {
    margin-top: 80px;
    padding-top: 32px;
    border-top: 1px solid var(--border-color);
    display: flex;
    align-items: center;
    justify-content: space-between;
    color: var(--text-muted);
    font-size: 14px;
}

/* Responsive */
@media (max-width: 1024px) {
    .doc-sidebar {
        transform: translateX(-100%);
        transition: transform 0.3s ease;
    }
    
    .doc-sidebar.active {
        transform: translateX(0);
    }
    
    .doc-main {
        margin-left: 0;
        padding: 32px 24px;
    }
    
    .nav-toggle-btn {
        display: block;
    }
}
