/* --- CSS Variables --- */
:root {
    --background-primary: #36393f;
    --background-secondary: #2f3136;
    --background-secondary-alt: #292b2f;
    --background-tertiary: #202225;
    --channel-interactive: #2e3035;
    --header-primary: #ffffff;
    --header-secondary: #b9bbbe;
    --text-normal: #dcddde;
    --text-muted: #72767d;
    --text-link: #00b0f4;
    --interactive-normal: #b9bbbe;
    --interactive-hover: #dcddde;
    --interactive-active: #ffffff;
    --background-modifier-hover: rgba(79,84,92,0.16);
    --background-modifier-active: rgba(79,84,92,0.24);
    --background-modifier-selected: rgba(79,84,92,0.32);
    --background-accent: #4f545c;
    --green: #43b581;
    --yellow: #faa61a;
    --red: #f04747;
    --brand-experiment: #5865f2;
    --font-primary: 'gg sans', 'Noto Sans', 'Helvetica Neue', Helvetica, Arial, sans-serif;
    --scrollbar-thumb: #202225;
    --scrollbar-track: #2e3136;
}

/* --- Base Styles --- */
*, *::before, *::after {
    box-sizing: border-box;
}

body {
    margin: 0;
    font-family: var(--font-primary);
    background-color: var(--background-primary);
    color: var(--text-normal);
    overflow: hidden;
}

#discord-app {
    display: flex;
    height: 100vh;
}

/* --- Servers List --- */
.servers-list {
    display: flex;
    flex-direction: column;
    align-items: center;
    padding-top: 12px;
    width: 72px;
    background-color: var(--background-tertiary);
    flex-shrink: 0;
}

.server-icon {
    width: 48px;
    height: 48px;
    border-radius: 50%;
    background-color: var(--background-primary);
    margin-bottom: 8px;
    cursor: pointer;
    transition: all 0.2s ease;
    position: relative;
    display: flex;
    align-items: center;
    justify-content: center;
}

.server-icon img {
    width: 100%;
    height: 100%;
    border-radius: 50%;
    object-fit: cover;
}

.server-icon:hover {
    border-radius: 16px;
    background-color: var(--brand-experiment);
}
.server-icon.active {
    border-radius: 16px;
    background-color: var(--brand-experiment);
}
.server-icon.active img {
    border-radius: 16px;
}


.server-icon::before {
    content: '';
    position: absolute;
    left: -16px;
    top: 50%;
    transform: translateY(-50%);
    width: 8px;
    height: 8px;
    border-radius: 0 4px 4px 0;
    background-color: white;
    transition: all 0.2s ease;
    transform-origin: left;
    scale: 0;
}
.server-icon:hover::before {
    height: 20px;
    scale: 1;
}
.server-icon.active::before {
    height: 40px;
    scale: 1;
}

[data-tooltip] {
    position: relative;
}
[data-tooltip]:hover::after {
    content: attr(data-tooltip);
    position: absolute;
    left: 70px;
    top: 50%;
    transform: translateY(-50%);
    background-color: var(--background-tertiary);
    color: var(--header-primary);
    padding: 6px 10px;
    border-radius: 6px;
    font-size: 14px;
    font-weight: 600;
    white-space: nowrap;
    z-index: 10;
}


.separator {
    width: 32px;
    height: 2px;
    background-color: var(--background-secondary-alt);
    margin: 0 0 8px 0;
}

/* --- Main Content Layout --- */
.main-content {
    display: flex;
    flex: 1;
}

.channels-panel {
    width: 240px;
    background-color: var(--background-secondary);
    display: flex;
    flex-direction: column;
    flex-shrink: 0;
}

.chat-wrapper {
    display: flex;
    flex: 1;
    min-width: 0;
}

.chat-area {
    flex: 1;
    background-color: var(--background-primary);
    display: flex;
    flex-direction: column;
}

.users-list {
    width: 240px;
    background-color: var(--background-secondary);
    flex-shrink: 0;
}

/* --- Channels Panel --- */
.server-header {
    padding: 0 16px;
    height: 48px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    border-bottom: 1px solid var(--background-tertiary);
    cursor: pointer;
    flex-shrink: 0;
}
.server-header h1 {
    color: var(--header-primary);
    font-size: 16px;
    font-weight: 600;
    margin: 0;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}
.dropdown-arrow {
    width: 18px;
    height: 18px;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 18 18' fill='%23B9BBBE'%3E%3Cpath d='M4.5 6.5L9 11l4.5-4.5' stroke='%23B9BBBE' stroke-width='1.5' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E");
}

