/* Base Variables & Reset (Light Theme) */
:root {
    --bg-main: #f8fafc; /* Light, cool gray background */
    --bg-card: #ffffff; /* Crisp white for cards and elements */
    --text-main: #0f172a; /* Dark slate for main text */
    --text-muted: #475569; /* Medium gray for secondary text */
    --accent: #2563eb; /* Vibrant blue */
    --accent-hover: #1d4ed8; /* Darker blue for hover states */
    --border-color: #e2e8f0; /* Soft gray for borders */
}

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

html {
    scroll-behavior: smooth;
}

body {
    font-family:
        -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial,
        sans-serif;
    background-color: var(--bg-main);
    color: var(--text-main);
    line-height: 1.6;
}

/* Typography */
h1 {
    font-size: clamp(2.5rem, 5vw, 4rem);
    line-height: 1.1;
    margin-bottom: 1rem;
    letter-spacing: -0.05em;
}
h2 {
    font-size: clamp(2rem, 4vw, 2.5rem);
    margin-bottom: 1rem;
}
h3 {
    font-size: 1.25rem;
    margin-bottom: 0.5rem;
}
p {
    color: var(--text-muted);
}

/* Buttons */
.btn {
    display: inline-block;
    padding: 0.75rem 1.5rem;
    border-radius: 6px;
    font-weight: 500;
    text-decoration: none;
    transition: all 0.2s ease;
    cursor: pointer;
}

.btn-primary {
    background-color: var(--accent);
    color: white;
    border: 1px solid var(--accent);
}
.btn-primary:hover {
    background-color: var(--accent-hover);
    border-color: var(--accent-hover);
}
.btn-secondary {
    background-color: var(--bg-card);
    color: var(--text-main);
    border: 1px solid var(--border-color);
}
.btn-secondary:hover {
    border-color: var(--text-muted);
}
.btn-outline {
    border: 1px solid var(--border-color);
    color: var(--text-main);
    padding: 0.5rem 1rem;
}
.btn-outline:hover {
    background-color: var(--bg-card);
}

/* Navigation */
.navbar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 1.5rem 5%;
    background-color: var(--bg-card);
    border-bottom: 1px solid var(--border-color);
}

.logo {
    font-size: 1.5rem;
    font-weight: 700;
    letter-spacing: -0.02em;
    color: var(--text-main);
}
.nav-links {
    display: flex;
    list-style: none;
    gap: 2rem;
}
.nav-links a {
    color: var(--text-muted);
    text-decoration: none;
    font-weight: 500;
    transition: color 0.2s;
}
.nav-links a:hover {
    color: var(--accent);
}

/* Hero Section */
.hero {
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 80vh;
    text-align: center;
    padding: 0 5%;
    /* Bright, subtle radial gradient for depth */
    background: radial-gradient(
        circle at center,
        #eff6ff 0%,
        var(--bg-main) 70%
    );
}

.hero-content {
    max-width: 800px;
}
.hero-content p {
    font-size: 1.125rem;
    margin-bottom: 2rem;
    color: var(--text-muted);
}
.hero-actions {
    display: flex;
    gap: 1rem;
    justify-content: center;
    margin-bottom: 3rem;
}

/* Live Stats Counter */
.live-stats {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    background: var(--bg-card);
    padding: 0.5rem 1rem;
    border-radius: 50px;
    border: 1px solid var(--border-color);
    font-family: monospace;
    font-size: 0.9rem;
    box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.05);
}

.pulse-dot {
    width: 8px;
    height: 8px;
    background-color: #10b981; /* Green remains visible on light theme */
    border-radius: 50%;
    box-shadow: 0 0 8px #10b981;
    animation: pulse 1.5s infinite;
}

@keyframes pulse {
    0% {
        transform: scale(0.95);
        box-shadow: 0 0 0 0 rgba(16, 185, 129, 0.4);
    }
    70% {
        transform: scale(1);
        box-shadow: 0 0 0 6px rgba(16, 185, 129, 0);
    }
    100% {
        transform: scale(0.95);
        box-shadow: 0 0 0 0 rgba(16, 185, 129, 0);
    }
}

