/* ==================== CSS Variables ==================== */
:root {
    /* Colors */
    --primary-color: #6366f1;
    --primary-hover: #4f46e5;
    --primary-light: #818cf8;
    --secondary-color: #10b981;
    --accent-color: #f59e0b;

    --bg-color: #0f172a;
    --bg-secondary: #1e293b;
    --bg-tertiary: #334155;

    --text-color: #f8fafc;
    --text-secondary: #94a3b8;
    --text-muted: #64748b;

    --border-color: #334155;
    --code-bg: #1e293b;

    /* Gradients */
    --gradient-primary: linear-gradient(135deg, #6366f1 0%, #8b5cf6 50%, #a855f7 100%);
    --gradient-hero: linear-gradient(135deg, #1e1b4b 0%, #312e81 50%, #3730a3 100%);

    /* Shadows */
    --shadow-sm: 0 1px 2px 0 rgba(0, 0, 0, 0.3);
    --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.3), 0 4px 6px -2px rgba(0, 0, 0, 0.2);
    --shadow-xl: 0 20px 25px -5px rgba(0, 0, 0, 0.3), 0 10px 10px -5px rgba(0, 0, 0, 0.2);

    /* Spacing */
    --container-max-width: 1200px;
    --section-padding: 100px;

    /* Typography */
    --font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    --font-mono: 'JetBrains Mono', 'Fira Code', monospace;

    /* Transitions */
    --transition-fast: 150ms ease;
    --transition-normal: 300ms ease;

    /* Border Radius */
    --radius-sm: 6px;
    --radius-md: 12px;
    --radius-lg: 16px;
    --radius-xl: 24px;
}

/* ==================== Reset & Base ==================== */
*, *::before, *::after {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

html {
    scroll-behavior: smooth;
}

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

a {
    color: var(--primary-light);
    text-decoration: none;
    transition: color var(--transition-fast);
}

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

img {
    max-width: 100%;
    height: auto;
}

/* ==================== Container ==================== */
.container {
    max-width: var(--container-max-width);
    margin: 0 auto;
    padding: 0 24px;
}

/* ==================== Navigation ==================== */
.navbar {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    z-index: 1000;
    background: rgba(15, 23, 42, 0.85);
    backdrop-filter: blur(12px);
    border-bottom: 1px solid var(--border-color);
}

.navbar .container {
    display: flex;
    align-items: center;
    justify-content: space-between;
    height: 70px;
}

.logo {
    display: flex;
    align-items: center;
    gap: 10px;
    font-weight: 700;
    font-size: 1.25rem;
    color: var(--text-color);
}

.logo:hover {
    color: var(--text-color);
}

.logo-icon {
    font-size: 1.5rem;
}

.nav-links {
    display: flex;
    align-items: center;
    gap: 32px;
}

.nav-links a {
    color: var(--text-secondary);
    font-weight: 500;
    font-size: 0.95rem;
    transition: color var(--transition-fast);
}

.nav-links a:hover,
.nav-links a.active {
    color: var(--text-color);
}

.github-link {
    display: flex;
    align-items: center;
    padding: 8px 16px;
    background: var(--bg-tertiary);
    border-radius: var(--radius-sm);
}

.github-link:hover {
    background: var(--primary-color);
    color: white;
}

.mobile-menu-btn {
    display: none;
    flex-direction: column;
    gap: 5px;
    padding: 10px;
    background: none;
    border: none;
    cursor: pointer;
}

.mobile-menu-btn span {
    display: block;
    width: 24px;
    height: 2px;
    background: var(--text-color);
    transition: var(--transition-normal);
}

/* ==================== Hero Section ==================== */
.hero {
    position: relative;
    min-height: 100vh;
    display: flex;
    align-items: center;
    padding-top: 70px;
    overflow: hidden;
}

.hero-bg {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: var(--gradient-hero);
    opacity: 0.6;
}

.hero-bg::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: radial-gradient(circle at 30% 20%, rgba(99, 102, 241, 0.3) 0%, transparent 50%),
                radial-gradient(circle at 70% 80%, rgba(139, 92, 246, 0.2) 0%, transparent 50%);
}

.hero .container {
    position: relative;
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 60px;
    align-items: center;
    padding-top: 60px;
    padding-bottom: 60px;
}

.hero-content {
    max-width: 600px;
}

.badge {
    display: inline-block;
    padding: 8px 16px;
    background: rgba(99, 102, 241, 0.2);
    border: 1px solid rgba(99, 102, 241, 0.4);
    border-radius: 100px;
    font-size: 0.875rem;
    font-weight: 500;
    color: var(--primary-light);
    margin-bottom: 24px;
}

.hero h1 {
    font-size: 3.5rem;
    font-weight: 700;
    line-height: 1.1;
    margin-bottom: 24px;
    background: linear-gradient(135deg, #fff 0%, #c7d2fe 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.hero-description {
    font-size: 1.25rem;
    color: var(--text-secondary);
    margin-bottom: 32px;
    line-height: 1.7;
}

.hero-buttons {
    display: flex;
    gap: 16px;
    flex-wrap: wrap;
    margin-bottom: 48px;
}

.hero-stats {
    display: flex;
    gap: 48px;
}

.stat {
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.stat-value {
    font-size: 1.25rem;
    font-weight: 600;
    color: var(--text-color);
}

.stat-label {
    font-size: 0.875rem;
    color: var(--text-muted);
}

.hero-code {
    perspective: 1000px;
}

.code-window {
    background: var(--bg-secondary);
    border-radius: var(--radius-lg);
    overflow: hidden;
    box-shadow: var(--shadow-xl);
    transform: rotateY(-5deg) rotateX(5deg);
    transition: transform var(--transition-normal);
}

.code-window:hover {
    transform: rotateY(0) rotateX(0);
}

.code-header {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 16px 20px;
    background: var(--bg-tertiary);
    border-bottom: 1px solid var(--border-color);
}

.code-dots {
    display: flex;
    gap: 8px;
}

.dot {
    width: 12px;
    height: 12px;
    border-radius: 50%;
}

.dot.red { background: #ef4444; }
.dot.yellow { background: #eab308; }
.dot.green { background: #22c55e; }

.code-title {
    font-size: 0.875rem;
    color: var(--text-muted);
}

.code-window pre {
    margin: 0;
    padding: 24px;
    overflow-x: auto;
}

.code-window code {
    font-family: var(--font-mono);
    font-size: 0.9rem;
    line-height: 1.6;
}

/* ==================== Buttons ==================== */
.btn {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 14px 28px;
    font-size: 1rem;
    font-weight: 600;
    border-radius: var(--radius-md);
    cursor: pointer;
    transition: all var(--transition-fast);
    border: none;
}

.btn-primary {
    background: var(--gradient-primary);
    color: white;
    box-shadow: 0 4px 15px rgba(99, 102, 241, 0.4);
}

.btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(99, 102, 241, 0.5);
    color: white;
}

.btn-secondary {
    background: var(--bg-tertiary);
    color: var(--text-color);
    border: 1px solid var(--border-color);
}

.btn-secondary:hover {
    background: var(--bg-secondary);
    color: var(--text-color);
}

.btn-outline {
    background: transparent;
    color: var(--text-color);
    border: 2px solid var(--border-color);
}

.btn-outline:hover {
    border-color: var(--primary-color);
    color: var(--primary-light);
}

.btn-large {
    padding: 18px 36px;
    font-size: 1.1rem;
}

/* ==================== Section Headers ==================== */
.section-header {
    text-align: center;
    max-width: 700px;
    margin: 0 auto 60px;
}

.section-header h2 {
    font-size: 2.5rem;
    font-weight: 700;
    margin-bottom: 16px;
    background: linear-gradient(135deg, #fff 0%, #94a3b8 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.section-header p {
    font-size: 1.2rem;
    color: var(--text-secondary);
}

/* ==================== Features Section ==================== */
.features-section {
    padding: var(--section-padding) 0;
    background: var(--bg-color);
}

.features-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 24px;
}

.feature-card {
    padding: 32px;
    background: var(--bg-secondary);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-lg);
    transition: all var(--transition-normal);
}

.feature-card:hover {
    transform: translateY(-4px);
    border-color: var(--primary-color);
    box-shadow: var(--shadow-lg);
}

.feature-icon {
    font-size: 2.5rem;
    margin-bottom: 20px;
}

.feature-card h3 {
    font-size: 1.2rem;
    font-weight: 600;
    margin-bottom: 12px;
    color: var(--text-color);
}

.feature-card p {
    font-size: 0.95rem;
    color: var(--text-secondary);
    line-height: 1.6;
}

/* ==================== Installation Section ==================== */
.installation-section {
    padding: var(--section-padding) 0;
    background: var(--bg-secondary);
}

.installation-tabs {
    max-width: 700px;
    margin: 0 auto;
}

.tab-buttons {
    display: flex;
    gap: 8px;
    margin-bottom: 20px;
}

.tab-btn {
    padding: 12px 24px;
    background: var(--bg-tertiary);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-sm);
    color: var(--text-secondary);
    font-weight: 500;
    cursor: pointer;
    transition: all var(--transition-fast);
}

.tab-btn:hover {
    color: var(--text-color);
}

.tab-btn.active {
    background: var(--primary-color);
    border-color: var(--primary-color);
    color: white;
}

.tab-pane {
    display: none;
}

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

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

.code-block .code-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 12px 20px;
    background: var(--bg-tertiary);
    border-bottom: 1px solid var(--border-color);
}

.code-block .code-header span {
    font-size: 0.875rem;
    color: var(--text-muted);
}

.copy-btn {
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 6px 12px;
    background: var(--bg-secondary);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-sm);
    color: var(--text-secondary);
    font-size: 0.8rem;
    cursor: pointer;
    transition: all var(--transition-fast);
}

.copy-btn:hover {
    background: var(--primary-color);
    border-color: var(--primary-color);
    color: white;
}

.code-block pre {
    margin: 0;
    padding: 24px;
    overflow-x: auto;
}

.code-block code {
    font-family: var(--font-mono);
    font-size: 0.9rem;
    line-height: 1.6;
}

.code-block.large {
    max-width: 900px;
    margin: 0 auto;
}

/* ==================== Example Section ==================== */
.example-section {
    padding: var(--section-padding) 0;
    background: var(--bg-color);
}

/* ==================== Output Section ==================== */
.output-section {
    padding: var(--section-padding) 0;
    background: var(--bg-secondary);
}

.output-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 24px;
}

