:root {
    /* Dracula Colors */
    --dracula-bg: #282a36;
    --dracula-current-line: #44475a;
    --dracula-fg: #f8f8f2;
    --dracula-comment: #6272a4;
    --dracula-cyan: #8be9fd;
    --dracula-green: #50fa7b;
    --dracula-orange: #ffb86c;
    --dracula-pink: #ff79c6;
    --dracula-purple: #bd93f9;
    --dracula-red: #ff5555;
    --dracula-yellow: #f1fa8c;

    /* Discord-like Colors using Dracula */
    --bg-primary: #282a36;
    --bg-secondary: #2f3136;
    --bg-tertiary: #202225;
    --bg-accent: #44475a;
    --bg-modifier-hover: rgba(98, 114, 164, 0.16);
    --bg-modifier-selected: rgba(189, 147, 249, 0.2);
    --text-normal: #f8f8f2;
    --text-muted: #a6adc8;
    --text-link: #8be9fd;
    --accent-primary: #bd93f9;
    --accent-secondary: #ff79c6;
    --border-color: #1e1f22;
}

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

body {
    font-family: 'gg sans', 'Noto Sans', 'Helvetica Neue', Helvetica, Arial, sans-serif;
    background: var(--bg-primary);
    color: var(--text-normal);
    height: 100vh;
    overflow: hidden;
    font-size: 16px;
}

.app-container {
    display: flex;
    height: 100vh;
}

/* ===== SERVER LIST (Left-most sidebar) ===== */
.server-list {
    width: 72px;
    background: var(--bg-tertiary);
    display: flex;
    flex-direction: column;
    align-items: center;
    padding: 12px 0;
    gap: 8px;
    overflow-y: auto;
}

.server-icon {
    width: 48px;
    height: 48px;
    background: var(--bg-secondary);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.2s ease;
    position: relative;
    color: var(--dracula-green);
    font-weight: 600;
    font-size: 18px;
}

.server-icon::before {
    content: '';
    position: absolute;
    left: -12px;
    width: 8px;
    height: 0;
    background: var(--text-normal);
    border-radius: 0 4px 4px 0;
    transition: height 0.2s ease;
}

.server-icon:hover {
    border-radius: 16px;
    background: var(--accent-primary);
    color: white;
}

.server-icon:hover::before {
    height: 20px;
}

.server-icon.active {
    border-radius: 16px;
    background: var(--accent-primary);
    color: white;
}

.server-icon.active::before {
    height: 40px;
}

.server-icon.add-server {
    background: transparent;
    border: 2px dashed var(--dracula-comment);
    color: var(--dracula-green);
}

.server-icon.add-server:hover {
    border-color: var(--dracula-green);
    background: var(--bg-modifier-hover);
}

.server-separator {
    width: 32px;
    height: 2px;
    background: var(--dracula-current-line);
    border-radius: 1px;
    margin: 4px 0;
}

/* ===== SIDEBAR (Channels) ===== */
.sidebar {
    width: 240px;
    background: var(--bg-secondary);
    display: flex;
    flex-direction: column;
}

.sidebar-header {
    padding: 12px 16px;
    border-bottom: 1px solid var(--border-color);
    display: flex;
    justify-content: space-between;
    align-items: center;
    min-height: 48px;
    box-shadow: 0 1px 0 rgba(0, 0, 0, 0.2), 0 1.5px 0 rgba(0, 0, 0, 0.05), 0 2px 0 rgba(0, 0, 0, 0.05);
}

