/**
 * FriendRewind Groups - Discord-Style Theme
 * Complete redesign for a modern chat-focused experience
 */

/* ========== CSS VARIABLES ========== */
:root {
    --discord-dark: #0d0e10;
    --discord-darker: #080909;
    --discord-sidebar: #111214;
    --discord-chat-bg: #0d0e10;
    --discord-input-bg: #1a1b1e;
    --discord-hover: #1e1f22;
    --discord-active: #26272b;
    --discord-text: #f2f3f5;
    --discord-text-muted: #b5bac1;
    --discord-text-faint: #80848e;
    --discord-link: #00a8fc;
    --discord-green: #23a559;
    --discord-yellow: #f0b232;
    --discord-red: #f23f43;
    --discord-blurple: #5865f2;
    --discord-border: #3f4147;
    --discord-scrollbar: #1a1b1e;
    --discord-scrollbar-thumb: #1a1b1e;
    --header-height: 48px;
    --input-height: 68px;
    --member-sidebar-width: 240px;
}

/* ========== RESET & BASE ========== */
.discord-group-page {
    position: fixed;
    top: var(--site-nav-height, 0px);
    left: 0;
    right: 0;
    bottom: 50px; /* Leave room for footer music bar */
    display: flex;
    flex-direction: column;
    background: var(--discord-chat-bg);
    color: var(--discord-text);
    font-family: 'gg sans', 'Noto Sans', 'Helvetica Neue', Helvetica, Arial, sans-serif;
    font-size: 16px;
    line-height: 1.375;
    overflow: hidden;
    z-index: 100;
}

.discord-group-page * {
    box-sizing: border-box;
}

/* Hide site header/footer when in Discord mode - BUT NOT the music bar */
body.discord-mode .header,
body.discord-mode .site-footer,
body.discord-mode > header {
    display: none !important;
}

body.discord-mode {
    overflow: hidden;
    margin: 0;
    padding: 0;
    background: #1e1f22;
}

body.discord-mode main {
    background: #1e1f22 !important;
    color: var(--discord-text);
    padding: 0;
}

/* Compact the site navbar on Discord group pages (use core/components/navbar.php, but restyle it) */
body.discord-mode .myspace-header {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    max-width: none;
    width: 100%;
    margin: 0;
    z-index: 500;
    line-height: normal;
}

/* Hide the large 100px blue header band and search on this page */
body.discord-mode .myspace-header .top-nav {
    display: none;
}

