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

body {
    font-family: 'gg sans', 'Noto Sans', 'Helvetica Neue', Helvetica, Arial, sans-serif;
    background: #313338;
    color: #dbdee1;
    height: 100vh;
    overflow: hidden;
}

/* Login Page */
.login-container {
    max-width: 480px;
    margin: 0 auto;
    padding: 32px;
    display: flex;
    flex-direction: column;
    justify-content: center;
    min-height: 100vh;
}

.login-container h1 {
    text-align: center;
    margin-bottom: 32px;
    color: #f2f3f5;
    font-size: 24px;
    font-weight: 600;
}

.form-group {
    margin-bottom: 20px;
}

.form-group label {
    display: block;
    margin-bottom: 8px;
    color: #b5bac1;
    font-size: 12px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.02em;
}

.form-group input {
    width: 100%;
    padding: 10px;
    background: #1e1f22;
    border: 1px solid #1e1f22;
    border-radius: 3px;
    color: #dbdee1;
    font-size: 16px;
    transition: border-color 0.2s;
}

.form-group input:focus {
    outline: none;
    border-color: #5865f2;
}

button[type="submit"] {
    width: 100%;
    padding: 12px 16px;
    background: #5865f2;
    color: #fff;
    border: none;
    border-radius: 3px;
    font-size: 16px;
    font-weight: 500;
    cursor: pointer;
    transition: background 0.17s ease;
}

button[type="submit"]:hover {
    background: #4752c4;
}

.error {
    background: #f23f43;
    color: #fff;
    padding: 10px 12px;
    border-radius: 3px;
    margin-bottom: 20px;
    text-align: center;
    font-size: 14px;
}

/* Username Modal */
.username-modal {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.85);
    z-index: 1000;
    align-items: center;
    justify-content: center;
}

.username-modal-content {
    background: #313338;
    border-radius: 4px;
    padding: 24px;
    width: 440px;
    max-width: 90vw;
}

.username-modal-content h2 {
    color: #f2f3f5;
    font-size: 20px;
    font-weight: 600;
    margin-bottom: 8px;
}

.username-modal-content p {
    color: #b5bac1;
    font-size: 14px;
    margin-bottom: 20px;
    line-height: 1.4;
}

.username-modal .form-group {
    margin-bottom: 16px;
}

.username-error {
    display: none;
    background: #f23f43;
    color: #fff;
    padding: 8px 12px;
    border-radius: 3px;
    margin-bottom: 16px;
    font-size: 13px;
}

.modal-button {
    width: 100%;
    padding: 12px 16px;
    background: #5865f2;
    color: #fff;
    border: none;
    border-radius: 3px;
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
    transition: background 0.17s ease;
}

.modal-button:hover {
    background: #4752c4;
}

/* Main Interface - Discord Layout */
.container {
    display: flex;
    flex-direction: column;
    height: 100vh;
    background: #313338;
}

/* Header */
.header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 12px 16px;
    background: #2b2d31;
    border-bottom: 1px solid #1e1f22;
    box-shadow: 0 1px 0 rgba(0, 0, 0, 0.2);
    height: 48px;
}

.header h1 {
    color: #f2f3f5;
    font-size: 16px;
    font-weight: 600;
}

.header-right {
    display: flex;
    align-items: center;
    gap: 12px;
}

.username-display {
    display: none;
    align-items: center;
    gap: 8px;
    padding: 6px 12px;
    background: #1e1f22;
    border-radius: 3px;
    cursor: pointer;
    transition: background 0.17s ease;
    position: relative;
}

.username-display:hover {
    background: #292b2f;
}

.username-display:hover::after {
    content: 'Click to change';
    position: absolute;
    bottom: -24px;
    left: 50%;
    transform: translateX(-50%);
    background: #111214;
    color: #dbdee1;
    padding: 4px 8px;
    border-radius: 3px;
    font-size: 12px;
    white-space: nowrap;
    pointer-events: none;
}

.username-display .current-username {
    color: #f2f3f5;
    font-size: 14px;
    font-weight: 500;
}

.username-display .edit-icon {
    color: #949ba4;
    font-size: 12px;
}

.logout-btn {
    padding: 6px 12px;
    background: #da373c;
    color: #fff;
    text-decoration: none;
    border-radius: 3px;
    font-size: 14px;
    font-weight: 500;
    transition: background 0.17s ease;
}

.logout-btn:hover {
    background: #a12d30;
}

/* Status Bar */
.status {
    padding: 8px 16px;
    font-size: 13px;
    text-align: center;
    border-bottom: 1px solid #1e1f22;
}

.status.success {
    background: #3ba55d;
    color: #fff;
}

.status.error {
    background: #f23f43;
    color: #fff;
}