.sidebar-header h2 {
    color: var(--text-normal);
    font-size: 16px;
    font-weight: 600;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.header-icon {
    background: none;
    border: none;
    color: var(--text-muted);
    cursor: pointer;
    padding: 4px;
    border-radius: 4px;
    transition: color 0.2s, background 0.2s;
    display: flex;
    align-items: center;
    justify-content: center;
}

.header-icon:hover {
    color: var(--text-normal);
    background: var(--bg-modifier-hover);
}

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

.channel-category {
    margin-bottom: 16px;
}

.category-header {
    display: flex;
    align-items: center;
    padding: 8px 8px 4px 12px;
    color: var(--text-muted);
    font-size: 12px;
    font-weight: 600;
    letter-spacing: 0.5px;
    text-transform: uppercase;
    cursor: pointer;
    transition: color 0.2s;
}

.category-header:hover {
    color: var(--text-normal);
}

.category-header svg {
    margin-right: 4px;
    transition: transform 0.2s;
}

.category-header span {
    flex: 1;
}

.icon-btn {
    background: none;
    border: none;
    color: var(--text-muted);
    cursor: pointer;
    font-size: 18px;
    padding: 0 4px;
    transition: color 0.2s;
}

.icon-btn:hover {
    color: var(--text-normal);
}

.channel-list {
    display: flex;
    flex-direction: column;
}

.channel-item {
    padding: 6px 8px;
    margin: 1px 8px;
    cursor: pointer;
    border-radius: 4px;
    display: flex;
    align-items: center;
    transition: background 0.15s ease;
    color: var(--text-muted);
    font-size: 16px;
    position: relative;
}

.channel-item::before {
    content: '# ';
    font-weight: 300;
    margin-right: 6px;
    color: var(--text-muted);
}

.channel-item:hover {
    background: var(--bg-modifier-hover);
    color: var(--text-normal);
}

.channel-item.active {
    background: var(--bg-modifier-selected);
    color: var(--text-normal);
}

.channel-item.active::before {
    color: var(--text-normal);
}

.channel-item strong {
    font-weight: 500;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.channel-item small {
    display: none;
}

.voice-channel {
    padding: 6px 8px;
    margin: 1px 8px;
    cursor: pointer;
    border-radius: 4px;
    display: flex;
    align-items: center;
    gap: 8px;
    transition: background 0.15s ease;
    color: var(--text-muted);
    font-size: 16px;
}

.voice-channel svg {
    flex-shrink: 0;
}

.voice-channel:hover {
    background: var(--bg-modifier-hover);
    color: var(--text-normal);
}

.sidebar-footer {
    padding: 0;
    background: #232428;
    border-top: 1px solid var(--border-color);
}

.user-panel {
    width: 100%;
    padding: 10px 8px;
    background: transparent;
    border: none;
    display: flex;
    align-items: center;
    gap: 8px;
    cursor: pointer;
    transition: background 0.15s;
    color: var(--text-normal);
}

.user-panel:hover {
    background: var(--bg-modifier-hover);
}

.user-avatar {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    background: var(--dracula-red);
    color: white;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 600;
    font-size: 14px;
    flex-shrink: 0;
}

.user-info {
    flex: 1;
    overflow: hidden;
}

.user-name {
    font-size: 14px;
    font-weight: 600;
    color: var(--text-normal);
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

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

.user-actions {
    display: flex;
    gap: 4px;
}

.user-actions svg {
    color: var(--text-muted);
}

/* ===== MAIN AREA ===== */
.main-area {
    flex: 1;
    display: flex;
    flex-direction: column;
    background: var(--bg-primary);
    min-width: 0;
}

.header {
    padding: 0 16px;
    border-bottom: 1px solid var(--border-color);
    background: var(--bg-primary);
    display: flex;
    justify-content: space-between;
    align-items: center;
    min-height: 48px;
    box-shadow: 0 1px 0 rgba(0, 0, 0, 0.2), 0 1.5px 0 rgba(0, 0, 0, 0.05), 0 2px 0 rgba(0, 0, 0, 0.05);
    z-index: 1;
}

.header-left {
    display: flex;
    align-items: center;
    gap: 8px;
    min-width: 0;
}

.channel-icon {
    color: var(--text-muted);
    flex-shrink: 0;
}

.header h1 {
    font-size: 16px;
    font-weight: 600;
    color: var(--text-normal);
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

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

.header-icons {
    display: flex;
    gap: 16px;
}

.status-indicator {
    font-size: 12px;
    color: var(--text-muted);
    padding: 4px 8px;
    background: var(--bg-accent);
    border-radius: 4px;
}

.status-indicator.online {
    color: var(--dracula-green);
    background: rgba(80, 250, 123, 0.1);
}

.chat-container {
    flex: 1;
    overflow: hidden;
    position: relative;
}

.message-list {
    height: 100%;
    padding: 16px 0;
    overflow-y: auto;
    overflow-x: hidden;
    display: flex;
    flex-direction: column;
}

.welcome-message {
    padding: 16px;
    margin: 0 16px;
    background: var(--bg-secondary);
    border-radius: 8px;
    flex-shrink: 0;
}

.welcome-message h2 {
    font-size: 32px;
    font-weight: 700;
    color: var(--text-normal);
    margin-bottom: 8px;
}

.welcome-message p {
    color: var(--text-muted);
    font-size: 16px;
}

.message {
    padding: 2px 16px;
    margin-top: 17px;
    position: relative;
    transition: background 0.05s;
    min-height: 44px;
    word-wrap: break-word;
    display: flex;
    gap: 16px;
    flex-shrink: 0;
}

.message:hover {
    background: var(--bg-modifier-hover);
}

.message-avatar {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background: var(--accent-primary);
    color: white;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 600;
    font-size: 16px;
    flex-shrink: 0;
    overflow: hidden;
}

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

.message-avatar .avatar-initial {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 100%;
    height: 100%;
}

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

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

.message-header strong {
    color: var(--text-normal);
    font-size: 16px;
    font-weight: 500;
}

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

.message-content {
    color: var(--text-normal);
    line-height: 1.375rem;
    font-size: 16px;
    word-wrap: break-word;
}

.message-actions {
    margin-top: 8px;
    display: flex;
    gap: 4px;
    flex-wrap: wrap;
}

.reaction-btn {
    background: var(--bg-accent);
    border: 1px solid transparent;
    border-radius: 8px;
    padding: 4px 6px;
    cursor: pointer;
    color: var(--text-normal);
    font-size: 14px;
    display: inline-flex;
    align-items: center;
    gap: 4px;
    transition: all 0.15s;
}

.reaction-btn:hover {
    background: var(--bg-modifier-selected);
    border-color: var(--dracula-comment);
}

.reaction-btn.active {
    background: rgba(189, 147, 249, 0.15);
    border-color: var(--accent-primary);
}

/* ===== INPUT AREA ===== */
.input-area {
    padding: 16px;
    background: var(--bg-primary);
    display: flex;
    align-items: center;
    gap: 12px;
}

.input-icon {
    background: none;
    border: none;
    color: var(--text-muted);
    cursor: pointer;
    padding: 8px;
    border-radius: 4px;
    transition: color 0.2s;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.input-icon:hover {
    color: var(--text-normal);
}

#message-input {
    flex: 1;
    padding: 11px 16px;
    background: var(--bg-accent);
    border: none;
    border-radius: 8px;
    color: var(--text-normal);
    font-size: 15px;
    outline: none;
    font-family: inherit;
}

#message-input::placeholder {
    color: var(--text-muted);
}

.input-actions {
    display: flex;
    align-items: center;
    gap: 8px;
}

/* ===== MEMBERS SIDEBAR ===== */
.members-sidebar {
    width: 240px;
    background: var(--bg-secondary);
    display: flex;
    flex-direction: column;
    border-left: 1px solid var(--border-color);
}

.members-header {
    padding: 24px 16px 8px;
    font-size: 12px;
    font-weight: 600;
    color: var(--text-muted);
    letter-spacing: 0.5px;
}

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

.member-group {
    margin-bottom: 16px;
}

.member-group-title {
    padding: 16px 8px 4px;
    font-size: 12px;
    font-weight: 600;
    color: var(--text-muted);
    letter-spacing: 0.5px;
    text-transform: uppercase;
}

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

.member-item:hover {
    background: var(--bg-modifier-hover);
}

.member-avatar {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    background: var(--accent-primary);
    color: white;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 600;
    font-size: 14px;
    position: relative;
    flex-shrink: 0;
}

.member-avatar::after {
    content: '';
    position: absolute;
    bottom: -2px;
    right: -2px;
    width: 12px;
    height: 12px;
    border-radius: 50%;
    border: 3px solid var(--bg-secondary);
    background: var(--text-muted);
}

.member-avatar.online::after {
    background: var(--dracula-green);
}

.member-avatar.offline::after {
    background: var(--text-muted);
}

.member-info {
    flex: 1;
    overflow: hidden;
}

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

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

.member-status.status-online {
    color: var(--dracula-green);
}

.member-status.status-offline {
    color: var(--text-muted);
}

/* ===== MODAL ===== */
.modal {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.85);
    justify-content: center;
    align-items: center;
    z-index: 1000;
}

.modal.show {
    display: flex;
}

.modal-content {
    background: var(--bg-secondary);
    padding: 32px;
    border-radius: 8px;
    width: 440px;
    box-shadow: 0 8px 16px rgba(0, 0, 0, 0.4);
}

.modal-content h3 {
    color: var(--text-normal);
    font-size: 24px;
    font-weight: 600;
    margin-bottom: 20px;
}

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

.form-group label {
    display: block;
    margin-bottom: 8px;
    color: var(--text-muted);
    font-size: 12px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.form-group input,
.form-group textarea {
    width: 100%;
    padding: 10px;
    background: var(--bg-tertiary);
    border: 1px solid var(--border-color);
    color: var(--text-normal);
    border-radius: 4px;
    font-size: 16px;
    font-family: inherit;
    outline: none;
    transition: border-color 0.2s;
}

.form-group input:focus,
.form-group textarea:focus {
    border-color: var(--accent-primary);
}

.form-group textarea {
    resize: vertical;
    min-height: 80px;
}

.modal-actions {
    display: flex;
    justify-content: flex-end;
    gap: 12px;
    margin-top: 24px;
}

.cancel-btn {
    background: transparent;
    border: none;
    color: var(--text-normal);
    padding: 10px 16px;
    border-radius: 4px;
    cursor: pointer;
    font-size: 14px;
    font-weight: 500;
    transition: text-decoration 0.2s;
}

.cancel-btn:hover {
    text-decoration: underline;
}

.save-btn {
    background: var(--accent-primary);
    color: white;
    border: none;
    padding: 10px 16px;
    border-radius: 4px;
    cursor: pointer;
    font-weight: 600;
    font-size: 14px;
    transition: background 0.2s;
}

.save-btn:hover {
    background: #a575e8;
}

.danger-btn {
    background: var(--dracula-red);
    color: white;
    border: none;
    padding: 10px 16px;
    border-radius: 4px;
    cursor: pointer;
    font-weight: 600;
}

.danger-btn:hover {
    background: #ff6b6b;
}

/* ===== SCROLLBARS ===== */
::-webkit-scrollbar {
    width: 8px;
    height: 8px;
}

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

::-webkit-scrollbar-thumb {
    background: var(--bg-tertiary);
    border-radius: 4px;
}

::-webkit-scrollbar-thumb:hover {
    background: var(--dracula-comment);
}

::-webkit-scrollbar-corner {
    background: transparent;
}

/* ===== LOADING INDICATOR ===== */
.loading-indicator {
    display: none;
    align-items: center;
    justify-content: center;
    gap: 10px;
    padding: 16px;
    margin: 0 16px 16px;
    background: var(--bg-secondary);
    border-radius: 8px;
    color: var(--text-muted);
    font-size: 14px;
}

.spinner {
    width: 20px;
    height: 20px;
    border: 3px solid var(--bg-accent);
    border-top-color: var(--accent-primary);
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
}

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

.channel-description {
    display: none;
}

/* ===== RESPONSIVE DESIGN ===== */

/* Hide members sidebar toggle by default */
#toggle-members {
    display: flex;
}

/* Desktop - Hide members sidebar below 1200px */
@media (max-width: 1199px) {
    .members-sidebar {
        display: none;
    }
}

/* Tablet Landscape - Optimize for medium screens */
@media (max-width: 1023px) {
    .server-list {
        width: 60px;
    }

    .server-icon {
        width: 40px;
        height: 40px;
        font-size: 16px;
    }

    .sidebar {
        width: 200px;
    }

    .header h1 {
        font-size: 15px;
    }

    .message-avatar {
        width: 36px;
        height: 36px;
        font-size: 14px;
    }
}

/* Tablet Portrait - Further optimizations */
@media (max-width: 767px) {
    .server-list {
        width: 50px;
        padding: 8px 0;
    }

    .server-icon {
        width: 36px;
        height: 36px;
        font-size: 14px;
    }

    .sidebar {
        width: 180px;
    }

    .sidebar-header h2 {
        font-size: 14px;
    }

    .channel-item,
    .voice-channel {
        font-size: 14px;
        padding: 5px 6px;
        margin: 1px 6px;
    }

    .header {
        padding: 0 12px;
    }

    .header-icons {
        gap: 12px;
    }

    .header h1 {
        font-size: 14px;
    }

    .message {
        padding: 2px 12px;
        font-size: 14px;
        gap: 12px;
    }

    .message-avatar {
        width: 32px;
        height: 32px;
        font-size: 12px;
    }

    .message-header strong {
        font-size: 14px;
    }

    .message-content {
        font-size: 14px;
    }

    .input-area {
        padding: 12px;
    }

    #message-input {
        font-size: 14px;
        padding: 10px 14px;
    }
}

/* Mobile Landscape - Hide sidebars, show toggles */
@media (max-width: 639px) {
    .server-list {
        position: fixed;
        left: -60px;
        top: 0;
        height: 100vh;
        z-index: 100;
        transition: left 0.3s ease;
    }

    .server-list.show {
        left: 0;
    }

    .sidebar {
        position: fixed;
        left: -200px;
        top: 0;
        height: 100vh;
        z-index: 99;
        transition: left 0.3s ease;
        box-shadow: 2px 0 8px rgba(0, 0, 0, 0.3);
    }

    .sidebar.show {
        left: 0;
    }

    .main-area {
        width: 100%;
    }

    .header {
        padding: 0 8px;
    }

    .header-left {
        gap: 4px;
    }

    .channel-icon {
        width: 20px;
        height: 20px;
    }

    .header h1 {
        font-size: 14px;
    }

    .header-icons button {
        padding: 6px;
    }

    .header-icons button svg {
        width: 20px;
        height: 20px;
    }

    .status-indicator {
        display: none;
    }

    .welcome-message h2 {
        font-size: 24px;
    }

    .welcome-message p {
        font-size: 14px;
    }

    .message {
        padding: 2px 8px;
        margin-top: 12px;
        gap: 8px;
    }

    .message-avatar {
        width: 32px;
        height: 32px;
        font-size: 12px;
    }

    .input-area {
        padding: 8px;
        gap: 8px;
    }

    .input-icon {
        padding: 6px;
    }

    .input-icon svg {
        width: 20px;
        height: 20px;
    }

    #message-input {
        padding: 9px 12px;
        font-size: 14px;
    }

    .modal-content {
        width: 90%;
        max-width: 400px;
        padding: 24px;
    }
}

