/* Discord Navigation Sidebar - Mimics Discord's channel list */

:root {
    --discord-bg-primary: #36393f;
    --discord-bg-secondary: #2f3136;
    --discord-bg-tertiary: #202225;
    --discord-text-normal: #dcddde;
    --discord-text-muted: #72767d;
    --discord-text-link: #00b0f4;
    --discord-interactive-normal: #b9bbbe;
    --discord-interactive-hover: #dcddde;
    --discord-interactive-active: #fff;
    --discord-interactive-muted: #4f5058;
    --discord-background-modifier-hover: rgba(79, 84, 92, 0.16);
    --discord-background-modifier-active: rgba(79, 84, 92, 0.24);
    --discord-background-modifier-selected: rgba(79, 84, 92, 0.32);
    --discord-scrollbar-thin-thumb: #202225;
    --discord-scrollbar-thin-track: transparent;
}

#discord-nav-sidebar {
    position: fixed;
    left: 0;
    top: 0;
    width: 240px;
    height: 100vh;
    background-color: var(--discord-bg-secondary);
    color: var(--discord-text-normal);
    font-family: "gg sans", "Helvetica Neue", Helvetica, Arial, sans-serif;
    font-size: 16px;
    overflow: hidden;
    display: flex;
    flex-direction: column;
    z-index: 10000;
    box-shadow: 0 0 0 1px rgba(0, 0, 0, 0.2), 0 2px 10px 0 rgba(0, 0, 0, 0.2);
}

#discord-nav-sidebar.hidden {
    display: none;
}

html, body {
    margin: 0;
    padding: 0;
    height: 100%;
}
body.discord-nav-active {
    overflow: hidden;
}
body.discord-nav-active .preamble,
body.discord-nav-active .chatlog,
body.discord-nav-active .postamble {
    margin-left: 240px;
    width: calc(100% - 240px);
    max-width: none;
}
body.discord-nav-active .chatlog {
    height: calc(100vh - 200px);
    overflow-y: auto;
    overflow-x: hidden;
}

/* Header with guild name and search */
.discord-nav-header {
    padding: 16px;
    border-bottom: 1px solid rgba(0, 0, 0, 0.2);
    box-shadow: 0 1px 0 rgba(4, 4, 5, 0.2), 0 1.5px 0 rgba(6, 6, 7, 0.05), 0 2px 0 rgba(4, 4, 5, 0.05);
    flex-shrink: 0;
}

.discord-nav-guild-name {
    font-weight: 600;
    font-size: 16px;
    line-height: 20px;
    color: var(--discord-text-normal);
    margin-bottom: 12px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.discord-nav-search {
    position: relative;
}

.discord-nav-search input {
    width: 100%;
    height: 28px;
    padding: 0 8px;
    background-color: var(--discord-bg-tertiary);
    border: none;
    border-radius: 4px;
    color: var(--discord-text-normal);
    font-size: 14px;
    font-family: inherit;
    outline: none;
}

.discord-nav-search input::placeholder {
    color: var(--discord-text-muted);
}

.discord-nav-search input:focus {
    background-color: var(--discord-bg-primary);
}

/* Channel list container */
.discord-nav-channels {
    flex: 1;
    overflow-y: auto;
    overflow-x: hidden;
    padding: 8px 0;
}

.discord-nav-channels::-webkit-scrollbar {
    width: 8px;
}

.discord-nav-channels::-webkit-scrollbar-track {
    background: var(--discord-scrollbar-thin-track);
}

.discord-nav-channels::-webkit-scrollbar-thumb {
    background-color: var(--discord-scrollbar-thin-thumb);
    border-radius: 4px;
}

/* Category header */
.discord-nav-category {
    margin-top: 16px;
}

.discord-nav-category:first-child {
    margin-top: 0;
}

.discord-nav-category-header {
    display: flex;
    align-items: center;
    padding: 6px 8px;
    margin: 0 8px;
    cursor: pointer;
    user-select: none;
    text-transform: uppercase;
    font-size: 12px;
    font-weight: 600;
    color: var(--discord-interactive-muted);
    letter-spacing: 0.02em;
}

.discord-nav-category-header:hover {
    color: var(--discord-interactive-hover);
}

.discord-nav-category-arrow {
    display: inline-block;
    width: 12px;
    height: 12px;
    margin-right: 4px;
    transition: transform 0.2s ease;
}

.discord-nav-category.collapsed .discord-nav-category-arrow {
    transform: rotate(-90deg);
}

.discord-nav-category.collapsed .discord-nav-category-channels {
    display: none;
}

/* Channel item */
.discord-nav-channel {
    display: flex;
    align-items: center;
    padding: 6px 8px;
    margin: 1px 8px;
    border-radius: 4px;
    cursor: pointer;
    color: var(--discord-interactive-normal);
    font-size: 16px;
    font-weight: 500;
    text-decoration: none;
    position: relative;
}

.discord-nav-channel:hover {
    background-color: var(--discord-background-modifier-hover);
    color: var(--discord-interactive-hover);
}

.discord-nav-channel.active {
    background-color: var(--discord-background-modifier-selected);
    color: var(--discord-interactive-active);
}

.discord-nav-channel-icon {
    display: inline-block;
    width: 20px;
    height: 20px;
    margin-right: 6px;
    color: var(--discord-interactive-muted);
    flex-shrink: 0;
}

.discord-nav-channel.active .discord-nav-channel-icon {
    color: var(--discord-interactive-active);
}

.discord-nav-channel-name {
    flex: 1;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

/* Toggle button */
.discord-nav-toggle {
    position: fixed;
    left: 10px;
    top: 10px;
    z-index: 10001;
    background-color: var(--discord-bg-secondary);
    border: 1px solid rgba(0, 0, 0, 0.3);
    border-radius: 4px;
    padding: 8px 12px;
    color: var(--discord-text-normal);
    cursor: pointer;
    font-family: "gg sans", "Helvetica Neue", Helvetica, Arial, sans-serif;
    font-size: 14px;
    font-weight: 500;
    box-shadow: 0 2px 10px 0 rgba(0, 0, 0, 0.2);
}

.discord-nav-toggle:hover {
    background-color: var(--discord-bg-primary);
}

body.discord-nav-active .discord-nav-toggle {
    left: 250px;
}

/* No results message */
.discord-nav-no-results {
    padding: 16px;
    text-align: center;
    color: var(--discord-text-muted);
    font-size: 14px;
}

/* Hidden class */
.discord-nav-hidden {
    display: none;
}
