* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Poppins', sans-serif;
    background: #f5f7fb;
    color: #222;
    line-height: 1.7;
}

a {
    text-decoration: none;
    color: inherit;
}

/* Header */

header {
    background: #0d1117;
    color: white;
    padding: 15px 25px;
    position: sticky;
    top: 0;
    z-index: 1000;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
}

.topbar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 20px;
}

/* ADD THIS CSS */

.menu-btn {
    display: none;
    background: #16a34a;
    color: white;
    border: none;
    width: 45px;
    height: 45px;
    border-radius: 8px;
    font-size: 22px;
    cursor: pointer;
}

/* OVERLAY */

.sidebar-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.5);
    z-index: 999;
    display: none;
}

/* MOBILE SIDEBAR */

@media(max-width:768px) {

    .menu-btn {
        display: block;
    }

    .container {
        grid-template-columns: 1fr;
    }

    .sidebar {
        position: fixed;
        left: -320px;
        top: 0;
        width: 280px;
        height: 100vh;
        background: white;
        z-index: 1000;
        transition: 0.3s ease;
        border-radius: 0;
        overflow-y: auto;
        box-shadow: 0 0 20px rgba(0, 0, 0, 0.3);
    }

    .sidebar.active {
        left: 0;
    }

    .ads-section {
        display: none;
    }

    .topbar {
        flex-direction: row;
        align-items: center;
    }

    .search-box {
        width: 100%;
    }

    .hero-title {
        font-size: 30px;
    }

    main {
        padding: 20px;
    }
}

.logo {
    font-size: 26px;
    font-weight: 700;
    color: #4ade80;
}

.search-box {
    flex: 1;
    max-width: 500px;
}

.search-box input {
    width: 100%;
    padding: 12px 15px;
    border: none;
    border-radius: 8px;
    outline: none;
    font-size: 15px;
}

/* Layout */

.container {
    display: grid;
    grid-template-columns: 260px 1fr 280px;
    gap: 20px;
    padding: 20px;
}

/* Sidebar */

.sidebar {
    background: white;
    border-radius: 12px;
    padding: 20px;
    height: calc(100vh - 110px);
    overflow-y: auto;
    position: sticky;
    top: 90px;
}

.sidebar h2 {
    margin-bottom: 15px;
    font-size: 20px;
    color: #111827;
}

.lesson-list {
    list-style: none;
}

.lesson-list li {
    margin-bottom: 10px;
}

.lesson-list a {
    display: block;
    padding: 10px 14px;
    border-radius: 8px;
    transition: 0.3s;
    font-size: 15px;
}

.lesson-list a:hover,
.lesson-list a.active {
    background: #16a34a;
    color: white;
}

/* Main Content */

main {
    background: white;
    border-radius: 12px;
    padding: 35px;
}

.breadcrumb {
    font-size: 14px;
    margin-bottom: 20px;
    color: #666;
}

.hero-title {
    font-size: 40px;
    margin-bottom: 15px;
    color: #111827;
}

.hero-desc {
    font-size: 17px;
    margin-bottom: 25px;
    color: #555;
}

.btn-group {
    display: flex;
    gap: 15px;
    margin-bottom: 35px;
    flex-wrap: wrap;
}

.btn {
    padding: 12px 22px;
    border-radius: 8px;
    font-weight: 600;
    transition: 0.3s;
    display: inline-block;
}

.btn-primary {
    background: #16a34a;
    color: white;
}

.btn-primary:hover {
    background: #15803d;
}

.btn-secondary {
    background: #111827;
    color: white;
}

.btn-secondary:hover {
    background: #1f2937;
}

section {
    margin-bottom: 45px;
}

/* MOBILE ADS */

.mobile-ad {
    display: none;
    justify-content: center;
    align-items: center;
    margin: 25px auto;
    width: 100%;
    overflow: hidden;
}

/* SHOW ONLY ON MOBILE */

@media(max-width:768px) {

    .mobile-ad {
        display: flex;
    }

    .ads-section {
        display: none;
    }

}


/* SHOW ONLY ON MOBILE */

@media(max-width:768px) {

    .mobile-ad {
        display: flex;
    }

    /* HIDE RIGHT ADS */

    .ads-section {
        display: none;
    }
}

h2 {
    margin-bottom: 15px;
    font-size: 28px;
    color: #111827;
}

p {
    margin-bottom: 15px;
}

/* STATIC CODE BLOCK */

.code-wrapper {
    margin-top: 20px;
    border-radius: 14px;
    overflow: hidden;
}

/* PRISM */

pre[class*="language-"] {
    margin: 0;
    border-radius: 14px;
    font-size: 15px;
    line-height: 1.7;
    padding: 25px;
    overflow: auto;
}

