* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

html {
    scroll-behavior: smooth;
}

body {
    font-family: 'Poppins', sans-serif;
    background: linear-gradient(135deg, #f0f4f8, #e0f7fa);
    margin: 0;
    padding: 30px;
}

h1 {
    text-align: center;
    margin-bottom: 50px;
    font-size: 36px;
    color: #1a1a1a;
    text-shadow: 2px 2px 4px rgba(0, 0, 0, 0.1);
}

section {
    background: rgba(255, 255, 255, 0.25);
    backdrop-filter: blur(15px);
    padding: 30px;
    border-radius: 20px;
    box-shadow: 0 10px 25px rgba(0, 0, 0, 0.15);
    margin-bottom: 40px;
    transition: transform 0.4s ease, box-shadow 0.4s ease;
}

section:hover {
    transform: translateY(-10px);
    box-shadow: 0 20px 35px rgba(0, 0, 0, 0.25);
}

h2 {
    color: #1976d2;
    margin-bottom: 15px;
    font-size: 28px;
}

p {
    margin: 8px 0;
    font-size: 16px;
    color: #333;
}

pre {
    background: rgba(255, 255, 255, 0.6);
    padding: 15px;
    border-radius: 12px;
    overflow-x: auto;
    font-size: 14px;
}

.example-box {
    margin-top: 25px;
    padding: 40px;
    border-radius: 15px;
    color: #fff;
    font-size: 22px;
    font-weight: 600;
    text-align: center;
    transition: all 0.6s ease;
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.1);
}

button {
    width: 120px;
    height: 30px;
    font-size: 19px;
    font-weight: 600;
    color: white;
    border-radius: 4px;
    border: none;
    background-color: #00d2d3;
}

button a {
    text-decoration: none;
    color: white;
}

/* Width Queries */
@media (max-width: 600px) {
    .width-box {
        background: #ff6b6b;
    }
}

@media (min-width: 601px) and (max-width: 1024px) {
    .width-box {
        background: #1dd1a1;
    }
}

@media (min-width: 1025px) {
    .width-box {
        background: #54a0ff;
    }
}

/* Height Queries */
@media (max-height: 500px) {
    .height-box {
        font-size: 16px;
        background: #ff9ff3;
    }
}

@media (min-height: 501px) {
    .height-box {
        font-size: 20px;
        background: #00d2d3;
    }
}

/* Orientation */
@media (orientation: portrait) {
    .orientation-box {
        background: #feca57;
    }
}

@media (orientation: landscape) {
    .orientation-box {
        background: #54e346;
    }
}

/* ===== Hamburger ===== */
.hamburger {
    font-size: 26px;
    cursor: pointer;
    user-select: none;
    position: fixed;
    top: 20px;
    left: 20px;
    padding: 8px 12px;
    border-radius: 6px;
    color: black;
    box-shadow: 0 2px 8px rgba(58, 57, 57, 0.419);
}

/* ===== Sidebar ===== */
.sidebar {
    position: fixed;
    top: 0;
    left: -260px;
    width: 260px;
    height: 100vh;
    background: linear-gradient(180deg, #0f172a 0%, #1e293b 100%);
    padding: 20px;
    transition: left 0.4s cubic-bezier(0.4, 0, 0.2, 1);
    overflow-y: auto;
    z-index: 1000;
    border-right: 1px solid rgba(59, 130, 246, 0.2);
}

.sidebar.active {
    left: 0;
    box-shadow: 4px 0 20px rgba(0, 0, 0, 0.4);
}

.sidebar h2 {
    color: #fff;
    margin-bottom: 15px;
    font-size: 1.1em;
    font-weight: 700;
}

.sidebar h1 {
    color: #60a5fa;
    font-size: 13px;
    margin: 20px 0 15px 0;
    padding: 12px;
    border-top: 1px solid rgba(255, 255, 255, 0.1);
    text-transform: uppercase;
    letter-spacing: 0.5px;
    cursor: pointer;
    user-select: none;
    border-radius: 6px;
    transition: all 0.3s ease;
    font-weight: 600;
}

.sidebar h1:hover {
    background: rgba(96, 165, 250, 0.15);
    padding-left: 16px;
}

.sidebar h1::before {
    content: "▼ ";
    font-size: 10px;
    margin-right: 8px;
    transition: transform 0.3s ease;
    display: inline-block;
}

.sidebar h1.collapsed::before {
    transform: rotate(-90deg);
}

.sidebar-section {
    max-height: 2000px;
    overflow: hidden;
    transition: max-height 0.3s ease;
}

.sidebar-section.collapsed {
    max-height: 0;
}

.sidebar a {
    display: block;
    color: #cbd5e1;
    text-decoration: none;
    padding: 10px 12px;
    font-size: 14px;
    font-weight: 500;
    border-radius: 6px;
    transition: all 0.3s ease;
    margin-bottom: 4px;
}

.sidebar a:hover {
    color: #fff;
    background: rgba(96, 165, 250, 0.2);
    padding-left: 18px;
    border-left: 3px solid #60a5fa;
}

/* ===== Overlay ===== */
.overlay {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.4);
    display: none;
    z-index: 900;
}

