/**
 * Nexus ZG - UI Components Styles
 * Styles for User Panel, Profile Cards, Server Settings, Message Composer
 */

@import url("https://fonts.googleapis.com/css2?family=Sora:wght@400;500;600;700&display=swap");

:root {
    --ui-bg: #0b0d10;
    --ui-panel: #15181d;
    --ui-panel-2: #1b1f25;
    --ui-input: #101318;
    --ui-border: rgba(255, 255, 255, 0.06);
    --ui-text: #e7e9ee;
    --ui-muted: rgba(231, 233, 238, 0.68);
    --ui-accent: #4c82d8;
    --ui-accent-hover: #3f73c8;
    --ui-accent-soft: rgba(76, 130, 216, 0.16);
    --ui-danger: #d36868;
    --ui-success: #3e9b6b;
    --ui-shadow: 0 16px 40px rgba(0, 0, 0, 0.45);
    --ui-radius-lg: 12px;
    --ui-radius-md: 10px;
    --ui-font: "Sora", "Inter", "Segoe UI", system-ui, sans-serif;
}

/* ==========================================
   1. USER PANEL STYLES
   ========================================== */

#user-panel {
    position: absolute !important;
    bottom: 0 !important;
    left: 0 !important;
    right: 0 !important;
    height: 52px !important;
    min-height: 52px !important;
    background: rgba(17, 18, 20, 0.95) !important;
    border-top: 1px solid rgba(255, 255, 255, 0.06);
    display: flex !important;
    align-items: center;
    justify-content: space-between;
    padding: 0 8px;
    z-index: 100;
    flex-shrink: 0;
}

#sidebar {
    position: relative;
    padding-bottom: 52px !important;
}

.user-avatar-section {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 4px 8px;
    border-radius: 4px;
    cursor: pointer;
    transition: background 0.15s ease;
    flex: 1;
    min-width: 0;
}

.user-avatar-section:hover {
    background: rgba(255, 255, 255, 0.08);
}

.avatar-wrapper {
    position: relative;
    width: 32px;
    height: 32px;
    flex-shrink: 0;
}

.avatar-wrapper img,
#user-avatar-img {
    width: 100%;
    height: 100%;
    border-radius: 50%;
    object-fit: cover;
}

.avatar-fallback,
#user-avatar-fallback {
    width: 100%;
    height: 100%;
    border-radius: 50%;
    background: #5865F2;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #fff;
    font-weight: 700;
    font-size: 14px;
}

.status-dot,
#user-status-dot {
    position: absolute;
    bottom: -2px;
    right: -2px;
    width: 14px;
    height: 14px;
    border-radius: 50%;
    border: 3px solid #111214;
    background: #3ba55c;
}

.status-dot.online {
    background: #3ba55c;
}

.status-dot.idle {
    background: #faa61a;
}

.status-dot.dnd {
    background: #ed4245;
}

.status-dot.offline {
    background: #747f8d;
}

.user-info {
    display: flex;
    flex-direction: column;
    overflow: hidden;
    min-width: 0;
}

.username,
#user-display-name {
    font-size: 14px;
    font-weight: 600;
    color: #fff;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    max-width: 100%;
}

.discriminator,
#user-discrim {
    font-size: 12px;
    color: #b9bbbe;
}

.user-controls {
    display: flex;
    gap: 4px;
    margin-left: auto;
    flex-shrink: 0;
}

.control-btn {
    width: 32px;
    height: 32px;
    border: none;
    background: transparent;
    color: #b9bbbe;
    cursor: pointer;
    border-radius: 4px;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.15s ease;
}

.control-btn:hover {
    background: rgba(255, 255, 255, 0.1);
    color: #fff;
}

.control-btn.muted {
    color: #ed4245;
    background: rgba(237, 66, 69, 0.1);
}

.control-btn.muted:hover {
    background: rgba(237, 66, 69, 0.2);
}

/* ==========================================
   2. SETTINGS MENU (DROPDOWN)
   ========================================== */

.settings-menu {
    position: fixed;
    width: 240px;
    background: var(--ui-panel);
    border-radius: var(--ui-radius-md);
    border: 1px solid var(--ui-border);
    box-shadow: 0 12px 28px rgba(0, 0, 0, 0.55);
    z-index: 1001;
    padding: 6px 8px;
    font-family: var(--ui-font);
    animation: menuSlide 0.15s ease;
}