code[class*="language-"],
pre[class*="language-"] {
    font-family: Consolas, monospace;
    font-size: 15px;
    line-height: 1.7;
}

/* SCROLLBAR */

pre::-webkit-scrollbar {
    height: 8px;
}

pre::-webkit-scrollbar-thumb {
    background: #374151;
    border-radius: 20px;
}

/* MOBILE */

@media(max-width:768px) {

    pre[class*="language-"] {
        font-size: 14px;
        padding: 18px;
    }
}

.info-card {
    background: #ecfdf5;
    border-left: 5px solid #16a34a;
    padding: 20px;
    border-radius: 8px;
    margin-top: 20px;
}

/* Right Ads */

.ads-section {
    position: sticky;
    top: 90px;
    height: fit-content;
}

.ad-box {
    background: white;
    border-radius: 12px;
    padding: 20px;
    margin-bottom: 20px;
    text-align: center;
    min-height: 250px;
    display: flex;
    align-items: center;
    justify-content: center;
    border: 2px dashed #ccc;
    color: #888;
    font-weight: 600;
}

/* DESKTOP ADS */

.desktop-ad {
    display: flex;
    justify-content: center;
    align-items: center;
    width: 100%;
    margin-bottom: 20px;
    overflow: hidden;
}

/* HIDE DESKTOP ADS ON MOBILE */

@media(max-width:768px) {

    .desktop-ad {
        display: none;
    }

}


/* FAQ */

.faq {
    margin-top: 25px;
}

.faq-item {
    background: #f8fafc;
    padding: 18px;
    border-radius: 10px;
    margin-bottom: 15px;
}

.faq-item h3 {
    margin-bottom: 10px;
    font-size: 18px;
}

/* Footer */

footer {
    background: #0d1117;
    color: white;
    text-align: center;
    padding: 30px 20px;
    margin-top: 40px;
}

footer p {
    margin: 5px 0;
}

/* Responsive */

@media(max-width:1100px) {

    .container {
        grid-template-columns: 230px 1fr;
    }

    .ads-section {
        display: none;
    }
}

/* REPLACE YOUR MOBILE SIDEBAR CSS WITH THIS */

@media(max-width:768px) {

    .menu-btn {
        display: block;
    }

    .container {
        grid-template-columns: 1fr;
        padding: 10px;
    }

    /* FIX EXTRA TOP SPACE */

    .sidebar {
        position: fixed;
        left: -320px;
        top: 0;
        width: 280px;
        height: 100vh;
        background: white;
        z-index: 1000;
        transition: 0.3s ease;
        border-radius: 0;
        overflow-y: auto;
        box-shadow: 0 0 20px rgba(0, 0, 0, 0.3);
        margin: 0;
    }

    .sidebar.active {
        left: 0;
    }

    /* IMPORTANT FIX */

    main {
        margin: 0;
        padding: 20px;
        width: 100%;
    }

    .ads-section {
        display: none;
    }

    .topbar {
        flex-direction: row;
        align-items: center;
        gap: 10px;
    }

    .search-box {
        width: 100%;
    }

    .hero-title {
        font-size: 30px;
        line-height: 1.3;
    }
}

/* EDITOR SECTION */

.editor-section {
    margin-top: 40px;
}

/* MAIN CONTAINER */

.editor-container {
    background: #0f172a;
    border-radius: 14px;
    padding: 20px;
}

/* CODEMIRROR */

.CodeMirror {
    height: auto;
    font-size: 16px;
    border-radius: 10px;
    margin-bottom: 20px;
    overflow: hidden;
}

/* BUTTON */

.run-btn {
    background: #16a34a;
    color: white;
    border: none;
    padding: 12px 24px;
    border-radius: 8px;
    font-size: 16px;
    font-weight: 600;
    cursor: pointer;
    transition: 0.3s;
    margin-bottom: 20px;
}

.run-btn:hover {
    background: #15803d;
}

/* OUTPUT AREA */

.output-container {
    background: white;
    border-radius: 10px;
    overflow: hidden;
    border: 2px solid #e5e7eb;
    margin-top: 20px;
}

/* IFRAME */

#output {
    width: 100%;
    height: 350px;
    border: none;
    background: white;
    display: block;
}

/* MOBILE */

@media(max-width:768px) {

    .editor-container {
        padding: 15px;
    }

    .CodeMirror {
        font-size: 14px;
    }

    #output {
        height: 250px;
    }
}

/* DESKTOP CONTENT AD */

.content-desktop-ad {
    width: 100%;
    display: flex;
    justify-content: center;
    align-items: center;
    margin: 35px auto;
    overflow: hidden;
}

/* HIDE ON MOBILE */

@media(max-width:768px) {

    .content-desktop-ad {
        display: none;
    }
}