/* Navigation tabs */
.nav-tabs {
    display: flex;
    gap: 8px;
    margin-left: 24px;
}

.nav-tab {
    padding: 6px 16px;
    border-radius: 6px;
    color: var(--text-secondary);
    text-decoration: none;
    font-size: 14px;
    transition: all 0.15s;
}

.nav-tab:hover {
    background: var(--bg-hover);
    color: var(--text-primary);
}

.nav-tab.active {
    background: var(--accent);
    color: white;
}

/* Server selector */
.server-selector {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 20px;
    padding: 16px;
    background: var(--bg-card);
    border-radius: var(--border-radius);
    border: 1px solid var(--border);
}

.server-selector label {
    font-weight: 500;
    color: var(--text-secondary);
}

.select-input {
    padding: 8px 12px;
    border: 1px solid var(--border);
    border-radius: var(--border-radius);
    background: var(--bg-secondary);
    color: var(--text-primary);
    font-size: 14px;
    min-width: 200px;
}

.select-input:focus {
    outline: none;
    border-color: var(--accent);
}

/* Layout */
.channels-layout {
    display: grid;
    grid-template-columns: 350px 1fr;
    gap: 20px;
    height: calc(100vh - 180px);
}

@media (max-width: 1024px) {
    .channels-layout {
        grid-template-columns: 1fr;
        height: auto;
    }
}

/* Panels */
.panel {
    background: var(--bg-card);
    border-radius: 12px;
    border: 1px solid var(--border);
    padding: 20px;
    overflow-y: auto;
}

.panel h2 {
    font-size: 16px;
    font-weight: 600;
    margin-bottom: 16px;
    color: var(--text-primary);
}

/* Server structure */
.server-structure {
    font-size: 14px;
}

.structure-category {
    margin-bottom: 12px;
}

.category-header {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 8px;
    background: var(--bg-secondary);
    border-radius: 6px;
    cursor: pointer;
    margin-bottom: 4px;
}

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

.category-icon {
    font-size: 12px;
    color: var(--text-muted);
}

.category-name {
    font-weight: 500;
    flex: 1;
}

.category-count {
    font-size: 12px;
    color: var(--text-muted);
    background: var(--bg-hover);
    padding: 2px 8px;
    border-radius: 10px;
}

.category-channels {
    margin-left: 16px;
}

.structure-channel {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 6px 8px;
    border-radius: 4px;
    color: var(--text-secondary);
}

.structure-channel:hover {
    background: var(--bg-hover);
}

.structure-channel.voice::before {
    content: '🔊';
    font-size: 12px;
}

.structure-channel.text::before {
    content: '#';
    font-weight: bold;
    color: var(--text-muted);
}

.channel-actions-mini {
    margin-left: auto;
    opacity: 0;
    transition: opacity 0.15s;
}

.structure-channel:hover .channel-actions-mini {
    opacity: 1;
}

/* Creator tabs */
.creator-tabs {
    display: flex;
    gap: 4px;
    margin-bottom: 20px;
    border-bottom: 1px solid var(--border);
    padding-bottom: 12px;
}

.tab-btn {
    padding: 8px 16px;
    border: none;
    background: transparent;
    color: var(--text-secondary);
    font-size: 14px;
    cursor: pointer;
    border-radius: 6px;
    transition: all 0.15s;
}

.tab-btn:hover {
    background: var(--bg-hover);
    color: var(--text-primary);
}

.tab-btn.active {
    background: var(--accent);
    color: white;
}

.tab-content {
    display: none;
}

.tab-content.active {
    display: block;
}

/* Form sections */
.form-section {
    margin-bottom: 24px;
    padding-bottom: 20px;
    border-bottom: 1px solid var(--border);
}

.form-section:last-child {
    border-bottom: none;
    margin-bottom: 0;
}

.form-section h3 {
    font-size: 14px;
    font-weight: 600;
    margin-bottom: 12px;
    color: var(--text-secondary);
}

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

.form-group label {
    display: block;
    font-size: 13px;
    font-weight: 500;
    margin-bottom: 6px;
    color: var(--text-secondary);
}

.input {
    width: 100%;
    padding: 10px 12px;
    border: 1px solid var(--border);
    border-radius: var(--border-radius);
    background: var(--bg-secondary);
    color: var(--text-primary);
    font-size: 14px;
}