.output-card {
    padding: 24px;
    background: var(--bg-color);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
}

.output-card h3 {
    font-size: 1rem;
    margin-bottom: 16px;
    color: var(--text-color);
}

.output-card pre {
    margin: 0;
    padding: 0;
}

.output-card code {
    font-family: var(--font-mono);
    font-size: 0.8rem;
}

/* ==================== CTA Section ==================== */
.cta-section {
    padding: var(--section-padding) 0;
    background: var(--gradient-hero);
    text-align: center;
}

.cta-content h2 {
    font-size: 2.5rem;
    font-weight: 700;
    margin-bottom: 16px;
}

.cta-content p {
    font-size: 1.2rem;
    color: var(--text-secondary);
    margin-bottom: 32px;
}

.cta-buttons {
    display: flex;
    gap: 16px;
    justify-content: center;
    flex-wrap: wrap;
}

/* ==================== Footer ==================== */
.footer {
    padding: 80px 0 40px;
    background: var(--bg-secondary);
    border-top: 1px solid var(--border-color);
}

.footer-content {
    display: grid;
    grid-template-columns: 1fr 2fr;
    gap: 60px;
    margin-bottom: 60px;
}

.footer-brand p {
    margin-top: 16px;
    color: var(--text-secondary);
    line-height: 1.7;
}

