:root {
    --primary-color: #b22222;
    --icon-color: #65757c;
    --bg-primary-color: #f5f5f5;
    --bg-secondary-color: #eee;
    --menu-background: #fff;
    --menu-hover-color: #f0f0f0;
    --border-color: #ddd;
    --primary-text: #333;
    --secondary-text: #999;
}

[data-bs-theme="dark"] {
    --bg-primary-color: #181a1a;
    --bg-secondary-color: #1c1e1f;
    --menu-background: #121414;
    --menu-hover-color: #1a1d1e;
    --border-color: #35383a;
    --primary-text: #c4beb5;
    --secondary-text: #a49b8e;
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    font-family:
        Manrope,
        system-ui,
        -apple-system,
        BlinkMacSystemFont,
        "Segoe UI",
        Roboto,
        Oxygen,
        Ubuntu,
        Cantarell,
        "Open Sans",
        "Helvetica Neue",
        sans-serif;
}

html,
body {
    height: 100%;
}

body {
    background-color: var(--bs-body-bg);
}

a {
    text-decoration: none !important;
    color: var(--primary-text);
}

code {
    color: #d63384;
    font-size: .875rem;
    font-family: unset;
}

.text-secondary {
    color: var(--secondary-text);
}

.text-small {
    font-size: .875rem;
}

.wrapper {
    display: flex;
    height: 100vh;
    flex-direction: column;
}

.header {
    background: var(--menu-background);
    padding: 1rem 1rem;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
    display: flex;
    justify-content: space-between;
}

.header h1 {
    margin: 0;
    font-size: 1rem;
    line-height: 1;
    font-weight: 600;
}

.sidebar img {
    max-width: 100%;
    max-height: 3rem;
}

.content-wrapper {
    display: flex;
    flex: 1;
    overflow: hidden;
}

.sidebar {
    display: flex;
    flex-direction: column;
    width: 300px;
    background: var(--menu-background);
    border-right: 1px solid var(--border-color);
    overflow-y: auto;
    padding: 1.5rem;
    box-shadow: 2px 0 4px rgba(0, 0, 0, 0.05);
}

.sidebar-list {
    list-style: none;
    padding-left: .5rem;
}

.sidebar-tree {
    margin-top: 1rem;
    flex: 1;
    overflow-y: auto;
}

.sidebar-footer {
    color: var(--primary-text);
    margin-top: auto;
    font-size: .8rem;
    display: flex;
    justify-content: space-between;
}

.main-content {
    flex: 1;
    display: flex;
    flex-direction: column;
    overflow: hidden;
}

.toolbar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    background: var(--menu-background);
    padding: 1rem 2rem;
    border-bottom: 1px solid var(--border-color);
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.05);
}

.file-list {
    flex: 1;
    overflow-y: auto;
    padding: 2rem;
    background: var(--bg-primary-color);
}

.tree-link {
    display: flex;
    align-items: center;
    padding: 0.25rem 0.33rem;
    color: var(--primary-text);
    text-decoration: none;
    border-radius: 4px;
    transition: all 0.2s;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    font-size: .9rem;
}

.tree-link:hover {
    background-color: var(--menu-hover-color);
    color: var(--primary-color);
}

.tree-link-active {
    font-weight: 700;
}

.tree-link i {
    margin-right: 0.6rem;
    min-width: 1.2rem;
    color: inherit;
}

.tree-item {
    margin: 0.2rem 0;
}

.file-card {
    color: var(--primary-text);
    background: var(--menu-background);
    border: 1px solid var(--border-color);
    border-radius: 6px;
    padding: 0.5rem 1rem;
    margin-bottom: 0.5rem;
    transition: all 0.2s;
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.file-card:hover {
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
    border-color: var(--primary-color);
}

.file-card:active {
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1) inset;
}

.file-content-card {
    color: var(--primary-text);
    background: var(--bg-secondary-color);
    border: 1px solid var(--border-color);
    border-radius: 6px;
    padding: .5rem 1rem;
    transition: all .2s;
}

.file-content-card *:not(code) {
    color: inherit;
}

.file-content-card a {
    color: var(--primary-color);
    text-decoration: underline !important;
}

.file-info {
    display: flex;
    align-items: center;
    flex: 1;
    min-width: 0;
}

.file-icon {
    font-size: 1.5rem;
    color: var(--icon-color);
    margin-right: 1rem;
    min-width: 1.5rem;
}

.file-icon > .ph-link {
    color: #105f7f;
}

.file-icon > .ph-folder-simple {
    color: #edcb68;
}

.file-details {
    flex: 1;
    min-width: 0;
}

.file-name {
    font-weight: 500;
    color: var(--primary-text);
    margin: 0;
    word-break: break-all;
}

.file-meta {
    font-size: 0.8rem;
    color: var(--secondary-text);
    margin: 0;
}

.file-additional-icon {
    color: var(--icon-color);
    display: flex;
    gap: 0.5rem;
}

.empty-state {
    text-align: center;
    padding-top: 3rem;
    color: var(--secondary-text);
}

.empty-state i {
    font-size: 3rem;
    margin-bottom: 1rem;
    opacity: 0.3;
}

.breadcrumb {
    display:flex;
    flex-wrap: wrap;
    list-style: none;
    margin-bottom: 0;
    padding: 0;
}

.breadcrumb-item > a {
    color: var(--primary-color);
    text-decoration: underline !important;
}

@media (max-width: 768px) {
    .content-wrapper {
        flex-direction: column;
    }

    .sidebar {
        margin: 0;
        padding: .6rem 0 0 0;
        border: none;
        width: 100%;
    }

    .sidebar-tree {
        display: none;
    }

    .sidebar-footer {
        display: none;
    }
}