.input:focus {
    outline: none;
    border-color: var(--accent);
}

.form-hint {
    display: block;
    font-size: 12px;
    color: var(--text-muted);
    margin-top: 4px;
}

/* Emoji picker */
.emoji-picker {
    display: flex;
    flex-wrap: wrap;
    gap: 4px;
    padding: 8px;
    background: var(--bg-secondary);
    border-radius: var(--border-radius);
}

.emoji-btn {
    width: 32px;
    height: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 18px;
    cursor: pointer;
    border-radius: 4px;
    transition: all 0.15s;
}

.emoji-btn:hover {
    background: var(--bg-hover);
    transform: scale(1.2);
}

.emoji-btn.selected {
    background: var(--accent);
    box-shadow: 0 0 0 2px var(--accent);
    transform: scale(1.1);
}

.emoji-count-hint {
    display: block;
    margin-top: 8px;
    font-size: 12px;
    transition: color 0.2s;
}

/* Channel preview */
.channel-preview {
    background: var(--bg-secondary);
    border-radius: var(--border-radius);
    padding: 12px;
    max-height: 200px;
    overflow-y: auto;
}

.preview-channel {
    padding: 6px 8px;
    color: var(--text-secondary);
    font-size: 14px;
    border-radius: 4px;
}

.preview-channel:hover {
    background: var(--bg-hover);
}

.preview-channel.voice::before {
    content: '🔊 ';
}

.preview-channel.text::before {
    content: '# ';
    font-weight: bold;
}

/* Form actions */
.form-actions {
    display: flex;
    gap: 8px;
    margin-top: 16px;
}

/* Danger zone */
.danger-zone {
    border: 1px solid var(--error);
    border-radius: var(--border-radius);
    padding: 16px;
    margin-top: 24px;
}

.danger-zone h3 {
    color: var(--error);
}

.warning-text {
    color: var(--error);
    font-size: 13px;
    margin-bottom: 12px;
}

/* Loading state */
.loading {
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 40px;
    color: var(--text-muted);
}

.loading::after {
    content: '';
    width: 20px;
    height: 20px;
    border: 2px solid var(--border);
    border-top-color: var(--accent);
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
    margin-left: 8px;
}

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

/* Uncategorized channels */
.uncategorized {
    margin-bottom: 12px;
    padding-bottom: 12px;
    border-bottom: 1px solid var(--border);
}

.uncategorized-title {
    font-size: 12px;
    color: var(--text-muted);
    text-transform: uppercase;
    margin-bottom: 8px;
}

/* Context menu */
.context-menu {
    position: absolute;
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: 6px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.4);
    min-width: 160px;
    z-index: 1000;
    overflow: hidden;
}

.context-menu-item {
    padding: 10px 14px;
    font-size: 13px;
    color: var(--text-primary);
    cursor: pointer;
    transition: background 0.15s;
}

.context-menu-item:hover {
    background: var(--bg-hover);
}

.context-menu-item.danger {
    color: var(--error);
}

.context-menu-item.danger:hover {
    background: rgba(237, 66, 69, 0.15);
}

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

/* Delete Preview */
.delete-preview {
    margin-top: 16px;
    border: 1px solid var(--border);
    border-radius: var(--border-radius);
    background: var(--bg-secondary);
    overflow: hidden;
}

.delete-preview-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 12px 16px;
    background: var(--bg-hover);
    border-bottom: 1px solid var(--border);
}

.delete-preview-header h4 {
    margin: 0;
    font-size: 14px;
    color: var(--text-primary);
}

.delete-stats {
    font-size: 12px;
    color: var(--text-muted);
}

.delete-preview-actions {
    display: flex;
    gap: 8px;
    padding: 8px 16px;
    border-bottom: 1px solid var(--border);
}

.delete-preview-list {
    max-height: 300px;
    overflow-y: auto;
    padding: 8px;
}

.delete-category-group {
    margin-bottom: 12px;
}

.delete-category-name {
    font-size: 11px;
    font-weight: 600;
    color: var(--text-muted);
    text-transform: uppercase;
    padding: 4px 8px;
    margin-bottom: 4px;
}

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

.delete-channel-item:hover {
    background: var(--bg-hover);
}

.delete-channel-item input[type="checkbox"] {
    width: 16px;
    height: 16px;
    cursor: pointer;
}