/* Mobile Portrait - Smallest screens */
@media (max-width: 479px) {
    .server-list {
        width: 50px;
        left: -50px;
    }

    .sidebar {
        width: 100%;
        max-width: 280px;
        left: -100%;
    }

    .sidebar.show {
        left: 0;
    }

    .header h1 {
        font-size: 13px;
        overflow: hidden;
        text-overflow: ellipsis;
    }

    .header-icons {
        gap: 8px;
    }

    .header-icons button {
        padding: 4px;
    }

    .header-right {
        gap: 8px;
    }

    .welcome-message {
        padding: 12px;
        margin: 0 8px;
    }

    .welcome-message h2 {
        font-size: 20px;
    }

    .message {
        padding: 2px 8px;
        margin-top: 10px;
        gap: 8px;
    }

    .message-avatar {
        width: 28px;
        height: 28px;
        font-size: 11px;
    }

    .message-header {
        flex-wrap: wrap;
        gap: 4px;
    }

    .message-header strong {
        font-size: 13px;
    }

    .message-header small {
        font-size: 11px;
    }

    .message-content {
        font-size: 13px;
        line-height: 1.4rem;
    }

    .reaction-btn {
        padding: 3px 5px;
        font-size: 12px;
    }

    .input-area {
        padding: 8px;
        gap: 6px;
        flex-wrap: wrap;
    }

    .input-icon:first-child {
        display: none;
        /* Hide add attachment on very small screens */
    }

    #message-input {
        flex: 1;
        min-width: 0;
        font-size: 13px;
        padding: 8px 10px;
    }

    .input-actions {
        gap: 6px;
    }

    .modal-content {
        width: 95%;
        padding: 20px;
    }

    .modal-content h3 {
        font-size: 20px;
    }

    .form-group input,
    .form-group textarea {
        font-size: 14px;
    }

    .user-panel {
        padding: 8px;
    }

    .user-avatar {
        width: 28px;
        height: 28px;
        font-size: 12px;
    }

    .user-name {
        font-size: 13px;
    }

    .user-status {
        font-size: 11px;
    }
}

