/* Code Block Copy Button */
pre[class*="language-"] {
    position: relative;
}

.copy-btn {
    position: absolute;
    top: 0.5rem;
    right: 0.5rem;
    background: rgba(255, 255, 255, 0.1);
    border: 1px solid rgba(255, 255, 255, 0.2);
    color: #dfe6e9;
    padding: 0.3rem;
    line-height: 0;
    border-radius: 4px;
    cursor: pointer;
    opacity: 0;
    transition: opacity 0.2s, background 0.2s;
    z-index: 10;
}

pre[class*="language-"]:hover .copy-btn {
    opacity: 1;
}

.copy-btn svg {
    width: 14px;
    height: 14px;
    fill: currentColor;
}

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

.copy-btn.copied {
    background: #00cec9;
    color: #fff;
    border-color: #00cec9;
}

/* Inline Code Snippets */
:not(pre) > code {
    background-color: #2d3436;
    color: #fab1a0;
    padding: 0.2rem 0.4rem;
    border-radius: 4px;
    font-family: Consolas, Monaco, 'Andale Mono', 'Ubuntu Mono', monospace;
    font-size: 0.9em;
    transition: background-color 0.1s, color 0.1s;
    border: 1px solid transparent;
    display: inline-flex;
    align-items: center;
    vertical-align: middle;
    position: relative;
    white-space: pre-wrap;
    word-break: break-word;
    gap: 4px;
    margin: 0 2px;
}

:not(pre) > code:hover {
    background-color: #4a5557;
    color: #fff;
    border-color: #00cec9;
}

/* Tooltip button (Desktop) */
:not(pre) > code .copy-btn {
    position: absolute;
    top: -32px;
    left: 50%;
    transform: translateX(-50%);
    background: #2d3436;
    border: 1px solid #555;
    padding: 4px 6px;
    box-shadow: 0 4px 12px rgba(0,0,0,0.5);
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.2s;
}

:not(pre) > code:hover .copy-btn {
    opacity: 1;
    pointer-events: auto;
}

/* Tooltip Arrow */
:not(pre) > code .copy-btn::after {
    content: "";
    position: absolute;
    bottom: -4px;
    left: 50%;
    transform: translateX(-50%);
    border-left: 4px solid transparent;
    border-right: 4px solid transparent;
    border-top: 4px solid #2d3436;
}

/* Home Page Styling */
.hero {
    padding: 4rem 2rem;
    background: linear-gradient(135deg, #2d3436 0%, #00cec9 100%);
    color: white;
    border-radius: 12px;
    margin-bottom: 3rem;
    text-align: center;
}

.hero h1 {
    font-size: 3.5rem;
    margin-bottom: 1rem;
    color: white;
    letter-spacing: -1px;
}

.hero p {
    font-size: 1.4rem;
    opacity: 0.95;
    max-width: 700px;
    margin: 0 auto 2.5rem auto;
    line-height: 1.4;
}

.hero-cta {
    display: inline-block;
    background: white;
    color: #2d3436;
    padding: 1rem 2.5rem;
    border-radius: 50px;
    text-decoration: none;
    font-weight: 800;
    transition: transform 0.2s, box-shadow 0.2s;
    font-size: 1.1rem;
}

.hero-cta:hover {
    transform: translateY(-3px);
    box-shadow: 0 10px 20px rgba(0,0,0,0.2);
}

.card-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 2rem;
    margin-bottom: 4rem;
}

.home-card {
    background: white;
    padding: 2.5rem;
    border-radius: 12px;
    border: 1px solid #e1e4e8;
    text-decoration: none;
    color: inherit;
    transition: all 0.3s ease;
    box-shadow: 0 2px 4px rgba(0,0,0,0.02);
}

.home-card:hover {
    transform: translateY(-5px);
    border-color: #00cec9;
    box-shadow: 0 15px 30px rgba(0,0,0,0.08);
}

.home-card h2 {
    margin-top: 0;
    color: #2d3436;
    font-size: 1.8rem;
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

.home-card p {
    color: #636e72;
    margin-bottom: 0;
    font-size: 1.1rem;
    line-height: 1.5;
}

.feature-demo-section {
    background: #f1f2f6;
    padding: 3rem;
    border-radius: 12px;
    margin-top: 4rem;
}

.feature-demo-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 2rem;
    margin-top: 2rem;
}

@media (max-width: 768px) {
    .hero h1 { font-size: 2.5rem; }
    .hero p { font-size: 1.1rem; }
    .card-grid, .feature-demo-grid { grid-template-columns: 1fr; }
    .feature-demo-section { padding: 1.5rem; }
}

body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
    margin: 0;
    padding: 0;
    color: #1a1a1a;
    background-color: #f8f9fa;
    line-height: 1.6;
}