.channels-list-container {
    flex: 1;
    overflow-y: auto;
    padding: 8px 8px 0 8px;
}

/* Custom Scrollbar */
.channels-list-container::-webkit-scrollbar,
.messages-container::-webkit-scrollbar,
.users-list::-webkit-scrollbar {
    width: 8px;
}
.channels-list-container::-webkit-scrollbar-track,
.messages-container::-webkit-scrollbar-track,
.users-list::-webkit-scrollbar-track {
    background: transparent;
}
.channels-list-container::-webkit-scrollbar-thumb,
.messages-container::-webkit-scrollbar-thumb,
.users-list::-webkit-scrollbar-thumb {
    background-color: var(--scrollbar-thumb);
    border-radius: 4px;
    border: 2px solid var(--background-secondary);
}
.messages-container::-webkit-scrollbar-thumb {
    border: 2px solid var(--background-primary);
}


.channel-category {
    padding: 12px 8px 4px;
    color: var(--text-muted);
    font-size: 12px;
    font-weight: 700;
    text-transform: uppercase;
}
.channel {
    display: flex;
    align-items: center;
    padding: 6px 8px;
    border-radius: 4px;
    margin-bottom: 2px;
    cursor: pointer;
    color: var(--text-muted);
    font-weight: 500;
}
.channel:hover {
    background-color: var(--background-modifier-hover);
    color: var(--interactive-hover);
}
.channel.active {
    background-color: var(--background-modifier-selected);
    color: var(--interactive-active);
}
.channel .hashtag {
    font-size: 20px;
    margin-right: 6px;
    font-weight: 300;
    color: var(--text-muted);
}
.channel.active .hashtag {
    color: var(--interactive-active);
}

/* User Panel */
.user-panel {
    display: flex;
    align-items: center;
    height: 52px;
    padding: 0 8px;
    background-color: var(--background-secondary-alt);
    flex-shrink: 0;
}
.user-avatar-wrapper {
    position: relative;
    margin-right: 8px;
}
.avatar {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    object-fit: cover;
}
.status-dot {
    position: absolute;
    bottom: 0;
    right: 0;
    width: 10px;
    height: 10px;
    border-radius: 50%;
    border: 2px solid var(--background-secondary-alt);
}
.status-dot.online { background-color: var(--green); }
.status-dot.idle { background-color: var(--yellow); }
.status-dot.dnd { background-color: var(--red); }
.status-dot.offline { background-color: var(--text-muted); }