/* Add mobile menu toggle button */
@media (max-width: 639px) {
    .header::before {
        content: '☰';
        font-size: 24px;
        color: var(--text-normal);
        cursor: pointer;
        margin-right: 8px;
        padding: 4px 8px;
        border-radius: 4px;
        transition: background 0.2s;
        display: flex;
        align-items: center;
        justify-content: center;
    }

    .header::before:hover {
        background: var(--bg-modifier-hover);
    }
}

/* Ensure no horizontal scroll */
* {
    min-width: 0;
}

body {
    overflow-x: hidden;
}

.app-container {
    overflow-x: hidden;
}
/* ===== DISCOVERY ===== */
.server-icon.discovery {
    background: transparent;
    color: var(--dracula-green);
    font-size: 24px;
}

.server-icon.discovery:hover {
    background: var(--dracula-green);
    color: var(--bg-primary);
}

.discovery-list {
    display: flex;
    flex-direction: column;
    gap: 10px;
    max-height: 400px;
    overflow-y: auto;
}

.discovery-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 12px;
    background: var(--bg-tertiary);
    border-radius: 8px;
    transition: background 0.2s;
}

.discovery-item:hover {
    background: var(--bg-modifier-hover);
}

.discovery-item-info {
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.discovery-item-name {
    font-weight: 600;
    color: var(--text-normal);
    font-size: 16px;
}

.discovery-item-desc {
    color: var(--text-muted);
    font-size: 14px;
}

.join-btn {
    background: var(--dracula-green);
    color: var(--bg-primary);
    border: none;
    padding: 8px 16px;
    border-radius: 4px;
    font-weight: 600;
    cursor: pointer;
    transition: opacity 0.2s;
}

.join-btn:hover {
    opacity: 0.9;
}

/* ===== WORKSPACE DROPDOWN MENU ===== */
.workspace-menu-container {
    position: relative;
}

.workspace-dropdown {
    display: none;
    position: absolute;
    top: 100%;
    right: 0;
    background: var(--bg-tertiary);
    border-radius: 4px;
    box-shadow: 0 8px 16px rgba(0, 0, 0, 0.24);
    min-width: 180px;
    z-index: 1000;
    padding: 6px 0;
    margin-top: 4px;
}

.workspace-dropdown.show {
    display: block;
}

.dropdown-item {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 8px 12px;
    color: var(--text-muted);
    cursor: pointer;
    font-size: 14px;
    transition: background 0.1s, color 0.1s;
}

.dropdown-item:hover {
    background: var(--accent-primary);
    color: white;
}

.dropdown-item svg {
    flex-shrink: 0;
}

.dropdown-divider {
    height: 1px;
    background: var(--border-color);
    margin: 6px 0;
}

/* ===== FORM ELEMENTS ===== */
.form-select {
    width: 100%;
    padding: 10px;
    background: var(--bg-tertiary);
    border: 1px solid var(--border-color);
    color: var(--text-normal);
    border-radius: 4px;
    font-size: 14px;
    font-family: inherit;
    outline: none;
    cursor: pointer;
}

.form-select:focus {
    border-color: var(--accent-primary);
}

.form-select option {
    background: var(--bg-tertiary);
    color: var(--text-normal);
}

.permission-checkboxes,
.role-checkbox-list {
    display: flex;
    flex-direction: column;
    gap: 8px;
    padding: 10px;
    background: var(--bg-tertiary);
    border-radius: 4px;
}

.checkbox-label {
    display: flex;
    align-items: center;
    gap: 8px;
    color: var(--text-normal);
    font-size: 14px;
    cursor: pointer;
}

.checkbox-label input[type="checkbox"] {
    width: 18px;
    height: 18px;
    accent-color: var(--accent-primary);
    cursor: pointer;
}

input[type="color"] {
    width: 100%;
    height: 40px;
    padding: 4px;
    background: var(--bg-tertiary);
    border: 1px solid var(--border-color);
    border-radius: 4px;
    cursor: pointer;
}

input[type="color"]::-webkit-color-swatch-wrapper {
    padding: 0;
}

input[type="color"]::-webkit-color-swatch {
    border: none;
    border-radius: 2px;
}

/* ===== ROLE CHECKBOX LIST ===== */
.role-checkbox-list {
    display: flex;
    flex-direction: column;
    gap: 8px;
    max-height: 150px;
    overflow-y: auto;
    padding: 8px;
    background: var(--bg-tertiary);
    border-radius: 4px;
}

.role-checkbox {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 6px 8px;
    border-radius: 4px;
    cursor: pointer;
    transition: background 0.15s ease;
}

.role-checkbox:hover {
    background: var(--bg-modifier-hover);
}

.role-checkbox input[type="checkbox"] {
    width: 16px;
    height: 16px;
    accent-color: var(--accent-primary);
    cursor: pointer;
}

.role-checkbox .role-name {
    font-size: 14px;
    font-weight: 500;
}

.no-roles {
    color: var(--text-muted);
    font-size: 13px;
    font-style: italic;
    padding: 8px;
}

/* ===== FRIENDS LIST ===== */
.friends-container {
    padding: 20px 24px;
    flex: 1;
    overflow-y: auto;
}

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

.friends-header h2 {
    font-size: 20px;
    font-weight: 700;
    color: var(--text-normal);
}

.add-friend-btn {
    background: var(--accent-primary);
    color: white;
    border: none;
    padding: 8px 16px;
    border-radius: 4px;
    font-weight: 600;
    font-size: 14px;
    cursor: pointer;
    transition: background 0.2s;
}

.add-friend-btn:hover {
    background: #a575e8;
}

.friends-sections {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 24px;
}

.friends-section {
    background: var(--bg-secondary);
    border-radius: 8px;
    padding: 16px;
}

.friends-section-title {
    font-size: 12px;
    font-weight: 600;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.5px;
    margin-bottom: 12px;
    display: flex;
    align-items: center;
    gap: 8px;
}

.friends-section-title .count {
    background: var(--bg-accent);
    padding: 2px 8px;
    border-radius: 10px;
    font-size: 11px;
}

.friends-section-list {
    display: flex;
    flex-direction: column;
    gap: 4px;
    max-height: 400px;
    overflow-y: auto;
}

.friend-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 10px 12px;
    background: var(--bg-tertiary);
    border-radius: 6px;
    transition: background 0.15s;
}