@keyframes menuSlide {
    from {
        opacity: 0;
        transform: translateY(8px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.settings-menu.hidden {
    display: none;
}

.settings-menu-item {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 8px 10px;
    border-radius: 8px;
    color: var(--ui-muted);
    cursor: pointer;
    font-size: 13px;
    transition: all 0.12s ease;
}

.settings-menu-item:hover {
    background: rgba(255, 255, 255, 0.04);
    color: var(--ui-text);
}

.settings-menu-item.danger {
    color: var(--ui-danger);
}

.settings-menu-item.danger:hover {
    background: rgba(211, 104, 104, 0.12);
    color: var(--ui-danger);
}

.settings-menu-item.admin {
    color: var(--ui-text);
    font-weight: 600;
}

.settings-menu-item.admin:hover {
    background: rgba(76, 130, 216, 0.12);
}

.settings-menu-separator {
    height: 1px;
    background: var(--ui-border);
    margin: 6px 0;
}

/* NOTE: Profile card styles are now handled by send-fix.js with inline styles
   and profile-card.css for base styles. Removed from here to avoid CSS conflicts. */

/* ==========================================
   4. SERVER SETTINGS MODAL STYLES
   ========================================== */

.server-settings-modal {
    position: fixed;
    inset: 0;
    background: rgba(6, 8, 10, 0.78);
    z-index: 999;
    display: flex;
    align-items: center;
    justify-content: center;
    font-family: var(--ui-font);
    color: var(--ui-text);
    animation: fadeIn 0.18s ease;
}

@keyframes fadeIn {
    from {
        opacity: 0;
    }

    to {
        opacity: 1;
    }
}

.server-settings-modal.hidden {
    display: none;
}

.server-settings-container {
    width: min(92vw, 980px);
    height: min(84vh, 720px);
    background: var(--ui-panel);
    border-radius: var(--ui-radius-lg);
    border: 1px solid var(--ui-border);
    display: flex;
    overflow: hidden;
    box-shadow: var(--ui-shadow);
}

.server-settings-sidebar {
    width: 230px;
    background: var(--ui-panel-2);
    display: flex;
    flex-direction: column;
    border-right: 1px solid var(--ui-border);
}

.settings-sidebar-header {
    padding: 16px;
    font-size: 11px;
    font-weight: 700;
    color: var(--ui-muted);
    text-transform: uppercase;
    letter-spacing: 0.12em;
    border-bottom: 1px solid var(--ui-border);
}

.settings-tabs {
    flex: 1;
    padding: 10px;
    overflow-y: auto;
}

.settings-tab {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 10px 12px;
    border-radius: 8px;
    color: var(--ui-muted);
    cursor: pointer;
    font-size: 13px;
    transition: all 0.12s ease;
    margin-bottom: 2px;
}

.settings-tab:hover {
    background: rgba(255, 255, 255, 0.04);
    color: var(--ui-text);
}

.settings-tab.active {
    background: var(--ui-accent-soft);
    color: var(--ui-text);
    box-shadow: inset 0 0 0 1px rgba(76, 130, 216, 0.3);
}

.settings-tab svg {
    flex-shrink: 0;
}

.server-settings-content {
    flex: 1;
    display: flex;
    flex-direction: column;
    background: var(--ui-panel);
    min-width: 0;
}

.settings-content-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 18px 24px;
    border-bottom: 1px solid var(--ui-border);
}

.settings-content-header h2 {
    margin: 0;
    font-size: 18px;
    font-weight: 600;
    color: var(--ui-text);
}

.settings-close-btn {
    width: 32px;
    height: 32px;
    border: none;
    background: transparent;
    color: var(--ui-muted);
    cursor: pointer;
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.15s ease;
}

.settings-close-btn:hover {
    background: rgba(255, 255, 255, 0.06);
    color: var(--ui-text);
}

.settings-content-body {
    flex: 1;
    padding: 24px;
    overflow-y: auto;
    min-height: 0;
    display: flex;
    flex-direction: column;
    gap: 16px;
}

/* Settings Form Elements */
.settings-section {
    margin-bottom: 0;
    padding: 16px;
    background: var(--ui-panel-2);
    border: 1px solid var(--ui-border);
    border-radius: var(--ui-radius-md);
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.settings-section h3 {
    font-size: 14px;
    font-weight: 600;
    color: var(--ui-text);
    margin: 0 0 6px 0;
}

.settings-label {
    display: block;
    font-size: 12px;
    font-weight: 600;
    color: var(--ui-muted);
    text-transform: uppercase;
    letter-spacing: 0.08em;
    margin-bottom: 6px;
}

.settings-input,
.settings-textarea,
.settings-select {
    width: 100%;
    padding: 10px 12px;
    background: var(--ui-input);
    border: 1px solid var(--ui-border);
    border-radius: 8px;
    color: var(--ui-text);
    font-size: 13px;
    min-height: 40px;
    outline: none;
    transition: border-color 0.15s ease, box-shadow 0.15s ease;
}

.settings-input:focus,
.settings-textarea:focus,
.settings-select:focus {
    border-color: rgba(76, 130, 216, 0.6);
    box-shadow: 0 0 0 2px rgba(76, 130, 216, 0.18);
}

.settings-textarea {
    min-height: 88px;
    resize: vertical;
}

.settings-select {
    cursor: pointer;
}

/* Section helpers */
.settings-section-title {
    font-size: 12px;
    font-weight: 700;
    color: var(--ui-muted);
    text-transform: uppercase;
    letter-spacing: 0.16em;
}

.settings-section-desc {
    font-size: 12px;
    color: var(--ui-muted);
    margin-top: -4px;
}

.settings-field {
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.settings-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
    gap: 12px;
}

.settings-inline {
    display: flex;
    align-items: center;
    gap: 12px;
    flex-wrap: wrap;
}

/* Toggle Switch */
.toggle-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    min-height: 44px;
    padding: 10px 0;
    border-bottom: 1px solid var(--ui-border);
}

.toggle-row:last-child {
    border-bottom: none;
}

.toggle {
    position: relative;
    width: 44px;
    height: 24px;
}

.toggle input {
    opacity: 0;
    width: 0;
    height: 0;
}

.toggle-slider {
    position: absolute;
    inset: 0;
    background: #323844;
    border-radius: 999px;
    cursor: pointer;
    transition: background 0.2s ease;
}

.toggle-slider::before {
    content: '';
    position: absolute;
    left: 3px;
    top: 3px;
    width: 18px;
    height: 18px;
    background: #fff;
    border-radius: 50%;
    transition: transform 0.2s ease;
}

.toggle input:checked+.toggle-slider {
    background: var(--ui-accent);
}

.toggle input:checked+.toggle-slider::before {
    transform: translateX(16px);
}

/* Buttons */
.settings-actions {
    margin-top: 8px;
    padding: 14px 0 6px;
    border-top: 1px solid var(--ui-border);
    display: flex;
    justify-content: flex-end;
    gap: 12px;
    position: sticky;
    bottom: 0;
    background: linear-gradient(0deg, var(--ui-panel) 70%, rgba(21, 24, 29, 0.2));
}

.btn-primary {
    height: 40px;
    padding: 0 18px;
    background: var(--ui-accent);
    color: #fff;
    border: none;
    border-radius: 10px;
    font-size: 13px;
    font-weight: 600;
    cursor: pointer;
    transition: background 0.15s ease, box-shadow 0.15s ease;
    box-shadow: 0 6px 16px rgba(76, 130, 216, 0.22);
}

.btn-primary:hover {
    background: var(--ui-accent-hover);
}

.btn-secondary {
    height: 36px;
    padding: 0 16px;
    background: transparent;
    color: var(--ui-text);
    border: 1px solid var(--ui-border);
    border-radius: 10px;
    font-size: 13px;
    font-weight: 600;
    cursor: pointer;
    transition: background 0.15s ease, border-color 0.15s ease;
}

.btn-secondary:hover {
    background: rgba(255, 255, 255, 0.05);
    border-color: rgba(255, 255, 255, 0.14);
}

.btn-secondary.danger {
    color: var(--ui-danger);
    border-color: rgba(211, 104, 104, 0.4);
}

.btn-secondary.danger:hover {
    background: rgba(211, 104, 104, 0.12);
    border-color: rgba(211, 104, 104, 0.6);
}

/* Roles List */
.roles-header {
    margin-bottom: 16px;
}

.roles-list {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.role-item {
    display: flex;
    align-items: center;
    gap: 12px;
    min-height: 44px;
    padding: 10px 12px;
    background: var(--ui-panel-2);
    border-radius: 10px;
    border: 1px solid var(--ui-border);
    transition: background 0.12s ease, border-color 0.12s ease;
}

.role-item:hover {
    background: rgba(255, 255, 255, 0.03);
    border-color: rgba(255, 255, 255, 0.12);
}

.role-color {
    width: 16px;
    height: 16px;
    border-radius: 50%;
    flex-shrink: 0;
}

.role-name {
    flex: 1;
    font-size: 14px;
    color: var(--ui-text);
    font-weight: 500;
}

.role-count {
    font-size: 12px;
    color: var(--ui-muted);
    padding: 2px 8px;
    border-radius: 999px;
    border: 1px solid var(--ui-border);
    background: rgba(255, 255, 255, 0.04);
    text-transform: uppercase;
    letter-spacing: 0.04em;
}

.role-edit-btn {
    padding: 6px 10px;
    background: transparent;
    color: var(--ui-muted);
    border: 1px solid var(--ui-border);
    border-radius: 8px;
    font-size: 12px;
    cursor: pointer;
    opacity: 0;
    transition: all 0.12s ease;
}

.role-item:hover .role-edit-btn {
    opacity: 1;
}

.role-edit-btn:hover {
    background: rgba(76, 130, 216, 0.14);
    color: var(--ui-text);
}

/* Channels List */
.channels-header {
    display: flex;
    align-items: center;
    gap: 12px;
    flex-wrap: wrap;
}

.channels-list {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.members-list,
.bots-list,
.logs-list {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.bots-header {
    display: flex;
    align-items: center;
    gap: 12px;
}

.logs-list {
    margin-top: 8px;
}

.channel-item-row {
    display: flex;
    align-items: center;
    gap: 10px;
    min-height: 44px;
    padding: 10px 12px;
    background: var(--ui-panel-2);
    border: 1px solid var(--ui-border);
    border-radius: 10px;
    transition: background 0.12s ease, border-color 0.12s ease;
}

.channel-item-row:hover {
    background: rgba(255, 255, 255, 0.03);
    border-color: rgba(255, 255, 255, 0.12);
}

.channel-icon {
    width: 18px;
    color: var(--ui-muted);
    text-align: center;
}

.channel-name {
    flex: 1;
    font-size: 13px;
    color: var(--ui-text);
}

.channel-edit-btn,
.channel-delete-btn {
    padding: 6px 10px;
    border-radius: 8px;
    border: 1px solid var(--ui-border);
    background: transparent;
    color: var(--ui-muted);
    font-size: 12px;
    cursor: pointer;
    opacity: 0;
    transition: all 0.12s ease;
}

.channel-item-row:hover .channel-edit-btn,
.channel-item-row:hover .channel-delete-btn {
    opacity: 1;
}

.channel-edit-btn:hover {
    background: rgba(76, 130, 216, 0.12);
    color: var(--ui-text);
}

.channel-delete-btn {
    border-color: rgba(211, 104, 104, 0.3);
    color: var(--ui-danger);
}

.channel-delete-btn:hover {
    background: rgba(211, 104, 104, 0.12);
}

/* Icon Upload */
.icon-upload-area {
    display: flex;
    align-items: center;
    gap: 16px;
    flex-wrap: wrap;
}

.icon-preview {
    width: 80px;
    height: 80px;
    border-radius: 50%;
    background: var(--ui-input);
    border: 1px solid var(--ui-border);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 32px;
    color: var(--ui-muted);
    overflow: hidden;
}

.icon-preview img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

/* Loading & Empty States */
.loading,
.no-data {
    text-align: center;
    padding: 24px;
    color: var(--ui-muted);
    font-size: 14px;
}

/* ==========================================
   4b. SETTINGS MODALS & PANELS
   ========================================== */

.ui-modal {
    position: fixed;
    inset: 0;
    background: rgba(6, 8, 10, 0.78);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 10010;
    font-family: var(--ui-font);
    color: var(--ui-text);
    animation: modalFade 0.16s ease;
}

@keyframes modalFade {
    from {
        opacity: 0;
        transform: scale(0.98);
    }

    to {
        opacity: 1;
        transform: scale(1);
    }
}

.ui-modal-panel {
    width: min(92vw, 720px);
    max-height: 90vh;
    background: var(--ui-panel);
    border-radius: var(--ui-radius-lg);
    border: 1px solid var(--ui-border);
    box-shadow: var(--ui-shadow);
    display: flex;
    flex-direction: column;
    overflow: hidden;
}

.ui-modal-panel-sm {
    width: min(92vw, 460px);
}

.ui-modal-panel-lg {
    width: min(92vw, 760px);
}

.ui-modal-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 16px 20px;
    border-bottom: 1px solid var(--ui-border);
}

.ui-modal-title {
    margin: 0;
    font-size: 18px;
    font-weight: 600;
    color: var(--ui-text);
}

.ui-modal-body {
    padding: 18px 20px;
    display: flex;
    flex-direction: column;
    gap: 16px;
    overflow-y: auto;
}

.ui-modal-section {
    padding: 14px 16px;
    background: var(--ui-panel-2);
    border: 1px solid var(--ui-border);
    border-radius: var(--ui-radius-md);
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.ui-modal-section-title {
    font-size: 12px;
    font-weight: 700;
    color: var(--ui-muted);
    text-transform: uppercase;
    letter-spacing: 0.16em;
}

.ui-modal-actions {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 12px;
    padding: 14px 20px;
    border-top: 1px solid var(--ui-border);
    background: var(--ui-panel);
}

.ui-modal-actions-left,
.ui-modal-actions-right {
    display: flex;
    align-items: center;
    gap: 12px;
}

.ui-icon-btn {
    width: 32px;
    height: 32px;
    border-radius: 8px;
    border: 1px solid var(--ui-border);
    background: transparent;
    color: var(--ui-muted);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.12s ease;
}

.ui-icon-btn:hover {
    background: rgba(255, 255, 255, 0.06);
    color: var(--ui-text);
}

.ui-permission-list {
    display: flex;
    flex-direction: column;
    gap: 8px;
    max-height: 240px;
    overflow-y: auto;
    padding-right: 4px;
}

.ui-permission-grid {
    padding: 12px;
    background: var(--ui-panel);
    border: 1px solid var(--ui-border);
    border-radius: var(--ui-radius-md);
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.ui-permission-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    min-height: 44px;
    padding: 10px 12px;
    border-radius: 8px;
    border: 1px solid var(--ui-border);
    background: rgba(255, 255, 255, 0.02);
    transition: background 0.12s ease, border-color 0.12s ease;
}

.ui-permission-row:hover {
    background: rgba(255, 255, 255, 0.04);
    border-color: rgba(255, 255, 255, 0.12);
}

.ui-permission-info {
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.ui-permission-title {
    font-size: 13px;
    font-weight: 600;
    color: var(--ui-text);
}

.ui-permission-desc {
    font-size: 11px;
    color: var(--ui-muted);
}

.perm-toggle {
    position: relative;
    width: 44px;
    height: 24px;
    flex-shrink: 0;
}

.perm-toggle input {
    opacity: 0;
    width: 0;
    height: 0;
}

.perm-toggle span {
    position: absolute;
    inset: 0;
    background: #323844;
    border-radius: 999px;
    transition: background 0.2s ease;
}

.perm-toggle span::before {
    content: '';
    position: absolute;
    top: 3px;
    left: 3px;
    width: 18px;
    height: 18px;
    border-radius: 50%;
    background: #fff;
    transition: transform 0.2s ease;
}

.perm-toggle input:checked+span {
    background: var(--ui-accent);
}

.perm-toggle input:checked+span::before {
    transform: translateX(16px);
}

.channel-type-group {
    display: flex;
    gap: 8px;
}

.channel-type-btn {
    flex: 1;
    height: 40px;
    border-radius: 10px;
    border: 1px solid var(--ui-border);
    background: transparent;
    color: var(--ui-muted);
    font-size: 13px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.12s ease;
}

.channel-type-btn.active {
    background: var(--ui-accent-soft);
    border-color: rgba(76, 130, 216, 0.4);
    color: var(--ui-text);
}

.perm-select {
    min-width: 140px;
}

.color-input {
    width: 64px;
    height: 36px;
    border-radius: 8px;
    border: 1px solid var(--ui-border);
    background: transparent;
    padding: 0;
    cursor: pointer;
}

.role-modal {
    z-index: 10020;
}

.channel-settings-modal {
    z-index: 10030;
}

.create-channel-modal {
    z-index: 10010;
}

.settings-content-body::-webkit-scrollbar,
.settings-tabs::-webkit-scrollbar,
.roles-list::-webkit-scrollbar,
.channels-list::-webkit-scrollbar,
.ui-modal-body::-webkit-scrollbar,
.ui-permission-list::-webkit-scrollbar {
    width: 6px;
}

.settings-content-body::-webkit-scrollbar-thumb,
.settings-tabs::-webkit-scrollbar-thumb,
.roles-list::-webkit-scrollbar-thumb,
.channels-list::-webkit-scrollbar-thumb,
.ui-modal-body::-webkit-scrollbar-thumb,
.ui-permission-list::-webkit-scrollbar-thumb {
    background: rgba(255, 255, 255, 0.12);
    border-radius: 999px;
}

.settings-content-body::-webkit-scrollbar-thumb:hover,
.settings-tabs::-webkit-scrollbar-thumb:hover,
.roles-list::-webkit-scrollbar-thumb:hover,
.channels-list::-webkit-scrollbar-thumb:hover,
.ui-modal-body::-webkit-scrollbar-thumb:hover,
.ui-permission-list::-webkit-scrollbar-thumb:hover {
    background: rgba(255, 255, 255, 0.24);
}

@media (max-width: 1100px) {
    .server-settings-container {
        width: 96vw;
        height: 88vh;
    }
}

@media (max-width: 900px) {
    .server-settings-container {
        flex-direction: column;
        height: 92vh;
    }

    .server-settings-sidebar {
        width: 100%;
        flex-direction: row;
        padding: 8px 12px;
    }

    .settings-sidebar-header {
        display: none;
    }

    .settings-tabs {
        display: flex;
        flex-direction: row;
        gap: 6px;
        overflow-x: auto;
        padding: 8px;
    }

    .settings-tab {
        margin-bottom: 0;
        white-space: nowrap;
    }
}

@media (max-width: 600px) {

    .ui-modal-panel,
    .ui-modal-panel-lg,
    .ui-modal-panel-sm {
        width: 94vw;
    }

    .settings-content-body {
        padding: 18px;
    }
}

/* ==========================================
   5. MESSAGE COMPOSER ENHANCEMENTS
   ========================================== */

#composer-area {
    padding: 0 16px 24px 16px;
    position: relative;
    min-height: 68px;
    flex-shrink: 0;
}

#composer-area.disabled {
    opacity: 0.6;
}

#composer-inner {
    background: rgba(56, 58, 64, 0.7);
    border-radius: 8px;
    padding: 8px 16px;
    display: flex;
    align-items: center;
    gap: 12px;
    transition: background 0.15s ease, box-shadow 0.15s ease;
}

#composer-inner:focus-within {
    background: rgba(64, 68, 75, 0.9);
    box-shadow: 0 0 0 2px rgba(88, 101, 242, 0.3);
}

#msg-input {
    flex: 1;
    background: transparent;
    border: none;
    color: #dcddde;
    font-size: 15px;
    outline: none;
}

#msg-input::placeholder {
    color: #72767d;
}

#msg-input:disabled {
    cursor: not-allowed;
}

.composer-icons {
    display: flex;
    gap: 4px;
}

.icon-btn-small {
    width: 32px;
    height: 32px;
    border: none;
    background: transparent;
    color: #b9bbbe;
    cursor: pointer;
    border-radius: 4px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 18px;
    transition: color 0.1s ease;
}

.icon-btn-small:hover {
    color: #dcddde;
}

.composer-disabled-overlay {
    position: absolute;
    inset: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(0, 0, 0, 0.5);
    border-radius: 8px;
    font-size: 14px;
    color: #ed4245;
    font-weight: 500;
    pointer-events: none;
}

.composer-disabled-overlay.hidden {
    display: none;
}

/* ==========================================
   6. MEMBER LIST ENHANCEMENTS
   ========================================== */

.member-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 8px;
    cursor: pointer;
    border-radius: 4px;
    transition: background 0.1s ease;
}

.member-item:hover {
    background: rgba(255, 255, 255, 0.06);
}

.member-item:active {
    background: rgba(255, 255, 255, 0.1);
}

.member-avatar {
    position: relative;
    width: 32px;
    height: 32px;
    border-radius: 50%;
    background: #5865F2;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #fff;
    font-weight: 600;
    font-size: 14px;
    flex-shrink: 0;
}

.member-avatar img {
    width: 100%;
    height: 100%;
    border-radius: 50%;
    object-fit: cover;
}

