:root {
    --sidebar-width: 300px;
    --sidebar-bg: #f5f5f5;
    --border-color: #ddd;
    --text-color: #333;
    --accent-color: #0066cc;
    --hover-bg: #e9e9e9;
}

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

body,
html {
    height: 100%;
    width: 100%;
    overflow: hidden;
    color: var(--text-color);
}

.container {
    display: flex;
    height: 100vh;
    width: 100%;
}

.sidebar {
    width: var(--sidebar-width);
    background-color: var(--sidebar-bg);
    border-right: 1px solid var(--border-color);
    display: flex;
    flex-direction: column;
    overflow: hidden;
    transition: width 0.3s ease;
    font-size: 14px;
}

.sidebar.collapsed {
    width: 30px;
}

.sidebar-header {
    padding: 10px;
    border-bottom: 1px solid var(--border-color);
    font-weight: bold;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.sidebar-toggle {
    background: none;
    border: none;
    cursor: pointer;
    font-family: monospace;
}

.file-tree {
    flex: 1;
    overflow: auto;
    padding: 10px;
    white-space: nowrap;
}

.collapsed .file-tree,
.collapsed .sidebar-header span {
    display: none;
}

.tree-node {
    display: flex;
    flex-direction: column;
}

.node-content {
    display: flex;
    align-items: center;
    cursor: pointer;
    padding: 2px 0;
}

.node-content:hover {
    color: var(--accent-color);
}

.toggle {
    display: inline-block;
    width: 15px;
    text-align: center;
    flex-shrink: 0;
}

.node-name {
    word-break: break-all;
    white-space: normal;
}

.node-children {
    margin-left: 15px;
    display: none;
}

.tree-node.expanded>.node-children {
    display: block;
}

/* Directory styling */
.node-content.directory .node-name {
    font-weight: bold;
    color: #0066cc;
}

/* PDF file styling */
.node-content.pdf {
    cursor: pointer;
    color: #e41e26;
}

.node-content.pdf.active {
    background-color: var(--accent-color);
    color: white;
}

/* Other file styling */
.node-content.file:not(.pdf) {
    color: #666;
    opacity: 0.8;
}

.path-display {
    padding: 5px 10px;
    border-bottom: 1px solid var(--border-color);
    font-size: 12px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.viewer {
    flex: 1;
    display: flex;
    flex-direction: column;
    overflow: hidden;
}

iframe {
    flex: 1;
    border: none;
}

@media (max-width: 768px) {
    .container {
        flex-direction: column;
    }

    .sidebar {
        width: 100%;
        height: 200px;
    }

    .sidebar.collapsed {
        height: 30px;
    }
}