/* Features Section */
.features {
    padding: 6rem 5%;
}
.section-title {
    text-align: center;
    margin-bottom: 4rem;
}

.grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 1.5rem;
    max-width: 1200px;
    margin: 0 auto;
}

.card {
    background: var(--bg-card);
    padding: 2rem;
    border-radius: 12px;
    border: 1px solid var(--border-color);
    box-shadow:
        0 4px 6px -1px rgba(0, 0, 0, 0.05),
        0 2px 4px -1px rgba(0, 0, 0, 0.03);
    transition:
        transform 0.2s ease,
        border-color 0.2s ease,
        box-shadow 0.2s ease;
}

.card:hover {
    transform: translateY(-5px);
    border-color: var(--accent);
    box-shadow:
        0 10px 15px -3px rgba(0, 0, 0, 0.1),
        0 4px 6px -2px rgba(0, 0, 0, 0.05);
}

/* Footer */
footer {
    border-top: 1px solid var(--border-color);
    padding: 4rem 5% 2rem;
    background-color: var(--bg-card);
}

.footer-grid {
    display: grid;
    grid-template-columns: 2fr 1fr 1fr 1fr;
    gap: 2rem;
    max-width: 1200px;
    margin: 0 auto 3rem auto;
}

.footer-brand .footer-logo {
    font-size: 1.5rem;
    font-weight: 700;
    margin-bottom: 1rem;
    color: var(--text-main);
    letter-spacing: -0.02em;
}

.footer-brand p {
    font-size: 0.95rem;
    max-width: 300px;
}

.footer-links {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
}

.footer-links h4 {
    font-size: 1rem;
    color: var(--text-main);
    margin-bottom: 0.5rem;
}

.footer-links a {
    color: var(--text-muted);
    text-decoration: none;
    font-size: 0.95rem;
    transition: color 0.2s;
}

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

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

.legal-links {
    display: flex;
    gap: 1.5rem;
}

.legal-links a {
    color: var(--text-muted);
    text-decoration: none;
    transition: color 0.2s;
}

.legal-links a:hover {
    color: var(--text-main);
}

/* Mobile Responsiveness for Footer */
@media (max-width: 768px) {
    .footer-grid {
        grid-template-columns: 1fr 1fr;
    }
    .footer-brand {
        grid-column: 1 / -1; /* Makes the brand section take full width on mobile */
        margin-bottom: 1rem;
    }
    .footer-bottom {
        flex-direction: column;
        gap: 1rem;
        text-align: center;
    }
}

@media (max-width: 480px) {
    .footer-grid {
        grid-template-columns: 1fr;
    }
}

/* Mobile Responsiveness */
@media (max-width: 768px) {
    .nav-links {
        display: none;
    }
    .hero-actions {
        flex-direction: column;
    }
    .navbar {
        padding: 1.5rem;
    }
}

/* Docs Section */
.docs {
    padding: 6rem 5%;
    background-color: var(--bg-main); /* Merges seamlessly with the page */
}

.docs-container {
    display: flex;
    gap: 3rem;
    max-width: 1000px;
    margin: 0 auto;
    align-items: center;
}

/* Steps list */
.docs-steps {
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
}

.step {
    display: flex;
    gap: 1rem;
    padding: 1rem;
    border-radius: 8px;
    border: 1px solid transparent;
    transition: all 0.2s;
    opacity: 0.6;
}

.step.active {
    opacity: 1;
    background-color: var(--bg-card);
    border-color: var(--border-color);
    box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.05);
}

.step-num {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 2rem;
    height: 2rem;
    border-radius: 50%;
    background-color: var(--accent);
    color: white;
    font-weight: bold;
    flex-shrink: 0;
}

.step h3 {
    font-size: 1.1rem;
    margin-bottom: 0.2rem;
}
.step p {
    font-size: 0.9rem;
    margin: 0;
}

