/* Zenith Documentation - Layout Fix */
/* Improved sidebar and content positioning */

/* ===== LAYOUT SYSTEM ===== */

/* Reset and base */
html,
body {
    margin: 0;
    padding: 0;
    width: 100%;
    height: 100%;
    overflow-x: hidden;
}

.layout {
    display: flex;
    min-height: 100vh;
    position: relative;
}

/* ===== SIDEBAR ===== */

.sidebar {
    width: 280px;
    min-width: 280px;
    background: var(--bg-panel);
    border-right: 1px solid var(--border);
    padding: 2rem 1.5rem;
    position: fixed;
    left: 0;
    top: 0;
    height: 100vh;
    overflow-y: auto;
    overflow-x: hidden;
    transition: transform var(--transition-speed);
    z-index: 1000;
}

/* Sidebar scrollbar */
.sidebar::-webkit-scrollbar {
    width: 6px;
}

.sidebar::-webkit-scrollbar-thumb {
    background: var(--border);
    border-radius: 3px;
}

.sidebar::-webkit-scrollbar-thumb:hover {
    background: var(--primary);
}

/* ===== CONTENT AREA ===== */

.content {
    flex: 1;
    margin-left: 280px;
    padding: 3rem;
    width: calc(100% - 280px);
    min-height: 100vh;
    box-sizing: border-box;
}

/* Container for content sections */
.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0;
    width: 100%;
}

/* Section spacing */
.section {
    padding: 4rem 0;
    width: 100%;
}

.section:first-child {
    padding-top: 2rem;
}

/* ===== MOBILE MENU TOGGLE ===== */

.menu-toggle {
    display: none;
    position: fixed;
    top: 1rem;
    left: 1rem;
    z-index: 2001;
    background: var(--primary);
    color: white;
    border: none;
    padding: 0.75rem 1rem;
    border-radius: 8px;
    cursor: pointer;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.3);
    font-size: 1.2rem;
    line-height: 1;
}

.menu-toggle:hover {
    background: var(--secondary);
    transform: scale(1.05);
}

/* ===== RESPONSIVE BREAKPOINTS ===== */

/* Tablets and below (≤991px) */
@media (max-width: 991px) {
    .sidebar {
        transform: translateX(-100%);
        box-shadow: 2px 0 10px rgba(0, 0, 0, 0.3);
    }

    .sidebar.open {
        transform: translateX(0);
    }

    .content {
        margin-left: 0;
        width: 100%;
        padding: 2rem;
    }

    .menu-toggle {
        display: block;
    }

    /* Overlay when sidebar is open */
    .sidebar.open::after {
        content: '';
        position: fixed;
        top: 0;
        left: 280px;
        right: 0;
        bottom: 0;
        background: rgba(0, 0, 0, 0.5);
        z-index: -1;
    }
}

/* Mobile phones (≤767px) */
@media (max-width: 767px) {
    .sidebar {
        width: 260px;
        min-width: 260px;
        padding: 1.5rem 1rem;
    }

    .sidebar.open::after {
        left: 260px;
    }

    .content {
        padding: 1.5rem;
    }

    .section {
        padding: 2rem 0;
    }

    .container {
        padding: 0;
    }
}

/* Small phones (≤575px) */
@media (max-width: 575px) {
    .sidebar {
        width: 100%;
        min-width: 100%;
    }

    .sidebar.open::after {
        display: none;
    }

    .content {
        padding: 1rem;
    }

    .section {
        padding: 1.5rem 0;
    }

    .menu-toggle {
        top: 0.75rem;
        left: 0.75rem;
        padding: 0.6rem 0.9rem;
    }
}

/* ===== GRID LAYOUTS ===== */

.card-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 1.5rem;
    margin: 2rem 0;
    width: 100%;
}

@media (max-width: 767px) {
    .card-grid {
        grid-template-columns: 1fr;
        gap: 1rem;
    }
}

@media (min-width: 768px) and (max-width: 991px) {
    .card-grid {
        grid-template-columns: repeat(2, 1fr);
    }
}

/* ===== HERO SECTION ===== */

.hero {
    text-align: center;
    padding: 4rem 0;
    width: 100%;
}

@media (max-width: 767px) {
    .hero {
        padding: 2rem 0;
    }

    .hero h1 {
        font-size: 2rem;
    }

    .hero p {
        font-size: 1rem;
    }
}

/* ===== PLAYGROUND ===== */

.playground {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 1rem;
    height: 600px;
    background: var(--bg-panel);
    border: 1px solid var(--border);
    border-radius: 12px;
    overflow: hidden;
    width: 100%;
}

@media (max-width: 991px) {
    .playground {
        grid-template-columns: 1fr;
        height: auto;
    }

    .code-input,
    .output-content {
        height: 300px;
    }
}

@media (max-width: 575px) {

    .code-input,
    .output-content {
        height: 250px;
    }
}

/* ===== COMPARISON SECTION ===== */

.comparison-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(320px, 1fr));
    gap: 1.5rem;
    margin-bottom: 3rem;
    width: 100%;
}

@media (max-width: 767px) {
    .comparison-grid {
        grid-template-columns: 1fr;
    }
}

@media (min-width: 768px) and (max-width: 1199px) {
    .comparison-grid {
        grid-template-columns: repeat(2, 1fr);
    }
}

/* ===== TABLES ===== */

.comparison-table {
    width: 100%;
    overflow-x: auto;
    display: block;
}

@media (max-width: 767px) {
    .comparison-table {
        font-size: 0.85rem;
    }

    .comparison-table th,
    .comparison-table td {
        padding: 0.5rem;
    }
}

/* ===== FOOTER ===== */

.footer {
    background: var(--bg-panel);
    border-top: 1px solid var(--border);
    padding: 3rem 0;
    margin-top: 4rem;
    width: 100%;
}

.footer-content {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 2rem;
    margin-bottom: 2rem;
}

@media (max-width: 767px) {
    .footer {
        padding: 2rem 0;
        margin-top: 2rem;
    }

    .footer-content {
        grid-template-columns: 1fr;
        gap: 1.5rem;
    }
}

/* ===== UTILITY CLASSES ===== */

.w-full {
    width: 100%;
}

.max-w-full {
    max-width: 100%;
}

.overflow-hidden {
    overflow: hidden;
}

.overflow-auto {
    overflow: auto;
}

/* ===== PRINT STYLES ===== */

@media print {

    .sidebar,
    .menu-toggle {
        display: none;
    }

    .content {
        margin-left: 0;
        width: 100%;
        padding: 1rem;
    }

    .section {
        page-break-inside: avoid;
    }
}

/* ===== ACCESSIBILITY ===== */

/* Skip to main content link */
.skip-to-main {
    position: absolute;
    top: -40px;
    left: 0;
    background: var(--primary);
    color: white;
    padding: 0.5rem 1rem;
    text-decoration: none;
    z-index: 3000;
}

.skip-to-main:focus {
    top: 0;
}

/* Focus visible for keyboard navigation */
*:focus-visible {
    outline: 2px solid var(--primary);
    outline-offset: 2px;
}

/* ===== SMOOTH TRANSITIONS ===== */

.sidebar,
.content,
.menu-toggle {
    transition: all var(--transition-speed) ease;
}

/* Prevent layout shift */
.sidebar,
.content {
    will-change: transform, margin-left, width;
}