/* VendTunnel Documentation Styles */
/* Inspired by Fly.io and Tailscale docs */

:root {
    --accent: #0ea5e9;
    --accent-hover: #0284c7;
    --bg-primary: #ffffff;
    --bg-secondary: #f8fafc;
    --bg-tertiary: #f1f5f9;
    --bg-code: #1e293b;
    --border: #e2e8f0;
    --text-primary: #0f172a;
    --text-secondary: #64748b;
    --text-muted: #94a3b8;
    --success: #10b981;
    --warning: #f59e0b;
    --radius: 8px;
    --sidebar-width: 260px;
    --content-max-width: 800px;
}

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

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

/* Layout */
.docs-layout {
    display: flex;
    min-height: 100vh;
}

/* Sidebar */
.docs-sidebar {
    width: var(--sidebar-width);
    background: var(--bg-secondary);
    border-right: 1px solid var(--border);
    padding: 24px 0;
    position: fixed;
    top: 0;
    left: 0;
    height: 100vh;
    overflow-y: auto;
    z-index: 100;
}

.sidebar-logo {
    padding: 0 24px 24px;
    border-bottom: 1px solid var(--border);
    margin-bottom: 16px;
}

.sidebar-logo a {
    font-size: 1.25rem;
    font-weight: 700;
    color: var(--text-primary);
    text-decoration: none;
    display: flex;
    align-items: center;
    gap: 8px;
}

.sidebar-logo span {
    color: var(--accent);
}

.sidebar-nav {
    padding: 0 12px;
}

.nav-section {
    margin-bottom: 24px;
}

.nav-section-title {
    font-size: 0.75rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: var(--text-muted);
    padding: 8px 12px;
}

.nav-section ul {
    list-style: none;
}

.nav-section li a {
    display: block;
    padding: 8px 12px;
    color: var(--text-secondary);
    text-decoration: none;
    font-size: 0.9rem;
    border-radius: var(--radius);
    transition: all 0.15s ease;
}

.nav-section li a:hover {
    color: var(--text-primary);
    background: var(--bg-tertiary);
}

.nav-section li a.active {
    color: var(--accent);
    background: rgba(14, 165, 233, 0.1);
    font-weight: 500;
}

.nav-section li.nav-child a {
    padding-left: 28px;
    font-size: 0.85rem;
}

/* Main Content */
.docs-main {
    flex: 1;
    margin-left: var(--sidebar-width);
    min-width: 0;
}

.docs-header {
    background: var(--bg-primary);
    border-bottom: 1px solid var(--border);
    padding: 16px 32px;
    position: sticky;
    top: 0;
    z-index: 50;
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.docs-header-nav {
    display: flex;
    gap: 24px;
}

.docs-header-nav a {
    color: var(--text-secondary);
    text-decoration: none;
    font-size: 0.9rem;
    font-weight: 500;
    transition: color 0.15s;
}

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

.docs-content {
    max-width: var(--content-max-width);
    padding: 48px 32px;
    margin: 0 auto;
}

/* Typography */
h1 {
    font-size: 2.25rem;
    font-weight: 700;
    line-height: 1.2;
    margin-bottom: 16px;
    color: var(--text-primary);
}

h2 {
    font-size: 1.5rem;
    font-weight: 600;
    line-height: 1.3;
    margin-top: 48px;
    margin-bottom: 16px;
    padding-bottom: 8px;
    border-bottom: 1px solid var(--border);
}

h3 {
    font-size: 1.25rem;
    font-weight: 600;
    margin-top: 32px;
    margin-bottom: 12px;
}

h4 {
    font-size: 1rem;
    font-weight: 600;
    margin-top: 24px;
    margin-bottom: 8px;
}

p {
    margin-bottom: 16px;
}

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

/* Links */
a {
    color: var(--accent);
    text-decoration: none;
}

a:hover {
    text-decoration: underline;
}

/* Lists */
ul, ol {
    margin-bottom: 16px;
    padding-left: 24px;
}

li {
    margin-bottom: 8px;
}

/* Code */
code {
    font-family: 'JetBrains Mono', 'Fira Code', monospace;
    font-size: 0.875em;
    background: var(--bg-tertiary);
    padding: 2px 6px;
    border-radius: 4px;
    color: var(--text-primary);
}

pre {
    background: var(--bg-code);
    color: #e2e8f0;
    padding: 20px;
    border-radius: var(--radius);
    overflow-x: auto;
    margin-bottom: 24px;
    font-size: 0.875rem;
    line-height: 1.6;
}

pre code {
    background: none;
    padding: 0;
    color: inherit;
}

/* Tables */
table {
    width: 100%;
    border-collapse: collapse;
    margin-bottom: 24px;
    font-size: 0.9rem;
}

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

th {
    background: var(--bg-secondary);
    font-weight: 600;
    font-size: 0.8rem;
    text-transform: uppercase;
    letter-spacing: 0.03em;
    color: var(--text-secondary);
}

tr:hover {
    background: var(--bg-secondary);
}

/* Cards */
.card-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 20px;
    margin-bottom: 32px;
}