.footer-links {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 40px;
}

.footer-column h4 {
    font-size: 1rem;
    font-weight: 600;
    margin-bottom: 20px;
    color: var(--text-color);
}

.footer-column ul {
    list-style: none;
}

.footer-column li {
    margin-bottom: 12px;
}

.footer-column a {
    color: var(--text-secondary);
    font-size: 0.95rem;
}

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

.footer-bottom {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding-top: 40px;
    border-top: 1px solid var(--border-color);
    color: var(--text-muted);
    font-size: 0.9rem;
}

/* ==================== Page Content Styles ==================== */
.page-header {
    padding: 140px 0 80px;
    background: var(--gradient-hero);
    text-align: center;
}

.page-header h1 {
    font-size: 3rem;
    font-weight: 700;
    margin-bottom: 16px;
}

.page-header p {
    font-size: 1.25rem;
    color: var(--text-secondary);
}

.page-content {
    padding: 80px 0;
}

.content-section {
    margin-bottom: 60px;
}

.content-section h2 {
    font-size: 2rem;
    font-weight: 700;
    margin-bottom: 24px;
    padding-bottom: 12px;
    border-bottom: 2px solid var(--border-color);
}

.content-section h3 {
    font-size: 1.5rem;
    font-weight: 600;
    margin-top: 40px;
    margin-bottom: 16px;
    color: var(--primary-light);
}