header {
    background-color: #2d3436;
    color: #fff;
    padding: 1rem 2rem;
    position: sticky;
    top: 0;
    z-index: 1000;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
}

nav.top-nav {
    display: flex;
    justify-content: space-between;
    align-items: center;
    max-width: 1200px;
    margin: 0 auto;
}

.logo {
    font-size: 1.5rem;
    font-weight: 800;
    text-decoration: none;
    color: #00cec9;
    letter-spacing: -0.5px;
}

.nav-links {
    display: flex;
    gap: 2rem;
    list-style: none;
    margin: 0;
    padding: 0;
}

.nav-links a {
    color: #fff;
    text-decoration: none;
    font-weight: 500;
    transition: color 0.2s;
}

.nav-links a:hover {
    color: #00cec9;
}

.layout-container.full-width {
    display: block;
}

.layout-container.full-width main.content {
    max-width: 1000px;
    margin: 0 auto;
    padding: 3rem 2rem;
}

.layout-container {
    display: flex;
    max-width: 1200px;
    margin: 0 auto;
    min-height: calc(100vh - 4rem);
}

aside.side-nav {
    width: 250px;
    background: #fff;
    padding: 2rem;
    border-right: 1px solid #e1e4e8;
    flex-shrink: 0;
}

main.content {
    flex-grow: 1;
    padding: 2rem 3rem;
    background: #fff;
}

.topic-group {
    margin-bottom: 2rem;
}

.topic-group h3 {
    font-size: 0.9rem;
    text-transform: uppercase;
    color: #636e72;
    margin-bottom: 1rem;
    letter-spacing: 1px;
}

.side-nav ul {
    list-style: none;
    padding: 0;
    margin: 0;
}

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

.side-nav a {
    color: #2d3436;
    text-decoration: none;
    display: block;
    padding: 0.5rem 0.75rem;
    border-radius: 6px;
    transition: background 0.2s;
}

.side-nav a:hover {
    background: #f1f2f6;
    color: #00b894;
}

.side-nav a.active {
    background: #00cec91a;
    color: #00b894;
    font-weight: 600;
}

footer {
    text-align: center;
    padding: 2rem;
    background: #2d3436;
    color: #dfe6e9;
    font-size: 0.9rem;
}

/* Responsive Adjustments for Copy Buttons */
@media (max-width: 768px) {
    /* Code Blocks: Always show icon */
    .copy-btn {
        opacity: 1;
        background: rgba(255, 255, 255, 0.15);
    }

    /* Mobile Inline: Icon always visible after text */
    :not(pre) > code .copy-btn {
        position: relative;
        top: 0;
        left: auto;
        transform: none;
        opacity: 1 !important;
        pointer-events: auto;
        padding: 2px;
        background: #f1f2f6;
        border: 1px solid #ccc;
        box-shadow: none;
        color: #636e72;
        width: 18px;
        height: 18px;
        margin-left: 2px;
    }

    :not(pre) > code .copy-btn::after {
        display: none;
    }
}

.side-nav-toggle {
    display: none;
    width: 100%;
    background: #f1f2f6;
    border: 1px solid #e1e4e8;
    padding: 0.75rem;
    border-radius: 6px;
    font-weight: 600;
    color: #2d3436;
    cursor: pointer;
    margin-bottom: 1rem;
    text-align: left;
}

@media (max-width: 768px) {
    .side-nav-toggle {
        display: block;
    }

    .side-nav-content {
        display: none;
    }

    .side-nav-content.show {
        display: block;
    }
}

.menu-toggle {
    display: none;
    background: none;
    border: 1px solid #00cec9;
    color: #00cec9;
    padding: 0.5rem 0.75rem;
    border-radius: 4px;
    cursor: pointer;
    font-weight: 600;
    font-family: inherit;
}

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

    .menu-toggle {
        display: block;
    }

    .nav-links {
        display: none; /* Default hidden on mobile */
        position: absolute;
        top: 100%;
        left: 0;
        right: 0;
        background: #2d3436;
        flex-direction: column;
        gap: 0;
        border-top: 1px solid #3d4446;
        box-shadow: 0 10px 15px rgba(0,0,0,0.1);
    }

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

    .nav-links li {
        width: 100%;
    }

    .nav-links a {
        display: block;
        padding: 1rem 1.5rem;
        border-bottom: 1px solid #3d4446;
    }

    .layout-container {
        flex-direction: column;
    }

    aside.side-nav {
        width: 100%;
        border-right: none;
        border-bottom: 1px solid #e1e4e8;
        padding: 1rem;
        background: #f8f9fa;
    }

    .topic-group {
        margin-bottom: 1rem;
    }

    main.content {
        padding: 1.5rem;
    }
}