.card {
    background: var(--bg-primary);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 24px;
    transition: all 0.2s ease;
}

.card:hover {
    border-color: var(--accent);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.05);
}

.card h3 {
    margin-top: 0;
    margin-bottom: 8px;
}

.card p {
    color: var(--text-secondary);
    font-size: 0.9rem;
    margin-bottom: 16px;
}

.card a {
    font-weight: 500;
}

/* Callouts */
.callout {
    padding: 16px 20px;
    border-radius: var(--radius);
    margin-bottom: 24px;
    border-left: 4px solid;
}

.callout-info {
    background: rgba(14, 165, 233, 0.1);
    border-color: var(--accent);
}

.callout-success {
    background: rgba(16, 185, 129, 0.1);
    border-color: var(--success);
}

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

.callout-title {
    font-weight: 600;
    margin-bottom: 8px;
    display: flex;
    align-items: center;
    gap: 8px;
}

.callout p:last-child {
    margin-bottom: 0;
}

/* Steps */
.steps {
    counter-reset: step;
    margin-bottom: 32px;
}

.step {
    position: relative;
    padding-left: 48px;
    padding-bottom: 24px;
    border-left: 2px solid var(--border);
    margin-left: 16px;
}

.step:last-child {
    border-left: none;
    padding-bottom: 0;
}

.step::before {
    counter-increment: step;
    content: counter(step);
    position: absolute;
    left: -17px;
    top: 0;
    width: 32px;
    height: 32px;
    background: var(--accent);
    color: white;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 600;
    font-size: 0.875rem;
}

.step h4 {
    margin-top: 0;
}

/* Comparison Table */
.comparison-highlight {
    background: rgba(16, 185, 129, 0.1);
    font-weight: 600;
    color: var(--success);
}

/* Pricing Cards */
.pricing-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 16px;
    margin-bottom: 32px;
}

.pricing-card {
    background: var(--bg-primary);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 24px;
    text-align: center;
}

.pricing-card.featured {
    border-color: var(--accent);
    box-shadow: 0 0 0 1px var(--accent);
}

.pricing-card h4 {
    margin-top: 0;
    text-transform: uppercase;
    font-size: 0.75rem;
    letter-spacing: 0.05em;
    color: var(--text-muted);
}

.pricing-card .price {
    font-size: 2rem;
    font-weight: 700;
    color: var(--text-primary);
    margin: 8px 0;
}

.pricing-card .duration {
    color: var(--text-secondary);
    font-size: 0.9rem;
}

/* Breadcrumb */
.breadcrumb {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 0.875rem;
    color: var(--text-muted);
    margin-bottom: 24px;
}

.breadcrumb a {
    color: var(--text-secondary);
}

.breadcrumb span {
    color: var(--text-primary);
}

/* Mobile Sidebar Toggle */
.sidebar-toggle {
    display: none;
    position: fixed;
    bottom: 24px;
    right: 24px;
    width: 56px;
    height: 56px;
    background: var(--accent);
    color: white;
    border: none;
    border-radius: 50%;
    cursor: pointer;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
    z-index: 200;
    font-size: 1.5rem;
}

/* Responsive */
@media (max-width: 1024px) {
    .docs-sidebar {
        transform: translateX(-100%);
        transition: transform 0.3s ease;
    }

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

    .docs-main {
        margin-left: 0;
    }

    .sidebar-toggle {
        display: flex;
        align-items: center;
        justify-content: center;
    }

    .docs-content {
        padding: 32px 20px;
    }
}

@media (max-width: 640px) {
    h1 {
        font-size: 1.75rem;
    }

    h2 {
        font-size: 1.25rem;
    }

    .card-grid {
        grid-template-columns: 1fr;
    }

    .pricing-grid {
        grid-template-columns: 1fr;
    }

    table {
        font-size: 0.8rem;
    }

    th, td {
        padding: 8px 12px;
    }
}

/* Hero section for landing */
.docs-hero {
    text-align: center;
    padding: 48px 0;
    border-bottom: 1px solid var(--border);
    margin-bottom: 48px;
}

.docs-hero h1 {
    margin-bottom: 12px;
}

.docs-hero .lead {
    max-width: 600px;
    margin: 0 auto;
}

/* Feature badges */
.badge {
    display: inline-block;
    padding: 4px 10px;
    font-size: 0.75rem;
    font-weight: 600;
    border-radius: 100px;
    text-transform: uppercase;
    letter-spacing: 0.03em;
}

.badge-success {
    background: rgba(16, 185, 129, 0.15);
    color: #059669;
}

.badge-accent {
    background: rgba(14, 165, 233, 0.15);
    color: var(--accent);
}

/* Config block styling */
.config-block {
    background: var(--bg-code);
    border-radius: var(--radius);
    overflow: hidden;
    margin-bottom: 24px;
}

.config-block-header {
    background: rgba(255, 255, 255, 0.05);
    padding: 12px 20px;
    font-size: 0.8rem;
    color: var(--text-muted);
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
    font-family: 'JetBrains Mono', monospace;
}

.config-block pre {
    margin: 0;
    border-radius: 0;
}