.member-avatar .status-dot {
    width: 10px;
    height: 10px;
    border: 2px solid #2f3136;
}

.member-name {
    flex: 1;
    font-size: 14px;
    color: #96989d;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.member-item:hover .member-name {
    color: #dcddde;
}

.member-role-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    flex-shrink: 0;
}

/* ==========================================
   7. GENERAL UI POLISH
   ========================================== */

/* Smooth transitions globally */
* {
    box-sizing: border-box;
}

/* Focus visible for accessibility */
button:focus-visible,
input:focus-visible,
select:focus-visible,
textarea:focus-visible {
    outline: 2px solid #5865F2;
    outline-offset: 2px;
}

/* Scrollbar styling */
.settings-tabs::-webkit-scrollbar,
.settings-content-body::-webkit-scrollbar,
.roles-list::-webkit-scrollbar {
    width: 8px;
}

.settings-tabs::-webkit-scrollbar-track,
.settings-content-body::-webkit-scrollbar-track,
.roles-list::-webkit-scrollbar-track {
    background: transparent;
}

.settings-tabs::-webkit-scrollbar-thumb,
.settings-content-body::-webkit-scrollbar-thumb,
.roles-list::-webkit-scrollbar-thumb {
    background: rgba(255, 255, 255, 0.1);
    border-radius: 4px;
}

.settings-tabs::-webkit-scrollbar-thumb:hover,
.settings-content-body::-webkit-scrollbar-thumb:hover,
.roles-list::-webkit-scrollbar-thumb:hover {
    background: rgba(255, 255, 255, 0.2);
}

/* ==========================================
   USER SETTINGS DRAWER + MENU HEADER
   ========================================== */

.settings-menu-header {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 8px 8px 10px;
}

.settings-menu-avatar {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    background: #2a2f39;
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
    flex-shrink: 0;
}

.settings-menu-avatar img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    border-radius: 50%;
}

.settings-menu-avatar-fallback {
    font-size: 14px;
    font-weight: 700;
    color: #fff;
}

.settings-menu-user {
    display: flex;
    flex-direction: column;
    min-width: 0;
}

.settings-menu-name {
    font-size: 13px;
    font-weight: 600;
    color: var(--ui-text);
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.settings-menu-tag {
    font-size: 12px;
    color: var(--ui-muted);
}

.ui-drawer {
    position: fixed;
    inset: 0;
    background: rgba(5, 7, 10, 0.55);
    display: flex;
    justify-content: flex-end;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.18s ease;
    z-index: 1100;
}

.ui-drawer.open {
    opacity: 1;
    pointer-events: auto;
}

.ui-drawer-panel {
    width: min(520px, 92vw);
    height: 100%;
    background: var(--ui-panel);
    border-left: 1px solid var(--ui-border);
    box-shadow: var(--ui-shadow);
    transform: translateX(24px);
    transition: transform 0.2s ease;
    display: flex;
    flex-direction: column;
}

.ui-drawer.open .ui-drawer-panel {
    transform: translateX(0);
}

.ui-drawer-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 16px 20px;
    border-bottom: 1px solid var(--ui-border);
}

.ui-drawer-title {
    font-size: 15px;
    font-weight: 600;
    color: var(--ui-text);
}

.ui-drawer-tabs {
    display: flex;
    gap: 8px;
    padding: 12px 16px;
    border-bottom: 1px solid var(--ui-border);
    background: linear-gradient(180deg, rgba(21, 24, 29, 0.96), rgba(21, 24, 29, 0.7));
}

.ui-tab-btn {
    background: transparent;
    border: 1px solid transparent;
    color: var(--ui-muted);
    font-size: 12px;
    font-weight: 600;
    padding: 6px 10px;
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.15s ease;
}

.ui-tab-btn:hover {
    color: var(--ui-text);
}

.ui-tab-btn.active {
    color: var(--ui-text);
    border-color: var(--ui-border);
    background: rgba(255, 255, 255, 0.04);
}

.ui-drawer-body {
    flex: 1;
    overflow-y: auto;
    padding: 16px 20px 24px;
    display: flex;
    flex-direction: column;
    gap: 18px;
}

.ui-tab-panel {
    display: none;
    flex-direction: column;
    gap: 16px;
}

.ui-tab-panel.active {
    display: flex;
}

.appearance-options {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
    gap: 12px;
}

.appearance-card {
    background: var(--ui-panel-2);
    border: 1px solid var(--ui-border);
    border-radius: 10px;
    padding: 14px;
    text-align: left;
    cursor: pointer;
    transition: border-color 0.15s ease, background 0.15s ease, box-shadow 0.15s ease;
}

.appearance-card:hover {
    border-color: rgba(255, 255, 255, 0.2);
}

.appearance-card.active {
    border-color: var(--ui-accent);
    box-shadow: 0 0 0 1px var(--ui-accent-soft);
    background: rgba(76, 130, 216, 0.08);
}

.appearance-title {
    font-size: 13px;
    font-weight: 600;
    color: var(--ui-text);
}

.appearance-desc {
    font-size: 11px;
    color: var(--ui-muted);
    margin-top: 6px;
}

.settings-link {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    font-size: 12px;
    color: var(--ui-muted);
    text-decoration: none;
}

.settings-link:hover {
    color: var(--ui-text);
}

/* Theme + Compact mode */
body.ui-theme-dark {
    --ui-bg: #0b0d10;
    --ui-panel: #15181d;
    --ui-panel-2: #1b1f25;
    --ui-input: #101318;
    --ui-border: rgba(255, 255, 255, 0.06);
    --ui-text: #e7e9ee;
    --ui-muted: rgba(231, 233, 238, 0.68);
    --bg-app: #0a0a0c;
    --bg-glass-heavy: rgba(14, 16, 20, 0.85);
    --bg-glass-light: rgba(255, 255, 255, 0.03);
}

body.ui-theme-dim {
    --ui-bg: #0f1217;
    --ui-panel: #1a1f27;
    --ui-panel-2: #222834;
    --ui-input: #131821;
    --ui-border: rgba(255, 255, 255, 0.08);
    --ui-text: #edf0f6;
    --ui-muted: rgba(237, 240, 246, 0.65);
    --bg-app: #0e1218;
    --bg-glass-heavy: rgba(18, 22, 30, 0.9);
    --bg-glass-light: rgba(255, 255, 255, 0.05);
}

body.ui-theme-light {
    --ui-bg: #ffffff;
    --ui-panel: #f2f3f5;
    --ui-panel-2: #e3e5e8;
    --ui-input: #ffffff;
    --ui-border: rgba(0, 0, 0, 0.1);
    --ui-text: #060607;
    --ui-muted: rgba(6, 6, 7, 0.6);
    --bg-app: #f9fafb;
    --bg-glass-heavy: rgba(255, 255, 255, 0.9);
    --bg-glass-light: rgba(0, 0, 0, 0.03);
    --accent-color: #5865f2;
    --text-primary: #060607;
    --text-secondary: #4e5058;
    --text-muted: #80848e;
    --bg-primary: #ffffff;
    --bg-secondary: #f2f3f5;
    --bg-tertiary: #e3e5e8;
}

body.ui-theme-neon {
    --ui-bg: #050505;
    --ui-panel: #0a0a14;
    --ui-panel-2: #0f0f1a;
    --ui-input: #08080d;
    --ui-border: rgba(0, 255, 255, 0.15);
    --ui-text: #e0ffff;
    --ui-muted: rgba(0, 255, 255, 0.6);
    --bg-app: #020204;
    --bg-glass-heavy: rgba(5, 5, 15, 0.95);
    --bg-glass-light: rgba(0, 255, 255, 0.05);
    --accent-color: #00ffff;
    --accent-secondary: #ff00ff;
    --text-primary: #e0ffff;
    --text-secondary: #00e5e5;
    --text-muted: #008b8b;
    --bg-primary: #050505;
    --bg-secondary: #0a0a14;
    --bg-tertiary: #0f0f1a;
}

/* Neon theme glowing effects */
body.ui-theme-neon .btn-primary {
    background: linear-gradient(135deg, #00ffff, #00cccc);
    box-shadow: 0 0 20px rgba(0, 255, 255, 0.4);
    color: #000;
}

body.ui-theme-neon .btn-primary:hover {
    box-shadow: 0 0 30px rgba(0, 255, 255, 0.6);
}

body.ui-theme-neon a {
    color: #ff00ff;
}

body.ui-theme-neon .message-bubble {
    border: 1px solid rgba(0, 255, 255, 0.1);
}

/* ========== LIGHT THEME COMPREHENSIVE STYLES ========== */

/* Sidebar and Panels */
body.ui-theme-light #guild-bar,
body.ui-theme-light #channel-sidebar,
body.ui-theme-light .sidebar {
    background: #f2f3f5;
    border-color: #d3d5d9;
}

body.ui-theme-light #channel-list {
    background: #f2f3f5;
}

body.ui-theme-light .channel-item {
    color: #4f5660;
}

body.ui-theme-light .channel-item:hover {
    background: rgba(79, 84, 92, 0.1);
    color: #060607;
}

body.ui-theme-light .channel-item.active {
    background: rgba(79, 84, 92, 0.15);
    color: #060607;
}

body.ui-theme-light .category-header {
    color: #5c5f66;
}

/* Member List */
body.ui-theme-light #member-list {
    background: #f2f3f5;
    border-left: 1px solid #e3e5e8;
}

body.ui-theme-light .member-item {
    color: #4f5660;
}

body.ui-theme-light .member-item:hover {
    background: rgba(79, 84, 92, 0.1);
}

body.ui-theme-light .member-name {
    color: #060607 !important;
}

body.ui-theme-light .member-name.role-owner {
    color: #c59f00 !important;
}

body.ui-theme-light .member-name.role-admin {
    color: #8a2be2 !important;
}

body.ui-theme-light .member-name.role-mod {
    color: #1a8a6e !important;
}

body.ui-theme-light .member-group-header {
    color: #5c5f66;
}

/* Home Button / DM Section */
body.ui-theme-light .home-btn,
body.ui-theme-light .dm-btn,
body.ui-theme-light #home-btn,
body.ui-theme-light .guild-home {
    background: #ffffff;
    color: #060607;
    border: 1px solid #e3e5e8;
}

body.ui-theme-light .home-btn:hover,
body.ui-theme-light .dm-btn:hover,
body.ui-theme-light #home-btn:hover,
body.ui-theme-light .guild-home:hover {
    background: #5865f2;
    color: #ffffff;
    border-color: #5865f2;
}

body.ui-theme-light .home-btn.active,
body.ui-theme-light .dm-btn.active,
body.ui-theme-light #home-btn.active,
body.ui-theme-light .guild-home.active {
    background: #5865f2;
    color: #ffffff;
}

/* Home Section Content */
body.ui-theme-light .home-content,
body.ui-theme-light .dm-list,
body.ui-theme-light .friends-list {
    background: #ffffff;
    color: #060607;
}

body.ui-theme-light .dm-item,
body.ui-theme-light .friend-item {
    color: #4f5660;
}

body.ui-theme-light .dm-item:hover,
body.ui-theme-light .friend-item:hover {
    background: rgba(79, 84, 92, 0.1);
    color: #060607;
}

body.ui-theme-light .dm-item.active {
    background: rgba(88, 101, 242, 0.15);
    color: #5865f2;
}

/* Messages */
body.ui-theme-light #message-container,
body.ui-theme-light .chat-area {
    background: #ffffff;
}

body.ui-theme-light .message {
    color: #2e3338;
}

body.ui-theme-light .message:hover {
    background: rgba(0, 0, 0, 0.02);
}

body.ui-theme-light .message-author {
    color: #060607;
}

body.ui-theme-light .message-timestamp {
    color: #747f8d;
}

body.ui-theme-light .message-content {
    color: #2e3338;
}

/* Input Area */
body.ui-theme-light #message-form,
body.ui-theme-light .message-input-area {
    background: #ffffff;
    border-top: 1px solid #e3e5e8;
}

body.ui-theme-light #message-input,
body.ui-theme-light .message-input {
    background: #ebedef;
    border: 1px solid #e3e5e8;
    color: #2e3338;
}

body.ui-theme-light #message-input::placeholder {
    color: #72767d;
}

body.ui-theme-light #message-input:focus {
    border-color: #5865f2;
    background: #ffffff;
}

/* Buttons */
body.ui-theme-light .btn-secondary {
    background: #e3e5e8;
    color: #2e3338;
    border: 1px solid #d3d5d9;
}

body.ui-theme-light .btn-secondary:hover {
    background: #d3d5d9;
}

/* Header */
body.ui-theme-light #channel-header,
body.ui-theme-light .header {
    background: #f2f3f5;
    border-bottom: 1px solid #e3e5e8;
    color: #060607;
}