.delete-channel-item .channel-icon {
    font-size: 12px;
    color: var(--text-muted);
    width: 20px;
    text-align: center;
}

.delete-channel-item .channel-name {
    font-size: 13px;
    color: var(--text-secondary);
}

.delete-channel-item:has(input:checked) .channel-name {
    color: var(--text-primary);
}

.delete-preview-footer {
    display: flex;
    gap: 8px;
    padding: 12px 16px;
    border-top: 1px solid var(--border);
    background: var(--bg-hover);
}

/* Preview empty state */
.preview-empty {
    color: var(--text-muted);
    font-size: 13px;
    font-style: italic;
    padding: 8px;
}

.preview-more {
    color: var(--text-muted);
    font-size: 12px;
    padding: 4px 8px;
}

/* Font style select */
.select-input option {
    font-family: inherit;
    padding: 8px 12px;
}

#voice-font-style,
#text-font-style,
#cat-voice-font-style,
#cat-text-font-style {
    font-size: 13px;
}

/* ========================================
   Hub Management Styles
   ======================================== */

/* Hubs list */
.hubs-list {
    display: flex;
    flex-direction: column;
    gap: 12px;
    margin-bottom: 24px;
}

.hub-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 14px 16px;
    background: var(--bg-secondary);
    border-radius: var(--border-radius);
    border: 1px solid var(--border);
    transition: all 0.15s;
}

.hub-item:hover {
    background: var(--bg-hover);
    border-color: var(--accent);
}

.hub-icon {
    font-size: 24px;
    width: 40px;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--bg-card);
    border-radius: 8px;
}

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

.hub-name {
    font-weight: 600;
    font-size: 14px;
    color: var(--text-primary);
    margin-bottom: 4px;
    display: flex;
    align-items: center;
    gap: 8px;
}

.hub-name .channel-badge {
    font-size: 11px;
    padding: 2px 6px;
    background: var(--accent);
    color: white;
    border-radius: 4px;
    font-weight: 500;
}

.hub-details {
    font-size: 12px;
    color: var(--text-muted);
    display: flex;
    gap: 12px;
    flex-wrap: wrap;
}

.hub-details span {
    display: flex;
    align-items: center;
    gap: 4px;
}

.hub-actions {
    display: flex;
    gap: 8px;
}

.hub-actions .btn-sm {
    padding: 6px 12px;
    font-size: 12px;
}

/* Empty state */
.hubs-empty {
    text-align: center;
    padding: 40px 20px;
    color: var(--text-muted);
}

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

.hubs-empty p {
    font-size: 14px;
    margin-bottom: 16px;
}

/* Hub create form */
.hub-form {
    background: var(--bg-secondary);
    border-radius: var(--border-radius);
    padding: 20px;
    border: 1px solid var(--border);
}

.hub-form h3 {
    font-size: 16px;
    font-weight: 600;
    margin-bottom: 16px;
    color: var(--text-primary);
    display: flex;
    align-items: center;
    gap: 8px;
}

.hub-form .form-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 16px;
}

@media (max-width: 768px) {
    .hub-form .form-row {
        grid-template-columns: 1fr;
    }
}

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

.hub-form .form-hint {
    font-size: 11px;
    color: var(--text-muted);
    margin-top: 4px;
}

/* Dynamic channels list */
.dynamic-channels-section {
    margin-top: 32px;
    padding-top: 24px;
    border-top: 1px solid var(--border);
}

.dynamic-channels-section h3 {
    font-size: 16px;
    font-weight: 600;
    margin-bottom: 16px;
    color: var(--text-primary);
    display: flex;
    align-items: center;
    gap: 8px;
}

.dynamic-channels-section h3 .count-badge {
    font-size: 12px;
    padding: 2px 8px;
    background: var(--bg-hover);
    color: var(--text-muted);
    border-radius: 10px;
    font-weight: 500;
}

.dynamic-channels-list {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.dynamic-channel-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px 14px;
    background: var(--bg-secondary);
    border-radius: var(--border-radius);
    border: 1px solid var(--border);
    transition: all 0.15s;
}

.dynamic-channel-item:hover {
    background: var(--bg-hover);
}

.dynamic-channel-icon {
    font-size: 18px;
    width: 32px;
    height: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--bg-card);
    border-radius: 6px;
}