.user-info {
    display: flex;
    flex-direction: column;
    flex: 1;
    overflow: hidden;
}
.username {
    font-size: 14px;
    font-weight: 600;
    color: var(--header-primary);
}
.user-id {
    font-size: 12px;
    color: var(--text-muted);
}
.user-actions {
    display: flex;
    align-items: center;
}
.user-actions .icon {
    width: 20px;
    height: 20px;
    margin-left: 4px;
    opacity: 0.7;
    cursor: pointer;
    background-size: contain;
    background-repeat: no-repeat;
    background-position: center;
}
.user-actions .icon:hover { opacity: 1; }
.icon.mic { background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='white'%3E%3Cpath d='M12 14c1.66 0 3-1.34 3-3V5c0-1.66-1.34-3-3-3S9 3.34 9 5v6c0 1.66 1.34 3 3 3zm5.3-3c0 3-2.54 5.1-5.3 5.1S6.7 14 6.7 11H5c0 3.41 2.72 6.23 6 6.72V21h2v-3.28c3.28-.49 6-3.31 6-6.72h-1.7z'/%3E%3C/svg%3E"); }
.icon.headphones { background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='white'%3E%3Cpath d='M12 1a9 9 0 0 0-9 9v7c0 1.66 1.34 3 3 3h3v-8H5v-2c0-3.87 3.13-7 7-7s7 3.13 7 7v2h-4v8h3c1.66 0 3-1.34 3-3v-7a9 9 0 0 0-9-9z'/%3E%3C/svg%3E"); }
.icon.settings { background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='white'%3E%3Cpath d='M19.43 12.98c.04-.32.07-.64.07-.98s-.03-.66-.07-.98l2.11-1.65c.19-.15.24-.42.12-.64l-2-3.46c-.12-.22-.39-.3-.61-.22l-2.49 1c-.52-.4-1.08-.73-1.69-.98l-.38-2.65C14.46 2.18 14.25 2 14 2h-4c-.25 0-.46.18-.49.42l-.38 2.65c-.61.25-1.17.59-1.69.98l-2.49-1c-.23-.09-.49 0-.61.22l-2 3.46c-.13.22-.07.49.12.64l2.11 1.65c-.04.32-.07.65-.07.98s.03.66.07.98l-2.11 1.65c-.19.15-.24.42-.12.64l2 3.46c.12.22.39.3.61.22l2.49-1c.52.4 1.08.73 1.69.98l.38 2.65c.03.24.24.42.49.42h4c.25 0 .46-.18.49-.42l.38-2.65c.61-.25 1.17-.59 1.69-.98l2.49 1c.23.09.49 0 .61-.22l2-3.46c.12-.22.07-.49-.12-.64l-2.11-1.65zM12 15.5c-1.93 0-3.5-1.57-3.5-3.5s1.57-3.5 3.5-3.5 3.5 1.57 3.5 3.5-1.57 3.5-3.5 3.5z'/%3E%3C/svg%3E"); }

/* --- Chat Area --- */
.chat-header {
    height: 48px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 16px;
    border-bottom: 1px solid var(--background-tertiary);
    flex-shrink: 0;
}
.chat-header .channel-name {
    display: flex;
    align-items: center;
}
.chat-header .hashtag {
    font-size: 24px;
    color: var(--text-muted);
    font-weight: 300;
    margin-right: 8px;
}
.chat-header h2 {
    font-size: 16px;
    font-weight: 600;
    color: var(--header-primary);
    margin: 0;
}
.chat-header-icons { display: flex; align-items: center; }
.chat-header-icons .icon {
    width: 24px;
    height: 24px;
    margin-left: 16px;
    opacity: 0.7;
    cursor: pointer;
    background-size: 20px;
    background-repeat: no-repeat;
    background-position: center;
}
.chat-header-icons .icon:hover { opacity: 1; }
.icon.bell { background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='white'%3E%3Cpath d='M12 22c1.1 0 2-.9 2-2h-4c0 1.1.9 2 2 2zm6-6v-5c0-3.07-1.63-5.64-4.5-6.32V4c0-.83-.67-1.5-1.5-1.5s-1.5.67-1.5 1.5v.68C7.64 5.36 6 7.92 6 11v5l-2 2v1h16v-1l-2-2z'/%3E%3C/svg%3E"); }
.icon.pin { background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='white'%3E%3Cpath d='M16 9V4h1c.55 0 1-.45 1-1s-.45-1-1-1H7c-.55 0-1 .45-1 1s.45 1 1 1h1v5c0 1.66-1.34 3-3 3v2h5.97v7l1.03 1 1.03-1v-7H19v-2c-1.66 0-3-1.34-3-3z'/%3E%3C/svg%3E"); }
.icon.members { background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='white'%3E%3Cpath d='M16 11c1.66 0 2.99-1.34 2.99-3S17.66 5 16 5c-1.66 0-3 1.34-3 3s1.34 3 3 3zm-8 0c1.66 0 2.99-1.34 2.99-3S9.66 5 8 5C6.34 5 5 6.34 5 8s1.34 3 3 3zm0 2c-2.33 0-7 1.17-7 3.5V19h14v-2.5c0-2.33-4.67-3.5-7-3.5zm8 0c-.29 0-.62.02-.97.05 1.16.84 1.97 1.97 1.97 3.45V19h6v-2.5c0-2.33-4.67-3.5-7-3.5z'/%3E%3C/svg%3E"); }

.search-bar {
    margin-left: 16px;
    background-color: var(--background-tertiary);
    border: none;
    border-radius: 4px;
    color: var(--text-normal);
    padding: 4px 8px;
    font-size: 14px;
    width: 144px;
}
.search-bar::placeholder { color: var(--text-muted); }

.messages-container {
    flex: 1;
    overflow-y: auto;
    padding: 16px;
}
.message {
    display: flex;
    margin-bottom: 16px;
    padding: 2px 16px;
    margin-right: 8px;
}
.message:hover {
    background-color: var(--background-modifier-hover);
}
.message .avatar {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    margin-right: 16px;
    flex-shrink: 0;
    margin-top: 4px;
}
.message-content {
    display: flex;
    flex-direction: column;
}
.message-header {
    display: flex;
    align-items: baseline;
    margin-bottom: 4px;
}
.message-header .username {
    color: var(--header-primary);
    font-weight: 500;
    font-size: 16px;
    margin-right: 8px;
}
.message-header .bot-tag {
    background-color: var(--brand-experiment);
    color: white;
    font-size: 10px;
    padding: 2px 4px;
    border-radius: 3px;
    font-weight: 600;
    margin-right: 8px;
}
.message-header .timestamp {
    color: var(--text-muted);
    font-size: 12px;
}
.message-body {
    line-height: 1.4;
}

.chat-input-container {
    display: flex;
    align-items: center;
    padding: 0 16px 24px;
}
#message-input {
    flex: 1;
    background-color: var(--channel-interactive);
    border: none;
    border-radius: 8px;
    height: 44px;
    padding: 0 16px;
    color: var(--text-normal);
    font-size: 16px;
}
#message-input::placeholder {
    color: var(--text-muted);
}
.input-actions { display: flex; }
.input-actions .icon {
    width: 24px;
    height: 24px;
    margin: 0 8px;
    cursor: pointer;
    opacity: 0.7;
    background-size: contain;
    background-repeat: no-repeat;
    background-position: center;
}
.input-actions .icon:hover { opacity: 1; }
.icon.attachment { background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='%23B9BBBE'%3E%3Cpath d='M12 2C6.48 2 2 6.48 2 12s4.48 10 10 10 10-4.48 10-10S17.52 2 12 2zm-1 15v-4H8l4-4 4 4h-3v4h-2z'/%3E%3C/svg%3E"); }
.icon.gift { background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='%23B9BBBE'%3E%3Cpath d='M20 6h-2.18c.11-.31.18-.65.18-1 0-1.66-1.34-3-3-3s-3 1.34-3 3c0 .35.07.69.18 1H4c-1.11 0-1.99.89-1.99 2L2 19c0 1.11.89 2 2 2h16c1.11 0 2-.89 2-2V8c0-1.11-.89-2-2-2zm-5-2c.55 0 1 .45 1 1s-.45 1-1 1-1-.45-1-1 .45-1 1-1zM9 4c.55 0 1 .45 1 1s-.45 1-1 1-1-.45-1-1 .45-1 1-1zm11 15H4v-2h16v2zm0-5H4V8h5.08L7 10.83 8.62 12 12 7.4l3.38 4.6L17 10.83 14.92 8H20v6z'/%3E%3C/svg%3E"); }
.icon.gif { background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='%23B9BBBE'%3E%3Cpath d='M11.5 9h1.5v6h-1.5zM9 9H6c-.6 0-1 .5-1 1v4c0 .5.4 1 1 1h3c.6 0 1-.5 1-1v-2H8.5v1.5h-2v-3H10V10c0-.5-.4-1-1-1zm10 1.5V9h-4.5v6H16v-2h2v-1.5h-2v-1z'/%3E%3C/svg%3E"); }
.icon.emoji { background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='%23B9BBBE'%3E%3Cpath d='M11.99 2C6.47 2 2 6.48 2 12s4.47 10 9.99 10C17.52 22 22 17.52 22 12S17.52 2 11.99 2zM12 20c-4.42 0-8-3.58-8-8s3.58-8 8-8 8 3.58 8 8-3.58 8-8 8zm3.5-9c.83 0 1.5-.67 1.5-1.5S16.33 8 15.5 8 14 8.67 14 9.5s.67 1.5 1.5 1.5zm-7 0c.83 0 1.5-.67 1.5-1.5S9.33 8 8.5 8 7 8.67 7 9.5 7.67 11 8.5 11zm3.5 6.5c2.33 0 4.31-1.46 5.11-3.5H6.89c.8 2.04 2.78 3.5 5.11 3.5z'/%3E%3C/svg%3E"); }


/* --- Users List --- */
.users-list {
    padding: 8px;
    padding-top: 24px;
    overflow-y: auto;
}
.user-list-category {
    padding: 0 8px 4px;
    color: var(--text-muted);
    font-size: 12px;
    font-weight: 700;
    text-transform: uppercase;
}
.user-list-item {
    display: flex;
    align-items: center;
    padding: 8px;
    border-radius: 4px;
    margin-bottom: 2px;
    cursor: pointer;
}
.user-list-item:hover {
    background-color: var(--background-modifier-hover);
}
.user-list-item .avatar {
    width: 32px;
    height: 32px;
    margin-right: 12px;
}
.user-list-item .username {
    font-weight: 500;
}
.online .username { color: var(--interactive-hover); }
.idle .username, .dnd .username { color: var(--interactive-normal); opacity: 0.8; }
.offline .username { color: var(--text-muted); opacity: 0.6; }