body.ui-theme-light #channel-header h2 {
    color: #060607;
}

/* Guild Bar */
body.ui-theme-light #guild-bar {
    background: #e3e5e8;
    border-right: 1px solid #d3d5d9;
}

body.ui-theme-light .guild-icon {
    background: #ffffff;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
}

body.ui-theme-light .guild-icon:hover {
    background: #5865f2;
}

/* User Panel */
body.ui-theme-light #user-panel,
body.ui-theme-light .user-area {
    background: #ebedef;
    border-top: 1px solid #e3e5e8;
}

body.ui-theme-light #user-panel .username {
    color: #060607;
}

body.ui-theme-light #user-panel .user-tag {
    color: #5c5f66;
}

/* Modals & Overlays */
body.ui-theme-light .modal-content,
body.ui-theme-light .settings-panel {
    background: #ffffff;
    border: 1px solid #e3e5e8;
}

body.ui-theme-light .modal-header {
    border-bottom: 1px solid #e3e5e8;
    color: #060607;
}

/* Settings */
body.ui-theme-light .settings-card {
    background: #f2f3f5;
}

body.ui-theme-light .settings-sidebar {
    background: #f2f3f5;
    border-right: 1px solid #e3e5e8;
}

body.ui-theme-light .settings-nav-btn {
    color: #4f5660;
}

body.ui-theme-light .settings-nav-btn:hover {
    background: rgba(79, 84, 92, 0.1);
    color: #060607;
}

body.ui-theme-light .settings-nav-btn.active {
    background: rgba(88, 101, 242, 0.15);
    color: #5865f2;
}

body.ui-theme-light .settings-input,
body.ui-theme-light .settings-textarea {
    background: #ffffff;
    border: 1px solid #d3d5d9;
    color: #2e3338;
}

body.ui-theme-light .settings-input:focus,
body.ui-theme-light .settings-textarea:focus {
    border-color: #5865f2;
}

/* Scrollbar */
body.ui-theme-light ::-webkit-scrollbar-track {
    background: #f2f3f5;
}

body.ui-theme-light ::-webkit-scrollbar-thumb {
    background: #c4c9ce;
}

body.ui-theme-light ::-webkit-scrollbar-thumb:hover {
    background: #a3a6aa;
}

/* Links */
body.ui-theme-light a {
    color: #0066ff;
}

body.ui-theme-light a:hover {
    color: #0052cc;
}

/* ========== END LIGHT THEME ========== */

body.ui-compact #channel-list {
    padding: 10px 6px;
}

body.ui-compact .channel-item {
    padding: 6px 8px;
    font-size: 14px;
}

body.ui-compact #member-list {
    padding: 10px 8px;
}

body.ui-compact .member-item {
    padding: 6px 8px;
}

body.ui-compact .member-group-header,
body.ui-compact .category-header {
    padding: 8px 8px 4px;
}

/* Admin Panel */
.admin-panel-overlay {
    position: fixed;
    inset: 0;
    background: rgba(5, 7, 10, 0.65);
    display: flex;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.2s ease;
    z-index: 1200;
}

.admin-panel-overlay.open {
    opacity: 1;
    pointer-events: auto;
}

.admin-panel {
    margin: 20px;
    flex: 1;
    background: var(--ui-panel);
    border: 1px solid var(--ui-border);
    border-radius: 12px;
    display: flex;
    overflow: hidden;
    box-shadow: var(--ui-shadow);
}

.admin-panel-sidebar {
    width: 220px;
    background: var(--ui-panel-2);
    border-right: 1px solid var(--ui-border);
    padding: 16px 12px;
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.admin-panel-brand {
    font-size: 14px;
    font-weight: 700;
    color: var(--ui-text);
    margin-bottom: 8px;
    padding: 6px 8px;
}

.admin-panel-tab {
    background: transparent;
    border: 1px solid transparent;
    color: var(--ui-muted);
    padding: 10px 12px;
    border-radius: 8px;
    text-align: left;
    cursor: pointer;
    font-weight: 600;
    font-size: 12px;
    transition: all 0.15s ease;
}

.admin-panel-tab:hover {
    color: var(--ui-text);
    background: rgba(255, 255, 255, 0.04);
}

.admin-panel-tab.active {
    color: var(--ui-text);
    border-color: var(--ui-border);
    background: rgba(255, 255, 255, 0.06);
}

.admin-panel-main {
    flex: 1;
    display: flex;
    flex-direction: column;
}

.admin-panel-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 16px 20px;
    border-bottom: 1px solid var(--ui-border);
}

.admin-panel-title {
    font-size: 15px;
    font-weight: 600;
    color: var(--ui-text);
}

.admin-panel-content {
    flex: 1;
    overflow-y: auto;
    padding: 16px 20px 24px;
}

.admin-table {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.admin-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 12px;
    border: 1px solid var(--ui-border);
    border-radius: 10px;
    background: var(--ui-panel-2);
}

.admin-row-left {
    display: flex;
    flex-direction: column;
    gap: 4px;
    min-width: 0;
}

.admin-row-actions {
    display: flex;
    align-items: center;
    gap: 8px;
}

.admin-strong {
    font-weight: 600;
    color: var(--ui-text);
}

.admin-muted {
    color: var(--ui-muted);
    font-size: 12px;
}

.admin-input {
    background: var(--ui-input);
    border: 1px solid var(--ui-border);
    color: var(--ui-text);
    border-radius: 8px;
    height: 36px;
    padding: 0 10px;
    font-size: 12px;
}

.admin-input.sm {
    height: 30px;
    font-size: 12px;
    padding: 0 8px;
}

.admin-form-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
    gap: 12px;
}