.dynamic-channel-item.locked .dynamic-channel-icon {
    background: rgba(237, 66, 69, 0.15);
}

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

.dynamic-channel-name {
    font-weight: 500;
    font-size: 13px;
    color: var(--text-primary);
    display: flex;
    align-items: center;
    gap: 6px;
}

.dynamic-channel-name .lock-icon {
    color: var(--error);
    font-size: 12px;
}

.dynamic-channel-meta {
    font-size: 11px;
    color: var(--text-muted);
    margin-top: 2px;
}

.dynamic-channel-actions {
    display: flex;
    gap: 6px;
}

.dynamic-channel-actions .btn-icon {
    width: 28px;
    height: 28px;
    padding: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 4px;
    font-size: 14px;
    background: transparent;
    border: 1px solid var(--border);
    color: var(--text-muted);
    cursor: pointer;
    transition: all 0.15s;
}

.dynamic-channel-actions .btn-icon:hover {
    background: var(--bg-hover);
    color: var(--text-primary);
}

.dynamic-channel-actions .btn-icon.danger:hover {
    background: rgba(237, 66, 69, 0.15);
    color: var(--error);
    border-color: var(--error);
}

/* Dynamic channels empty state */
.dynamic-channels-empty {
    text-align: center;
    padding: 24px;
    color: var(--text-muted);
    font-size: 13px;
    background: var(--bg-secondary);
    border-radius: var(--border-radius);
}

/* Voice channel indicator */
.voice-channel-select-item {
    display: flex;
    align-items: center;
    gap: 8px;
}

.voice-channel-select-item::before {
    content: '🔊';
    font-size: 12px;
}

/* Hub status indicators */
.hub-status {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    font-size: 11px;
    padding: 2px 8px;
    border-radius: 10px;
}

.hub-status.active {
    background: rgba(87, 242, 135, 0.15);
    color: var(--success);
}

.hub-status.inactive {
    background: var(--bg-hover);
    color: var(--text-muted);
}

/* ========================================
   Channel Moderation Styles
   ======================================== */

/* Toggle labels */
.toggle-label {
    display: flex;
    align-items: center;
    gap: 10px;
    cursor: pointer;
    padding: 8px 0;
}

.toggle-label input[type="checkbox"] {
    width: 18px;
    height: 18px;
    cursor: pointer;
}

.toggle-label span {
    font-size: 14px;
    color: var(--text-primary);
}

/* Inline inputs for spam config */
.inline-inputs {
    display: flex;
    align-items: center;
    gap: 8px;
    flex-wrap: wrap;
}

.inline-inputs span {
    color: var(--text-secondary);
    font-size: 13px;
}

.inline-inputs .input {
    text-align: center;
}

/* Mod channels list */
.mod-channels-list {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.mod-config-item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    padding: 12px 14px;
    background: var(--bg-secondary);
    border-radius: var(--border-radius);
    border: 1px solid var(--border);
    transition: all 0.15s;
}

.mod-config-item:hover {
    background: var(--bg-hover);
    border-color: var(--accent);
}

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

.mod-config-name {
    font-weight: 500;
    font-size: 14px;
    color: var(--text-primary);
    display: flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 4px;
}

.mod-config-name .channel-icon {
    color: var(--text-muted);
    font-weight: 400;
}

.mod-config-features {
    display: flex;
    gap: 6px;
    flex-wrap: wrap;
}

.feature-badge {
    font-size: 11px;
    padding: 2px 8px;
    background: var(--accent);
    color: white;
    border-radius: 4px;
    font-weight: 500;
}

.feature-badge.inactive {
    background: var(--bg-hover);
    color: var(--text-muted);
}

.mod-config-actions {
    display: flex;
    gap: 6px;
}

.locked-badge {
    font-size: 14px;
    margin-left: 4px;
}

/* Incidents list */
.mod-incidents-list {
    display: flex;
    flex-direction: column;
    gap: 10px;
    max-height: 300px;
    overflow-y: auto;
}

.incident-item {
    padding: 12px 14px;
    background: var(--bg-secondary);
    border-radius: var(--border-radius);
    border: 1px solid var(--border);
    border-left: 3px solid;
}

.incident-item.warning {
    border-left-color: var(--warning);
}