/* Code Window */
.docs-code {
    flex: 1.2;
    min-width: 0; /* Prevents flex overflow */
}

.code-window {
    background-color: #0f172a; /* Dark terminal look */
    border-radius: 10px;
    overflow: hidden;
    box-shadow:
        0 20px 25px -5px rgba(0, 0, 0, 0.1),
        0 10px 10px -5px rgba(0, 0, 0, 0.04);
}

.code-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0.75rem 1rem;
    background-color: #1e293b;
    border-bottom: 1px solid #334155;
}

.window-controls {
    display: flex;
    gap: 6px;
}
.dot {
    width: 12px;
    height: 12px;
    border-radius: 50%;
}
.dot.close {
    background-color: #ef4444;
}
.dot.min {
    background-color: #f59e0b;
}
.dot.max {
    background-color: #10b981;
}

.file-name {
    color: #94a3b8;
    font-size: 0.85rem;
    font-family: monospace;
}

.copy-btn {
    background: transparent;
    border: 1px solid #475569;
    color: #cbd5e1;
    padding: 0.2rem 0.5rem;
    border-radius: 4px;
    font-size: 0.75rem;
    cursor: pointer;
    transition: all 0.2s;
}

.copy-btn:hover {
    background: #334155;
    color: white;
}

pre {
    padding: 1.5rem;
    margin: 0;
    overflow-x: auto; /* Scroll horizontally on small screens */
}

code {
    font-family: "Courier New", Courier, monospace;
    font-size: 0.9rem;
    color: #38bdf8; /* Light blue code text */
    line-height: 1.5;
    white-space: pre-wrap; /* Keeps formatting but wraps if necessary */
}

/* Mobile Responsiveness for Docs */
@media (max-width: 850px) {
    .docs-container {
        flex-direction: column;
    }
    .docs-code {
        width: 100%;
    }
}

/* Pricing Section */
.pricing {
    padding: 6rem 5%;
    background-color: var(--bg-main);
}

.pricing-grid {
    display: flex;
    justify-content: center;
    gap: 2rem;
    max-width: 900px;
    margin: 0 auto;
}

.pricing-card {
    flex: 1;
    background: var(--bg-card);
    padding: 3rem 2.5rem;
    border-radius: 12px;
    border: 1px solid var(--border-color);
    box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.05);
    position: relative;
    display: flex;
    flex-direction: column;
    transition:
        transform 0.2s ease,
        box-shadow 0.2s ease;
}

/* Highlight the Pro plan */
.pricing-card.popular {
    border: 2px solid var(--accent);
    transform: translateY(-10px); /* Lifts the card up slightly */
    box-shadow: 0 10px 25px -5px rgba(0, 0, 0, 0.1);
}