/* Make the nav bar full width and Discord-themed */
body.discord-mode .myspace-header .main-nav-wrapper {
    height: 42px;
    background: linear-gradient(to bottom, #1e4390 0%, #0a2a78 100%);
    border-top: 1px solid #5588bb;
    border-bottom: 1px solid #0f2f7d;
}

body.discord-mode .myspace-header .main-nav-container {
    width: 100%;
    margin: 0;
    height: 42px;
    max-width: none;
    position: relative;
    padding-left: 140px;
    overflow: visible;
}

/* Clickable logo (logo is the Home button) */
body.discord-mode .discord-nav-home {
    position: fixed;
    top: 0;
    left: 0;
    height: 42px;
    width: 140px;
    z-index: 600;
    background: url('/static/img/friendrewind-logo.png') no-repeat 12px center;
    background-size: auto 22px;
}

/* Hide scrollbars but keep scroll available */
body.discord-mode .myspace-header .main-nav-container::-webkit-scrollbar {
    height: 0px;
}

@media (max-width: 720px) {
    /* Hide the custom logo overlay on mobile */
    body.discord-mode .discord-nav-home {
        display: none;
    }
    /* Reset container to normal site styling */
    body.discord-mode .myspace-header .main-nav-container {
        padding-left: 0;
        overflow: visible;
        height: 29px;
    }
    body.discord-mode .myspace-header .main-nav-wrapper {
        height: 29px;
    }
    body.discord-mode .myspace-header .main-nav {
        height: 29px;
    }
    body.discord-mode .myspace-header .main-nav li a {
        padding: 0 5px;
        font-size: 11px;
        height: 29px;
        line-height: 29px;
    }
    /* Replace "Home" text with small logo */
    body.discord-mode .myspace-header .main-nav li:first-child a {
        font-size: 0;
        padding: 0 8px;
        background: url('/static/img/friendrewind-logo.png') no-repeat center center;
        background-size: auto 16px;
        min-width: 50px;
    }
    /* Position Discord content below the 29px navbar with small gap */
    .discord-group-page {
        top: 30px;
    }
    /* Ensure navbar stays above Discord content */
    body.discord-mode .myspace-header {
        z-index: 500;
    }
    body.discord-mode .myspace-header .main-nav-wrapper {
        overflow: visible;
    }
}

body.discord-mode .myspace-header .main-nav {
    height: 42px;
    align-items: center;
    min-width: max-content;
}

body.discord-mode .myspace-header .main-nav li a {
    height: 42px;
    line-height: 42px;
    padding: 0 10px;
    font-size: 12px;
    border-right: 1px solid #002a6e;
    text-shadow: 0px 1px 1px rgba(0, 0, 0, 0.5);
}

body.discord-mode .myspace-header .main-nav li a:hover,
body.discord-mode .myspace-header .main-nav li a.active {
    background-color: #0033a7;
}

body.discord-mode .discord-nav-home {
    background-color: transparent;
}

body.discord-mode .myspace-header .dropdown-menu {
    top: 42px;
    z-index: 1200;
}

/* ========== BODY (sidebar + layout) ========== */
.discord-body {
    display: flex;
    flex: 1;
    overflow: hidden;
}

/* ========== CHANNEL SIDEBAR ========== */
.discord-channel-sidebar {
    width: 240px;
    min-width: 240px;
    background: rgba(13, 14, 16, 0.7);
    backdrop-filter: blur(2px);
    display: flex;
    flex-direction: column;
    overflow-y: auto;
    overflow-x: hidden;
    flex-shrink: 0;
    border-right: 1px solid var(--discord-darker);
    box-shadow: 2px 0 12px rgba(0, 0, 0, 0.25), inset -1px 0 0 rgba(255, 255, 255, 0.03);
}

.discord-channel-sidebar::-webkit-scrollbar {
    width: 4px;
}

.discord-channel-sidebar::-webkit-scrollbar-thumb {
    background: var(--discord-scrollbar-thumb);
    border-radius: 4px;
}

.discord-channel-sidebar-header {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 12px 16px;
    border-bottom: 1px solid var(--discord-darker);
    min-height: 48px;
    cursor: pointer;
    box-shadow: 0 1px 0 rgba(0,0,0,0.2), 0 2px 4px rgba(0,0,0,0.15);
    transition: all 0.2s ease;
    position: relative;
}

.discord-channel-sidebar-header::before {
    content: '';
    position: absolute;
    inset: 0;
    background: linear-gradient(135deg, rgba(88, 101, 242, 0.05) 0%, transparent 50%);
    opacity: 0;
    transition: opacity 0.3s ease;
}

.discord-channel-sidebar-header:hover::before {
    opacity: 1;
}

.discord-channel-sidebar-header:hover {
    background: rgba(255, 255, 255, 0.03);
    box-shadow: 0 1px 0 rgba(0,0,0,0.2), 0 4px 8px rgba(0,0,0,0.2);
}

.discord-cs-icon {
    width: 24px;
    height: 24px;
    border-radius: 8px;
    object-fit: cover;
    flex-shrink: 0;
}

.discord-cs-icon-placeholder {
    width: 24px;
    height: 24px;
    border-radius: 8px;
    background: linear-gradient(135deg, var(--discord-blurple), #eb459e);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 12px;
    font-weight: 700;
    color: #fff;
    flex-shrink: 0;
}

.discord-cs-name {
    font-size: 15px;
    font-weight: 600;
    color: var(--discord-text);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.discord-cs-chevron {
    margin-left: auto;
    font-size: 10px;
    color: var(--discord-text-muted);
    transition: transform 0.2s ease;
    flex-shrink: 0;
}

/* Removed empty ruleset - no longer needed */

.discord-group-info {
    max-height: 0;
    overflow: hidden;
    transition: max-height 0.25s ease, padding 0.25s ease;
    background: var(--discord-darker);
    padding: 0 14px;
    border-bottom: none;
}

.discord-group-info.open {
    max-height: 300px;
    padding: 12px 14px;
    border-bottom: 1px solid rgba(255,255,255,0.06);
}

.discord-group-info.open ~ .discord-channel-category:first-of-type {
    padding-top: 10px;
}

.discord-gi-desc {
    font-size: 12px;
    color: var(--discord-text-secondary);
    line-height: 1.45;
    margin-bottom: 10px;
    word-wrap: break-word;
}

.discord-gi-stats {
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.discord-gi-stat {
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-size: 11px;
}

.discord-gi-label {
    color: var(--discord-text-muted);
    text-transform: uppercase;
    font-weight: 600;
    letter-spacing: 0.03em;
}

.discord-gi-value {
    color: var(--discord-text);
    font-weight: 500;
}

.discord-channel-category {
    padding: 18px 8px 4px 16px;
    display: flex;
    align-items: center;
    cursor: default;
}

.discord-channel-category-label {
    font-size: 11px;
    font-weight: 700;
    color: var(--discord-text-muted);
    text-transform: uppercase;
    letter-spacing: 0.02em;
}

.discord-channel-item {
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 6px 8px 6px 16px;
    margin: 1px 8px;
    border-radius: 4px;
    color: var(--discord-text-muted);
    font-size: 16px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.15s cubic-bezier(0.4, 0, 0.2, 1);
    white-space: nowrap;
    border: none;
    background: none;
    width: calc(100% - 16px);
    text-align: left;
    position: relative;
}

.discord-channel-item:hover {
    color: var(--discord-text);
    background: var(--discord-hover);
    transform: translateX(2px);
}

.discord-channel-item.active {
    color: #fff;
    background: linear-gradient(90deg, rgba(88, 101, 242, 0.15) 0%, var(--discord-active) 100%);
    box-shadow: inset 0 0 0 1px rgba(88, 101, 242, 0.3), 0 2px 8px rgba(88, 101, 242, 0.1);
}

.discord-channel-item.active::before {
    content: '';
    position: absolute;
    left: 0;
    top: 50%;
    transform: translateY(-50%);
    width: 4px;
    height: 24px;
    background: linear-gradient(180deg, var(--discord-blurple) 0%, #4752c4 100%);
    border-radius: 0 4px 4px 0;
    box-shadow: 0 0 8px rgba(88, 101, 242, 0.5);
}

.discord-channel-item .channel-hash {
    font-size: 18px;
    opacity: 0.5;
    font-weight: 400;
    width: 20px;
    text-align: center;
    flex-shrink: 0;
}

.discord-channel-item.active .channel-hash {
    opacity: 0.8;
}

.discord-channel-item .channel-badge {
    background: var(--discord-red);
    color: #fff;
    font-size: 10px;
    font-weight: 700;
    padding: 1px 5px;
    border-radius: 8px;
    min-width: 16px;
    text-align: center;
    line-height: 14px;
    margin-left: auto;
}

.discord-channel-item.voice-channel .channel-hash {
    font-size: 16px;
    opacity: 0.7;
}

/* ========== MAIN LAYOUT ========== */
.discord-layout {
    display: flex;
    flex: 1;
    overflow: hidden;
}

/* ========== GROUP HEADER ========== */
.discord-header {
    height: var(--header-height);
    min-height: var(--header-height);
    background: rgba(13, 14, 16, 0.7);
    border-bottom: 1px solid var(--discord-darker);
    display: flex;
    align-items: center;
    padding: 0 16px;
    gap: 12px;
    box-shadow: 0 1px 0 rgba(0,0,0,0.2), 0 4px 12px rgba(0,0,0,0.2), inset 0 1px 0 rgba(255,255,255,0.03);
    z-index: 10;
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
}

.discord-header-channel {
    display: flex;
    align-items: center;
    gap: 6px;
    flex-shrink: 0;
}

.discord-header-hash {
    font-size: 20px;
    font-weight: 500;
    color: var(--discord-text-muted);
    opacity: 0.6;
}

.discord-header-channel-name {
    font-size: 15px;
    font-weight: 600;
    color: var(--discord-text);
    white-space: nowrap;
}

.discord-header-divider {
    width: 1px;
    height: 24px;
    background: var(--discord-border);
    flex-shrink: 0;
}

.discord-header-topic {
    flex: 1;
    min-width: 0;
    font-size: 13px;
    color: var(--discord-text-muted);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.discord-header-meta-inline {
    display: flex;
    align-items: center;
    gap: 8px;
    flex-shrink: 0;
}

.discord-header-stat {
    display: flex;
    align-items: center;
    gap: 4px;
    font-size: 11px;
    color: var(--discord-text-muted);
    white-space: nowrap;
}

.discord-header-stat .stat-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    flex-shrink: 0;
}

.discord-header-stat .stat-dot.online {
    background: var(--discord-green);
    animation: onlinePulse 2s ease-in-out infinite;
    box-shadow: 0 0 4px var(--discord-green);
}

@keyframes onlinePulse {
    0%, 100% { opacity: 1; box-shadow: 0 0 4px var(--discord-green); }
    50% { opacity: 0.7; box-shadow: 0 0 8px var(--discord-green); }
}

.discord-header-stat .stat-dot.total {
    background: var(--discord-text-faint);
}

.discord-header-actions {
    display: flex;
    gap: 4px;
    align-items: center;
    flex-shrink: 0;
}

.discord-header-btn {
    background: none;
    border: none;
    color: var(--discord-text-muted);
    cursor: pointer;
    padding: 8px;
    border-radius: 4px;
    font-size: 20px;
    transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
    flex-shrink: 0;
    position: relative;
}

.discord-header-btn:hover {
    color: var(--discord-text);
    background: linear-gradient(135deg, rgba(88, 101, 242, 0.15) 0%, var(--discord-hover) 100%);
    transform: scale(1.1);
    box-shadow: 0 4px 12px rgba(88, 101, 242, 0.2), inset 0 0 0 1px rgba(88, 101, 242, 0.3);
}

.discord-header-btn:active {
    transform: scale(0.95);
    box-shadow: inset 0 2px 4px rgba(0, 0, 0, 0.2);
}

.discord-back-btn {
    display: flex;
    align-items: center;
    color: var(--discord-text-muted);
    text-decoration: none;
    font-size: 18px;
    padding: 6px;
    border-radius: 4px;
    transition: all 0.15s ease;
    flex-shrink: 0;
    border: none;
    background: none;
}

.discord-back-btn:hover {
    color: var(--discord-text);
    background: var(--discord-hover);
}

.discord-back-icon {
    font-size: 18px;
    line-height: 1;
}

/* ========== CHAT AREA ========== */
.discord-chat-area {
    flex: 1;
    display: flex;
    flex-direction: column;
    min-width: 0;
    background: rgba(13, 14, 16, 0.85);
    backdrop-filter: blur(2px);
    position: relative;
}

.discord-messages {
    flex: 1;
    overflow-y: auto;
    overflow-x: hidden;
    padding: 16px 16px 0;
    display: flex;
    flex-direction: column;
}

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

.discord-messages::-webkit-scrollbar-track {
    background: transparent;
}

.discord-messages::-webkit-scrollbar-thumb {
    background: var(--discord-dark);
    border-radius: 4px;
}

.discord-messages::-webkit-scrollbar-thumb:hover {
    background: #232428;
}

/* ========== MESSAGE STYLES ========== */
.discord-message {
    display: flex;
    padding: 4px 48px 4px 72px;
    margin: 0 -16px;
    position: relative;
    min-height: 44px;
    word-wrap: break-word;
    transition: background 0.1s ease;
}

.discord-message:hover {
    background: linear-gradient(90deg, rgba(88, 101, 242, 0.03) 0%, rgba(4, 4, 5, 0.07) 100%);
    box-shadow: inset 3px 0 0 rgba(88, 101, 242, 0.3);
}

.discord-message-avatar {
    position: absolute;
    left: 16px;
    top: 2px;
    width: 40px;
    height: 40px;
    border-radius: 50%;
    cursor: pointer;
    object-fit: cover;
    transition: opacity 0.1s ease;
}

.discord-message-avatar:hover {
    opacity: 0.8;
}

.discord-message-content {
    flex: 1;
    min-width: 0;
}

.discord-message-header {
    display: flex;
    align-items: baseline;
    gap: 8px;
    margin-bottom: 2px;
}

.discord-message-author {
    font-weight: 600;
    font-size: 16px;
    color: var(--discord-text);
    cursor: pointer;
    transition: all 0.2s ease;
    text-shadow: 0 1px 2px rgba(0, 0, 0, 0.1);
}

.discord-message-author:hover {
    text-decoration: underline;
    color: var(--discord-blurple);
    text-shadow: 0 0 8px rgba(88, 101, 242, 0.4);
}

.discord-message-author.owner {
    color: var(--discord-yellow);
}

.discord-message-author.moderator {
    color: #57f287;
}

/* Profile Preview Scrollbar */
.profile-preview-content::-webkit-scrollbar {
    width: 8px;
}

.profile-preview-content::-webkit-scrollbar-track {
    background: rgba(0, 0, 0, 0.2);
    border-radius: 4px;
}

.profile-preview-content::-webkit-scrollbar-thumb {
    background: rgba(88, 101, 242, 0.4);
    border-radius: 4px;
}

.profile-preview-content::-webkit-scrollbar-thumb:hover {
    background: rgba(88, 101, 242, 0.6);
}

/* Role badges */
.discord-role-badge {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: 10px;
    padding: 1px 4px;
    border-radius: 3px;
    margin-left: 4px;
    font-weight: 600;
    vertical-align: middle;
    line-height: 14px;
}

.discord-role-badge.owner-badge {
    background: rgba(250, 168, 26, 0.2);
    color: var(--discord-yellow);
}

.discord-role-badge.mod-badge {
    background: rgba(87, 242, 135, 0.2);
    color: #57f287;
}

.discord-role-badge.bot-badge {
    background: rgba(88, 101, 242, 0.3);
    color: #7289da;
}

/* Hover action bar - floating toolbar */
.discord-message-actions {
    position: absolute;
    top: -16px;
    right: 16px;
    display: none;
    background: var(--discord-sidebar);
    border: 1px solid var(--discord-darker);
    border-radius: 4px;
    overflow: hidden;
    box-shadow: 0 2px 8px rgba(0,0,0,0.3);
    z-index: 5;
}

.discord-message:hover .discord-message-actions {
    display: flex;
}

.discord-action-btn {
    background: none;
    border: none;
    color: var(--discord-text-muted);
    cursor: pointer;
    padding: 6px 8px;
    font-size: 16px;
    transition: all 0.1s ease;
    display: flex;
    align-items: center;
    justify-content: center;
}

.discord-action-btn:hover {
    background: var(--discord-hover);
    color: var(--discord-text);
}

.discord-action-btn.danger:hover {
    background: rgba(242, 63, 67, 0.15);
    color: #f23f43;
}

/* @mention autocomplete */
.discord-mention-popup {
    position: absolute;
    bottom: 100%;
    left: 0;
    right: 0;
    background: var(--discord-sidebar);
    border: 1px solid var(--discord-darker);
    border-radius: 8px;
    max-height: 200px;
    overflow-y: auto;
    z-index: 1001;
    box-shadow: 0 -4px 16px rgba(0,0,0,0.3);
    display: none;
    margin-bottom: 4px;
}

.discord-mention-popup.active {
    display: block;
}

.discord-mention-item {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 8px 12px;
    cursor: pointer;
    transition: background 0.1s;
}

.discord-mention-item:hover,
.discord-mention-item.selected {
    background: var(--discord-blurple);
}

.discord-mention-item img {
    width: 24px;
    height: 24px;
    border-radius: 50%;
    object-fit: cover;
}

.discord-mention-item-name {
    color: var(--discord-text);
    font-size: 14px;
    font-weight: 500;
}

.discord-mention-item-role {
    color: var(--discord-text-muted);
    font-size: 11px;
    margin-left: auto;
}

/* @mention highlight in messages */
.discord-mention {
    background: rgba(88, 101, 242, 0.3);
    color: #dee0fc;
    padding: 0 2px;
    border-radius: 3px;
    font-weight: 500;
    cursor: pointer;
}

.discord-mention:hover {
    background: rgba(88, 101, 242, 0.5);
    color: #fff;
}

.discord-mention.mention-me {
    background: rgba(250, 168, 26, 0.2);
    color: var(--discord-yellow);
}

/* Message edit mode */
.discord-message.editing {
    background: rgba(88, 101, 242, 0.08);
}

.discord-edit-input {
    width: 100%;
    background: var(--discord-input-bg);
    border: none;
    border-radius: 4px;
    padding: 8px;
    color: var(--discord-text);
    font-size: 15px;
    font-family: inherit;
    resize: none;
    outline: none;
    margin-top: 4px;
}

.discord-edit-actions {
    display: flex;
    gap: 8px;
    margin-top: 4px;
    font-size: 12px;
    color: var(--discord-text-muted);
}

.discord-edit-actions span {
    cursor: pointer;
}

.discord-edit-actions span:hover {
    text-decoration: underline;
}

.discord-message-edited {
    font-size: 10px;
    color: var(--discord-text-muted);
    margin-left: 4px;
}

/* Unread messages divider */
.discord-unread-divider {
    display: flex;
    align-items: center;
    margin: 8px -16px;
    padding: 0 16px;
    position: relative;
}

.discord-unread-divider::before,
.discord-unread-divider::after {
    content: '';
    flex: 1;
    height: 1px;
    background: #f23f43;
}

.discord-unread-divider span {
    padding: 0 8px;
    font-size: 11px;
    font-weight: 700;
    color: #f23f43;
    text-transform: uppercase;
    white-space: nowrap;
}

/* Image lightbox */
.discord-lightbox {
    position: fixed;
    inset: 0;
    background: rgba(0,0,0,0.9);
    z-index: 10000;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: zoom-out;
    animation: fadeIn 0.2s ease;
    backdrop-filter: blur(4px);
    -webkit-backdrop-filter: blur(4px);
}

@keyframes fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

.discord-lightbox img {
    max-width: 90vw;
    max-height: 90vh;
    border-radius: 8px;
    box-shadow: 0 20px 60px rgba(0,0,0,0.8);
    cursor: default;
    object-fit: contain;
    animation: lightboxImageIn 0.25s cubic-bezier(0.4, 0, 0.2, 1);
}

@keyframes lightboxImageIn {
    from { opacity: 0; transform: scale(0.9); }
    to { opacity: 1; transform: scale(1); }
}

.discord-lightbox-close {
    position: absolute;
    top: 16px;
    right: 16px;
    background: rgba(0,0,0,0.6);
    border: none;
    color: #fff;
    width: 36px;
    height: 36px;
    border-radius: 50%;
    font-size: 18px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background 0.15s;
}

.discord-lightbox-close:hover {
    background: rgba(255,255,255,0.2);
}

.discord-lightbox-info {
    position: absolute;
    bottom: 16px;
    left: 50%;
    transform: translateX(-50%);
    color: rgba(255,255,255,0.7);
    font-size: 13px;
    background: rgba(0,0,0,0.5);
    padding: 6px 16px;
    border-radius: 4px;
}

.discord-lightbox-actions {
    position: absolute;
    bottom: 16px;
    right: 16px;
    display: flex;
    gap: 8px;
}

.discord-lightbox-actions a {
    background: rgba(0,0,0,0.6);
    color: #fff;
    padding: 8px 16px;
    border-radius: 4px;
    text-decoration: none;
    font-size: 13px;
    transition: background 0.15s;
}

.discord-lightbox-actions a:hover {
    background: var(--discord-blurple);
}

/* Bot messages */
.discord-message-author.bot {
    color: #5865f2;
}

.discord-bot-badge {
    display: inline-flex;
    align-items: center;
    background: #5865f2;
    color: #fff;
    font-size: 10px;
    font-weight: 600;
    padding: 1px 4px;
    border-radius: 3px;
    margin-left: 4px;
    vertical-align: middle;
    line-height: 1.3;
    letter-spacing: 0.02em;
    text-transform: uppercase;
}

/* Right-click context menu */
.discord-context-menu {
    position: fixed;
    background: linear-gradient(180deg, rgba(30, 31, 34, 0.98) 0%, var(--discord-dark) 100%);
    border-radius: 8px;
    padding: 8px 0;
    min-width: 200px;
    box-shadow: 0 12px 32px rgba(0,0,0,0.7), 0 0 0 1px rgba(88, 101, 242, 0.2), inset 0 1px 0 rgba(255, 255, 255, 0.05);
    z-index: 10001;
    animation: contextMenuIn 0.2s cubic-bezier(0.34, 1.56, 0.64, 1);
    border: 1px solid rgba(88, 101, 242, 0.15);
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
}

@keyframes contextMenuIn {
    from { opacity: 0; transform: scale(0.9) translateY(-8px); }
    to { opacity: 1; transform: scale(1) translateY(0); }
}

.discord-context-item {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 8px 12px;
    color: var(--discord-text);
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.15s cubic-bezier(0.4, 0, 0.2, 1);
    border: none;
    background: none;
    width: 100%;
    text-align: left;
    margin: 0 4px;
    border-radius: 4px;
    width: calc(100% - 8px);
}

.discord-context-item:hover {
    background: var(--discord-blurple);
    color: #fff;
    padding-left: 14px;
}

.discord-context-item.danger {
    color: #f23f43;
}

.discord-context-item.danger:hover {
    background: #f23f43;
    color: #fff;
}

.discord-context-item .ctx-icon {
    width: 18px;
    text-align: center;
    flex-shrink: 0;
}

.discord-context-separator {
    height: 1px;
    background: var(--discord-border);
    margin: 4px 0;
}

/* Notification sound toggle */
.discord-sound-toggle {
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 4px 8px;
    border-radius: 4px;
    cursor: pointer;
    font-size: 13px;
    color: var(--discord-text-muted);
    transition: all 0.15s;
    border: none;
    background: none;
}

.discord-sound-toggle:hover {
    color: var(--discord-text);
    background: var(--discord-hover);
}

.discord-sound-toggle.muted {
    color: #f23f43;
}

/* Clickable images in chat */
.discord-message-text img,
.discord-message-content img:not(.discord-message-avatar) {
    cursor: pointer;
    border-radius: 4px;
    transition: opacity 0.15s;
}

.discord-message-text img:hover,
.discord-message-content img:not(.discord-message-avatar):hover {
    opacity: 0.85;
}

.discord-message-timestamp {
    font-size: 12px;
    color: var(--discord-text-muted);
    font-weight: 400;
}

.discord-message-text {
    color: var(--discord-text);
    font-size: 16px;
    line-height: 1.5;
    white-space: pre-wrap;
    word-break: break-word;
}

.discord-message-text a {
    color: var(--discord-link);
    text-decoration: none;
}

.discord-message-text a:hover {
    text-decoration: underline;
}

/* ========== EMBEDS ========== */
.discord-embed {
    margin-top: 8px;
    max-width: 520px;
}

.discord-embed-image img {
    display: block;
    max-width: 100%;
    max-height: 320px;
    border-radius: 6px;
    border: 1px solid rgba(255, 255, 255, 0.08);
}

.discord-embed-link {
    background: rgba(0, 0, 0, 0.25);
    border-left: 4px solid var(--discord-blurple);
    border-radius: 6px;
    padding: 10px 12px;
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.discord-embed-domain {
    font-size: 12px;
    color: var(--discord-text-muted);
    text-transform: lowercase;
}

.discord-embed-link a {
    color: var(--discord-link);
    text-decoration: none;
    word-break: break-word;
}

.discord-embed-link a:hover {
    text-decoration: underline;
}

/* Message grouping - consecutive messages from same user */
.discord-message.grouped {
    min-height: 22px;
    padding-top: 0;
}

.discord-message.grouped .discord-message-avatar,
.discord-message.grouped .discord-message-header {
    display: none;
}

.discord-message.grouped:hover .discord-compact-time {
    display: block;
}

.discord-compact-time {
    display: none;
    position: absolute;
    left: 16px;
    font-size: 11px;
    color: var(--discord-text-muted);
    width: 48px;
    text-align: right;
}

/* Message actions */
.discord-message-actions {
    position: absolute;
    right: 16px;
    top: -16px;
    display: none;
    background: var(--discord-sidebar);
    border: 1px solid var(--discord-border);
    border-radius: 4px;
    overflow: hidden;
    box-shadow: 0 2px 8px rgba(0,0,0,0.3);
}

.discord-message:hover .discord-message-actions {
    display: flex;
}

.discord-action-btn {
    background: none;
    border: none;
    color: var(--discord-text-muted);
    padding: 6px 8px;
    cursor: pointer;
    font-size: 18px;
    transition: all 0.1s ease;
}

.discord-action-btn:hover {
    background: var(--discord-hover);
    color: var(--discord-text);
}

.discord-action-btn.danger:hover {
    background: var(--discord-red);
    color: white;
}

/* ========== DATE DIVIDERS ========== */
.discord-date-divider {
    display: flex;
    align-items: center;
    margin: 24px 0 16px;
    user-select: none;
}

.discord-date-divider::before,
.discord-date-divider::after {
    content: '';
    flex: 1;
    height: 1px;
    background: linear-gradient(90deg, transparent 0%, var(--discord-border) 50%, transparent 100%);
    opacity: 0.6;
}

.discord-date-divider span {
    padding: 4px 16px;
    font-size: 11px;
    font-weight: 700;
    color: var(--discord-text-muted);
    background: linear-gradient(135deg, rgba(88, 101, 242, 0.1) 0%, var(--discord-chat-bg) 100%);
    border-radius: 12px;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.2), inset 0 1px 0 rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(88, 101, 242, 0.2);
}

/* ========== WELCOME MESSAGE ========== */
.discord-welcome {
    padding: 24px 0 32px;
    margin-bottom: 16px;
}

.discord-welcome-icon {
    width: 88px;
    height: 88px;
    border-radius: 50%;
    background: linear-gradient(135deg, rgba(88, 101, 242, 0.2) 0%, var(--discord-sidebar) 100%);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 44px;
    margin-bottom: 16px;
    overflow: hidden;
    box-shadow: 0 12px 24px rgba(0, 0, 0, 0.3), 0 0 0 4px var(--discord-chat-bg), 0 0 0 5px rgba(88, 101, 242, 0.3);
    border: 4px solid rgba(88, 101, 242, 0.2);
    position: relative;
}

.discord-welcome-icon::before {
    content: '';
    position: absolute;
    inset: -4px;
    background: linear-gradient(135deg, rgba(88, 101, 242, 0.3), transparent);
    border-radius: 50%;
    animation: iconGlow 3s ease-in-out infinite;
}

@keyframes iconGlow {
    0%, 100% { opacity: 0.5; }
    50% { opacity: 1; }
}

.discord-welcome-icon img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.discord-welcome h1 {
    font-size: 36px;
    font-weight: 800;
    margin: 0 0 12px;
    color: var(--discord-text);
    text-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

.discord-welcome p {
    color: var(--discord-text-muted);
    margin: 0;
    font-size: 17px;
    line-height: 1.5;
}

/* ========== INPUT AREA ========== */
.discord-input-area {
    padding: 0 16px 16px;
    position: relative;
}

.discord-input-wrapper {
    background: rgba(64, 68, 75, 0.3);
    border-radius: 8px;
    display: flex;
    align-items: center;
    padding: 4px;
    min-height: 44px;
    position: relative;
    box-shadow: inset 0 1px 3px rgba(0,0,0,0.4);
    transition: all 0.2s ease;
    border: 1px solid rgba(0,0,0,0.4);
    gap: 4px;
}

.discord-input-wrapper:focus-within {
    background: rgba(64, 68, 75, 0.4);
    border-color: rgba(85, 136, 187, 0.5);
    box-shadow: inset 0 1px 3px rgba(0,0,0,0.4), 0 0 0 1px rgba(85, 136, 187, 0.3);
}

/* Force pickers to be absolutely positioned popups, not flex items */
.discord-input-wrapper .discord-gif-picker,
.discord-input-wrapper .discord-emoji-picker,
.discord-input-wrapper .discord-color-picker,
.discord-input-wrapper #gif-picker {
    position: absolute;
    bottom: 100%;
    right: 0;
    flex: none;
    margin-bottom: 8px;
    z-index: 1000;
}

.discord-input-buttons {
    display: flex;
    align-items: center;
    gap: 2px;
}

.discord-input-btn {
    background: transparent;
    border: none;
    color: #b9bbbe;
    cursor: pointer;
    padding: 0;
    border-radius: 4px;
    font-size: 20px;
    transition: all 0.15s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    width: 32px;
    height: 32px;
}

.discord-input-btn:hover {
    color: #dcddde;
    background: rgba(79, 84, 92, 0.4);
}

.discord-input-btn:active {
    background: rgba(79, 84, 92, 0.6);
}

.discord-gif-btn {
    font-size: 11px !important;
    font-weight: 800 !important;
    font-family: 'gg sans', 'Noto Sans', Helvetica, Arial, sans-serif !important;
    letter-spacing: 0.02em;
    border: 2px solid #b9bbbe !important;
    border-radius: 4px !important;
    padding: 2px 4px !important;
    width: auto !important;
    height: 22px !important;
    line-height: 1;
    color: #b9bbbe !important;
}

.discord-gif-btn:hover {
    border-color: #dcddde !important;
    color: #dcddde !important;
    background: rgba(79, 84, 92, 0.4);
}

.discord-text-input {
    flex: 1;
    background: none;
    border: none;
    color: #dcddde;
    font-size: 15px;
    padding: 11px 8px;
    outline: none;
    resize: none;
    max-height: 200px;
    overflow-y: auto;
    font-family: inherit;
    line-height: 1.375;
}

.discord-text-input::placeholder {
    color: #72767d;
}

.discord-text-input::-webkit-scrollbar {
    width: 8px;
}

.discord-text-input::-webkit-scrollbar-thumb {
    background: var(--discord-scrollbar-thumb);
    border-radius: 4px;
}

.discord-send-btn {
    background: transparent;
    border: none;
    color: #b9bbbe;
    cursor: pointer;
    padding: 0;
    width: 32px;
    height: 32px;
    border-radius: 4px;
    font-size: 20px;
    transition: all 0.15s ease;
    display: flex;
    align-items: center;
    justify-content: center;
}

.discord-send-btn:hover {
    color: #dcddde;
    background: rgba(79, 84, 92, 0.4);
}

.discord-send-btn:active {
    background: rgba(79, 84, 92, 0.6);
}

.discord-send-btn:disabled {
    opacity: 0.3;
    cursor: not-allowed;
}

/* ========== MEMBER SIDEBAR ========== */
.discord-members-sidebar {
    width: var(--member-sidebar-width);
    background: rgba(13, 14, 16, 0.7);
    backdrop-filter: blur(2px);
    flex-shrink: 0;
    position: relative;
    overflow: hidden;
    display: flex;
    flex-direction: column;
    border-left: 1px solid var(--discord-darker);
    box-shadow: -2px 0 12px rgba(0, 0, 0, 0.25), inset 1px 0 0 rgba(255, 255, 255, 0.03);
}

.discord-members-header {
    padding: 12px 8px 4px 16px;
    font-size: 12px;
    font-weight: 600;
    color: var(--discord-text-muted);
    text-transform: uppercase;
    letter-spacing: 0.02em;
}

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

.discord-members-list::-webkit-scrollbar {
    width: 8px;
}

.discord-members-list::-webkit-scrollbar-thumb {
    background: var(--discord-scrollbar-thumb);
    border-radius: 4px;
}

.discord-member {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 8px;
    border-radius: 4px;
    cursor: pointer;
    transition: all 0.15s cubic-bezier(0.4, 0, 0.2, 1);
}

.discord-member:hover {
    background: linear-gradient(90deg, rgba(30, 67, 144, 0.35) 0%, rgba(10, 42, 120, 0.25) 100%);
    padding-left: 12px;
    box-shadow: inset 3px 0 0 #5588bb, 0 2px 8px rgba(30, 67, 144, 0.4);
    transform: translateX(-2px);
}

.discord-member-avatar {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    object-fit: cover;
    flex-shrink: 0;
}

.discord-member-info {
    flex: 1;
    min-width: 0;
}

.discord-member-name {
    font-size: 15px;
    font-weight: 500;
    color: var(--discord-text-muted);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    display: flex;
    align-items: center;
    gap: 4px;
    transition: color 0.15s ease;
}

.discord-member.online .discord-member-name {
    color: var(--discord-text);
    font-weight: 600;
}

.discord-member-role {
    font-size: 11px;
    padding: 1px 4px;
    border-radius: 3px;
    background: var(--discord-yellow);
    color: #000;
    font-weight: 600;
}

.discord-member-status {
    font-size: 12px;
    color: var(--discord-text-faint);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

/* Online status indicator */
.discord-status-indicator {
    position: absolute;
    bottom: -2px;
    right: -2px;
    width: 12px;
    height: 12px;
    border-radius: 50%;
    border: 3px solid var(--discord-sidebar);
}

.discord-status-indicator.online {
    background: var(--discord-green);
    box-shadow: 0 0 3px var(--discord-green);
}

.discord-status-indicator.offline {
    background: var(--discord-text-faint);
}

.discord-member-avatar-wrapper {
    position: relative;
    flex-shrink: 0;
}

/* ========== ROLE SECTIONS ========== */
.discord-role-section {
    margin-bottom: 8px;
}

.discord-role-header {
    padding: 24px 8px 4px 8px;
    font-size: 12px;
    font-weight: 600;
    color: var(--discord-text-muted);
    text-transform: uppercase;
    letter-spacing: 0.02em;
}

.discord-role-header:first-child {
    padding-top: 12px;
}

/* ========== TYPING INDICATOR ========== */
.discord-typing-indicator {
    position: absolute;
    bottom: 100%;
    left: 16px;
    padding: 4px 8px;
    font-size: 14px;
    color: var(--discord-text-muted);
    display: none;
}

.discord-typing-indicator.show {
    display: flex;
    align-items: center;
    gap: 4px;
}

.typing-dots {
    display: flex;
    gap: 3px;
}

.typing-dots span {
    width: 6px;
    height: 6px;
    background: var(--discord-text-muted);
    border-radius: 50%;
    animation: typingBounce 1.4s infinite ease-in-out;
}

.typing-dots span:nth-child(1) { animation-delay: 0s; }
.typing-dots span:nth-child(2) { animation-delay: 0.2s; }
.typing-dots span:nth-child(3) { animation-delay: 0.4s; }

@keyframes typingBounce {
    0%, 60%, 100% { transform: translateY(0); }
    30% { transform: translateY(-4px); }
}

/* ========== REACTIONS ========== */
.discord-reactions {
    display: flex;
    flex-wrap: wrap;
    gap: 4px;
    margin-top: 4px;
}

.discord-reaction {
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 3px 8px;
    background: var(--discord-input-bg);
    border: 1px solid transparent;
    border-radius: 8px;
    cursor: pointer;
    font-size: 16px;
    transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
    position: relative;
    overflow: hidden;
}

.discord-reaction::before {
    content: '';
    position: absolute;
    inset: 0;
    background: linear-gradient(135deg, rgba(88, 101, 242, 0.2) 0%, transparent 50%);
    opacity: 0;
    transition: opacity 0.3s ease;
}

.discord-reaction:hover::before {
    opacity: 1;
}

.discord-reaction:hover {
    border-color: var(--discord-blurple);
    background: var(--discord-hover);
    transform: scale(1.1);
    box-shadow: 0 4px 12px rgba(88, 101, 242, 0.3);
}

.discord-reaction.user-reacted {
    background: linear-gradient(135deg, rgba(88, 101, 242, 0.4) 0%, rgba(88, 101, 242, 0.25) 100%);
    border-color: var(--discord-blurple);
    box-shadow: 0 0 0 1px rgba(88, 101, 242, 0.4), 0 4px 12px rgba(88, 101, 242, 0.3), inset 0 1px 0 rgba(255, 255, 255, 0.1);
}

.discord-reaction-count {
    font-size: 14px;
    color: var(--discord-text-muted);
    min-width: 16px;
}

.discord-reaction.user-reacted .discord-reaction-count {
    color: var(--discord-blurple);
}

/* Add reaction button */
.discord-add-reaction {
    width: 32px;
    height: 24px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--discord-input-bg);
    border: 1px dashed var(--discord-border);
    border-radius: 8px;
    cursor: pointer;
    font-size: 14px;
    color: var(--discord-text-muted);
    opacity: 0;
    transition: all 0.1s ease;
}

.discord-message:hover .discord-add-reaction {
    opacity: 1;
}

.discord-add-reaction:hover {
    background: var(--discord-hover);
    border-style: solid;
}

/* ========== REPLY CONTEXT ========== */
.discord-reply-context {
    display: flex;
    align-items: center;
    padding: 2px 0 4px 72px;
    font-size: 12px;
    color: var(--discord-text-muted, #949ba4);
    cursor: pointer;
    margin-bottom: -2px;
    overflow: hidden;
    white-space: nowrap;
    text-overflow: ellipsis;
}

.discord-reply-context:hover {
    color: var(--discord-text, #dbdee1);
}

.discord-reply-context svg {
    color: var(--discord-text-muted, #949ba4);
    flex-shrink: 0;
}

.discord-reply-author {
    color: var(--discord-blurple, #5865f2);
    font-weight: 600;
    margin-right: 6px;
    flex-shrink: 0;
}

.discord-reply-preview {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    opacity: 0.8;
}

.discord-reply-preview:hover {
    opacity: 1;
}

.discord-message.grouped .discord-reply-context {
    padding-left: 72px;
}

@media (max-width: 768px) {
    .discord-reply-context {
        padding-left: 52px;
    }
    .discord-message.grouped .discord-reply-context {
        padding-left: 52px;
    }
}

/* ========== EMOJI PICKER ========== */
.discord-emoji-picker {
    position: absolute;
    bottom: 60px;
    right: 16px;
    width: 420px;
    max-height: 400px;
    background: linear-gradient(180deg, rgba(43, 45, 49, 0.98) 0%, var(--discord-sidebar) 100%);
    border-radius: 12px;
    box-shadow: 0 12px 32px rgba(0,0,0,0.6), 0 0 0 1px rgba(88, 101, 242, 0.2), inset 0 1px 0 rgba(255, 255, 255, 0.05);
    display: none;
    flex-direction: column;
    z-index: 100;
    animation: emojiPickerIn 0.25s cubic-bezier(0.34, 1.56, 0.64, 1);
    border: 1px solid rgba(88, 101, 242, 0.15);
}

@keyframes emojiPickerIn {
    from { opacity: 0; transform: scale(0.9) translateY(12px); }
    to { opacity: 1; transform: scale(1) translateY(0); }
}

.discord-emoji-picker.show {
    display: flex;
}

.discord-emoji-picker-header {
    padding: 12px;
    border-bottom: 1px solid var(--discord-border);
}

.discord-emoji-search {
    width: 100%;
    background: var(--discord-dark);
    border: none;
    border-radius: 4px;
    padding: 8px 12px;
    color: var(--discord-text);
    font-size: 14px;
}

.discord-emoji-search::placeholder {
    color: var(--discord-text-faint);
}

.discord-emoji-grid {
    padding: 12px;
    display: grid;
    grid-template-columns: repeat(9, 1fr);
    gap: 4px;
    overflow-y: auto;
    flex: 1;
}

.discord-emoji-item {
    width: 36px;
    height: 36px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 24px;
    cursor: pointer;
    border-radius: 6px;
    transition: all 0.15s cubic-bezier(0.4, 0, 0.2, 1);
}

.discord-emoji-item:hover {
    background: var(--discord-hover);
    transform: scale(1.15);
}

/* ========== COLOR PICKER ========== */
.discord-color-picker {
    position: absolute;
    bottom: 60px;
    right: 60px;
    background: var(--discord-sidebar);
    border-radius: 8px;
    padding: 12px;
    box-shadow: 0 8px 24px rgba(0,0,0,0.4);
    display: none;
    z-index: 100;
}

.discord-color-picker.show {
    display: block;
}

.discord-color-grid {
    display: grid;
    grid-template-columns: repeat(6, 1fr);
    gap: 8px;
}

.discord-color-item {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    cursor: pointer;
    border: 2px solid transparent;
    transition: all 0.1s ease;
}

.discord-color-item:hover {
    transform: scale(1.1);
}

.discord-color-item.selected {
    border-color: white;
    box-shadow: 0 0 0 2px var(--discord-blurple);
}

/* ========== LOADING STATES ========== */
.discord-loading {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 40px;
    color: var(--discord-text-muted);
}

.discord-spinner {
    width: 32px;
    height: 32px;
    border: 3px solid var(--discord-border);
    border-top-color: var(--discord-blurple);
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

@keyframes spin {
    to { transform: rotate(360deg); }
}

/* ========== TOAST NOTIFICATIONS ========== */
.discord-toast {
    position: fixed;
    bottom: 80px;
    left: 50%;
    transform: translateX(-50%) translateY(100px);
    background: var(--discord-dark);
    color: var(--discord-text);
    padding: 14px 24px;
    border-radius: 8px;
    box-shadow: 0 8px 24px rgba(0,0,0,0.5), 0 0 0 1px rgba(0,0,0,0.1);
    font-size: 15px;
    font-weight: 500;
    opacity: 0;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    z-index: 10000;
    max-width: 400px;
}

.discord-toast.show {
    transform: translateX(-50%) translateY(0);
    opacity: 1;
}

.discord-toast.success {
    border-left: 4px solid var(--discord-green);
}

.discord-toast.error {
    border-left: 4px solid var(--discord-red);
}

/* ========== SETTINGS PANEL ========== */
.discord-settings-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0,0,0,0.85);
    display: none;
    align-items: center;
    justify-content: center;
    z-index: 1000;
}

.discord-settings-overlay.show {
    display: flex;
}

.discord-settings-panel {
    background: linear-gradient(180deg, rgba(43, 45, 49, 0.98) 0%, var(--discord-sidebar) 100%);
    border-radius: 12px;
    width: 500px;
    max-width: 600px;
    max-height: 80vh;
    overflow: hidden;
    display: flex;
    flex-direction: column;
    box-shadow: 0 20px 60px rgba(0,0,0,0.7), 0 0 0 1px rgba(88, 101, 242, 0.3), inset 0 1px 0 rgba(255, 255, 255, 0.05);
    animation: settingsPanelIn 0.3s cubic-bezier(0.34, 1.56, 0.64, 1);
    border: 1px solid rgba(88, 101, 242, 0.2);
}

@keyframes settingsPanelIn {
    from { opacity: 0; transform: scale(0.85) translateY(30px); }
    to { opacity: 1; transform: scale(1) translateY(0); }
}

.discord-settings-header {
    padding: 16px 20px;
    border-bottom: 1px solid var(--discord-border);
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.discord-settings-title {
    font-size: 20px;
    font-weight: 600;
    color: var(--discord-text);
}

.discord-settings-close {
    background: none;
    border: none;
    color: var(--discord-text-muted);
    font-size: 24px;
    cursor: pointer;
    padding: 6px;
    border-radius: 4px;
    transition: all 0.15s ease;
    display: flex;
    align-items: center;
    justify-content: center;
}

.discord-settings-close:hover {
    color: var(--discord-text);
    background: var(--discord-hover);
    transform: rotate(90deg);
}

.discord-settings-body {
    padding: 20px;
    overflow-y: auto;
    flex: 1;
}

.discord-settings-body::-webkit-scrollbar {
    width: 8px;
}

.discord-settings-body::-webkit-scrollbar-track {
    background: transparent;
}

.discord-settings-body::-webkit-scrollbar-thumb {
    background: var(--discord-scrollbar-thumb);
    border-radius: 4px;
}

.discord-settings-body::-webkit-scrollbar-thumb:hover {
    background: #232428;
}

.discord-settings-section {
    margin-bottom: 24px;
}

.discord-settings-section h3 {
    font-size: 12px;
    font-weight: 700;
    color: var(--discord-text-muted);
    text-transform: uppercase;
    margin: 0 0 12px;
    letter-spacing: 0.02em;
}

.discord-settings-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    padding: 12px;
    background: var(--discord-dark);
    border-radius: 4px;
    margin-bottom: 8px;
}

/* Right-align only the primary action buttons in settings forms */
.discord-settings-section > form {
    display: flex;
    flex-direction: column;
    align-items: stretch;
}

.discord-settings-section > form > button[type="submit"],
.discord-settings-section > form > input[type="submit"] {
    align-self: flex-end;
}

.discord-settings-label {
    color: var(--discord-text);
    font-size: 16px;
}

.discord-settings-description {
    color: var(--discord-text-muted);
    font-size: 14px;
    margin-top: 4px;
}

/* Toggle switch */
.discord-toggle {
    position: relative;
    width: 40px;
    height: 24px;
    background: linear-gradient(135deg, rgba(109, 111, 120, 0.8) 0%, var(--discord-text-faint) 100%);
    border-radius: 12px;
    cursor: pointer;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    box-shadow: inset 0 2px 4px rgba(0,0,0,0.3), 0 1px 2px rgba(0,0,0,0.1);
}

.discord-toggle.on {
    background: linear-gradient(135deg, #23a559 0%, #1e8e4f 100%);
    box-shadow: inset 0 1px 3px rgba(0,0,0,0.2), 0 0 0 3px rgba(35, 165, 89, 0.3), 0 4px 12px rgba(35, 165, 89, 0.4);
}

.discord-toggle::after {
    content: '';
    position: absolute;
    top: 2px;
    left: 2px;
    width: 20px;
    height: 20px;
    background: white;
    border-radius: 50%;
    transition: transform 0.25s cubic-bezier(0.34, 1.56, 0.64, 1);
    box-shadow: 0 2px 4px rgba(0,0,0,0.2);
}

.discord-toggle.on::after {
    transform: translateX(16px);
}

/* Hide hamburger on desktop */
.discord-mobile-channels-btn {
    display: none !important;
}

/* ========== MOBILE RESPONSIVE ========== */
@media (max-width: 768px) {
    .discord-mobile-channels-btn {
        display: flex !important;
    }

    .discord-channel-sidebar {
        display: none;
        position: fixed;
        left: -100%;
        top: var(--site-nav-height, 0px);
        bottom: 50px;
        width: 80%;
        max-width: 280px;
        z-index: 100;
        transition: left 0.3s ease;
        border-right: 1px solid var(--discord-darker);
    }

    .discord-channel-sidebar.show {
        display: flex;
        left: 0;
    }

    .discord-members-sidebar {
        display: none;
        position: fixed;
        right: -100%;
        top: var(--site-nav-height, 0px);
        bottom: 50px;
        width: 80%;
        max-width: 300px;
        z-index: 100;
        transition: right 0.3s ease;
    }

    .discord-members-sidebar.show {
        display: flex;
        right: 0;
    }

    .discord-mobile-overlay {
        position: fixed;
        inset: 0;
        background: rgba(0,0,0,0.5);
        display: none;
        z-index: 99;
    }

    .discord-mobile-overlay.show {
        display: block;
    }

    .discord-header-description,
    .discord-header-topic,
    .discord-header-meta-inline {
        display: none;
    }

    .discord-header-divider {
        display: none;
    }

    .discord-message {
        padding: 2px 16px 2px 56px;
    }

    .discord-message-avatar {
        left: 8px;
        width: 36px;
        height: 36px;
    }

    .discord-input-wrapper {
        padding: 0 8px;
    }

    .discord-emoji-picker {
        width: calc(100vw - 32px);
        right: 16px;
        left: 16px;
        max-height: 320px;
    }
    
    /* Ensure footer music bar space on mobile */
    .discord-group-page {
        bottom: 50px;
    }
}

/* (Old channel tabs removed — replaced by channel sidebar) */

/* ========== VOICE CHAT (Discord-style sidebar) ========== */

/* Users listed under the voice channel */
.discord-voice-users {
    padding: 2px 0 4px 0;
}

.discord-voice-user {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 1px 8px;
    margin: 1px 8px 1px 28px;
    border-radius: 4px;
    cursor: default;
    height: 32px;
}

.discord-voice-user:hover {
    background: rgba(79, 84, 92, 0.32);
}

.discord-voice-user-avatar {
    width: 24px;
    height: 24px;
    min-width: 24px;
    min-height: 24px;
    border-radius: 50%;
    object-fit: cover;
    display: block;
    flex-shrink: 0;
    background: #36393f;
    border: 2px solid transparent;
    transition: border-color 0.15s ease, box-shadow 0.15s ease;
}

.discord-voice-user.speaking .discord-voice-user-avatar {
    border-color: #23a559;
    box-shadow: 0 0 8px rgba(35, 165, 89, 0.6);
    animation: voicePulse 1.5s ease-in-out infinite;
}

@keyframes voicePulse {
    0%, 100% { box-shadow: 0 0 6px rgba(35, 165, 89, 0.5); }
    50% { box-shadow: 0 0 12px rgba(35, 165, 89, 0.8); }
}

.discord-voice-user.speaking .discord-voice-user-name {
    color: #23a559;
}

.discord-voice-user-name {
    font-size: 13px;
    font-weight: 500;
    color: #8e9297;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    flex: 1;
    line-height: 1;
}

.discord-voice-user-icon {
    display: flex;
    align-items: center;
    flex-shrink: 0;
}

/* Voice channel active state */
.discord-channel-item.voice-channel.voice-active {
    color: var(--discord-green);
}

.discord-channel-item.voice-channel.voice-active .channel-hash {
    opacity: 1;
}

/* ========== Voice Connection Panel (bottom of channel sidebar) ========== */
.discord-voice-panel {
    background: #232428;
    border-top: 1px solid #1a1b1e;
    flex-shrink: 0;
    padding: 0;
}

/* Top row: signal icon + status text + channel name */
.discord-voice-panel-status {
    display: flex;
    align-items: flex-start;
    padding: 10px 10px 0 10px;
    gap: 8px;
    cursor: default;
}

.discord-voice-panel-signal {
    color: #23a559;
    flex-shrink: 0;
    margin-top: 2px;
}

.discord-voice-panel-info {
    display: flex;
    flex-direction: column;
    min-width: 0;
    flex: 1;
    gap: 1px;
}

.discord-voice-panel-state {
    font-size: 13px;
    font-weight: 600;
    color: #23a559;
    line-height: 1.2;
}

.discord-voice-panel-channel {
    font-size: 12px;
    color: #949ba4;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    line-height: 1.2;
}

/* Bottom row: avatar + username + mute/deafen/disconnect */
.discord-voice-panel-user {
    display: flex;
    align-items: center;
    padding: 6px 6px 8px 10px;
    gap: 8px;
}

.discord-voice-panel-avatar {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    object-fit: cover;
    flex-shrink: 0;
}

.discord-voice-panel-username {
    font-size: 14px;
    font-weight: 500;
    color: #f2f3f5;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    flex: 1;
    min-width: 0;
}

.discord-voice-panel-controls {
    display: flex;
    align-items: center;
    gap: 2px;
    flex-shrink: 0;
}

.discord-voice-ctrl {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 32px;
    height: 32px;
    border-radius: 4px;
    background: transparent;
    border: none;
    color: #b5bac1;
    cursor: pointer;
    transition: background 0.15s ease, color 0.15s ease;
    padding: 0;
}

.discord-voice-ctrl:hover {
    background: rgba(79, 84, 92, 0.4);
    color: #dbdee1;
}

.discord-voice-ctrl.active {
    color: #f23f43;
}

.discord-voice-ctrl.active:hover {
    background: rgba(242, 63, 67, 0.15);
}

.discord-voice-ctrl.disconnect {
    color: #b5bac1;
}

.discord-voice-ctrl.disconnect:hover {
    color: #f23f43;
    background: rgba(242, 63, 67, 0.15);
}

.discord-voice-ctrl svg {
    width: 20px;
    height: 20px;
    pointer-events: none;
}

/* ========== Voice Context Menu ========== */
.voice-ctx {
    min-width: 220px;
    max-width: 260px;
}

.voice-ctx-header {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 10px 12px;
}

.voice-ctx-avatar {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    object-fit: cover;
    flex-shrink: 0;
    background: #36393f;
}

.voice-ctx-name {
    font-size: 14px;
    font-weight: 600;
    color: #f2f3f5;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.voice-ctx-slider-label {
    font-size: 11px;
    font-weight: 700;
    text-transform: uppercase;
    color: #b5bac1;
    padding: 6px 12px 4px;
    letter-spacing: 0.02em;
}

.voice-ctx-slider-wrap {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 2px 12px 8px;
}

.voice-ctx-slider {
    flex: 1;
    -webkit-appearance: none;
    appearance: none;
    height: 6px;
    border-radius: 3px;
    background: #4e5058;
    outline: none;
    cursor: pointer;
}

.voice-ctx-slider::-webkit-slider-thumb {
    -webkit-appearance: none;
    appearance: none;
    width: 14px;
    height: 14px;
    border-radius: 50%;
    background: #fff;
    cursor: pointer;
    box-shadow: 0 1px 3px rgba(0,0,0,0.3);
}

.voice-ctx-slider::-moz-range-thumb {
    width: 14px;
    height: 14px;
    border-radius: 50%;
    background: #fff;
    cursor: pointer;
    border: none;
    box-shadow: 0 1px 3px rgba(0,0,0,0.3);
}

.voice-ctx-slider-val {
    font-size: 12px;
    font-weight: 600;
    color: #b5bac1;
    min-width: 36px;
    text-align: right;
    flex-shrink: 0;
}

/* ========== FILE UPLOAD ========== */
.discord-upload-btn {
    background: transparent;
    border: none;
    color: #b9bbbe;
    cursor: pointer;
    padding: 0;
    border-radius: 50%;
    font-size: 24px;
    transition: all 0.15s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    width: 32px;
    height: 32px;
}

.discord-upload-btn:hover {
    color: #dcddde;
    background: rgba(79, 84, 92, 0.4);
}

.discord-upload-btn:active {
    background: rgba(79, 84, 92, 0.6);
}

.discord-drop-overlay {
    position: absolute;
    inset: 0;
    background: rgba(88, 101, 242, 0.15);
    border: 2px dashed var(--discord-blurple);
    border-radius: 8px;
    display: none;
    align-items: center;
    justify-content: center;
    z-index: 50;
    pointer-events: none;
}

.discord-drop-overlay.active {
    display: flex;
}

.discord-drop-overlay-text {
    background: var(--discord-blurple);
    color: #fff;
    padding: 16px 32px;
    border-radius: 8px;
    font-size: 18px;
    font-weight: 600;
    box-shadow: 0 4px 16px rgba(0,0,0,0.3);
}

.discord-upload-preview {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 8px 12px;
    background: var(--discord-dark);
    border-radius: 6px;
    margin-bottom: 8px;
}

.discord-upload-preview img {
    width: 60px;
    height: 60px;
    object-fit: cover;
    border-radius: 4px;
}

.discord-upload-preview .upload-file-info {
    flex: 1;
    min-width: 0;
}

.discord-upload-preview .upload-file-name {
    color: var(--discord-text);
    font-size: 14px;
    font-weight: 500;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.discord-upload-preview .upload-file-size {
    color: var(--discord-text-muted);
    font-size: 12px;
}

.discord-upload-preview .upload-remove {
    background: none;
    border: none;
    color: var(--discord-red);
    cursor: pointer;
    font-size: 18px;
    padding: 4px;
}

/* ========== SEARCH BAR ========== */
.discord-search-wrapper {
    position: relative;
    display: flex;
    align-items: center;
}

.discord-search-input {
    background: var(--discord-dark);
    border: none;
    border-radius: 4px;
    padding: 6px 28px 6px 10px;
    color: var(--discord-text);
    font-size: 13px;
    width: 0;
    opacity: 0;
    transition: all 0.25s ease;
    outline: none;
}

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

.discord-search-wrapper.open .discord-search-input {
    width: 200px;
    opacity: 1;
}

.discord-search-clear {
    position: absolute;
    right: 6px;
    background: none;
    border: none;
    color: var(--discord-text-muted);
    cursor: pointer;
    font-size: 14px;
    display: none;
    padding: 2px;
}

.discord-search-wrapper.open .discord-search-clear {
    display: block;
}

.discord-search-results {
    position: absolute;
    top: 100%;
    right: 0;
    width: 400px;
    max-width: 90vw;
    max-height: 400px;
    overflow-y: auto;
    background: var(--discord-sidebar);
    border-radius: 8px;
    box-shadow: 0 8px 24px rgba(0,0,0,0.4);
    z-index: 200;
    display: none;
    margin-top: 8px;
}

.discord-search-results.show {
    display: block;
}

.discord-search-result {
    padding: 10px 14px;
    border-bottom: 1px solid var(--discord-border);
    cursor: pointer;
    transition: background 0.1s;
}

.discord-search-result:hover {
    background: var(--discord-hover);
}

.discord-search-result:last-child {
    border-bottom: none;
}

.discord-search-result-author {
    font-weight: 600;
    color: var(--discord-text);
    font-size: 13px;
}

.discord-search-result-time {
    color: var(--discord-text-faint);
    font-size: 11px;
    margin-left: 8px;
}

.discord-search-result-text {
    color: var(--discord-text-muted);
    font-size: 13px;
    margin-top: 2px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.discord-search-result-text mark {
    background: rgba(88, 101, 242, 0.3);
    color: var(--discord-text);
    border-radius: 2px;
    padding: 0 2px;
}

/* ========== ONLINE STATUS DOTS ========== */
.discord-member-avatar-wrapper .status-dot {
    position: absolute;
    bottom: -1px;
    right: -1px;
    width: 12px;
    height: 12px;
    border-radius: 50%;
    border: 3px solid var(--discord-sidebar);
    background: var(--discord-text-faint);
    z-index: 1;
}

.discord-member.online .discord-member-avatar-wrapper .status-dot {
    background: var(--discord-green);
}

.discord-message-avatar-wrapper {
    position: relative;
}

/* ========== WALL/FORUM TAB ========== */
.discord-wall-container {
    flex: 1;
    overflow-y: auto;
    padding: 16px;
    display: none;
}

.discord-wall-container.active {
    display: block;
}

.discord-wall-post-form {
    background: var(--discord-input-bg);
    border-radius: 8px;
    padding: 12px 16px;
    margin-bottom: 16px;
}

.discord-wall-post-input {
    width: 100%;
    background: none;
    border: none;
    color: var(--discord-text);
    font-size: 14px;
    resize: none;
    outline: none;
    min-height: 60px;
    font-family: inherit;
}

.discord-wall-post-input::placeholder {
    color: var(--discord-text-faint);
}

.discord-wall-post-actions {
    display: flex;
    justify-content: flex-end;
    margin-top: 8px;
    padding-top: 8px;
    border-top: 1px solid var(--discord-border);
}

.discord-wall-post {
    background: var(--discord-sidebar);
    border-radius: 8px;
    padding: 16px;
    margin-bottom: 12px;
}

.discord-wall-post-header {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 8px;
}

.discord-wall-post-avatar {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    object-fit: cover;
}

.discord-wall-post-author {
    font-weight: 600;
    color: var(--discord-text);
    font-size: 14px;
}

.discord-wall-post-time {
    color: var(--discord-text-muted);
    font-size: 12px;
}

.discord-wall-post-body {
    color: var(--discord-text);
    font-size: 14px;
    line-height: 1.5;
    white-space: pre-wrap;
    word-break: break-word;
}

.discord-wall-post-footer {
    display: flex;
    gap: 16px;
    margin-top: 10px;
    padding-top: 8px;
    border-top: 1px solid var(--discord-border);
}

.discord-wall-action {
    display: flex;
    align-items: center;
    gap: 4px;
    color: var(--discord-text-muted);
    font-size: 13px;
    cursor: pointer;
    background: none;
    border: none;
    padding: 4px 8px;
    border-radius: 4px;
    transition: all 0.15s;
}

.discord-wall-action:hover {
    color: var(--discord-text);
    background: var(--discord-hover);
}

/* ========== MEDIA TAB ========== */
.discord-media-container {
    flex: 1;
    overflow-y: auto;
    padding: 16px;
    display: none;
}

.discord-media-container.active {
    display: block;
}

.discord-media-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(160px, 1fr));
    gap: 8px;
}

.discord-media-item {
    aspect-ratio: 1;
    border-radius: 8px;
    overflow: hidden;
    cursor: pointer;
    position: relative;
    background: var(--discord-dark);
}

.discord-media-item img,
.discord-media-item video {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.2s ease;
}

.discord-media-item:hover img,
.discord-media-item:hover video {
    transform: scale(1.05);
}

.discord-media-item .media-overlay {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    padding: 6px 8px;
    background: linear-gradient(transparent, rgba(0,0,0,0.7));
    color: #fff;
    font-size: 11px;
    opacity: 0;
    transition: opacity 0.2s;
}

.discord-media-item:hover .media-overlay {
    opacity: 1;
}

.discord-media-empty {
    text-align: center;
    padding: 60px 20px;
    color: var(--discord-text-muted);
}

.discord-media-empty-icon {
    font-size: 48px;
    margin-bottom: 12px;
    opacity: 0.5;
}

/* (Slim links removed — invite moved to header button) */

/* ========== SCROLLBAR FIREFOX ========== */
.discord-messages,
.discord-members-list {
    scrollbar-width: thin;
    scrollbar-color: var(--discord-scrollbar-thumb) transparent;
}

/* ========== ANIMATIONS ========== */
@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(8px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.discord-message {
    animation: msgSlideIn 0.25s ease-out;
}

@keyframes msgSlideIn {
    from { opacity: 0; transform: translateY(8px); }
    to { opacity: 1; transform: translateY(0); }
}

/* System messages (join/leave/pin) */
.discord-system-message {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 4px 16px;
    color: var(--discord-text-muted);
    font-size: 13px;
    font-style: italic;
}

.discord-system-message .system-icon {
    font-size: 16px;
    flex-shrink: 0;
}

/* ========== VOICE CONTROLS ========== */
.discord-voice-bar {
    display: none;
    background: var(--discord-darker);
    padding: 8px 16px;
    border-top: 1px solid var(--discord-border);
    align-items: center;
    gap: 12px;
}

.discord-voice-bar.show {
    display: flex;
}

.discord-voice-status {
    display: flex;
    align-items: center;
    gap: 8px;
    color: var(--discord-green);
    font-size: 14px;
    font-weight: 500;
}

.discord-voice-status::before {
    content: '';
    width: 8px;
    height: 8px;
    background: currentColor;
    border-radius: 50%;
    animation: pulse 2s infinite;
}

@keyframes pulse {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.5; }
}

@keyframes profileModalIn {
    from { opacity: 0; transform: scale(0.9) translateY(20px); }
    to { opacity: 1; transform: scale(1) translateY(0); }
}

@keyframes bannerShimmer {
    0%, 100% { opacity: 0.5; transform: translateX(-100%); }
    50% { opacity: 1; transform: translateX(100%); }
}

.discord-voice-controls {
    display: flex;
    gap: 8px;
    margin-left: auto;
}

.discord-voice-btn {
    background: var(--discord-input-bg);
    border: none;
    color: var(--discord-text);
    padding: 8px 12px;
    border-radius: 4px;
    cursor: pointer;
    font-size: 14px;
    display: flex;
    align-items: center;
    gap: 6px;
    transition: all 0.15s ease;
}

.discord-voice-btn:hover {
    background: var(--discord-hover);
}

.discord-voice-btn.muted {
    color: var(--discord-red);
}

.discord-voice-btn.disconnect {
    background: var(--discord-red);
    color: white;
}

.discord-voice-btn.disconnect:hover {
    background: #d93f43;
}

/* ========== FOOTER MUSIC BAR COMPATIBILITY ========== */
/* Do NOT override footer music bar styles - let it use its own CSS */

/* ========== MOBILE RESPONSIVE ========== */

/* Hide desktop-only buttons on small screens */
@media (max-width: 768px) {
    .discord-header-btn-desktop {
        display: none !important;
    }
}

@media (max-width: 640px) {
    /* Combined header: tighter on mobile */
    .discord-header {
        padding: 0 8px;
        gap: 6px;
        height: 48px;
        min-height: 48px;
    }
    
    .discord-header-group-icon,
    .discord-header-group-icon-placeholder {
        width: 28px;
        height: 28px;
        border-radius: 6px;
        font-size: 12px;
    }
    
    .discord-header-name {
        font-size: 14px;
    }
    
    .discord-header-meta {
        gap: 8px;
    }
    
    .discord-header-stat {
        font-size: 10px;
    }
    
    .discord-header-actions {
        gap: 2px;
    }
    
    .discord-header-btn {
        padding: 4px;
        font-size: 16px;
    }
    
    .discord-back-btn {
        padding: 4px;
        font-size: 16px;
    }
    
    /* Channel tabs */
    .discord-channel-tabs {
        min-height: 36px;
        padding: 0 4px;
    }
    
    .discord-channel-tab {
        padding: 4px 10px;
        font-size: 13px;
    }
    
    .discord-channel-tab .tab-icon {
        font-size: 13px;
    }
    
    /* Search */
    .discord-search-wrapper.open .discord-search-input {
        width: 140px;
    }
    
    .discord-search-results {
        width: calc(100vw - 32px);
        right: -60px;
        max-height: 50vh;
    }
    
    /* Upload */
    .discord-upload-btn {
        font-size: 18px;
        width: 28px;
        height: 28px;
    }
    
    .discord-upload-preview {
        padding: 6px 8px;
    }
    
    .discord-upload-preview img {
        width: 40px;
        height: 40px;
    }
    
    /* Wall & Media tabs */
    .discord-wall-container,
    .discord-media-container {
        padding: 10px;
    }
    
    .discord-wall-post {
        padding: 12px;
    }
    
    .discord-media-grid {
        grid-template-columns: repeat(auto-fill, minmax(100px, 1fr));
        gap: 4px;
    }
    
    /* Drag-drop overlay */
    .discord-drop-overlay-text {
        font-size: 14px;
        padding: 12px 20px;
    }
    
    /* Chat input */
    .discord-input-area {
        padding: 0 8px 8px;
    }
    
    .discord-input-wrapper {
        padding: 6px 8px;
    }
    
    .discord-input-wrapper textarea {
        font-size: 14px;
    }
    
    /* Messages */
    .discord-messages {
        padding: 12px 8px 0;
    }
    
    .discord-message {
        padding: 2px 8px 2px 56px;
        margin: 0 -8px;
    }
    
    .discord-message-avatar {
        left: 8px;
        width: 32px;
        height: 32px;
    }
    
    .discord-message-actions {
        right: 8px;
    }
    
    /* Members sidebar: full overlay on mobile */
    .discord-members {
        position: fixed;
        right: -260px;
        top: 0;
        bottom: 0;
        z-index: 100;
        transition: right 0.25s ease;
        box-shadow: -4px 0 16px rgba(0,0,0,0.4);
    }
    
    .discord-members.show {
        right: 0;
    }
    
    /* Voice bar */
    .discord-voice-bar {
        flex-wrap: wrap;
        gap: 6px;
        padding: 6px 8px;
    }
    
    /* Invite modal */
    .invite-modal {
        max-width: calc(100vw - 24px) !important;
        margin: 12px;
    }
}

/* Extra small screens */
@media (max-width: 400px) {
    .discord-header-meta {
        display: none;
    }
    
    .discord-header-name {
        font-size: 13px;
    }
    
    .discord-channel-tab {
        padding: 4px 8px;
        font-size: 12px;
    }
    
    .discord-channel-tab .tab-icon {
        display: none;
    }
}

@media (max-width: 720px) {
    :root {
        --site-nav-height: 29px;
    }

    body.discord-mode .myspace-header .top-nav {
        display: none !important;
    }

    body.discord-mode .myspace-header .main-nav-wrapper {
        height: 29px !important;
    }

    body.discord-mode .myspace-header .main-nav-container {
        height: 29px !important;
        overflow: visible !important;
    }

    body.discord-mode .myspace-header .main-nav {
        height: 29px !important;
        align-items: stretch !important;
    }

    body.discord-mode .myspace-header .main-nav {
        overflow: visible !important;
    }

    body.discord-mode .myspace-header .main-nav li a,
    body.discord-mode .myspace-header .main-nav li a:hover,
    body.discord-mode .myspace-header .main-nav li a.active {
        height: 29px !important;
        line-height: 29px !important;
    }

    body.discord-mode .myspace-header .dropdown-menu {
        position: absolute !important;
        top: 100% !important;
        left: auto !important;
        right: 0 !important;
        bottom: auto !important;
        transform: none !important;
        margin-top: 0 !important;
        z-index: 2000 !important;
        max-height: calc(100vh - 29px) !important;
        overflow-y: auto !important;
        -webkit-overflow-scrolling: touch;
    }

    .discord-group-page {
        top: 29px !important;
    }
}