.content-section h4 {
    font-size: 1.2rem;
    font-weight: 600;
    margin-top: 32px;
    margin-bottom: 12px;
}

.content-section p {
    color: var(--text-secondary);
    margin-bottom: 16px;
    line-height: 1.7;
}

.content-section ul,
.content-section ol {
    margin-bottom: 24px;
    padding-left: 24px;
    color: var(--text-secondary);
}

.content-section li {
    margin-bottom: 8px;
    line-height: 1.6;
}

.content-section code:not(pre code) {
    padding: 2px 8px;
    background: var(--bg-tertiary);
    border-radius: 4px;
    font-family: var(--font-mono);
    font-size: 0.9em;
    color: var(--primary-light);
}

/* ==================== Sidebar Navigation ==================== */
.page-with-sidebar {
    display: grid;
    grid-template-columns: 280px 1fr;
    gap: 60px;
    max-width: 1400px;
    margin: 0 auto;
    padding: 0 24px;
}

.sidebar {
    position: sticky;
    top: 100px;
    height: fit-content;
}

.sidebar-nav {
    background: var(--bg-secondary);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    padding: 24px;
}

.sidebar-nav h3 {
    font-size: 0.875rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: var(--text-muted);
    margin-bottom: 16px;
}

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

.sidebar-nav li {
    margin-bottom: 8px;
}

.sidebar-nav a {
    display: block;
    padding: 8px 12px;
    color: var(--text-secondary);
    border-radius: var(--radius-sm);
    font-size: 0.95rem;
    transition: all var(--transition-fast);
}

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

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

/* ==================== Tables ==================== */
.table-wrapper {
    overflow-x: auto;
    margin: 24px 0;
}

table {
    width: 100%;
    border-collapse: collapse;
    background: var(--bg-secondary);
    border-radius: var(--radius-md);
    overflow: hidden;
}

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

th {
    background: var(--bg-tertiary);
    font-weight: 600;
    color: var(--text-color);
}

td {
    color: var(--text-secondary);
}

tr:last-child td {
    border-bottom: none;
}

/* ==================== Alerts/Notes ==================== */
.note {
    padding: 20px 24px;
    border-radius: var(--radius-md);
    margin: 24px 0;
    border-left: 4px solid;
}

.note-info {
    background: rgba(59, 130, 246, 0.1);
    border-color: #3b82f6;
}

.note-warning {
    background: rgba(245, 158, 11, 0.1);
    border-color: #f59e0b;
}

.note-tip {
    background: rgba(16, 185, 129, 0.1);
    border-color: #10b981;
}

.note-title {
    font-weight: 600;
    margin-bottom: 8px;
    color: var(--text-color);
}

.note p {
    margin-bottom: 0;
}

/* ==================== API Reference Cards ==================== */
.api-card {
    background: var(--bg-secondary);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    padding: 24px;
    margin-bottom: 24px;
}

.api-card-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    margin-bottom: 16px;
}

