* { margin: 0; padding: 0; box-sizing: border-box; }
body { font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif; color: #333; line-height: 1.7; }

body.sidebar-layout {
    background-color: #f4f7f6;
    display: flex;
    min-height: 100vh;
}

.sidebar {
    width: 400px;
    background-color: #1a1a2e;
    color: white;
    padding: 25px 20px;
    box-shadow: 2px 0 5px rgba(0, 0, 0, 0.2);
    display: flex;
    flex-direction: column;
    position: fixed;
    height: 100vh;
    overflow-y: auto;
    top: 0;
    left: 0;
}

.sidebar h1 {
    font-size: 20px;
    margin-bottom: 10px;
    text-align: center;
    border-bottom: 1px solid #0f3460;
    padding-bottom: 15px;
    color: #e94560;
}

.sidebar .subtitle {
    font-size: 12px;
    text-align: center;
    color: #888;
    margin-bottom: 20px;
}

.sidebar .section-title {
    font-size: 13px;
    text-align: left;
    color: #e94560;
    margin-top: 18px;
    margin-bottom: 8px;
    font-weight: bold;
    border-bottom: 1px solid #0f3460;
    padding-bottom: 4px;
}

.menu { list-style: none; padding: 0; margin: 0; }
.menu li { margin-bottom: 6px; }
.menu a {
    display: block;
    padding: 10px 14px;
    color: #ecf0f1;
    text-decoration: none;
    background-color: #243342;
    transition: background-color 0.3s;
    font-size: 0.85em;
}
.menu a:hover, .menu a.active { background-color: #e94560; }

.content-area {
    flex: 1;
    padding: 40px;
    margin-left: 400px;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
}

.welcome-box {
    background-color: white;
    padding: 40px;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.1);
    max-width: 800px;
    width: 100%;
}
.welcome-box h1 { color: #1a1a2e; margin-bottom: 8px; }
.welcome-box h2 {
    color: #0f3460;
    margin-top: 0;
    margin-bottom: 10px;
    font-weight: normal;
    border-bottom: 2px solid #e94560;
    padding-bottom: 10px;
}
.welcome-box h3 { color: #e94560; margin-bottom: 20px; font-weight: normal; font-size: 1em; }
.welcome-box p { font-size: 16px; line-height: 1.8; color: #555; margin-bottom: 14px; }

.sidebar .footer {
    margin-top: auto;
    text-align: center;
    padding-top: 20px;
    font-size: 0.85em;
    color: #7f8c8d;
    border-top: 1px solid #0f3460;
    padding-bottom: 20px;
    margin-bottom: 25px;
}
.sidebar .footer a { color: #7f8c8d; text-decoration: none; }

@media (max-width: 768px) {
    .sidebar { width: 100%; position: relative; height: auto; }
    .content-area { margin-left: 0; padding: 20px; }
}

/* === LECTURE LAYOUT === */
body.lecture-layout { background-color: #f0f2f5; padding: 0; margin: 0; padding-top: 50px; }

.menu-bar {
    background-color: #243342;
    padding: 10px 20px;
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    z-index: 1000;
    align-items: center;
}
.menu-bar a {
    color: #ecf0f1;
    text-decoration: none;
    padding: 6px 14px;
    font-size: 0.9em;
    transition: background-color 0.3s;
}
.menu-bar a:hover, .menu-bar a.active { background-color: #e94560; font-weight: bold; }

.slide {
    max-width: 1100px;
    margin: 30px auto;
    background: #f9f9f9;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
    overflow: hidden;
}
.header {
    background-color: #364d63;
    color: white;
    padding: 14px 24px;
    display: flex;
    align-items: center;
    gap: 16px;
}
.slide-number {
    background-color: #e94560;
    padding: 4px 14px;
    font-weight: bold;
    font-size: 0.95em;
    white-space: nowrap;
}
.slide-title {
    font-size: 1.15em;
    font-weight: 600;
    border-bottom: 2px solid #e94560;
    padding-bottom: 4px;
}
.slide-content {
    display: flex;
    flex-wrap: wrap;
    padding: 24px;
    gap: 24px;
}
.text { flex: 3; min-width: 300px; max-width: 100%; }
.text h3 { color: #2c3e50; margin-bottom: 12px; font-size: 1.15em; }
.text p { margin-bottom: 10px; text-align: justify; }
.text ul, .text ol { margin: 10px 0 10px 20px; }
.text li { margin-bottom: 6px; }
.illustration { flex: 2; min-width: 250px; display: flex; align-items: center; justify-content: center; }
.illustration img { max-width: 100%; box-shadow: 0 2px 8px rgba(0, 0, 0, 0.15); }

pre.cli {
    background-color: #1e1e1e;
    color: #d4d4d4;
    padding: 16px;
    overflow-x: auto;
    font-family: 'Courier New', Courier, monospace;
    font-size: 0.92em;
    line-height: 1.6;
    margin: 12px 0;
    border-left: 5px solid #e94560;
}
.cmd { color: #569cd6; } .def { color: #dcdcaa; } .str { color: #ce9178; }
.comment { color: #6a9955; font-style: italic; } .num { color: #b5cea8; } .attr { color: #9cdcfe; }

.important-box { background-color: #fff3cd; border-left: 5px solid #ffc107; padding: 15px; margin: 12px 0; }
.note { background-color: #fff3cd; border-left: 5px solid #ffc107; padding: 15px; margin: 12px 0; }
.note strong { color: #333; }

table { width: 100%; border-collapse: collapse; margin: 12px 0; }
table th, table td { border: 1px solid #ddd; padding: 8px 12px; text-align: left; }
table th { background-color: #2c3e50; color: white; }
table tr:nth-child(even) { background-color: #f2f2f2; }

code {
    background-color: #eef5fa;
    padding: 2px 6px;
    font-family: 'Courier New', Courier, monospace;
    color: #c7254e;
    font-weight: bold;
    font-size: 0.9em;
}

@media (max-width: 768px) {
    .slide-content { flex-direction: column; }
    .illustration { order: -1; }
}

.btn-toggle {
    background-color: #e94560;
    color: white;
    border: none;
    padding: 6px 14px;
    font-size: 0.9em;
    cursor: pointer;
    margin-left: auto;
    transition: background-color 0.3s;
    font-family: inherit;
    white-space: nowrap;
}
.btn-toggle:hover {
    background-color: #c73050;
}

.slide_ext {
    padding: 20px 24px;
    background-color: #eef5fa;
    border-top: 2px solid #2c3e50;
}
.slide_ext p {
    margin-bottom: 10px;
    text-align: justify;
}

.hidden {
    display: none;
}