.admin-section {
    padding: 12px;
    border: 1px solid var(--ui-border);
    border-radius: 10px;
    background: var(--ui-panel-2);
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.admin-denied {
    padding: 18px;
    border-radius: 12px;
    border: 1px solid rgba(211, 104, 104, 0.35);
    background: rgba(211, 104, 104, 0.12);
    color: #f1c3c3;
    font-size: 13px;
}

/* ==========================================
   Explore Modal
   ========================================== */
.explore-modal {
    position: fixed;
    inset: 0;
    display: none;
    align-items: center;
    justify-content: center;
    background: rgba(6, 8, 12, 0.78);
    backdrop-filter: blur(8px);
    z-index: 10070;
}

.explore-modal.open {
    display: flex;
}

.explore-modal-content {
    width: clamp(860px, 90vw, 960px);
    max-height: 70vh;
    background: var(--ui-panel);
    border-radius: 14px;
    border: 1px solid var(--ui-border);
    box-shadow: 0 30px 80px rgba(0, 0, 0, 0.55);
    overflow: hidden;
    display: flex;
    flex-direction: column;
}

.explore-modal-header {
    position: sticky;
    top: 0;
    z-index: 2;
    padding: 18px 20px 14px 20px;
    background: var(--ui-panel);
    display: grid;
    grid-template-columns: 1fr auto 1fr;
    align-items: center;
    gap: 12px;
}

.explore-header-left {
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.explore-header-center {
    display: flex;
    justify-content: center;
}

.explore-title {
    font-size: 18px;
    font-weight: 700;
    color: var(--ui-text);
}

.explore-subtitle {
    font-size: 12px;
    color: var(--ui-muted);
}

.explore-header-actions {
    display: flex;
    align-items: center;
    gap: 10px;
    justify-content: flex-end;
}

.explore-filter {
    height: 40px;
    padding: 0 12px;
    border-radius: 10px;
    border: 1px solid var(--ui-border);
    background: var(--ui-panel-2);
    color: var(--ui-muted);
    font-size: 12px;
    cursor: pointer;
}

.explore-search-wrap {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 0 10px;
    height: 40px;
    border-radius: 10px;
    border: 1px solid var(--ui-border);
    background: var(--ui-input);
    color: var(--ui-muted);
}

.explore-search-icon {
    font-size: 13px;
    opacity: 0.8;
}

.explore-search {
    width: 200px;
    height: 40px;
    border-radius: 10px;
    border: none;
    background: transparent;
    color: var(--ui-text);
    padding: 0;
    font-size: 12px;
}

.explore-search:focus {
    outline: none;
}

.explore-search-wrap:focus-within {
    border-color: rgba(76, 130, 216, 0.5);
    box-shadow: 0 0 0 2px rgba(76, 130, 216, 0.15);
}

.explore-close {
    width: 40px;
    height: 40px;
    border-radius: 10px;
    border: 1px solid var(--ui-border);
    background: var(--ui-panel-2);
    color: var(--ui-text);
    cursor: pointer;
    font-size: 16px;
}

.explore-close:hover {
    background: rgba(255, 255, 255, 0.08);
}

.explore-divider {
    height: 1px;
    background: var(--ui-border);
}

.explore-modal-body {
    padding: 16px 20px 20px 20px;
    background: linear-gradient(180deg, rgba(15, 18, 24, 0.2), transparent 55%);
    overflow: hidden;
    flex: 1;
}

.explore-layout {
    display: grid;
    grid-template-columns: minmax(0, 1.3fr) minmax(0, 1fr);
    gap: 16px;
    height: 100%;
}

.explore-list {
    overflow: auto;
    padding-right: 6px;
}

.explore-preview {
    border: 1px solid var(--ui-border);
    border-radius: 14px;
    background: var(--ui-panel-2);
    padding: 18px;
    height: fit-content;
    position: sticky;
    top: 0;
}

.explore-loading,
.explore-empty,
.explore-error {
    font-size: 12px;
    color: var(--ui-muted);
    padding: 12px;
}

.explore-empty {
    min-height: 180px;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 6px;
    text-align: center;
    background: rgba(255, 255, 255, 0.02);
    border-radius: 12px;
    border: 1px dashed rgba(255, 255, 255, 0.08);
}

.explore-empty-icon {
    font-size: 22px;
    opacity: 0.9;
}

.explore-empty-title {
    font-size: 13px;
    color: var(--ui-text);
    font-weight: 600;
}

.explore-empty-text {
    font-size: 12px;
    color: var(--ui-muted);
}

.explore-loading.hidden,
.explore-empty.hidden,
.explore-error.hidden {
    display: none;
}

.explore-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 14px;
}

.explore-card {
    border: 1px solid var(--ui-border);
    background: var(--ui-panel-2);
    border-radius: 14px;
    padding: 14px;
    display: flex;
    flex-direction: column;
    gap: 12px;
    transition: transform 0.15s ease, border-color 0.15s ease, background 0.15s ease;
}

.explore-card:hover {
    transform: translateY(-2px);
    border-color: rgba(255, 255, 255, 0.16);
    background: rgba(255, 255, 255, 0.04);
}

.explore-card.selected {
    border-color: rgba(88, 101, 242, 0.55);
    box-shadow: 0 0 0 1px rgba(88, 101, 242, 0.35);
}

.explore-card__header {
    display: flex;
    gap: 12px;
}

.explore-card__avatar {
    width: 48px;
    height: 48px;
    border-radius: 12px;
    background: rgba(76, 130, 216, 0.16);
    color: #dbe6ff;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
}

.explore-card__info {
    display: flex;
    flex-direction: column;
    gap: 6px;
    min-width: 0;
}

.explore-card__title {
    font-size: 14px;
    font-weight: 600;
    color: var(--ui-text);
}

.explore-card__description {
    font-size: 12px;
    color: var(--ui-muted);
    line-height: 1.4;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.explore-card__footer {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
}

.explore-card__meta {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
}

.explore-card__badge,
.explore-card__region {
    font-size: 11px;
    padding: 4px 8px;
    border-radius: 999px;
    border: 1px solid var(--ui-border);
    color: var(--ui-muted);
}

.explore-card__join {
    border: none;
    border-radius: 10px;
    padding: 8px 12px;
    background: var(--ui-accent);
    color: #fff;
    font-size: 12px;
    font-weight: 600;
    cursor: pointer;
}

.explore-preview-card {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.explore-preview-header {
    display: flex;
    align-items: center;
    gap: 12px;
}

.explore-preview-avatar {
    width: 56px;
    height: 56px;
    border-radius: 14px;
    background: rgba(76, 130, 216, 0.2);
    color: #dbe6ff;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    font-size: 18px;
}

.explore-preview-title {
    font-size: 16px;
    font-weight: 700;
    color: var(--ui-text);
}

.explore-preview-text {
    font-size: 12px;
    color: var(--ui-muted);
    line-height: 1.6;
}

.explore-preview-stats {
    display: flex;
    gap: 10px;
    font-size: 12px;
    color: var(--ui-muted);
}

.explore-preview-join {
    height: 38px;
    border-radius: 10px;
    border: none;
    background: var(--ui-accent);
    color: #fff;
    font-size: 12px;
    font-weight: 700;
    cursor: pointer;
}

.explore-preview-join:disabled {
    background: rgba(255, 255, 255, 0.08);
    color: var(--ui-muted);
    cursor: default;
}

.explore-error {
    display: flex;
    flex-direction: column;
    gap: 8px;
    padding: 16px;
    border-radius: 12px;
    border: 1px dashed rgba(255, 255, 255, 0.12);
    background: rgba(255, 255, 255, 0.02);
}

.explore-error-title {
    color: var(--ui-text);
    font-size: 13px;
    font-weight: 600;
}

.explore-error-text {
    color: var(--ui-muted);
    font-size: 12px;
}

.explore-retry {
    height: 34px;
    border-radius: 10px;
    border: 1px solid var(--ui-border);
    background: var(--ui-panel-2);
    color: var(--ui-text);
    font-size: 12px;
    cursor: pointer;
    width: fit-content;
    padding: 0 14px;
}

@media (max-width: 900px) {
    .explore-modal-content {
        width: min(92vw, 880px);
        max-height: 80vh;
    }

    .explore-modal-header {
        grid-template-columns: 1fr;
        align-items: flex-start;
    }

    .explore-header-center {
        justify-content: flex-start;
    }

    .explore-layout {
        grid-template-columns: 1fr;
    }

    .explore-preview {
        position: static;
    }

    .explore-grid {
        grid-template-columns: 1fr;
    }
}

.explore-card__join:hover:not(:disabled) {
    background: var(--ui-accent-hover);
}

.explore-card__join:disabled {
    background: rgba(255, 255, 255, 0.08);
    color: var(--ui-muted);
    cursor: default;
}


/* Friends panel redesign */
.friends-panel {
    position: fixed;
    inset: 0;
    z-index: 9999;
    display: flex;
    flex-direction: column;
    background: rgba(14, 16, 20, 0.92);
    backdrop-filter: blur(18px);
    color: #e6e9ee;
}

.friends-header {
    padding: 18px 24px 10px;
    display: grid;
    grid-template-columns: minmax(220px, 1.2fr) minmax(220px, 1fr) auto;
    gap: 16px;
    align-items: center;
    border-bottom: 1px solid rgba(255, 255, 255, 0.06);
}

.friends-title-block {
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.friends-title {
    font-size: 18px;
    font-weight: 700;
    color: #f6f7fb;
}

.friends-subtitle {
    font-size: 12px;
    color: rgba(230, 233, 238, 0.6);
}

.friends-search {
    height: 40px;
    display: flex;
    align-items: center;
    gap: 8px;
    background: rgba(255, 255, 255, 0.06);
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: 12px;
    padding: 0 12px;
}

.friends-search input {
    flex: 1;
    background: transparent;
    border: none;
    outline: none;
    color: #e6e9ee;
    font-size: 14px;
}

.friends-search-icon {
    font-size: 14px;
    opacity: 0.7;
}

.friends-header-actions {
    display: flex;
    align-items: center;
    gap: 12px;
}

.friends-add-btn {
    height: 36px;
    padding: 0 14px;
    border-radius: 10px;
    border: 1px solid rgba(88, 101, 242, 0.4);
    background: rgba(88, 101, 242, 0.15);
    color: #eef1ff;
    font-weight: 600;
    cursor: pointer;
}

.friends-close-btn {
    width: 34px;
    height: 34px;
    border-radius: 10px;
    border: 1px solid rgba(255, 255, 255, 0.08);
    background: rgba(255, 255, 255, 0.05);
    color: #e6e9ee;
    font-size: 20px;
    line-height: 1;
    cursor: pointer;
}

.friends-tabs {
    display: flex;
    gap: 8px;
    padding: 12px 24px 0;
}

.friends-tab {
    height: 34px;
    padding: 0 14px;
    border-radius: 999px;
    border: 1px solid rgba(255, 255, 255, 0.08);
    background: rgba(255, 255, 255, 0.04);
    color: rgba(230, 233, 238, 0.7);
    cursor: pointer;
    font-size: 13px;
}

.friends-tab.active {
    background: rgba(88, 101, 242, 0.2);
    border-color: rgba(88, 101, 242, 0.45);
    color: #ffffff;
}

.friends-add-section {
    padding: 12px 24px 0;
    display: none;
}

.friends-add-section.open {
    display: block;
}

.friends-add-card {
    background: rgba(255, 255, 255, 0.04);
    border: 1px solid rgba(255, 255, 255, 0.06);
    border-radius: 14px;
    padding: 16px;
}

.friends-add-title {
    font-weight: 700;
    margin-bottom: 6px;
}

.friends-add-desc {
    font-size: 12px;
    color: rgba(230, 233, 238, 0.65);
    margin-bottom: 12px;
}

.friends-add-row {
    display: flex;
    gap: 10px;
}

.friends-add-row input {
    flex: 1;
    height: 40px;
    border-radius: 10px;
    border: 1px solid rgba(255, 255, 255, 0.08);
    background: rgba(0, 0, 0, 0.25);
    color: #e6e9ee;
    padding: 0 12px;
}

.friends-add-row button {
    height: 40px;
    padding: 0 16px;
    border-radius: 10px;
    border: none;
    background: #5865f2;
    color: #fff;
    font-weight: 600;
    cursor: pointer;
}

.friends-content {
    flex: 1;
    overflow-y: auto;
    padding: 20px 24px 28px;
}

.friends-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
    gap: 14px;
}

.friend-card {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 14px;
    border-radius: 16px;
    background: rgba(255, 255, 255, 0.04);
    border: 1px solid rgba(255, 255, 255, 0.06);
    position: relative;
    transition: background 0.12s ease, border-color 0.12s ease, transform 0.12s ease;
}

.friend-card:hover {
    background: rgba(255, 255, 255, 0.08);
    border-color: rgba(255, 255, 255, 0.12);
    transform: translateY(-1px);
}

.friend-avatar {
    width: 48px;
    height: 48px;
    border-radius: 14px;
    background: rgba(88, 101, 242, 0.4);
    color: #fff;
    font-weight: 700;
    display: grid;
    place-items: center;
    position: relative;
    overflow: hidden;
}

.friend-avatar img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.friend-status {
    position: absolute;
    bottom: 6px;
    right: 6px;
    width: 10px;
    height: 10px;
    border-radius: 50%;
    border: 2px solid rgba(14, 16, 20, 0.9);
}

.friend-status.online {
    background: #3ba55c;
}

.friend-status.offline {
    background: #6c717a;
}

.friend-status.pending {
    background: #f5c451;
}

.friend-meta {
    flex: 1;
    min-width: 0;
}

.friend-name {
    font-weight: 600;
    color: #f6f7fb;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.friend-presence {
    font-size: 12px;
    color: rgba(230, 233, 238, 0.55);
}

.friend-actions {
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.12s ease;
}

.friend-card:hover .friend-actions {
    opacity: 1;
    pointer-events: auto;
}

.friend-actions button {
    height: 32px;
    padding: 0 12px;
    border-radius: 10px;
    border: 1px solid rgba(255, 255, 255, 0.12);
    background: rgba(255, 255, 255, 0.08);
    color: #e6e9ee;
    cursor: pointer;
    font-size: 12px;
    font-weight: 600;
}

.friend-actions .accept-btn {
    background: rgba(59, 165, 92, 0.2);
    border-color: rgba(59, 165, 92, 0.4);
    color: #dff7e7;
}

.friend-actions .reject-btn {
    background: rgba(237, 66, 69, 0.15);
    border-color: rgba(237, 66, 69, 0.4);
    color: #ffd5d6;
}

.friend-actions .cancel-btn {
    background: rgba(255, 255, 255, 0.08);
    border-color: rgba(255, 255, 255, 0.12);
}

.friends-empty {
    border-radius: 18px;
    border: 1px dashed rgba(255, 255, 255, 0.15);
    background: rgba(255, 255, 255, 0.03);
    padding: 36px 24px;
    text-align: center;
}

.friends-empty-icon {
    font-size: 28px;
    margin-bottom: 10px;
}

.friends-empty-title {
    font-weight: 700;
    color: #f6f7fb;
    margin-bottom: 6px;
}

.friends-empty-desc {
    font-size: 12px;
    color: rgba(230, 233, 238, 0.6);
    margin-bottom: 14px;
}

.friends-empty-cta {
    height: 36px;
    padding: 0 16px;
    border-radius: 10px;
    border: none;
    background: #5865f2;
    color: #fff;
    font-weight: 600;
    cursor: pointer;
}

@media (max-width: 900px) {
    .friends-header {
        grid-template-columns: 1fr;
    }

    .friends-header-actions {
        justify-content: flex-end;
    }

    .friends-search {
        width: 100%;
    }
}



/* Social Center (Friends) */
.friends-topbar {
    display: grid;
    grid-template-columns: minmax(220px, 1.2fr) minmax(240px, 1fr) auto;
    gap: 16px;
    align-items: center;
    padding: 16px 24px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.06);
    background: rgba(12, 14, 18, 0.9);
    position: sticky;
    top: 0;
    z-index: 2;
}

.friends-topbar-title {
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.friends-topbar-search {
    height: 40px;
    display: flex;
    align-items: center;
    gap: 8px;
    background: rgba(255, 255, 255, 0.06);
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: 12px;
    padding: 0 12px;
}

.friends-topbar-search input {
    flex: 1;
    background: transparent;
    border: none;
    outline: none;
    color: #e6e9ee;
    font-size: 14px;
}

.friends-topbar-actions {
    display: flex;
    align-items: center;
    gap: 12px;
}

.friends-shell {
    display: grid;
    grid-template-columns: 220px minmax(0, 1fr) 320px;
    gap: 16px;
    padding: 16px 24px 24px;
    height: calc(100% - 72px);
    overflow: hidden;
}

.friends-nav {
    display: flex;
    flex-direction: column;
    gap: 12px;
    background: rgba(255, 255, 255, 0.04);
    border: 1px solid rgba(255, 255, 255, 0.06);
    border-radius: 16px;
    padding: 14px;
    height: 100%;
}

.friends-nav-title {
    font-weight: 700;
    color: #f6f7fb;
}

.friends-nav-tabs {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.friends-nav-search input {
    width: 100%;
    height: 36px;
    border-radius: 10px;
    border: 1px solid rgba(255, 255, 255, 0.08);
    background: rgba(0, 0, 0, 0.2);
    color: #e6e9ee;
    padding: 0 10px;
}

.friends-dm-section {
    margin-top: auto;
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.friends-dm-title {
    font-size: 12px;
    letter-spacing: 0.6px;
    text-transform: uppercase;
    color: rgba(230, 233, 238, 0.5);
}

.friends-dm-list {
    display: flex;
    flex-direction: column;
    gap: 8px;
    max-height: 240px;
    overflow-y: auto;
}

.friends-dm-item {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 8px 10px;
    border-radius: 10px;
    cursor: pointer;
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid transparent;
    transition: background 0.12s ease, border-color 0.12s ease;
}

.friends-dm-item:hover {
    background: rgba(255, 255, 255, 0.07);
    border-color: rgba(255, 255, 255, 0.12);
}

.friends-dm-avatar {
    width: 32px;
    height: 32px;
    border-radius: 10px;
    background: rgba(88, 101, 242, 0.4);
    display: grid;
    place-items: center;
    color: #fff;
    font-weight: 600;
    position: relative;
    overflow: hidden;
}

.friends-dm-avatar img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.friends-dm-status {
    position: absolute;
    bottom: 4px;
    right: 4px;
    width: 8px;
    height: 8px;
    border-radius: 50%;
    border: 2px solid rgba(12, 14, 18, 0.9);
}

.friends-dm-status.online {
    background: #3ba55c;
}

.friends-dm-status.offline {
    background: #6c717a;
}

.friends-dm-meta {
    flex: 1;
    min-width: 0;
}

.friends-dm-name {
    font-size: 13px;
    color: #f6f7fb;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.friends-dm-sub {
    font-size: 11px;
    color: rgba(230, 233, 238, 0.5);
}

.friends-dm-empty {
    color: rgba(230, 233, 238, 0.5);
    font-size: 12px;
    text-align: center;
    padding: 12px;
}

.friends-main {
    display: flex;
    flex-direction: column;
    gap: 12px;
    overflow: hidden;
}

.friends-main-header {
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.friends-main-title {
    font-weight: 700;
    color: #f6f7fb;
}

.friends-main-subtitle {
    font-size: 12px;
    color: rgba(230, 233, 238, 0.5);
}

.friends-main .friends-grid {
    flex: 1;
    overflow-y: auto;
    padding-right: 4px;
}

.friend-card.selected {
    border-color: rgba(88, 101, 242, 0.6);
    background: rgba(88, 101, 242, 0.12);
}

.friend-actions {
    display: flex;
    gap: 8px;
}

.friend-actions .profile-btn {
    background: rgba(255, 255, 255, 0.06);
}

.friends-preview {
    position: relative;
}

.friends-preview-inner {
    position: sticky;
    top: 92px;
    background: rgba(255, 255, 255, 0.04);
    border: 1px solid rgba(255, 255, 255, 0.06);
    border-radius: 18px;
    padding: 16px;
    min-height: 420px;
}

.friends-preview-panel {
    display: flex;
    flex-direction: column;
    gap: 16px;
}

.friends-preview-header {
    display: flex;
    align-items: center;
    gap: 12px;
}

.friends-preview-back {
    display: none;
    border: none;
    background: rgba(255, 255, 255, 0.08);
    color: #fff;
    border-radius: 10px;
    padding: 6px 10px;
    cursor: pointer;
}

.friends-preview-user {
    display: flex;
    align-items: center;
    gap: 12px;
    flex: 1;
}

.friends-preview-avatar {
    width: 64px;
    height: 64px;
    border-radius: 18px;
    background: rgba(88, 101, 242, 0.4);
    display: grid;
    place-items: center;
    color: #fff;
    font-weight: 700;
    overflow: hidden;
}

.friends-preview-avatar img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.friends-preview-name {
    font-weight: 700;
    color: #f6f7fb;
}

.friends-preview-status {
    font-size: 12px;
    color: rgba(230, 233, 238, 0.6);
}

.friends-preview-dm {
    height: 36px;
    padding: 0 14px;
    border-radius: 10px;
    border: none;
    background: #5865f2;
    color: #fff;
    font-weight: 600;
    cursor: pointer;
}

.friends-preview-meta {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 12px;
}

.friends-preview-label {
    font-size: 11px;
    text-transform: uppercase;
    letter-spacing: 0.6px;
    color: rgba(230, 233, 238, 0.5);
}

.friends-preview-value {
    font-size: 12px;
    color: #f6f7fb;
}

.friends-preview-chat {
    display: none;
    flex-direction: column;
    gap: 10px;
}

.friends-preview-panel.mode-dm .friends-preview-chat {
    display: flex;
}

.friends-preview-messages {
    max-height: 220px;
    overflow-y: auto;
    background: rgba(0, 0, 0, 0.2);
    border-radius: 12px;
    padding: 10px;
    border: 1px solid rgba(255, 255, 255, 0.06);
}

.friends-preview-message {
    display: flex;
    flex-direction: column;
    gap: 4px;
    padding: 8px 6px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.05);
}

.friends-preview-message:last-child {
    border-bottom: none;
}

.friends-preview-author {
    font-size: 11px;
    color: rgba(230, 233, 238, 0.6);
}

.friends-preview-text {
    font-size: 13px;
    color: #f6f7fb;
}

.friends-preview-input {
    display: flex;
    gap: 8px;
}

.friends-preview-input input {
    flex: 1;
    height: 36px;
    border-radius: 10px;
    border: 1px solid rgba(255, 255, 255, 0.08);
    background: rgba(0, 0, 0, 0.2);
    color: #e6e9ee;
    padding: 0 10px;
}

.friends-preview-input button {
    height: 36px;
    padding: 0 14px;
    border-radius: 10px;
    border: none;
    background: #5865f2;
    color: #fff;
    font-weight: 600;
    cursor: pointer;
}

.friends-preview-empty-chat,
.friends-preview-loading {
    font-size: 12px;
    color: rgba(230, 233, 238, 0.6);
    text-align: center;
    padding: 12px;
}

.friends-add-section {
    position: fixed;
    inset: 0;
    background: rgba(6, 7, 10, 0.7);
    backdrop-filter: blur(4px);
    display: none;
    align-items: center;
    justify-content: center;
    z-index: 10000;
}

.friends-add-section.open {
    display: flex;
}

@media (max-width: 1024px) {
    .friends-shell {
        grid-template-columns: 1fr;
        height: auto;
    }

    .friends-nav {
        order: 1;
    }

    .friends-preview {
        display: none;
    }

    .friends-panel.preview-open .friends-nav,
    .friends-panel.preview-open .friends-main {
        display: none;
    }

    .friends-panel.preview-open .friends-preview {
        display: block;
        position: fixed;
        inset: 80px 12px 12px;
        z-index: 3;
    }

    .friends-preview-back {
        display: inline-flex;
    }
}


.request-card .friend-actions {
    opacity: 1;
    pointer-events: auto;
}



/* Friends list layout overrides */
.friends-list {
    display: flex;
    flex-direction: column;
    gap: 6px;
    overflow-y: auto;
}

.friend-row {
    height: 54px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 12px;
    border-radius: 12px;
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid rgba(255, 255, 255, 0.05);
    transition: background 0.12s ease, border-color 0.12s ease;
}

.friend-row:hover {
    background: rgba(255, 255, 255, 0.08);
    border-color: rgba(255, 255, 255, 0.12);
}

.friend-row.selected {
    border-color: rgba(88, 101, 242, 0.6);
    background: rgba(88, 101, 242, 0.12);
}

.friend-row-left {
    display: flex;
    align-items: center;
    gap: 12px;
    min-width: 0;
}

.friend-row .friend-avatar {
    width: 36px;
    height: 36px;
    border-radius: 10px;
}

.friend-row .friend-status {
    width: 8px;
    height: 8px;
    bottom: 4px;
    right: 4px;
}

.friend-row .friend-meta {
    min-width: 0;
}

.friend-row .friend-name {
    font-size: 14px;
}

.friend-row .friend-presence {
    font-size: 11px;
}

.friend-row-actions {
    display: flex;
    gap: 8px;
}

.friend-row-actions button {
    height: 30px;
    padding: 0 12px;
    border-radius: 10px;
    border: 1px solid rgba(255, 255, 255, 0.12);
    background: rgba(255, 255, 255, 0.08);
    color: #e6e9ee;
    cursor: pointer;
    font-size: 12px;
    font-weight: 600;
}

.request-row .friend-row-actions {
    opacity: 1;
    pointer-events: auto;
}

/* Skeletons */
.friends-skeleton .skeleton-row {
    position: relative;
    overflow: hidden;
}

.friends-skeleton .skeleton-row::after {
    content: '';
    position: absolute;
    inset: 0;
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.08), transparent);
    animation: shimmer 1.2s infinite;
}

.friend-avatar.skeleton {
    background: rgba(255, 255, 255, 0.08);
}

.skeleton-line {
    width: 140px;
    height: 10px;
    border-radius: 6px;
    background: rgba(255, 255, 255, 0.08);
    margin-bottom: 6px;
}

.skeleton-line.short {
    width: 80px;
}

.skeleton-btn {
    width: 60px;
    height: 22px;
    border-radius: 8px;
    background: rgba(255, 255, 255, 0.08);
}

@keyframes shimmer {
    0% {
        transform: translateX(-100%);
    }

    100% {
        transform: translateX(100%);
    }
}

/* ============================================
   FRIENDS PANEL PREMIUM REDESIGN v2
   Enhanced visual design for Home/DM/Friends UI
   ============================================ */

/* Main Panel - Darker, more premium feel */
.friends-panel {
    position: fixed;
    inset: 0;
    z-index: 9999;
    display: flex;
    flex-direction: column;
    background: linear-gradient(135deg, #0f0f1a 0%, #1a1a2e 50%, #16213e 100%);
    color: #e6e9ee;
}

/* Top Bar - Sleek header with subtle gradient */
.friends-topbar {
    display: grid;
    grid-template-columns: minmax(200px, 1fr) minmax(200px, 1.2fr) auto;
    gap: 20px;
    align-items: center;
    padding: 16px 24px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.08);
    background: linear-gradient(180deg, rgba(88, 101, 242, 0.08) 0%, transparent 100%);
    position: sticky;
    top: 0;
    z-index: 2;
}

.friends-topbar-title {
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.friends-title {
    font-size: 20px;
    font-weight: 700;
    color: #ffffff;
    display: flex;
    align-items: center;
    gap: 8px;
}

.friends-title::before {
    content: '👥';
    font-size: 18px;
}

.friends-subtitle {
    font-size: 12px;
    color: rgba(230, 233, 238, 0.6);
}

/* Search Box - Modern pill design */
.friends-topbar-search {
    height: 42px;
    display: flex;
    align-items: center;
    gap: 10px;
    background: rgba(0, 0, 0, 0.3);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 21px;
    padding: 0 16px;
    transition: all 0.2s ease;
}

.friends-topbar-search:focus-within {
    border-color: rgba(88, 101, 242, 0.6);
    box-shadow: 0 0 0 3px rgba(88, 101, 242, 0.15);
}

.friends-topbar-search input {
    flex: 1;
    background: transparent;
    border: none;
    outline: none;
    color: #ffffff;
    font-size: 14px;
}

.friends-topbar-search input::placeholder {
    color: rgba(255, 255, 255, 0.4);
}

.friends-search-icon {
    color: rgba(255, 255, 255, 0.5);
}

/* Action Buttons */
.friends-topbar-actions {
    display: flex;
    align-items: center;
    gap: 12px;
}

.friends-add-btn {
    height: 40px;
    padding: 0 20px;
    border-radius: 20px;
    border: none;
    background: linear-gradient(135deg, #5865f2 0%, #7289da 100%);
    color: #ffffff;
    font-weight: 600;
    font-size: 13px;
    cursor: pointer;
    transition: all 0.2s ease;
    box-shadow: 0 4px 15px rgba(88, 101, 242, 0.3);
}

.friends-add-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(88, 101, 242, 0.4);
}

.friends-close-btn {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    border: 1px solid rgba(255, 255, 255, 0.15);
    background: rgba(255, 255, 255, 0.05);
    color: #ffffff;
    font-size: 18px;
    line-height: 1;
    cursor: pointer;
    transition: all 0.2s ease;
}

.friends-close-btn:hover {
    background: rgba(237, 66, 69, 0.2);
    border-color: rgba(237, 66, 69, 0.5);
    color: #ed4245;
}

/* Main Shell Layout */
.friends-shell {
    display: grid;
    grid-template-columns: 240px minmax(0, 1fr);
    gap: 20px;
    padding: 20px 24px 24px;
    height: calc(100% - 76px);
    overflow: hidden;
}

/* Left Navigation Sidebar */
.friends-nav {
    display: flex;
    flex-direction: column;
    gap: 16px;
    background: rgba(0, 0, 0, 0.25);
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: 16px;
    padding: 16px;
    height: 100%;
    overflow-y: auto;
}

.friends-nav-title {
    font-weight: 700;
    font-size: 13px;
    color: rgba(255, 255, 255, 0.5);
    text-transform: uppercase;
    letter-spacing: 0.5px;
    padding: 0 4px;
}

/* Tab Buttons - Modern pill style */
.friends-nav-tabs {
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.friends-tab {
    height: 40px;
    padding: 0 14px;
    border-radius: 10px;
    border: none;
    background: transparent;
    color: rgba(255, 255, 255, 0.7);
    cursor: pointer;
    font-size: 14px;
    font-weight: 500;
    text-align: left;
    transition: all 0.15s ease;
    display: flex;
    align-items: center;
    gap: 10px;
}

.friends-tab:hover {
    background: rgba(255, 255, 255, 0.08);
    color: #ffffff;
}

.friends-tab.active {
    background: linear-gradient(90deg, rgba(88, 101, 242, 0.25), rgba(88, 101, 242, 0.1));
    color: #ffffff;
    font-weight: 600;
    border-left: 3px solid #5865f2;
    padding-left: 11px;
}

.friends-tab[data-tab="online"]::before {
    content: '🟢';
    font-size: 10px;
}

.friends-tab[data-tab="all"]::before {
    content: '📋';
    font-size: 12px;
}

.friends-tab[data-tab="pending"]::before {
    content: '⏳';
    font-size: 12px;
}

/* Search in sidebar */
.friends-nav-search input {
    width: 100%;
    height: 38px;
    border-radius: 10px;
    border: 1px solid rgba(255, 255, 255, 0.1);
    background: rgba(0, 0, 0, 0.3);
    color: #ffffff;
    padding: 0 12px;
    font-size: 13px;
    transition: all 0.2s ease;
}

.friends-nav-search input:focus {
    border-color: rgba(88, 101, 242, 0.5);
    outline: none;
}

.friends-nav-search input::placeholder {
    color: rgba(255, 255, 255, 0.4);
}

/* DM Section */
.friends-dm-section {
    margin-top: auto;
    display: flex;
    flex-direction: column;
    gap: 8px;
    padding-top: 16px;
    border-top: 1px solid rgba(255, 255, 255, 0.08);
}

.friends-dm-title {
    font-size: 11px;
    letter-spacing: 0.8px;
    text-transform: uppercase;
    color: rgba(255, 255, 255, 0.4);
    font-weight: 600;
    padding: 0 4px;
}

.friends-dm-list {
    display: flex;
    flex-direction: column;
    gap: 4px;
    max-height: 200px;
    overflow-y: auto;
}

/* DM Item - Clean Discord style */
.friends-dm-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 10px 12px;
    border-radius: 10px;
    cursor: pointer;
    background: transparent;
    border: 1px solid transparent;
    transition: all 0.15s ease;
}

.friends-dm-item:hover {
    background: rgba(255, 255, 255, 0.08);
}

.friends-dm-item.active {
    background: rgba(88, 101, 242, 0.15);
    border-color: rgba(88, 101, 242, 0.3);
}

.friends-dm-avatar {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    background: linear-gradient(135deg, #5865f2 0%, #7289da 100%);
    display: grid;
    place-items: center;
    color: #fff;
    font-weight: 700;
    font-size: 14px;
    position: relative;
    overflow: hidden;
    flex-shrink: 0;
}

.friends-dm-avatar img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    border-radius: 50%;
}

.friends-dm-status {
    position: absolute;
    bottom: 0;
    right: 0;
    width: 12px;
    height: 12px;
    border-radius: 50%;
    border: 3px solid #1a1a2e;
}

.friends-dm-status.online {
    background: #3ba55c;
}

.friends-dm-status.offline {
    background: #747f8d;
}

.friends-dm-meta {
    flex: 1;
    min-width: 0;
}

.friends-dm-name {
    font-size: 14px;
    font-weight: 600;
    color: #ffffff;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.friends-dm-sub {
    font-size: 12px;
    color: rgba(255, 255, 255, 0.5);
}

/* Main Content Area */
.friends-main {
    display: flex;
    flex-direction: column;
    gap: 16px;
    overflow: hidden;
}

.friends-main-header {
    display: flex;
    flex-direction: column;
    gap: 4px;
    padding: 4px 0;
}

.friends-main-title {
    font-size: 18px;
    font-weight: 700;
    color: #ffffff;
}

.friends-main-subtitle {
    font-size: 13px;
    color: rgba(255, 255, 255, 0.5);
}

/* Friends List Container */
.friends-main .friends-list,
.friends-main .friends-grid {
    flex: 1;
    overflow-y: auto;
    padding-right: 8px;
}

/* Friend Row - Discord style list item */
.friend-row {
    display: flex;
    align-items: center;
    gap: 14px;
    padding: 12px 16px;
    border-radius: 12px;
    background: rgba(0, 0, 0, 0.2);
    border: 1px solid rgba(255, 255, 255, 0.06);
    margin-bottom: 8px;
    cursor: pointer;
    transition: all 0.15s ease;
}

.friend-row:hover {
    background: rgba(255, 255, 255, 0.08);
    border-color: rgba(255, 255, 255, 0.12);
}

.friend-row.selected {
    background: rgba(88, 101, 242, 0.15);
    border-color: rgba(88, 101, 242, 0.4);
}

/* Friend Card (alternative grid style) */
.friend-card {
    display: flex;
    align-items: center;
    gap: 14px;
    padding: 14px 16px;
    border-radius: 14px;
    background: rgba(0, 0, 0, 0.25);
    border: 1px solid rgba(255, 255, 255, 0.08);
    position: relative;
    transition: all 0.15s ease;
    cursor: pointer;
}

.friend-card:hover {
    background: rgba(255, 255, 255, 0.08);
    border-color: rgba(255, 255, 255, 0.15);
    transform: translateY(-2px);
}

.friend-card.selected {
    background: rgba(88, 101, 242, 0.15);
    border-color: rgba(88, 101, 242, 0.5);
    box-shadow: 0 0 20px rgba(88, 101, 242, 0.2);
}

/* Friend Avatar */
.friend-avatar {
    width: 44px;
    height: 44px;
    border-radius: 50%;
    background: linear-gradient(135deg, #5865f2 0%, #7289da 100%);
    color: #fff;
    font-weight: 700;
    font-size: 16px;
    display: grid;
    place-items: center;
    position: relative;
    overflow: hidden;
    flex-shrink: 0;
}

.friend-avatar img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    border-radius: 50%;
}

.friend-status {
    position: absolute;
    bottom: 0;
    right: 0;
    width: 14px;
    height: 14px;
    border-radius: 50%;
    border: 3px solid #1a1a2e;
}

.friend-status.online {
    background: #3ba55c;
}

.friend-status.offline {
    background: #747f8d;
}

.friend-status.idle {
    background: #faa61a;
}

.friend-status.dnd {
    background: #ed4245;
}

.friend-meta {
    flex: 1;
    min-width: 0;
}

.friend-name {
    font-size: 15px;
    font-weight: 600;
    color: #ffffff;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.friend-presence {
    font-size: 13px;
    color: rgba(255, 255, 255, 0.5);
}

/* Friend Action Buttons */
.friend-actions {
    display: flex;
    gap: 8px;
    opacity: 0;
    transition: opacity 0.15s ease;
}

.friend-row:hover .friend-actions,
.friend-card:hover .friend-actions {
    opacity: 1;
}

.friend-actions button {
    height: 34px;
    padding: 0 14px;
    border-radius: 8px;
    border: none;
    font-size: 13px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.15s ease;
}

.friend-actions .message-btn,
.friend-actions .profile-btn {
    background: rgba(255, 255, 255, 0.1);
    color: #ffffff;
}

.friend-actions .message-btn:hover,
.friend-actions .profile-btn:hover {
    background: rgba(255, 255, 255, 0.2);
}

.friend-actions .accept-btn {
    background: linear-gradient(135deg, #3ba55c 0%, #2d8c4e 100%);
    color: #ffffff;
}

.friend-actions .accept-btn:hover {
    transform: scale(1.05);
}

.friend-actions .reject-btn {
    background: rgba(237, 66, 69, 0.2);
    color: #ff6b6b;
    border: 1px solid rgba(237, 66, 69, 0.3);
}

.friend-actions .reject-btn:hover {
    background: rgba(237, 66, 69, 0.3);
}

/* Right Preview Panel */
.friends-preview {
    position: relative;
}

.friends-preview-inner {
    position: sticky;
    top: 0;
    background: rgba(0, 0, 0, 0.25);
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: 18px;
    padding: 20px;
    min-height: 400px;
    display: flex;
    flex-direction: column;
}

/* Empty Preview State */
.friends-preview-empty {
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    text-align: center;
    padding: 40px 20px;
}

.friends-empty-icon {
    width: 64px;
    height: 64px;
    border-radius: 50%;
    background: rgba(88, 101, 242, 0.15);
    display: grid;
    place-items: center;
    margin-bottom: 16px;
}

.friends-empty-icon svg {
    color: #7289da;
}

.friends-empty-title {
    font-size: 16px;
    font-weight: 700;
    color: #ffffff;
    margin-bottom: 8px;
}

.friends-empty-desc {
    font-size: 13px;
    color: rgba(255, 255, 255, 0.5);
    line-height: 1.5;
    max-width: 200px;
}

/* Profile Preview Panel */
.friends-preview-panel {
    display: flex;
    flex-direction: column;
    gap: 20px;
}

.friends-preview-header {
    display: flex;
    align-items: center;
    gap: 14px;
}

.friends-preview-avatar {
    width: 72px;
    height: 72px;
    border-radius: 50%;
    background: linear-gradient(135deg, #5865f2 0%, #7289da 100%);
    display: grid;
    place-items: center;
    color: #fff;
    font-weight: 700;
    font-size: 24px;
    overflow: hidden;
    flex-shrink: 0;
}

.friends-preview-avatar img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    border-radius: 50%;
}

.friends-preview-info {
    flex: 1;
}

.friends-preview-name {
    font-size: 18px;
    font-weight: 700;
    color: #ffffff;
}

.friends-preview-status {
    font-size: 13px;
    color: rgba(255, 255, 255, 0.5);
    display: flex;
    align-items: center;
    gap: 6px;
}

.friends-preview-status::before {
    content: '';
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: #747f8d;
}

.friends-preview-status.online::before {
    background: #3ba55c;
}

.friends-preview-status.offline::before {
    background: #747f8d;
}

/* Action Buttons in Preview */
.friends-preview-actions {
    display: flex;
    gap: 10px;
}

.friends-preview-dm {
    flex: 1;
    height: 42px;
    padding: 0 20px;
    border-radius: 10px;
    border: none;
    background: linear-gradient(135deg, #5865f2 0%, #7289da 100%);
    color: #ffffff;
    font-weight: 600;
    font-size: 14px;
    cursor: pointer;
    transition: all 0.2s ease;
}

.friends-preview-dm:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 15px rgba(88, 101, 242, 0.3);
}

/* Meta Info Grid */
.friends-preview-meta {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 16px;
    padding: 16px;
    background: rgba(0, 0, 0, 0.2);
    border-radius: 12px;
    border: 1px solid rgba(255, 255, 255, 0.06);
}

.friends-preview-meta-item {
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.friends-preview-label {
    font-size: 11px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    color: rgba(255, 255, 255, 0.4);
    font-weight: 600;
}

.friends-preview-value {
    font-size: 14px;
    color: #ffffff;
}

/* DM Chat Preview */
.friends-preview-chat {
    display: none;
    flex-direction: column;
    gap: 12px;
    flex: 1;
}

.friends-preview-panel.mode-dm .friends-preview-chat {
    display: flex;
}

.friends-preview-messages {
    flex: 1;
    max-height: 250px;
    overflow-y: auto;
    background: rgba(0, 0, 0, 0.3);
    border-radius: 12px;
    padding: 12px;
    border: 1px solid rgba(255, 255, 255, 0.06);
}

.friends-preview-message {
    padding: 10px 0;
    border-bottom: 1px solid rgba(255, 255, 255, 0.06);
}

.friends-preview-message:last-child {
    border-bottom: none;
}

.friends-preview-author {
    font-size: 12px;
    font-weight: 600;
    color: #7289da;
    margin-bottom: 4px;
}

.friends-preview-text {
    font-size: 14px;
    color: #ffffff;
    line-height: 1.4;
}

/* Message Input */
.friends-preview-input {
    display: flex;
    gap: 10px;
}

.friends-preview-input input {
    flex: 1;
    height: 42px;
    border-radius: 21px;
    border: 1px solid rgba(255, 255, 255, 0.1);
    background: rgba(0, 0, 0, 0.3);
    color: #ffffff;
    padding: 0 16px;
    font-size: 14px;
}

.friends-preview-input input:focus {
    border-color: rgba(88, 101, 242, 0.5);
    outline: none;
}

.friends-preview-input button {
    width: 42px;
    height: 42px;
    border-radius: 50%;
    border: none;
    background: linear-gradient(135deg, #5865f2 0%, #7289da 100%);
    color: #ffffff;
    font-size: 16px;
    cursor: pointer;
    display: grid;
    place-items: center;
    transition: all 0.2s ease;
}

.friends-preview-input button:hover {
    transform: scale(1.1);
}

/* Add Friend Modal */
.friends-add-section {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.8);
    backdrop-filter: blur(8px);
    display: none;
    align-items: center;
    justify-content: center;
    z-index: 10000;
}

.friends-add-section.open {
    display: flex;
}

.friends-add-card {
    background: linear-gradient(135deg, #1e1e2e 0%, #2d2d44 100%);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 20px;
    padding: 28px;
    width: 100%;
    max-width: 440px;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.5);
}

.friends-add-title {
    font-size: 20px;
    font-weight: 700;
    color: #ffffff;
    margin-bottom: 8px;
}

.friends-add-desc {
    font-size: 14px;
    color: rgba(255, 255, 255, 0.6);
    margin-bottom: 20px;
    line-height: 1.5;
}

.friends-add-row {
    display: flex;
    gap: 12px;
}

.friends-add-row input {
    flex: 1;
    height: 48px;
    border-radius: 12px;
    border: 1px solid rgba(255, 255, 255, 0.1);
    background: rgba(0, 0, 0, 0.3);
    color: #ffffff;
    padding: 0 16px;
    font-size: 15px;
}

.friends-add-row input:focus {
    border-color: rgba(88, 101, 242, 0.5);
    outline: none;
}

.friends-add-row button {
    height: 48px;
    padding: 0 24px;
    border-radius: 12px;
    border: none;
    background: linear-gradient(135deg, #5865f2 0%, #7289da 100%);
    color: #ffffff;
    font-weight: 600;
    font-size: 15px;
    cursor: pointer;
    transition: all 0.2s ease;
}

.friends-add-row button:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 15px rgba(88, 101, 242, 0.3);
}

/* Empty States */
.friends-empty,
.friends-dm-empty {
    text-align: center;
    padding: 40px 20px;
    color: rgba(255, 255, 255, 0.5);
}

.friends-empty-cta {
    margin-top: 16px;
    height: 40px;
    padding: 0 24px;
    border-radius: 20px;
    border: none;
    background: linear-gradient(135deg, #5865f2 0%, #7289da 100%);
    color: #ffffff;
    font-weight: 600;
    cursor: pointer;
}

/* Skeleton Loading */
.friends-skeleton-list {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.friend-row.skeleton {
    background: rgba(255, 255, 255, 0.05);
    animation: pulse 1.5s ease-in-out infinite;
}

@keyframes pulse {

    0%,
    100% {
        opacity: 0.5;
    }

    50% {
        opacity: 0.8;
    }
}

.skeleton-avatar {
    width: 44px;
    height: 44px;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.1);
}

.skeleton-text {
    height: 14px;
    border-radius: 4px;
    background: rgba(255, 255, 255, 0.1);
}

.skeleton-text.short {
    width: 60%;
}

.skeleton-text.full {
    width: 100%;
}

/* Responsive */
@media (max-width: 1200px) {
    .friends-shell {
        grid-template-columns: 220px 1fr 280px;
    }
}

@media (max-width: 1024px) {
    .friends-shell {
        grid-template-columns: 200px 1fr;
    }

    .friends-preview {
        display: none;
    }

    .friends-panel.preview-open .friends-preview {
        display: block;
        position: fixed;
        inset: 0;
        background: rgba(0, 0, 0, 0.9);
        z-index: 100;
        padding: 20px;
    }
}

@media (max-width: 768px) {
    .friends-shell {
        grid-template-columns: 1fr;
    }

    .friends-nav {
        display: none;
    }

    .friends-topbar {
        grid-template-columns: 1fr auto;
    }

    .friends-topbar-search {
        display: none;
    }
}

/* Friend Context Menu */
.friend-menu-btn {
    background: transparent !important;
    border: none !important;
    font-size: 20px !important;
    cursor: pointer !important;
    padding: 4px 8px !important;
    color: var(--text-secondary, #b9bbbe) !important;
    transition: color 0.2s ease !important;
}

.friend-menu-btn:hover {
    color: var(--text-primary, #dcddde) !important;
}

.friend-context-menu {
    position: absolute;
    background: var(--bg-secondary, #2f3136);
    border-radius: 8px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.4);
    z-index: 10000;
    min-width: 180px;
    padding: 6px 0;
    animation: menuFadeIn 0.15s ease;
}

@keyframes menuFadeIn {
    from {
        opacity: 0;
        transform: translateY(-4px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.friend-context-menu-item {
    padding: 10px 14px;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 10px;
    font-size: 14px;
    color: var(--text-primary, #dcddde);
    transition: background 0.15s ease;
}

.friend-context-menu-item:hover {
    background: var(--bg-hover, #40444b);
}

.friend-context-menu-item.danger {
    color: #ed4245;
}

.friend-context-menu-item.danger:hover {
    background: rgba(237, 66, 69, 0.15);
}

/* ==========================================
   EXPLORE / DISCOVER MODAL
   ========================================== */

.explore-modal {
    position: fixed;
    inset: 0;
    z-index: 1000;
    display: none;
    align-items: center;
    justify-content: center;
    background: rgba(0, 0, 0, 0.7);
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
    animation: fadeIn 0.2s ease;
    font-family: var(--ui-font);
    color: var(--ui-text);
}

.explore-modal.hidden {
    display: none;
}

.explore-modal-content {
    width: min(96vw, 1080px);
    height: min(90vh, 780px);
    background: linear-gradient(135deg, rgba(18, 20, 28, 0.95), rgba(12, 14, 20, 0.98));
    border-radius: 16px;
    border: 1px solid rgba(255, 255, 255, 0.08);
    box-shadow: 0 24px 64px rgba(0, 0, 0, 0.6), 0 0 0 1px rgba(255, 255, 255, 0.04) inset;
    display: flex;
    flex-direction: column;
    overflow: hidden;
    animation: exploreSlideIn 0.3s cubic-bezier(0.16, 1, 0.3, 1);
}

@keyframes exploreSlideIn {
    from {
        opacity: 0;
        transform: scale(0.95) translateY(12px);
    }

    to {
        opacity: 1;
        transform: scale(1) translateY(0);
    }
}

/* Header */
.explore-modal-header {
    display: flex;
    align-items: center;
    gap: 16px;
    padding: 20px 24px;
    flex-wrap: wrap;
}

.explore-header-left {
    flex-shrink: 0;
}

.explore-title {
    font-size: 22px;
    font-weight: 700;
    background: linear-gradient(135deg, #7c8cf8, #6ee7b7);
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
    letter-spacing: -0.02em;
}

.explore-subtitle {
    font-size: 13px;
    color: var(--ui-muted);
    margin-top: 2px;
}

.explore-header-center {
    flex: 1;
    min-width: 180px;
}

.explore-search-wrap {
    display: flex;
    align-items: center;
    gap: 10px;
    background: rgba(255, 255, 255, 0.04);
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: 10px;
    padding: 0 14px;
    transition: border-color 0.2s, box-shadow 0.2s;
}

.explore-search-wrap:focus-within {
    border-color: rgba(124, 140, 248, 0.5);
    box-shadow: 0 0 0 3px rgba(124, 140, 248, 0.1);
}

.explore-search-icon {
    font-size: 14px;
    opacity: 0.5;
}

.explore-search {
    flex: 1;
    background: transparent;
    border: none;
    outline: none;
    color: var(--ui-text);
    font-size: 14px;
    padding: 10px 0;
    font-family: var(--ui-font);
}

.explore-search::placeholder {
    color: rgba(255, 255, 255, 0.3);
}

.explore-header-actions {
    display: flex;
    gap: 8px;
    flex-shrink: 0;
}

.explore-filter {
    height: 36px;
    padding: 0 16px;
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: 10px;
    color: var(--ui-muted);
    font-size: 13px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.15s;
    font-family: var(--ui-font);
}

.explore-filter:hover {
    background: rgba(255, 255, 255, 0.08);
    color: var(--ui-text);
}

.explore-close {
    width: 36px;
    height: 36px;
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: 10px;
    color: var(--ui-muted);
    font-size: 20px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.15s;
}

.explore-close:hover {
    background: rgba(237, 66, 69, 0.15);
    border-color: rgba(237, 66, 69, 0.3);
    color: #ed4245;
}

/* Divider */
.explore-divider {
    height: 1px;
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.06), transparent);
    margin: 0 24px;
}

/* Body & Layout */
.explore-modal-body {
    flex: 1;
    overflow: hidden;
    padding: 16px 24px 24px;
}

.explore-layout {
    display: flex;
    gap: 20px;
    height: 100%;
}

.explore-list {
    flex: 1;
    overflow-y: auto;
    min-width: 0;
    scrollbar-width: thin;
    scrollbar-color: rgba(255, 255, 255, 0.08) transparent;
}

/* Server Grid */
.explore-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
    gap: 14px;
}

.explore-grid-item {
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid rgba(255, 255, 255, 0.06);
    border-radius: 14px;
    padding: 16px;
    cursor: pointer;
    transition: all 0.25s cubic-bezier(0.16, 1, 0.3, 1);
    position: relative;
    overflow: hidden;
}

.explore-grid-item::before {
    content: '';
    position: absolute;
    inset: 0;
    background: linear-gradient(135deg, rgba(124, 140, 248, 0.04), rgba(110, 231, 183, 0.02));
    opacity: 0;
    transition: opacity 0.25s;
    pointer-events: none;
}

.explore-grid-item:hover {
    transform: translateY(-3px);
    border-color: rgba(124, 140, 248, 0.25);
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.3), 0 0 0 1px rgba(124, 140, 248, 0.1);
}

.explore-grid-item:hover::before {
    opacity: 1;
}

.explore-grid-item.active {
    border-color: rgba(124, 140, 248, 0.4);
    background: rgba(124, 140, 248, 0.06);
}

.explore-grid-icon {
    width: 52px;
    height: 52px;
    border-radius: 14px;
    background: linear-gradient(135deg, rgba(124, 140, 248, 0.15), rgba(110, 231, 183, 0.1));
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 22px;
    font-weight: 700;
    color: #7c8cf8;
    margin-bottom: 12px;
    overflow: hidden;
    flex-shrink: 0;
}

.explore-grid-icon img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.explore-grid-name {
    font-size: 15px;
    font-weight: 600;
    color: var(--ui-text);
    margin-bottom: 4px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.explore-grid-desc {
    font-size: 12px;
    color: var(--ui-muted);
    line-height: 1.4;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
    margin-bottom: 10px;
}

.explore-grid-meta {
    display: flex;
    align-items: center;
    gap: 12px;
    font-size: 12px;
    color: rgba(255, 255, 255, 0.4);
}

.explore-grid-members::before {
    content: '👥 ';
}

.explore-grid-online::before {
    content: '';
    display: inline-block;
    width: 8px;
    height: 8px;
    background: #3ba55c;
    border-radius: 50%;
    margin-right: 4px;
    vertical-align: middle;
}

/* Preview Panel */
.explore-preview {
    width: 300px;
    flex-shrink: 0;
    display: flex;
    flex-direction: column;
}

.explore-preview-card {
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid rgba(255, 255, 255, 0.06);
    border-radius: 14px;
    padding: 24px;
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
    gap: 12px;
    flex: 1;
}

.explore-preview-icon {
    width: 80px;
    height: 80px;
    border-radius: 20px;
    background: linear-gradient(135deg, rgba(124, 140, 248, 0.2), rgba(110, 231, 183, 0.12));
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 32px;
    font-weight: 700;
    color: #7c8cf8;
    overflow: hidden;
}

.explore-preview-icon img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.explore-preview-title {
    font-size: 18px;
    font-weight: 700;
    color: var(--ui-text);
}

.explore-preview-text {
    font-size: 13px;
    color: var(--ui-muted);
    line-height: 1.5;
}

.explore-preview-stats {
    display: flex;
    gap: 20px;
    font-size: 13px;
    color: rgba(255, 255, 255, 0.5);
    padding: 10px 0;
}

.explore-join-btn {
    width: 100%;
    height: 42px;
    background: linear-gradient(135deg, #7c8cf8, #5865F2);
    color: #fff;
    border: none;
    border-radius: 10px;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s;
    box-shadow: 0 4px 16px rgba(88, 101, 242, 0.3);
    font-family: var(--ui-font);
    margin-top: 8px;
}

.explore-join-btn:hover {
    transform: translateY(-1px);
    box-shadow: 0 6px 20px rgba(88, 101, 242, 0.4);
}

.explore-join-btn:active {
    transform: translateY(0);
}

.explore-join-btn.joined {
    background: rgba(62, 155, 107, 0.2);
    color: #6ee7b7;
    box-shadow: none;
    cursor: default;
}

/* Empty, Loading, Error States */
.explore-loading,
.explore-empty,
.explore-error {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 48px 24px;
    text-align: center;
    gap: 8px;
}

.explore-loading.hidden,
.explore-empty.hidden,
.explore-error.hidden {
    display: none;
}

.explore-empty-icon {
    font-size: 48px;
    margin-bottom: 8px;
    opacity: 0.6;
}

.explore-empty-title,
.explore-error-title {
    font-size: 16px;
    font-weight: 600;
    color: var(--ui-text);
}

.explore-empty-text,
.explore-error-text {
    font-size: 13px;
    color: var(--ui-muted);
}

.explore-retry {
    margin-top: 12px;
    height: 36px;
    padding: 0 20px;
    background: var(--ui-accent);
    color: #fff;
    border: none;
    border-radius: 10px;
    font-size: 13px;
    font-weight: 600;
    cursor: pointer;
    transition: background 0.15s;
    font-family: var(--ui-font);
}

.explore-retry:hover {
    background: var(--ui-accent-hover);
}

/* Responsive */
@media (max-width: 768px) {
    .explore-modal-content {
        width: 100vw;
        height: 100vh;
        border-radius: 0;
    }

    .explore-layout {
        flex-direction: column;
    }

    .explore-preview {
        width: 100%;
        max-height: 200px;
    }

    .explore-grid {
        grid-template-columns: 1fr;
    }

    .explore-modal-header {
        padding: 14px 16px;
    }

    .explore-modal-body {
        padding: 12px 16px 16px;
    }
}

/* ==========================================
   DRAG & DROP REORDERING
   ========================================== */

.category-header.dragging,
.channel-item.dragging {
    opacity: 0.4;
}

.category-header.drag-over {
    background: rgba(124, 140, 248, 0.12);
    border-radius: 6px;
    box-shadow: 0 0 0 2px rgba(124, 140, 248, 0.3);
}

.channel-item.drag-above {
    box-shadow: 0 -2px 0 0 #7c8cf8;
}

.channel-item.drag-below {
    box-shadow: 0 2px 0 0 #7c8cf8;
}

.category-header[draggable="true"]:hover {
    cursor: grab;
}

.category-header[draggable="true"]:active {
    cursor: grabbing;
}