.status.warning {
    background: #faa81a;
    color: #000;
}

.status.info {
    background: #5865f2;
    color: #fff;
}

/* Channels Area */
.channels {
    flex: 1;
    overflow-y: auto;
    background: #2b2d31;
    padding: 8px;
}

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

.channels::-webkit-scrollbar-track {
    background: transparent;
}

.channels::-webkit-scrollbar-thumb {
    background: #1e1f22;
    border-radius: 4px;
}

.channels::-webkit-scrollbar-thumb:hover {
    background: #1a1b1e;
}

/* Guild Header (collapsible) */
.guild {
    margin-bottom: 16px;
}

.guild-header {
    display: flex;
    align-items: center;
    padding: 4px 8px;
    margin-bottom: 4px;
    cursor: pointer;
    user-select: none;
    transition: color 0.1s;
    color: #949ba4;
    font-size: 12px;
    font-weight: 600;
    letter-spacing: 0.02em;
}

.guild-header:hover {
    color: #dbdee1;
}

.guild-arrow {
    margin-right: 4px;
    font-size: 10px;
    transition: transform 0.1s;
}

.channels-list {
    margin-left: 8px;
}

/* Voice Channel */
.voice-channel {
    margin-bottom: 2px;
}

.voice-channel.active .channel-btn {
    background: #404249;
    color: #f2f3f5;
}

.channel-btn {
    display: flex;
    align-items: center;
    padding: 6px 8px;
    border-radius: 4px;
    cursor: pointer;
    transition: background 0.15s ease, color 0.15s ease;
    color: #949ba4;
}

.channel-btn:hover {
    background: #35373c;
    color: #dbdee1;
}

.channel-icon {
    margin-right: 6px;
    font-size: 18px;
    display: flex;
    align-items: center;
}

.channel-name {
    font-size: 15px;
    font-weight: 500;
    flex: 1;
}

/* Members List (Discord style) */
.members-list {
    padding-left: 32px;
    margin-top: 4px;
}

.member-item {
    display: flex;
    align-items: center;
    padding: 4px 8px;
    margin-bottom: 2px;
    border-radius: 4px;
    transition: background 0.1s;
}

.member-item:hover {
    background: #35373c;
}

.member-avatar {
    width: 24px;
    height: 24px;
    border-radius: 50%;
    background: #5865f2;
    color: #fff;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 12px;
    font-weight: 600;
    margin-right: 8px;
    flex-shrink: 0;
}

.member-name {
    font-size: 14px;
    color: #949ba4;
    font-weight: 500;
}

.voice-channel.active .member-name {
    color: #f2f3f5;
}

/* Special styling for current user */
.member-item.is-you .member-avatar {
    background: #23a559;
    box-shadow: 0 0 0 2px #23a559;
}

.member-item.is-you .member-name {
    color: #23a559;
    font-weight: 600;
}

.voice-channel.active .member-item.is-you .member-name {
    color: #23a559;
}

/* Current Channel Footer */
.current-channel {
    display: none;
    justify-content: space-between;
    align-items: center;
    padding: 12px 16px;
    background: #232428;
    border-top: 1px solid #1e1f22;
    box-shadow: 0 -1px 0 rgba(0, 0, 0, 0.2);
}

.channel-info {
    display: flex;
    align-items: center;
    gap: 10px;
}

.channel-info .label {
    color: #949ba4;
    font-size: 13px;
    font-weight: 500;
}

.channel-info .name {
    color: #f2f3f5;
    font-size: 14px;
    font-weight: 600;
}

.leave-btn {
    padding: 8px 16px;
    background: #da373c;
    color: #fff;
    border: none;
    border-radius: 3px;
    font-size: 13px;
    font-weight: 500;
    cursor: pointer;
    transition: background 0.17s ease;
}

.leave-btn:hover {
    background: #a12d30;
}

.loading, .no-channels {
    text-align: center;
    color: #949ba4;
    padding: 32px 16px;
    font-size: 14px;
}

/* Mute button styles */
.mute-btn {
    margin-left: auto;
    padding: 4px 8px;
    background: #5865f2;
    color: #fff;
    border: none;
    border-radius: 3px;
    font-size: 14px;
    cursor: pointer;
    transition: background 0.17s ease, opacity 0.17s ease;
    opacity: 0;
}

.member-item:hover .mute-btn {
    opacity: 1;
}

.mute-btn.muted {
    background: #da373c;
    opacity: 1;
}

.mute-btn:hover {
    background: #4752c4;
}

.mute-btn.muted:hover {
    background: #a12d30;
}

.member-item.muted .member-name {
    color: #da373c;
    text-decoration: line-through;
}

.member-item.muted .member-avatar {
    opacity: 0.5;
}