.api-card h4 {
    margin: 0;
    font-family: var(--font-mono);
    color: var(--primary-light);
}

.api-badge {
    padding: 4px 10px;
    background: var(--bg-tertiary);
    border-radius: 100px;
    font-size: 0.75rem;
    font-weight: 500;
    color: var(--text-muted);
}

.api-card p {
    margin-bottom: 16px;
}

.api-params {
    margin-top: 16px;
}

.api-params h5 {
    font-size: 0.875rem;
    font-weight: 600;
    margin-bottom: 12px;
    color: var(--text-muted);
}

.param-item {
    display: flex;
    gap: 12px;
    margin-bottom: 8px;
    font-size: 0.9rem;
}

.param-name {
    font-family: var(--font-mono);
    color: var(--secondary-color);
    min-width: 120px;
}

.param-type {
    color: var(--accent-color);
    min-width: 100px;
}

.param-desc {
    color: var(--text-secondary);
}

/* ==================== Example Cards ==================== */
.example-card {
    background: var(--bg-secondary);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-lg);
    overflow: hidden;
    margin-bottom: 32px;
}

.example-card-header {
    padding: 20px 24px;
    background: var(--bg-tertiary);
    border-bottom: 1px solid var(--border-color);
}

.example-card-header h3 {
    margin: 0;
    font-size: 1.2rem;
}

.example-card-header p {
    margin: 8px 0 0;
    color: var(--text-muted);
    font-size: 0.9rem;
}

.example-card-body {
    padding: 0;
}

.example-card-body pre {
    margin: 0;
    padding: 24px;
}

/* ==================== Responsive ==================== */
@media (max-width: 1200px) {
    .features-grid {
        grid-template-columns: repeat(3, 1fr);
    }

    .output-grid {
        grid-template-columns: repeat(2, 1fr);
    }
}

@media (max-width: 992px) {
    .hero .container {
        grid-template-columns: 1fr;
        text-align: center;
    }

    .hero-content {
        max-width: 100%;
    }

    .hero-buttons {
        justify-content: center;
    }

    .hero-stats {
        justify-content: center;
    }

    .hero-code {
        display: none;
    }

    .features-grid {
        grid-template-columns: repeat(2, 1fr);
    }

    .page-with-sidebar {
        grid-template-columns: 1fr;
    }

    .sidebar {
        display: none;
    }

    .footer-content {
        grid-template-columns: 1fr;
    }

    .footer-links {
        grid-template-columns: repeat(2, 1fr);
    }
}

@media (max-width: 768px) {
    :root {
        --section-padding: 60px;
    }

    .nav-links {
        display: none;
        position: absolute;
        top: 70px;
        left: 0;
        right: 0;
        background: var(--bg-secondary);
        flex-direction: column;
        padding: 24px;
        border-bottom: 1px solid var(--border-color);
    }

    .nav-links.active {
        display: flex;
    }

    .mobile-menu-btn {
        display: flex;
    }

    .hero h1 {
        font-size: 2.5rem;
    }

    .hero-description {
        font-size: 1.1rem;
    }

    .section-header h2 {
        font-size: 2rem;
    }

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

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

    .footer-links {
        grid-template-columns: 1fr;
    }

    .footer-bottom {
        flex-direction: column;
        gap: 12px;
        text-align: center;
    }

    .page-header h1 {
        font-size: 2rem;
    }
}

@media (max-width: 480px) {
    .hero-buttons {
        flex-direction: column;
    }

    .btn {
        width: 100%;
        justify-content: center;
    }

    .hero-stats {
        flex-direction: column;
        gap: 24px;
    }

    .cta-buttons {
        flex-direction: column;
    }

    .tab-buttons {
        flex-direction: column;
    }

    .tab-btn {
        width: 100%;
        text-align: center;
    }
}

/* ==================== Animations ==================== */
@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(30px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.fade-in-up {
    animation: fadeInUp 0.6s ease forwards;
}

/* ==================== Prism.js Overrides ==================== */
pre[class*="language-"] {
    background: var(--code-bg) !important;
}

code[class*="language-"] {
    font-family: var(--font-mono) !important;
}

