/* W3Schools Like Design CSS */
:root {
    --w3-green: #04AA6D;
    --w3-green-hover: #059862;
    --w3-bg: #ffffff;
    --w3-sidebar-bg: #f1f1f1;
    --w3-top-bg: #282A35;
    --w3-text-dark: #000000;
    --w3-text-light: #ffffff;
    --w3-code-bg: #f1f1f1;
    --w3-border: #e3e3e3;
}

* {
    box-sizing: border-box;
    font-family: "Segoe UI", Arial, sans-serif;
    margin: 0;
    padding: 0;
}

body {
    background-color: var(--w3-bg);
    color: var(--w3-text-dark);
}

/* TOPNAV */
.topnav {
    background-color: var(--w3-top-bg);
    overflow: hidden;
    position: fixed;
    top: 0;
    width: 100%;
    z-index: 10;
    display: flex;
    align-items: center;
}

.topnav a {
    color: var(--w3-text-light);
    text-align: center;
    padding: 14px 24px;
    text-decoration: none;
    font-size: 17px;
    transition: 0.3s;
}

.topnav a.logo {
    font-weight: bold;
    font-size: 22px;
    letter-spacing: 1px;
}

.topnav a:hover:not(.logo) {
    background-color: var(--w3-green);
    color: white;
}

.topnav a.active {
    background-color: var(--w3-green);
    color: white;
}

/* MAIN LAYOUT */
.main-container {
    display: flex;
    margin-top: 55px; /* Topnav height */
    min-height: calc(100vh - 55px);
}

/* SIDEBAR */
.sidebar {
    width: 250px;
    background-color: var(--w3-sidebar-bg);
    height: calc(100vh - 55px);
    position: fixed;
    overflow-y: auto;
    padding-top: 20px;
    padding-bottom: 20px;
}

.sidebar h3 {
    padding: 0 16px 16px;
    margin: 0;
    font-size: 20px;
    color: var(--w3-text-dark);
}

.sidebar-link {
    display: block;
    color: var(--w3-text-dark);
    padding: 6px 16px;
    text-decoration: none;
    font-size: 15px;
}

.sidebar-link:hover {
    background-color: #cccccc;
}

.sidebar-link.active {
    background-color: var(--w3-green);
    color: white;
}

/* MAIN CONTENT */
.content {
    margin-left: 250px; /* Sidebar width */
    padding: 30px 40px;
    flex: 1;
    max-width: 1200px;
}

.page-section {
    display: none;
    animation: fadeEffect 0.3s;
}

.page-section.active {
    display: block;
}

@keyframes fadeEffect {
    from {opacity: 0;}
    to {opacity: 1;}
}

/* TYPOGRAPHY */
h1 {
    font-size: 40px;
    margin-bottom: 20px;
    font-weight: 500;
}

h2 {
    font-size: 30px;
    margin-top: 30px;
    margin-bottom: 15px;
    font-weight: 400;
}

p {
    font-size: 16px;
    line-height: 1.6;
    margin-bottom: 16px;
}

.intro {
    font-size: 18px;
}

.text-green {
    color: var(--w3-green);
}

hr {
    border: 0;
    border-top: 1px solid var(--w3-border);
    margin: 30px 0;
}

/* NAV BUTTONS */
.nav-buttons {
    display: flex;
    justify-content: space-between;
    margin: 20px 0;
}

.nav-buttons.bottom {
    margin-top: 40px;
}

.nav-btn {
    background-color: var(--w3-green);
    color: white;
    border: none;
    padding: 10px 20px;
    font-size: 16px;
    cursor: pointer;
    border-radius: 4px;
    font-weight: bold;
}

.nav-btn:hover {
    background-color: var(--w3-green-hover);
}

.nav-btn:disabled {
    background-color: #cccccc;
    color: #666666;
    cursor: not-allowed;
}

/* EXAMPLE BLOCKS */
.w3-example {
    background-color: #E7E9EB;
    padding: 15px;
    margin: 20px 0;
    border-radius: 5px;
}

.w3-example h3 {
    margin-bottom: 15px;
    font-weight: 400;
}

.w3-code {
    background-color: white;
    padding: 15px;
    border-left: 4px solid var(--w3-green);
    font-family: Consolas, 'Courier New', monospace;
    font-size: 15px;
    overflow-x: auto;
    white-space: pre;
    line-height: 1.4;
}

/* CODE HIGHLIGHTING */
.keyword { color: #0000ff; }
.string { color: #a31515; }
.comment { color: #008000; }

/* RESPONSIVE */
@media (max-width: 992px) {
    .sidebar {
        width: 200px;
    }
    .content {
        margin-left: 200px;
        padding: 20px;
    }
}

@media (max-width: 768px) {
    .sidebar {
        position: relative;
        width: 100%;
        height: auto;
        display: flex;
        flex-wrap: wrap;
        padding: 10px;
    }
    .sidebar h3 {
        display: none;
    }
    .sidebar-link {
        padding: 10px;
        flex: 1 1 50%;
    }
    .main-container {
        flex-direction: column;
    }
    .content {
        margin-left: 0;
    }
}

/* W3 PANEL & NOTES */
.w3-panel {
    padding: 15px;
    margin-top: 16px;
    margin-bottom: 16px;
    border-radius: 4px;
}
.w3-info {
    background-color: #ddffff;
    border-left: 6px solid #2196F3;
}
.w3-warning {
    background-color: #ffffcc;
    border-left: 6px solid #ffeb3b;
}

/* FOOTER */
.footer {
    margin-left: 250px;
    background-color: var(--w3-top-bg);
    color: var(--w3-text-light);
    text-align: center;
    padding: 30px 20px;
    margin-top: 50px;
}

@media screen and (max-width: 768px) {
    .footer {
        margin-left: 0;
    }
}