* { margin: 0; padding: 0; box-sizing: border-box; }

body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    margin: 0;
    padding: 0;
    background-color: #f4f7f6;
    color: #333;
}

body.page-index {
    display: flex;
    min-height: 100vh;
}

.menu-bar {
    background-color: #243342;
    padding: 10px 20px;
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    position: sticky;
    top: 0;
    z-index: 1000;
}

.menu-bar a {
    color: #ecf0f1;
    text-decoration: none;
    padding: 6px 14px;
    font-size: 0.9em;
    transition: background-color 0.3s;
}

.menu-bar a:hover { background-color: #e74c3c; }

.menu-bar a.active { background-color: #e74c3c; font-weight: bold; }

.sidebar {
    width: 400px;
    background-color: #1a1a2e;
    color: white;
    padding: 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: 25px;
}

.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-type: none;
    padding: 0;
    margin: 0;
}

.menu li { margin-bottom: 8px; }

.menu a {
    display: block;
    padding: 12px 15px;
    color: #ecf0f1;
    text-decoration: none;
    background-color: #0f3460;
    transition: background-color 0.3s;
    font-size: 0.9em;
}

.menu a:hover { background-color: #e94560; }

.menu .num {
    font-weight: bold;
    color: #e94560;
    margin-right: 6px;
}

.menu a:hover .num { color: #fff; }

.menu .active {
    background-color: #e94560;
    font-weight: bold;
}

.content {
    flex: 1;
    padding: 40px;
    min-height: 100vh;
}

body.page-index .content {
    margin-left: 400px;
}

.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;
}

.footer a { color: #7f8c8d; text-decoration: none; }

.btn-back {
    display: block;
    padding: 12px 15px;
    color: #ecf0f1;
    text-decoration: none;
    background-color: #e94560;
    transition: background-color 0.3s;
    font-size: 0.9em;
    text-align: center;
    margin-bottom: 10px;
}

.btn-back:hover { background-color: #c73a52; }

.welcome-box {
    background-color: white;
    padding: 50px;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.1);
    max-width: 900px;
    width: 100%;
    text-align: center;
}

.welcome-box h1 { color: #1a1a2e; margin-bottom: 8px; }

.welcome-box h2 {
    color: #1a1a2e;
    margin-bottom: 8px;
}

.welcome-box h3 {
    color: #0f3460;
    margin-top: 0;
    margin-bottom: 20px;
    font-weight: normal;
    border-bottom: 2px solid #e94560;
    padding-bottom: 10px;
}

.welcome-box p {
    font-size: 18px;
    line-height: 1.7;
    color: #7f8c8d;
    text-align: justify;
}

/* Index page (ndx_BIKUS) — word index / glossary */
.index-box {
    background-color: white;
    padding: 30px 40px;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.1);
    max-width: 1000px;
    width: 100%;
    margin: 0 auto;
}
.index-box h2 { color: #1a1a2e; margin-bottom: 8px; }
.index-box h3 {
    color: #0f3460;
    margin-top: 0;
    margin-bottom: 24px;
    font-weight: normal;
    border-bottom: 2px solid #e94560;
    padding-bottom: 10px;
}
.index-box p.desc {
    color: #555;
    margin-bottom: 24px;
    line-height: 1.6;
}
.toc {
    background: #f0f4f8;
    padding: 16px 20px;
    margin-bottom: 28px;
    border-left: 4px solid #0f3460;
}
.toc h4 { color: #0f3460; margin-bottom: 10px; }
.toc a {
    color: #0f3460;
    text-decoration: none;
    font-size: 0.92em;
    line-height: 1.8;
}
.toc a:hover { text-decoration: underline; color: #e94560; }

.letter-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(42px, 1fr));
    gap: 6px;
    margin-bottom: 24px;
}
.letter-card {
    background: #f0f4f8;
    border-left: 4px solid #0f3460;
    text-align: center;
    padding: 6px 0;
    cursor: pointer;
    font-weight: 700;
    font-size: 1.05em;
    color: #0f3460;
    transition: all 0.2s;
    user-select: none;
}
.letter-card:hover { background: #e94560; color: #fff; border-left-color: #1a1a2e; }
.letter-card.active { background: #e94560; color: #fff; border-left-color: #1a1a2e; }

.cat { margin-bottom: 36px; }
.cat h4 {
    color: #1a1a2e;
    font-size: 1.15em;
    background: #f0f4f8;
    padding: 10px 14px;
    border-left: 5px solid #e94560;
    margin-bottom: 14px;
}
.entry {
    padding: 10px 14px;
    border-bottom: 1px solid #eef1f0;
}
.entry:last-child { border-bottom: none; }
.entry .term-link {
    color: #1a1a2e;
    text-decoration: none;
    font-weight: 600;
    display: block;
    padding: 2px 0;
    transition: color 0.15s;
}
.entry .term-link:hover { color: #e94560; text-decoration: underline; }

.scroll-top {
    position: fixed;
    bottom: 30px;
    right: 30px;
    background: #e94560;
    color: white;
    border: none;
    padding: 10px 16px;
    cursor: pointer;
    font-size: 1.2em;
    box-shadow: 0 2px 8px rgba(0,0,0,0.2);
}
.scroll-top:hover { background: #c73a52; }

/* Slides for lecture pages — pidsk presentation style */
.slide {
    max-width: 1100px;
    margin: 30px auto;
    background: #f9f9f9;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
    overflow: hidden;
}

.slide .header {
    background-color: #364d63;
    color: white;
    padding: 14px 24px;
    display: flex;
    align-items: center;
    gap: 16px;
}

.slide .slide-number {
    background-color: #e74c3c;
    padding: 4px 14px;
    font-weight: bold;
    font-size: 0.95em;
    white-space: nowrap;
}

.slide .slide-title {
    font-size: 1.15em;
    font-weight: 600;
    border-bottom: 2px solid #e74c3c;
    padding-bottom: 4px;
}

.slide .slide-inner {
    display: flex;
    flex-wrap: wrap;
    padding: 24px;
    gap: 24px;
}

.slide .text {
    flex: 3;
    min-width: 300px;
    max-width: 100%;
}

.slide .text h3 {
    color: #2c3e50;
    margin-bottom: 12px;
    font-size: 1.15em;
}

.slide .text p {
    margin-bottom: 10px;
    text-align: justify;
}

.slide .text ul, .slide .text ol {
    margin: 10px 0 10px 20px;
}

.slide .text li {
    margin-bottom: 6px;
}

.slide .illustration {
    flex: 2;
    min-width: 250px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.slide .illustration img {
    max-width: 100%;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.15);
}

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

table.tech {
    border-collapse: collapse;
    width: 100%;
    font-size: 0.95em;
    margin-top: 10px;
}

table.tech th {
    background-color: #2c3e50;
    color: white;
    padding: 10px;
    text-align: left;
}

table.tech td {
    border: 1px solid #ccc;
    padding: 10px;
}

table.tech tr:nth-child(even) {
    background-color: #f2f2f2;
}

.code-block {
    background-color: #2d2d2d;
    color: #f8f8f2;
    padding: 15px;
    border-radius: 5px;
    font-family: 'Courier New', Courier, monospace;
    font-size: 0.9em;
    white-space: pre-wrap;
    margin: 10px 0;
}

@media (max-width: 768px) {
    .sidebar { width: 100%; position: relative; height: auto; }
    body.page-index .content { margin-left: 0; padding: 20px; }
    .slide .slide-inner { flex-direction: column; }
    .slide .illustration { order: -1; }
    .menu-bar { gap: 4px; padding: 8px 10px; }
    .menu-bar a { font-size: 0.8em; padding: 4px 8px; }
}

.slide_ext { background-color: #eef5fa; padding: 24px 24px; padding-right:20%; border-top: 2px solid #2c3e50; display: none; }
.slide_ext p { margin-bottom: 8px; font-size: 0.95em; }
.slide_ext.hidden { display: block; }