.incident-item.danger {
    border-left-color: var(--error);
}

.incident-header {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 6px;
    flex-wrap: wrap;
}

.incident-type {
    font-size: 11px;
    padding: 2px 8px;
    border-radius: 4px;
    font-weight: 600;
    text-transform: uppercase;
}

.incident-type.warning {
    background: rgba(250, 166, 26, 0.2);
    color: var(--warning);
}

.incident-type.danger {
    background: rgba(237, 66, 69, 0.2);
    color: var(--error);
}

.incident-channel {
    font-size: 13px;
    color: var(--text-primary);
    font-weight: 500;
}

.incident-date {
    font-size: 11px;
    color: var(--text-muted);
    margin-left: auto;
}

.incident-details {
    font-size: 12px;
    color: var(--text-secondary);
    display: flex;
    gap: 16px;
    flex-wrap: wrap;
}

.incident-details span {
    display: flex;
    align-items: center;
    gap: 4px;
}

/* Form actions for moderation */
#mod-actions {
    gap: 10px;
    margin-top: 16px;
}

/* ==================== Context Menu Enhancements ==================== */

.context-menu {
    min-width: 180px;
}

.context-menu-item .context-icon {
    margin-right: 8px;
}

/* ==================== Modal Styles ==================== */

.modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 1000;
    display: flex;
    align-items: center;
    justify-content: center;
}

.modal.hidden {
    display: none;
}

.modal-backdrop {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.7);
    backdrop-filter: blur(4px);
}

.modal-content {
    position: relative;
    background: var(--surface);
    border-radius: 12px;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.5);
    max-width: 500px;
    width: 90%;
    max-height: 80vh;
    overflow: hidden;
    display: flex;
    flex-direction: column;
    animation: modalSlideIn 0.2s ease-out;
}

.modal-content.modal-lg {
    max-width: 700px;
}

@keyframes modalSlideIn {
    from {
        opacity: 0;
        transform: translateY(-20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

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

.modal-header h3 {
    margin: 0;
    font-size: 18px;
    font-weight: 600;
}

.modal-close {
    background: none;
    border: none;
    font-size: 24px;
    cursor: pointer;
    color: var(--text-muted);
    padding: 0;
    line-height: 1;
    transition: color 0.2s;
}

.modal-close:hover {
    color: var(--text-primary);
}

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

.modal-footer {
    padding: 16px 20px;
    border-top: 1px solid var(--border);
    display: flex;
    justify-content: flex-end;
    gap: 10px;
}

/* ==================== Permissions Display ==================== */

.permissions-channel-name {
    font-size: 16px;
    font-weight: 600;
    color: var(--text-primary);
    margin-bottom: 16px;
    padding-bottom: 12px;
    border-bottom: 1px solid var(--border);
}

.permissions-list {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.permission-overwrite {
    background: var(--surface-light);
    border-radius: 8px;
    padding: 12px;
    border: 1px solid var(--border);
}

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

.permission-icon {
    font-size: 18px;
}

.permission-name {
    font-weight: 600;
    color: var(--text-primary);
    flex: 1;
}

.permission-type {
    font-size: 11px;
    padding: 2px 8px;
    border-radius: 4px;
    font-weight: 500;
    text-transform: uppercase;
}

.permission-type.role {
    background: rgba(88, 101, 242, 0.2);
    color: #7289da;
}

.permission-type.member {
    background: rgba(87, 242, 135, 0.2);
    color: #57f287;
}

.permission-details {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.perms-allowed, .perms-denied, .perms-neutral {
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.perms-label {
    font-size: 12px;
    font-weight: 600;
    color: var(--text-secondary);
}

.perms-list {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
}

.perm-badge {
    font-size: 11px;
    padding: 4px 8px;
    border-radius: 4px;
    display: inline-flex;
    align-items: center;
    gap: 4px;
}

.perm-badge.allowed {
    background: rgba(87, 242, 135, 0.15);
    color: #57f287;
    border: 1px solid rgba(87, 242, 135, 0.3);
}

.perm-badge.denied {
    background: rgba(237, 66, 69, 0.15);
    color: #ed4245;
    border: 1px solid rgba(237, 66, 69, 0.3);
}

.perms-neutral .perms-label {
    color: var(--text-muted);
}

.empty-state.error {
    color: var(--error);
}