.friend-item:hover {
    background: var(--bg-modifier-hover);
}

.friend-avatar {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background: var(--accent-primary);
    color: white;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 600;
    font-size: 16px;
    flex-shrink: 0;
    overflow: hidden;
}

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

.friend-name {
    font-size: 16px;
    font-weight: 500;
    color: var(--text-normal);
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.friend-actions {
    display: flex;
    gap: 8px;
    flex-shrink: 0;
}

.friend-action-btn {
    padding: 6px 12px;
    border: none;
    border-radius: 4px;
    font-size: 13px;
    font-weight: 500;
    cursor: pointer;
    transition: opacity 0.2s, background 0.2s;
}

.friend-action-btn:hover {
    opacity: 0.9;
}

.friend-action-btn.accept-btn {
    background: var(--dracula-green);
    color: var(--bg-primary);
}

.friend-action-btn.reject-btn {
    background: var(--dracula-red);
    color: white;
}

.friend-action-btn.cancel-btn {
    background: var(--bg-accent);
    color: var(--text-normal);
}

.friend-action-btn.cancel-btn:hover {
    background: var(--dracula-comment);
}

.friend-action-btn.unfriend-btn {
    background: transparent;
    border: 1px solid var(--dracula-red);
    color: var(--dracula-red);
}

.friend-action-btn.unfriend-btn:hover {
    background: var(--dracula-red);
    color: white;
}

.friend-action-btn.chat-btn {
    background: var(--accent-primary);
    color: white;
    padding: 6px 10px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.friend-action-btn.chat-btn:hover {
    background: #a575e8;
}

.friend-action-btn.chat-btn svg {
    width: 18px;
    height: 18px;
}

.friends-empty {
    text-align: center;
    padding: 32px 16px;
    color: var(--text-muted);
    font-size: 14px;
}

.load-more-btn {
    width: 100%;
    padding: 10px;
    margin-top: 8px;
    background: var(--bg-accent);
    border: none;
    border-radius: 4px;
    color: var(--text-normal);
    font-size: 14px;
    cursor: pointer;
    transition: background 0.2s;
}

.load-more-btn:hover {
    background: var(--dracula-comment);
}

/* Mobile responsive for friends list */
@media (max-width: 767px) {
    .friends-sections {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 639px) {
    .friends-container {
        padding: 12px;
    }

    .friends-header {
        flex-direction: column;
        gap: 12px;
        align-items: stretch;
    }

    .friends-header h2 {
        font-size: 18px;
    }

    .add-friend-btn {
        width: 100%;
        text-align: center;
    }

    .friends-section {
        padding: 12px;
    }

    .friends-section-list {
        max-height: 300px;
    }

    .friend-item {
        padding: 8px 10px;
        gap: 10px;
    }

    .friend-avatar {
        width: 36px;
        height: 36px;
        font-size: 14px;
    }

    .friend-actions {
        flex-direction: column;
        gap: 4px;
    }

    .friend-name {
        font-size: 14px;
    }

    .friend-action-btn {
        padding: 5px 10px;
        font-size: 12px;
    }
}