.overlay.active {
    display: block;
}

/* ===== RESPONSIVE DESIGN ===== */
@media (max-width: 1024px) {
    body {
        padding: 20px;
    }

    h1 {
        font-size: 28px;
        margin-bottom: 30px;
    }

    section {
        padding: 20px;
        margin-bottom: 30px;
    }

    h2 {
        font-size: 22px;
    }

    p {
        font-size: 15px;
    }

    .example-box {
        padding: 30px;
        font-size: 18px;
    }
}

@media (max-width: 768px) {
    body {
        padding: 15px;
    }

    h1 {
        font-size: 22px;
        margin-bottom: 20px;
    }

    section {
        padding: 15px;
        margin-bottom: 20px;
    }

    h2 {
        font-size: 18px;
        margin-bottom: 10px;
    }

    p {
        font-size: 13px;
        margin: 6px 0;
    }

    pre {
        padding: 10px;
        font-size: 12px;
    }

    .example-box {
        margin-top: 15px;
        padding: 25px;
        font-size: 16px;
    }

    button {
        width: 100px;
        height: 28px;
        font-size: 16px;
    }

    .hamburger {
        font-size: 22px;
    }

    .sidebar {
        width: 220px;
        left: -220px;
    }
}

@media (max-width: 480px) {
    body {
        padding: 10px;
    }

    h1 {
        font-size: 18px;
        margin-bottom: 15px;
    }

    section {
        padding: 12px;
        margin-bottom: 15px;
    }

    h2 {
        font-size: 16px;
    }

    p {
        font-size: 12px;
    }

    pre {
        padding: 8px;
        font-size: 11px;
        overflow-x: auto;
    }

    .example-box {
        margin-top: 12px;
        padding: 20px;
        font-size: 14px;
    }

    button {
        width: 90px;
        height: 26px;
        font-size: 14px;
    }

    .hamburger {
        font-size: 20px;
        padding: 6px 10px;
    }

    .sidebar {
        width: 200px;
        left: -200px;
        padding: 15px;
    }

    .sidebar h1 {
        font-size: 13px;
    }

    .sidebar a {
        font-size: 12px;
    }
}

/* ===== Scroll to Top Button ===== */
.scroll-to-top {
    position: fixed;
    bottom: 30px;
    right: 30px;
    width: 45px;
    height: 45px;
    background: #667eea;
    color: white;
    border: none;
    border-radius: 50%;
    font-size: 24px;
    cursor: pointer;
    display: none;
    align-items: center;
    justify-content: center;
    z-index: 999;
    transition: all 0.3s ease;
    box-shadow: 0 4px 12px rgba(102, 126, 234, 0.4);
}

.scroll-to-top:hover {
    background: #5568d3;
    transform: translateY(-3px);
    box-shadow: 0 6px 16px rgba(102, 126, 234, 0.6);
}

.scroll-to-top.show {
    display: flex;
}

.category {
    background: #1e293b;
    border-radius: 14px;
    padding: 25px;
    margin-bottom: 25px;
    border: 1px solid #334155;
    transition: .3s;
}

.category:hover {
    transform: translateY(-4px);
    box-shadow: 0 8px 20px rgba(0, 0, 0, 0.35);
}

.category h2 {
    color: #38bdf8;
    margin-bottom: 15px;
    font-size: 1.5em;
    border-bottom: 2px solid #38bdf8;
    padding-bottom: 8px;
}

.tags-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(190px, 1fr));
    gap: 14px;
}

.tag-link {
    display: inline-block;
    padding: 12px 16px;
    background: #0f172a;
    color: #38bdf8;
    text-decoration: none;
    border-radius: 10px;
    border: 1px solid #334155;
    transition: all 0.3s ease;
    font-weight: 500;
}

.tag-link:hover {
    background: #38bdf8;
    color: #0f172a;
    transform: translateY(-3px);
    box-shadow: 0 6px 15px rgba(56, 189, 248, 0.4);
}