.popular-badge {
    position: absolute;
    top: -12px;
    left: 50%;
    transform: translateX(-50%);
    background-color: var(--accent);
    color: white;
    padding: 0.25rem 1rem;
    border-radius: 20px;
    font-size: 0.75rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.pricing-card h3 {
    font-size: 1.5rem;
    margin-bottom: 0.5rem;
}

.price {
    font-size: 3rem;
    font-weight: 700;
    color: var(--text-main);
    margin-bottom: 1rem;
    display: flex;
    align-items: baseline;
}

.price .currency {
    font-size: 1.5rem;
    margin-right: 0.2rem;
}

.price .period {
    font-size: 1rem;
    color: var(--text-muted);
    font-weight: 400;
    margin-left: 0.2rem;
}

.plan-desc {
    margin-bottom: 2rem;
    font-size: 0.95rem;
}

.feature-list {
    list-style: none;
    margin-bottom: 2.5rem;
    flex-grow: 1; /* Pushes the button to the bottom if descriptions vary in height */
}

.feature-list li {
    margin-bottom: 1rem;
    display: flex;
    align-items: center;
    font-size: 0.95rem;
    color: var(--text-main);
}

/* Custom checkmark for list items */
.feature-list li::before {
    content: "✓";
    color: var(--accent);
    font-weight: bold;
    margin-right: 0.75rem;
    font-size: 1.1rem;
}

/* Button utility for full width */
.btn-block {
    text-align: center;
    width: 100%;
    display: block;
}

/* Mobile Responsiveness for Pricing */
@media (max-width: 768px) {
    .pricing-grid {
        flex-direction: column;
        max-width: 400px;
    }
    .pricing-card.popular {
        transform: translateY(
            0
        ); /* Remove the lift effect on mobile to prevent overlapping */
    }
}

/* =========================================
   Documentation Page Layout
   ========================================= */

.docs-navbar {
    position: sticky;
    top: 0;
    z-index: 50;
}

.docs-wrapper {
    display: flex;
    max-width: 1400px;
    margin: 0 auto;
    min-height: calc(100vh - 80px);
}

/* Sidebar */
.docs-sidebar {
    width: 280px;
    flex-shrink: 0;
    border-right: 1px solid var(--border-color);
    padding: 2rem 2rem 2rem 5%;
    position: sticky;
    top: 80px; /* Accounts for navbar */
    height: calc(100vh - 80px);
    overflow-y: auto;
    background-color: var(--bg-card);
}

.docs-nav-group {
    margin-bottom: 2rem;
}

.docs-nav-group h4 {
    font-size: 0.85rem;
    text-transform: uppercase;
    color: var(--text-muted);
    letter-spacing: 0.05em;
    margin-bottom: 0.75rem;
}

.docs-nav-group ul {
    list-style: none;
}

.docs-nav-group li {
    margin-bottom: 0.5rem;
}

.docs-nav-group a {
    color: var(--text-muted);
    text-decoration: none;
    font-size: 0.95rem;
    display: block;
    padding: 0.25rem 0;
    transition: color 0.2s;
}

.docs-nav-group a:hover,
.docs-nav-group a.active {
    color: var(--accent);
    font-weight: 500;
}

/* Main Content Typography (Prose) */
.docs-content {
    flex-grow: 1;
    padding: 3rem 5%;
    max-width: 850px;
}

.prose h1 {
    font-size: 2.5rem;
    margin-bottom: 1.5rem;
    color: var(--text-main);
}
.prose h2 {
    font-size: 1.75rem;
    margin-top: 3rem;
    margin-bottom: 1rem;
    padding-bottom: 0.5rem;
    border-bottom: 1px solid var(--border-color);
}
.prose p {
    margin-bottom: 1.5rem;
    font-size: 1.05rem;
    color: #334155;
}
.prose a {
    color: var(--accent);
    text-decoration: none;
}
.prose a:hover {
    text-decoration: underline;
}

.prose pre {
    background-color: #0f172a;
    padding: 1.5rem;
    border-radius: 8px;
    overflow-x: auto;
    margin-bottom: 2rem;
    box-shadow: inset 0 2px 4px rgba(0, 0, 0, 0.1);
}

.prose code {
    font-family: "Courier New", Courier, monospace;
    font-size: 0.9rem;
    color: #38bdf8;
}

/* Inline code formatting */
.prose p code {
    background-color: var(--border-color);
    color: var(--text-main);
    padding: 0.2rem 0.4rem;
    border-radius: 4px;
    font-size: 0.9em;
}

/* Callout Box */
.info-callout {
    background-color: #eff6ff;
    border-left: 4px solid var(--accent);
    padding: 1.5rem;
    border-radius: 0 8px 8px 0;
    margin-top: 2rem;
    font-size: 0.95rem;
    color: #1e3a8a;
}

/* Mobile Docs Responsiveness */
@media (max-width: 900px) {
    .docs-wrapper {
        flex-direction: column;
    }

    #mobile-sidebar-toggle {
        display: block !important;
    }

    .docs-sidebar {
        width: 100%;
        height: auto;
        position: static;
        border-right: none;
        border-bottom: 1px solid var(--border-color);
        display: none; /* Hidden by default on mobile */
    }

    .docs-sidebar.show {
        display: block;
    }
}
