:root {
    --primary-color: #4a90e2;
    --secondary-color: #f5f5f5;
    --text-color: #333;
    --border-color: #ddd;
}

* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

body {
    font-family: Arial, sans-serif;
    line-height: 1.6;
    color: var(--text-color);
    display: flex;
    flex-direction: column;
    height: 100vh;
    overflow: hidden;
}

header {
    background-color: var(--primary-color);
    color: white;
    padding: 1rem;
    text-align: center;
}

main {
    display: flex;
    flex: 1;
    overflow: hidden;
}

#sidebar {
    width: 300px;
    background-color: var(--secondary-color);
    padding: 1rem;
    overflow-y: auto;
    transition: transform 0.3s ease-in-out;
}

#viewer {
    flex: 1;
    overflow: hidden;
}

#controls {
    display: flex;
    justify-content: space-between;
    padding: 1rem;
    background-color: var(--secondary-color);
}

button {
    background-color: var(--primary-color);
    color: white;
    border: none;
    padding: 0.5rem 1rem;
    cursor: pointer;
    transition: background-color 0.3s;
    border-radius: 5px;
}

button:hover {
    background-color: #3a80d2;
}

input[type="file"], input[type="text"] {
    width: 100%;
    padding: 0.5rem;
    margin-bottom: 1rem;
}

#toc {
    list-style-type: none;
}

#toc li {
    margin-bottom: 0.5rem;
}

#toc a {
    color: var(--text-color);
    text-decoration: none;
}

#toc a:hover {
    color: var(--primary-color);
}

.collapsible {
    background-color: var(--primary-color);
    color: white;
    cursor: pointer;
    padding: 18px;
    width: 100%;
    border: none;
    text-align: left;
    outline: none;
    font-size: 15px;
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.collapsible:after {
    content: '\25B6';
    font-size: 13px;
    color: white;
    transition: transform 0.3s;
}

.collapsible.active:after {
    transform: rotate(90deg);
}

.content {
    padding: 0 18px;
    max-height: 0;
    overflow: hidden;
    transition: max-height 0.2s ease-out;
    background-color: var(--secondary-color);
}

@media (max-width: 768px) {
    #sidebar {
        position: absolute;
        top: 0;
        left: 0;
        height: 100%;
        transform: translateX(-100%);
        z-index: 1000;
    }

    #sidebar.active {
        transform: translateX(0);
    }

    #toggle-sidebar {
        display: block;
    }
}

@media (min-width: 769px) {
    #toggle-sidebar {
        display: none;
    }
}