body {
            background: var(--portal-bg-dark, #0f1419);
            color: var(--portal-text, #e1e5e9);
            min-height: 100vh;
            font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
            font-size: 13px;
            line-height: 1.28;
        }

        /* Notification Toasts */
        .notification-container {
            position: fixed;
            top: 20px;
            right: 20px;
            z-index: 1200;
            display: flex;
            flex-direction: column;
            gap: 10px;
            pointer-events: none;
        }

        .notification {
            background: linear-gradient(135deg, #1c2535 0%, #0f1623 100%);
            color: #f9fafb;
            padding: 12px 16px;
            border-radius: 9px;
            box-shadow: 0 14px 32px rgba(15, 23, 42, 0.38);
            min-width: 240px;
            max-width: 320px;
            position: relative;
            transform: translateX(420px);
            opacity: 0;
            transition: all 0.28s ease;
            border-left: 4px solid rgba(96, 165, 250, 0.45);
            pointer-events: auto;
            overflow: hidden;
            backdrop-filter: blur(6px);
            display: flex;
            align-items: stretch;
        }

        .notification-content {
            display: flex;
            align-items: flex-start;
            gap: 12px;
        }

        .notification-icon {
            font-size: 18px;
            flex-shrink: 0;
            margin-top: 2px;
            text-shadow: 0 6px 16px rgba(15, 23, 42, 0.45);
        }

        .notification-text {
            font-size: 13px;
            line-height: 1.45;
            color: inherit;
        }

        .notification.show {
            transform: translateX(0);
            opacity: 1;
        }

        .notification.success {
            background: linear-gradient(135deg, #14532d 0%, #166534 100%);
            border-left-color: #22c55e;
            box-shadow: 0 20px 50px rgba(22, 101, 52, 0.45);
        }

        .notification.error {
            background: linear-gradient(135deg, #7f1d1d 0%, #991b1b 100%);
            border-left-color: #f87171;
            box-shadow: 0 20px 50px rgba(127, 29, 29, 0.45);
        }

        .notification.info {
            background: linear-gradient(135deg, #1e3a8a 0%, #312e81 100%);
            border-left-color: #60a5fa;
        }

        .notification.success .notification-icon {
            color: #bbf7d0;
        }

        .notification.error .notification-icon {
            color: #fecdd3;
        }

        .notification.error .notification-text {
            color: inherit;
        }

        .notification.info .notification-icon {
            color: #c7d2fe;
        }

        .notification-close {
            position: absolute;
            top: 8px;
            right: 8px;
            background: rgba(255, 255, 255, 0.08);
       color: rgba(248, 250, 252, 0.85);
            cursor: pointer;
            font-size: 16px;
            width: 26px;
            height: 26px;
            display: flex;
            align-items: center;
            justify-content: center;
            border-radius: 50%;
            transition: background-color 0.2s ease, transform 0.2s ease;
        }

        .notification-close:hover {
            background-color: rgba(255, 255, 255, 0.2);
            color: #ffffff;
            transform: scale(1.05);
        }
        @media (max-width: 768px) {
            .notification-container {
                top: 12px;
                right: 12px;
                left: 12px;
            }

            .notification {
                min-width: auto;
                max-width: none;
                transform: translateY(-100px);
            }

            .notification.show {
                transform: translateY(0);
            }
        }
        .thread-reply-btn {
            font-size: 14px;
            padding: 10px 18px;
            border-radius: 999px;
            background: linear-gradient(135deg, #6366f1, #4338ca);
            border: none;
            color: white;
            font-weight: 600;
            box-shadow: 0 8px 20px rgba(99, 102, 241, 0.25);
            transition: transform 0.2s ease, box-shadow 0.2s ease;
        }

        .thread-reply-btn:hover {
            transform: translateY(-1px);
            box-shadow: 0 10px 26px rgba(99, 102, 241, 0.3);
        }

        /* Modern Dark Theme Header */
        .app-header {
            background: linear-gradient(135deg, #1a1f2e 0%, #16213e 100%);
            border-bottom: 1px solid #2a3441;
            padding: 0;
            display: flex;
            align-items: stretch;
            justify-content: space-between;
            position: sticky;
            top: 0;
            z-index: 100;
            box-shadow: 0 2px 8px rgba(0,0,0,.3);
        }

        .app-branding {
            display: flex;
            align-items: center;
            gap: 12px;
            padding: 12px 20px;
            background: rgba(0,0,0,.2);
        }

        .app-logo {
            width: 32px;
            height: 32px;
            border-radius: 4px;
            background: rgba(79, 172, 254, 0.15);
            display: flex;
            align-items: center;
            justify-content: center;
            overflow: hidden;
            border: 1px solid rgba(79, 172, 254, 0.3);
        }

        .app-logo img {
            width: 100%;
            height: 100%;
            object-fit: cover;
            border-radius: 2px;
        }

        .app-logo i {
            color: #4facfe;
            font-size: 14px;
        }

        .app-title h1 {
            color: #fff;
            margin: 0;
            font-size: 18px;
            font-weight: 600;
        }

        .app-title p {
            color: rgba(255, 255, 255, 0.8);
            margin: 0;
            font-size: 11px;
        }

        .header-actions {
            display: flex;
            align-items: center;
            justify-content: flex-end;
            flex-wrap: wrap;
            gap: 12px;
            padding: 12px 20px;
            margin-left: auto;
        }

        .header-actions .header-alerts {
            position: relative;
            display: flex;
            align-items: center;
        }

        .header-actions .alert-toggle {
            position: relative;
            display: inline-flex;
            align-items: center;
            justify-content: center;
            width: 38px;
            height: 38px;
            border-radius: 50%;
            border: 1px solid rgba(255, 255, 255, 0.18);
            background: rgba(15, 23, 42, 0.55);
            color: rgba(255, 255, 255, 0.85);
            cursor: pointer;
            transition: all 0.2s ease;
        }

        .header-actions .alert-toggle:hover,
        .header-actions .alert-toggle[aria-expanded="true"] {
            background: rgba(79, 172, 254, 0.18);
            color: #ffffff;
            border-color: rgba(79, 172, 254, 0.4);
        }

        .header-actions .alert-badge {
            position: absolute;
            top: -6px;
            right: -2px;
            min-width: 18px;
            height: 18px;
            border-radius: 999px;
            background: #f97316;
            color: #fff;
            font-size: 11px;
            font-weight: 600;
            display: flex;
            align-items: center;
            justify-content: center;
            padding: 0 4px;
            box-shadow: 0 2px 6px rgba(249, 115, 22, 0.45);
            opacity: 0;
            transform: scale(0.6);
            transition: all 0.2s ease;
        }

        .header-actions .alert-badge[data-unread="true"] {
            opacity: 1;
            transform: scale(1);
        }

        .header-actions .alert-dropdown {
            position: absolute;
            top: calc(100% + 12px);
            right: 0;
            width: 320px;
            max-height: 420px;
            display: none;
            flex-direction: column;
            background: #101826;
            border: 1px solid rgba(79, 172, 254, 0.25);
            border-radius: 12px;
            box-shadow: 0 20px 45px rgba(0, 0, 0, 0.45);
            overflow: hidden;
            z-index: 999;
        }

        .header-actions .header-alerts.active .alert-dropdown {
            display: flex;
            animation: dropdownFade 0.18s ease;
        }

        .header-actions .alert-dropdown-header {
            padding: 14px 16px;
            display: flex;
            align-items: center;
            justify-content: space-between;
            background: rgba(79, 172, 254, 0.1);
            border-bottom: 1px solid rgba(79, 172, 254, 0.25);
        }

        .header-actions .alert-dropdown-header span {
            font-size: 13px;
            font-weight: 600;
            color: #e2e8f0;
            letter-spacing: 0.4px;
        }

        .header-actions .alert-dropdown-header .mark-read {
            border: none;
            background: transparent;
            color: rgba(226, 232, 240, 0.75);
            font-size: 12px;
            cursor: pointer;
            padding: 0;
            transition: color 0.2s ease;
        }

        .header-actions .alert-dropdown-header .mark-read:hover {
            color: #4facfe;
        }

        .header-actions .alert-dropdown-body {
            flex: 1;
            overflow-y: auto;
            background: rgba(10, 17, 30, 0.75);
        }

        .header-actions .alert-empty {
            display: flex;
            flex-direction: column;
            align-items: center;
            justify-content: center;
            gap: 12px;
            padding: 36px 24px;
            color: rgba(148, 163, 184, 0.85);
            text-align: center;
        }

        .header-actions .alert-empty i {
            font-size: 38px;
            opacity: 0.85;
        }

        .header-actions .alert-empty p {
            margin: 0;
            font-size: 13px;
        }

        .header-actions .alert-list {
            display: flex;
            flex-direction: column;
            gap: 4px;
            padding: 8px;
        }

        .header-actions .mention-item {
            display: flex;
            flex-direction: column;
            align-items: flex-start;
            gap: 6px;
            width: 100%;
            border: none;
            border-radius: 10px;
            padding: 12px;
            background: rgba(15, 23, 42, 0.65);
            color: #e2e8f0;
            text-align: left;
            cursor: pointer;
            transition: transform 0.18s ease, background 0.18s ease;
        }

        .header-actions .mention-item:hover {
            background: rgba(79, 172, 254, 0.18);
            transform: translateY(-1px);
        }

        .header-actions .mention-item-title {
            font-size: 13px;
            font-weight: 600;
            color: #f8fafc;
        }

        .header-actions .mention-item-meta {
            font-size: 11px;
            color: rgba(148, 163, 184, 0.82);
            letter-spacing: 0.3px;
        }

        .header-actions .mention-item-excerpt {
            font-size: 12px;
            color: rgba(226, 232, 240, 0.88);
            line-height: 1.4;
            display: -webkit-box;
            display: box;
            -webkit-line-clamp: 2;
            line-clamp: 2;
            -webkit-box-orient: vertical;
            box-orient: vertical;
            overflow: hidden;
            text-overflow: ellipsis;
            max-width: 100%;
        }

        @keyframes dropdownFade {
            from {
                transform: translateY(-6px);
                opacity: 0;
            }
            to {
                transform: translateY(0);
                opacity: 1;
            }
        }

        .header-actions .btn-outline,
        .header-actions .btn-secondary,
        .header-actions .btn-redeem,
        .header-actions .btn-primary {
            font-size: 13px;
            padding: 8px 16px;
        }

        .auth-close-btn {
            position: absolute;
            top: 12px;
            right: 12px;
            background: transparent;
            border: none;
            color: #9ca3af;
            cursor: pointer;
            font-size: 16px;
            padding: 4px;
            line-height: 1;
            transition: color 0.2s ease;
        }

        .auth-close-btn:hover {
            color: #f3f4f6;
        }

        /* Modern Dark Theme Auth Container */
        .auth-overlay {
            position: fixed;
            inset: 0;
            display: none;
            align-items: center;
            justify-content: center;
            padding: 24px;
            background: rgba(6, 10, 18, 0.82);
            backdrop-filter: blur(6px);
            z-index: 1050;
        }

        .auth-overlay.active {
            display: flex;
        }

        .auth-container {
            width: 100%;
            max-width: 420px;
            margin: 0;
            padding: 0;
        }

        body.modal-open {
            overflow: hidden;
        }

        .auth-card {
            background: #1a1f2e;
            border: 1px solid #2a3441;
            border-radius: 8px;
            box-shadow: 0 8px 32px rgba(0,0,0,.4);
            overflow: hidden;
            position: relative;
        }

        .auth-form {
            padding: 30px;
        }

        .form-toggle {
            display: flex;
            margin-bottom: 25px;
            background: #0f1419;
            border-radius: 6px;
            padding: 3px;
            border: 1px solid #2a3441;
        }

        .form-toggle button {
            flex: 1;
            padding: 8px 16px;
            background: transparent;
            border: none;
            color: #4facfe;
            font-weight: 500;
            border-radius: 4px;
            cursor: pointer;
            transition: all 0.2s ease;
            font-size: 13px;
        }

        .form-toggle button.active {
            background: #4facfe;
            color: white;
            box-shadow: 0 2px 8px rgba(79, 172, 254, 0.3);
        }

        .form-section {
            display: none;
        }

        .form-section.active {
            display: block;
        }

        .form-group {
            margin-bottom: 20px;
        }

        .form-group label {
            display: block;
            margin-bottom: 5px;
            color: #e1e5e9;
            font-weight: 600;
            font-size: 13px;
        }

        .form-group input {
            width: 100%;
            padding: 10px 12px;
            background: #0f1419;
            border: 1px solid #2a3441;
            border-radius: 6px;
            color: #e1e5e9;
            font-size: 13px;
            transition: border-color 0.2s ease, box-shadow 0.2s ease;
        }

        .form-group input:focus {
            outline: none;
            border-color: #4facfe;
            box-shadow: 0 0 0 2px rgba(79, 172, 254, 0.15);
        }

        .btn {
            display: inline-flex;
            align-items: center;
            justify-content: center;
            padding: 8px 16px;
            border: 1px solid transparent;
            border-radius: 3px;
            font-weight: 500;
            text-decoration: none;
            cursor: pointer;
            transition: all 0.2s ease;
            font-size: 13px;
            line-height: 1.3;
        }

        .btn-primary {
            background: linear-gradient(135deg, #4facfe 0%, #00f2fe 100%);
            color: white;
            border-color: #4facfe;
        }

        .btn-primary:hover {
            background: linear-gradient(135deg, #369bfe 0%, #00d9fe 100%);
            border-color: #369bfe;
            text-decoration: none;
            color: white;
            transform: translateY(-1px);
            box-shadow: 0 4px 12px rgba(79, 172, 254, 0.4);
        }

        .btn-outline {
            background: transparent;
            color: #4facfe;
            border-color: #2a3441;
        }

        .btn-outline:hover {
            background: rgba(79, 172, 254, 0.1);
            border-color: #4facfe;
            text-decoration: none;
            color: #4facfe;
        }

        .btn-small {
            padding: 6px 12px;
            font-size: 12px;
        }

        .btn-danger {
            background: #dc2626;
            color: white;
            border-color: #dc2626;
        }

        .btn-danger:hover {
            background: #b91c1c;
            border-color: #b91c1c;
            text-decoration: none;
            color: white;
            transform: translateY(-1px);
            box-shadow: 0 4px 12px rgba(220, 38, 38, 0.4);
        }
        
        .btn-warning {
            background: #f59e0b;
            color: white;
            border-color: #f59e0b;
        }
        
        .btn-warning:hover {
            background: #d97706;
            border-color: #d97706;
            text-decoration: none;
            color: white;
            transform: translateY(-1px);
            box-shadow: 0 4px 12px rgba(245, 158, 11, 0.4);
        }
        
        .btn-disabled {
            background: #374151 !important;
            color: #6b7280 !important;
            border-color: #374151 !important;
            cursor: not-allowed !important;
            opacity: 0.6 !important;
        }
        
        .btn-disabled:hover {
            background: #374151 !important;
            color: #6b7280 !important;
            border-color: #374151 !important;
            transform: none !important;
            box-shadow: none !important;
        }

        .btn-secondary {
            background: #7a8996;
            color: white;
            border-color: #6c7b88;
        }

        .btn-secondary:hover {
            background: #6c7b88;
            border-color: #5e6d79;
        }

        .btn-redeem {
            background: linear-gradient(135deg, #f97316 0%, #f59e0b 100%);
            color: #111827;
            border: none;
            font-weight: 600;
        }

        .btn-redeem:hover {
            background: linear-gradient(135deg, #fb923c 0%, #fbbf24 100%);
            color: #0f172a;
            box-shadow: 0 6px 18px rgba(249, 115, 22, 0.35);
            transform: translateY(-1px);
        }

        /* XenForo Forum Styles */
        .forum-container {
            max-width: 1200px;
            margin: 0 auto;
            padding: 20px;
            display: none;
        }

        .forum-container.active {
            display: block;
        }

        /* =================== XENFORO STYLE ENHANCEMENTS =================== */
        
        /* Thread List - XenForo Style */
        .xf-thread-item {
            background: #1a2332;
            border: 1px solid #2a3441;
            border-radius: 6px;
            margin-bottom: 2px;
            cursor: pointer;
            transition: all 0.2s ease;
            position: relative;
        }
        
        .xf-thread-item:hover {
            background: #1e2530;
            border-color: #3b4b5c;
            transform: translateY(-1px);
            box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3);
        }
        
        .xf-thread-content {
            display: flex;
            align-items: center;
            padding: 16px;
            gap: 16px;
        }
        
        .xf-thread-main {
            display: flex;
            align-items: flex-start;
            gap: 12px;
            flex: 1;
            min-width: 0;
        }
        
        .xf-thread-avatar {
            flex-shrink: 0;
        }
        
        .xf-avatar {
            width: 40px;
            height: 40px;
            border-radius: 50%;
            border: 2px solid #374151;
            object-fit: cover;
            overflow: hidden;
        }
        
        .xf-avatar-small {
            width: 24px;
            height: 24px;
            border-radius: 50%;
            border: 1px solid #374151;
            object-fit: cover;
            overflow: hidden;
        }

        .xf-avatar-fallback {
            display: inline-flex;
            align-items: center;
            justify-content: center;
            background: linear-gradient(135deg, #374151, #1f2937);
            color: #f8fafc;
            font-weight: 600;
            text-transform: uppercase;
            letter-spacing: 0.03em;
        }

        .xf-avatar-small.xf-avatar-fallback {
            font-size: 0.65rem;
            border-width: 1px;
        }

        .xf-avatar-fallback:not(.xf-avatar-small) {
            font-size: 0.95rem;
        }

        .xf-avatar-initial {
            display: block;
            line-height: 1;
            text-align: center;
            width: 100%;
        }
        
        .xf-thread-details {
            flex: 1;
            min-width: 0;
        }
        
        .xf-thread-header {
            margin-bottom: 6px;
        }
        
        .xf-thread-title {
            margin: 0;
            font-size: 16px;
            font-weight: 600;
            color: #e1e5e9;
            display: flex;
            align-items: center;
            gap: 8px;
            line-height: 1.3;
        }
        
        .xf-thread-item:hover .xf-thread-title-text {
            color: #60a5fa;
        }
        
        .xf-thread-title-text {
            overflow: hidden;
            text-overflow: ellipsis;
            white-space: nowrap;
            transition: color 0.2s ease;
        }
        
        .xf-thread-pin {
            color: #fbbf24;
            font-size: 12px;
        }
        
        .xf-thread-lock {
            color: #ef4444;
            font-size: 12px;
        }
        
        .thread-status-badge {
            display: inline-block;
            padding: 2px 6px;
            border-radius: 3px;
            font-size: 10px;
            font-weight: 600;
            text-transform: uppercase;
            margin-left: 8px;
        }
        
        .thread-status-badge.locked {
            background: rgba(239, 68, 68, 0.2);
            color: #ef4444;
            border: 1px solid rgba(239, 68, 68, 0.3);
        }
        
        .xf-thread-meta {
            font-size: 13px;
            color: #9ca3af;
            display: flex;
            gap: 12px;
            align-items: center;
        }
        
        .xf-thread-author strong {
            color: #60a5fa;
            font-weight: 500;
        }
        
        .xf-thread-stats {
            display: flex;
            gap: 20px;
            text-align: center;
            flex-shrink: 0;
        }
        
        .xf-thread-replies,
        .xf-thread-views {
            display: flex;
            flex-direction: column;
            align-items: center;
            min-width: 50px;
        }
        
        .xf-thread-stat-number {
            font-size: 18px;
            font-weight: 600;
            color: #e1e5e9;
            line-height: 1;
        }
        
        .xf-thread-stat-label {
            font-size: 11px;
            color: #9ca3af;
            text-transform: uppercase;
            font-weight: 500;
            margin-top: 2px;
        }
        
        .xf-thread-last {
            display: flex;
            align-items: center;
            gap: 8px;
            flex-shrink: 0;
            min-width: 140px;
        }
        
        .xf-thread-last-details {
            display: flex;
            flex-direction: column;
            align-items: flex-end;
            text-align: right;
        }
        
        .xf-thread-last-date {
            font-size: 12px;
            color: #9ca3af;
            line-height: 1.2;
        }
        
        .xf-thread-last-user {
            font-size: 12px;
            color: #9ca3af;
            margin-top: 2px;
        }
        
        .xf-thread-last-user strong {
            color: #60a5fa;
            font-weight: 500;
        }
        
        /* Pagination Styles */
        .xf-pagination {
            display: flex;
            justify-content: center;
            align-items: center;
            gap: 4px;
            margin: 24px 0;
            padding: 16px;
            background: #1a2332;
            border: 1px solid #2a3441;
            border-radius: 6px;
        }
        
        .xf-page-btn {
            display: flex;
            align-items: center;
            justify-content: center;
            min-width: 32px;
            height: 32px;
            padding: 0 8px;
            background: transparent;
            border: 1px solid #374151;
            border-radius: 4px;
            color: #9ca3af;
            text-decoration: none;
            font-size: 13px;
            font-weight: 500;
            transition: all 0.2s ease;
            cursor: pointer;
        }
        
        .xf-page-btn:hover {
            background: #374151;
            color: #e1e5e9;
            border-color: #4b5563;
        }
        
        .xf-page-btn.active {
            background: #3b82f6;
            color: white;
            border-color: #3b82f6;
        }
        
        .xf-page-btn:disabled {
            opacity: 0.5;
            cursor: not-allowed;
        }
        
        .xf-page-btn:disabled:hover {
            background: transparent;
            color: #9ca3af;
            border-color: #374151;
        }
        
        .xf-page-info {
            color: #9ca3af;
            font-size: 13px;
            margin: 0 16px;
        }
        
        /* Show moderation buttons on hover */
        .xf-thread-item:hover .thread-moderation {
            display: flex !important;
            gap: 4px;
        }
        
        .moderation-btn {
            background: rgba(55, 65, 81, 0.8);
            border: 1px solid #4b5563;
            color: #9ca3af;
            border-radius: 3px;
            padding: 4px 6px;
            font-size: 11px;
        }

        /* =================== THREAD VIEW STYLES =================== */
        
        .thread-view {
            max-width: 100%;
        }

        .thread-hero {
            display: flex;
            flex-direction: column;
            gap: 20px;
            padding: 26px 30px;
            background: linear-gradient(165deg, rgba(21, 27, 43, 0.96) 0%, rgba(10, 16, 30, 0.94) 100%);
            border: 1px solid rgba(58, 80, 120, 0.55);
            border-radius: 14px;
            box-shadow: 0 22px 50px rgba(4, 10, 24, 0.55);
            margin-bottom: 26px;
            color: #e5ecff;
        }

        .post-content {
            padding: 24px 32px;
            transition: padding 0.2s ease;
        }

        .post-content.rich-text-content,
        .post-content .rich-text-content {
            padding-left: 32px;
            padding-right: 32px;
        }

        .thread-toolbar {
            display: flex;
            align-items: center;
            justify-content: space-between;
            gap: 16px;
            padding-bottom: 14px;
            border-bottom: 1px solid rgba(74, 96, 136, 0.4);
        }

        .thread-back-button {
            display: inline-flex;
            align-items: center;
            gap: 8px;
            padding: 7px 16px;
            border-radius: 10px;
            border: 1px solid rgba(79, 172, 254, 0.28);
            background: rgba(40, 52, 74, 0.65);
            color: #dbeafe;
            font-size: 13px;
            font-weight: 600;
            transition: background 0.2s ease, border-color 0.2s ease, color 0.2s ease, transform 0.2s ease;
        }

        .thread-back-button i {
            font-size: 13px;
            color: #9cc7ff;
        }

        .thread-back-button:hover {
            background: rgba(61, 79, 112, 0.8);
            border-color: rgba(79, 172, 254, 0.45);
            color: #ffffff;
            transform: translateY(-1px);
        }

        .thread-toolbar-actions {
            display: flex;
            align-items: center;
            gap: 10px;
            flex-wrap: wrap;
        }

        .btn-ghost {
            background: rgba(43, 56, 80, 0.45);
            border: 1px solid rgba(91, 167, 255, 0.32);
            color: #e0ecff;
            transition: background 0.2s ease, border-color 0.2s ease, color 0.2s ease, transform 0.2s ease;
        }

        .btn-ghost:hover {
            background: rgba(68, 93, 133, 0.6);
            border-color: rgba(123, 199, 255, 0.55);
            color: #ffffff;
            transform: translateY(-1px);
        }

        .thread-header {
            display: flex;
            flex-direction: column;
            gap: 18px;
        }

        .thread-title-block {
            display: flex;
            flex-direction: column;
            gap: 8px;
        }

        .thread-title-meta {
            display: flex;
            align-items: center;
            gap: 10px;
            flex-wrap: wrap;
        }

        .thread-category-pill {
            display: inline-flex;
            align-items: center;
            gap: 6px;
            padding: 4px 12px;
            border-radius: 999px;
            background: rgba(79, 172, 254, 0.18);
            border: 1px solid rgba(79, 172, 254, 0.42);
            color: #cfe7ff;
            font-size: 11px;
            font-weight: 700;
            letter-spacing: 0.05em;
            text-transform: uppercase;
        }

        .thread-title {
            margin: 0;
            font-size: clamp(1.75rem, 2.4vw, 2.4rem);
            line-height: 1.25;
            font-weight: 700;
            color: #f8fbff;
        }

        .thread-subtitle {
            margin: 0;
            font-size: 0.98rem;
            color: #a8b5d6;
            max-width: 720px;
            line-height: 1.65;
        }

                .thread-meta-row {
                    display: flex;
                    align-items: center;
                    justify-content: space-between;
                    gap: 24px;
                    flex-wrap: wrap;
                }

        .thread-author-card {
            display: flex;
            align-items: center;
            gap: 14px;
        }

        .thread-author-avatar {
            width: 48px;
            height: 48px;
            border-radius: 50%;
            display: flex;
            align-items: center;
            justify-content: center;
            overflow: hidden;
            flex-shrink: 0;
            position: relative;
            background: linear-gradient(140deg, rgba(26, 40, 70, 0.95), rgba(14, 22, 38, 0.95));
            box-shadow: 0 18px 28px rgba(5, 10, 20, 0.55);
        }

        .thread-author-avatar::before {
            content: "";
            position: absolute;
            inset: -2px;
            border-radius: 50%;
            background: linear-gradient(135deg, rgba(96, 165, 250, 0.75), rgba(147, 51, 234, 0.65));
            z-index: 1;
        }

        .thread-author-avatar::after {
            content: "";
            position: absolute;
            inset: 2px;
            border-radius: 50%;
            background: linear-gradient(145deg, rgba(15, 23, 42, 0.95), rgba(10, 15, 26, 0.98));
            z-index: 0;
        }

        .thread-author-avatar img {
            width: 100%;
            height: 100%;
            object-fit: cover;
            border-radius: 50%;
            position: relative;
            z-index: 2;
        }

        .thread-author-avatar i {
            color: #8fb7ff;
            font-size: 18px;
        }

        .thread-author-avatar .thread-author-initial {
            display: inline-flex;
            align-items: center;
            justify-content: center;
            width: 100%;
            height: 100%;
            font-size: 18px;
            font-weight: 700;
            color: #dbeafe;
            position: relative;
            z-index: 2;
        }

        .thread-author-details {
            display: flex;
            flex-direction: column;
            gap: 4px;
        }

        .thread-author-name {
            display: block;
            font-weight: 600;
            color: #f2f5ff;
            font-size: 15px;
        }

        .thread-author-meta {
            display: flex;
            gap: 8px;
            flex-wrap: wrap;
            color: #a5b3cc;
            font-size: 12px;
        }

        .meta-separator {
            opacity: 0.45;
        }

        .thread-meta-stats {
            display: flex;
            align-items: center;
            gap: 20px;
            flex-wrap: wrap;
        }

        .thread-meta-stat {
            display: flex;
            flex-direction: column;
            align-items: flex-start;
            gap: 2px;
        }

        .stat-label {
            font-size: 11px;
            font-weight: 600;
            text-transform: uppercase;
            letter-spacing: 0.05em;
            color: rgba(183, 195, 218, 0.75);
        }

        .stat-value {
            font-size: 1.25rem;
            font-weight: 700;
            color: #f8fbff;
        }


        .thread-hero-notices {
            display: flex;
            flex-direction: column;
            gap: 10px;
        }

        .thread-hero-notice {
            display: flex;
            align-items: center;
            gap: 12px;
            padding: 10px 14px;
            border-radius: 10px;
            border: 1px solid rgba(86, 112, 152, 0.45);
            background: rgba(28, 38, 58, 0.88);
            color: #e3e8ff;
            font-size: 13px;
            box-shadow: 0 8px 18px rgba(8, 15, 32, 0.35);

        }


        .friends-modal {
            max-width: 620px;
            background:
                radial-gradient(120% 120% at 50% 0%, rgba(66, 137, 255, 0.18) 0%, rgba(26, 32, 46, 0) 55%),
                linear-gradient(145deg, rgba(12, 18, 30, 0.94), rgba(10, 15, 24, 0.96));
            border: 1px solid rgba(88, 123, 188, 0.45);
            box-shadow: 0 32px 60px rgba(4, 9, 20, 0.55);
            border-radius: 18px;
            backdrop-filter: blur(18px);
        }

        .friends-modal-body {
            display: grid;
            gap: 1.5rem;
            grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
            max-height: 440px;
            overflow-y: auto;
            padding: 1.25rem 1rem 1.5rem;
        }

        .friends-section {
            position: relative;
            display: flex;
            flex-direction: column;
            gap: 0.85rem;
            padding: 1.15rem;
            border-radius: 16px;
            background:
                linear-gradient(135deg, rgba(21, 32, 48, 0.92), rgba(13, 20, 32, 0.92));
            border: 1px solid rgba(78, 115, 166, 0.35);
            box-shadow: 0 18px 35px rgba(7, 13, 26, 0.45);
        }

        .friends-section::after {
            content: "";
            position: absolute;
            inset: 0;
            border-radius: inherit;
            pointer-events: none;
            background: linear-gradient(135deg, rgba(81, 145, 255, 0.16), rgba(124, 58, 237, 0.08));
            opacity: 0.55;
            mix-blend-mode: screen;
        }

        .friends-section > * {
            position: relative;
            z-index: 1;
        }

        .friends-section.find-friends-section {
            grid-column: 1 / -1;
            padding-bottom: 1.4rem;
        }

        @media (max-width: 680px) {
            .friends-modal-body {
                grid-template-columns: 1fr;
                padding: 1.1rem 0.85rem 1.35rem;
            }

            .friends-section {
                padding: 1rem;
            }
        }

        .friends-section-header {
            display: flex;
            align-items: center;
            justify-content: space-between;
            margin-bottom: 0.5rem;
        }

        .friends-section-header h4 {
            margin: 0;
            font-size: 1.05rem;
            font-weight: 700;
            letter-spacing: 0.01em;
            color: #f0f4ff;
            display: inline-flex;
            align-items: center;
            gap: 0.45rem;
        }

        .friends-section-header h4::before {
            font-family: "Font Awesome 6 Free";
            font-weight: 900;
            font-size: 0.95rem;
            opacity: 0.92;
            color: #8fb7ff;
            filter: drop-shadow(0 0 6px rgba(126, 187, 255, 0.35));
        }

        .friends-section[data-section="search"] .friends-section-header h4::before {
            content: "\f002";
        }

        .friends-section[data-section="friends"] .friends-section-header h4::before {
            content: "\f500";
            color: #9be7c4;
        }

        .friends-section[data-section="incoming"] .friends-section-header h4::before {
            content: "\f0e0";
            color: #fcd48d;
        }

        .friends-section[data-section="outgoing"] .friends-section-header h4::before {
            content: "\f1d8";
            color: #d0b4ff;
        }

        .friends-count {
            background: linear-gradient(135deg, rgba(59, 130, 246, 0.3), rgba(124, 58, 237, 0.3));
            color: #c7dcff;
            font-size: 0.72rem;
            padding: 0.2rem 0.65rem;
            border-radius: 999px;
            font-weight: 700;
            box-shadow: 0 6px 16px rgba(64, 99, 184, 0.25);
        }

        .friends-list {
            background: rgba(10, 16, 26, 0.65);
            border: 1px solid rgba(58, 92, 146, 0.32);
            border-radius: 14px;
            padding: 0.9rem;
            display: flex;
            flex-direction: column;
            gap: 0.75rem;
            backdrop-filter: blur(14px);
        }

        .friends-list.empty-state {
            color: #9bb4d9;
            font-size: 0.85rem;
            text-align: center;
            padding: 0.75rem 0.25rem;
        }

        .friends-list .friend-item {
            display: flex;
            align-items: flex-start;
            justify-content: space-between;
            gap: 0.9rem;
            background: linear-gradient(135deg, rgba(12, 22, 38, 0.9), rgba(19, 29, 48, 0.9));
            border: 1px solid rgba(74, 110, 173, 0.35);
            border-radius: 12px;
            padding: 0.75rem 0.85rem;
            box-shadow: inset 0 0 0 1px rgba(52, 86, 150, 0.18);
            transition: transform 0.18s ease, box-shadow 0.18s ease, border-color 0.18s ease;
        }

        .friends-list .friend-item:hover {
            transform: translateY(-1px);
            border-color: rgba(96, 165, 250, 0.55);
            box-shadow: 0 16px 26px rgba(7, 16, 34, 0.55), inset 0 0 0 1px rgba(96, 165, 250, 0.3);
        }

        .friend-info {
            display: flex;
            align-items: center;
            gap: 0.6rem;
        }

        .friend-avatar {
            position: relative;
            width: 44px;
            height: 44px;
            border-radius: 50%;
            background: linear-gradient(145deg, rgba(41, 72, 128, 0.9), rgba(24, 35, 58, 0.95));
            display: flex;
            align-items: center;
            justify-content: center;
            overflow: hidden;
            color: #9ec5ff;
            box-shadow: 0 10px 18px rgba(11, 18, 31, 0.55);
        }

        .friend-avatar::before {
            content: "";
            position: absolute;
            inset: 0;
            border-radius: 50%;
            border: 1px solid rgba(113, 179, 255, 0.35);
            box-shadow: inset 0 0 14px rgba(148, 205, 255, 0.25);
            pointer-events: none;
            z-index: 1;
        }

        .friend-avatar::after {
            content: "";
            position: absolute;
            inset: 2px;
            border-radius: 50%;
            background: linear-gradient(140deg, rgba(15, 22, 35, 0.92), rgba(9, 14, 24, 0.96));
            z-index: 0;
        }

        .friend-avatar img {
            width: 100%;
            height: 100%;
            object-fit: cover;
            border-radius: 50%;
            position: relative;
            z-index: 2;
        }

        .friend-avatar i {
            position: relative;
            z-index: 2;
        }

        .friend-details {
            display: flex;
            flex-direction: column;
            min-width: 0;
            gap: 0.15rem;
        }

        .friend-details span {
            color: #95a9c6;
            font-size: 0.76rem;
        }

        .friend-name {
            margin: 0;
            font-size: 0.98rem;
            font-weight: 600;
            text-align: left;
            color: #d3e5ff;
        }

        .friend-actions {
            display: flex;
            flex-wrap: wrap;
            gap: 0.45rem;
            justify-content: flex-end;
            align-items: center;
        }

        .friend-actions .btn {
            padding: 0.35rem 0.75rem;
            font-size: 0.75rem;
        }

        .find-friends-section {
            margin-bottom: 1.25rem;
        }

        .find-friends-controls {
            display: flex;
            align-items: center;
            gap: 0.55rem;
            margin-bottom: 0.75rem;
            background: rgba(9, 14, 22, 0.65);
            border: 1px solid rgba(63, 99, 156, 0.35);
            border-radius: 12px;
            padding: 0.5rem 0.65rem 0.5rem 0.55rem;
            box-shadow: inset 0 0 0 1px rgba(45, 70, 118, 0.18);
        }

        #findFriendsInput {
            flex: 1;
            background: rgba(4, 9, 18, 0.9);
            border: 1px solid rgba(84, 122, 190, 0.32);
            color: #f0f4ff;
            border-radius: 10px;
            padding: 0.5rem 0.75rem;
            transition: border-color 0.2s ease, box-shadow 0.2s ease, background-color 0.2s ease;
        }

        #findFriendsInput:focus {
            outline: none;
            border-color: rgba(96, 165, 250, 0.75);
            box-shadow: 0 0 0 2px rgba(96, 165, 250, 0.25);
            background: rgba(8, 14, 26, 0.95);
        }

        #findFriendsButton {
            min-width: 118px;
            border-radius: 10px;
            font-weight: 600;
            box-shadow: 0 12px 24px rgba(59, 130, 246, 0.25);
            transition: transform 0.18s ease, box-shadow 0.2s ease;
        }

        #findFriendsButton:hover {
            transform: translateY(-1px);
            box-shadow: 0 18px 32px rgba(59, 130, 246, 0.35);
        }

        #findFriendsButton.loading {
            opacity: 0.75;
            cursor: wait;
        }

        .find-friends-status {
            font-size: 0.78rem;
            margin-bottom: 0.2rem;
            min-height: 1rem;
            display: none;
            padding: 0.4rem 0.65rem;
            border-radius: 10px;
            background: rgba(10, 16, 26, 0.6);
            border: 1px solid transparent;
        }

        .find-friends-status.status-muted,
        .find-friends-status.status-info,
        .find-friends-status.status-success,
        .find-friends-status.status-error,
        .find-friends-status.status-warning {
            display: block;
        }

        .find-friends-status.status-muted {
            color: #9db0c9;
            border-color: rgba(148, 163, 184, 0.28);
        }

        .find-friends-status.status-info {
            color: #8cc4ff;
            border-color: rgba(96, 165, 250, 0.35);
        }

        .find-friends-status.status-success {
            color: #6be4b8;
            border-color: rgba(16, 185, 129, 0.35);
        }

        .find-friends-status.status-error {
            color: #fda4af;
            border-color: rgba(248, 113, 113, 0.4);
        }

        .find-friends-status.status-warning {
            color: #fcd48d;
            border-color: rgba(245, 158, 11, 0.35);
        }

        .friend-item-search {
            background: linear-gradient(135deg, rgba(37, 70, 128, 0.65), rgba(21, 36, 66, 0.9));
            border-color: rgba(96, 165, 250, 0.45);
            box-shadow: 0 14px 28px rgba(20, 36, 70, 0.45);
        }

        .friend-info[data-open-profile] {
            cursor: pointer;
            transition: color 0.2s ease;
        }

        .friend-info[data-open-profile]:hover .friend-name {
            color: #c4d9ff;
        }

        .friend-status-badge {
            display: inline-flex;
            align-items: center;
            font-size: 0.7rem;
            font-weight: 600;
            text-transform: uppercase;
            letter-spacing: 0.03em;
            padding: 0.15rem 0.45rem;
            border-radius: 999px;
            margin-top: 0.25rem;
            background: linear-gradient(135deg, rgba(96, 165, 250, 0.28), rgba(147, 51, 234, 0.25));
            color: #d7e7ff;
            width: fit-content;
        }

        .friend-status-badge.friend-status-friends {
            background: linear-gradient(135deg, rgba(16, 185, 129, 0.28), rgba(59, 130, 246, 0.2));
            color: #c8f3df;
        }

        .friend-status-badge.friend-status-request_received {
            background: linear-gradient(135deg, rgba(249, 115, 22, 0.25), rgba(217, 70, 239, 0.2));
            color: #fde7c5;
        }

        .friend-status-badge.friend-status-request_sent,
        .friend-status-badge.friend-status-friends_pending {
            background: linear-gradient(135deg, rgba(96, 165, 250, 0.3), rgba(59, 130, 246, 0.18));
            color: #d7e8ff;
        }

        .friend-status-badge.friend-status-self {
            background: linear-gradient(135deg, rgba(148, 163, 184, 0.22), rgba(59, 130, 246, 0.12));
            color: #e5edff;
        }

        .friend-status-badge.friend-status-none {
            background: linear-gradient(135deg, rgba(71, 85, 105, 0.2), rgba(30, 41, 59, 0.45));
            color: #a8b1c3;
        }

        .friend-status-note {
            font-size: 0.75rem;
            color: #b1bed4;
            align-self: center;
        }

        .friend-meta {
            display: flex;
            flex-wrap: wrap;
            gap: 0.35rem;
            margin-top: 0.25rem;
            color: #b3c5e1;
            font-size: 0.72rem;
        }

        .friend-meta-separator {
            color: rgba(148, 163, 184, 0.45);
        }

        .profile-trigger[data-open-profile] {
            cursor: pointer;
        }

        .post-author.profile-trigger {
            background: transparent;
            border: none;
            padding: 0;
            display: flex;
            align-items: center;
            gap: 0.6rem;
            color: inherit;
            text-align: left;
        }

        .post-author.profile-trigger:focus-visible {
            outline: 2px solid rgba(59, 130, 246, 0.75);
            outline-offset: 2px;
        }

        .post-author.profile-trigger::-moz-focus-inner {
            border: 0;
        }

        .post-author.profile-trigger .post-avatar,
        .post-author.profile-trigger .post-author-info {
            pointer-events: none;
        }

        .thread-author-card[data-open-profile] {
            cursor: pointer;
            transition: transform 0.15s ease, box-shadow 0.15s ease;
        }

        .thread-author-card[data-open-profile]:hover {
            transform: translateY(-1px);
            box-shadow: 0 6px 18px rgba(59, 130, 246, 0.18);
        }

        .thread-author-card[data-open-profile]:focus-visible {
            outline: 2px solid rgba(59, 130, 246, 0.6);
            outline-offset: 3px;
        }

        .thread-author-link {
            color: #93b4e6;
            text-decoration: none;
        }

        .thread-author-link:hover {
            color: #c4d9ff;
        }

        .latest-post-author[data-open-profile] {
            color: #8fb5ff;
        }

        .latest-post-author[data-open-profile]:hover {
            color: #d1e4ff;
        }

        .member-profile-modal {
            max-width: 520px;
            background:
                radial-gradient(140% 140% at 50% 0%, rgba(82, 159, 255, 0.16) 0%, rgba(21, 27, 41, 0) 60%),
                linear-gradient(150deg, rgba(13, 20, 33, 0.96), rgba(6, 11, 20, 0.98));
            border: 1px solid rgba(86, 125, 190, 0.45);
            border-radius: 20px;
            box-shadow: 0 34px 65px rgba(6, 12, 26, 0.6);
            backdrop-filter: blur(22px);
        }

        .member-profile-body {
            display: flex;
            flex-direction: column;
            gap: 1.4rem;
            padding: 1.35rem 1.35rem 1.65rem;
        }

        .member-profile-hero {
            position: relative;
            display: flex;
            align-items: center;
            gap: 1.2rem;
            padding: 1.15rem 1.25rem;
            border-radius: 18px;
            overflow: hidden;
            background:
                linear-gradient(135deg, rgba(25, 34, 55, 0.95), rgba(15, 23, 40, 0.9));
            border: 1px solid rgba(78, 115, 168, 0.4);
            box-shadow: inset 0 0 0 1px rgba(49, 75, 124, 0.2), 0 20px 34px rgba(7, 12, 24, 0.5);
            isolation: isolate;
        }

        .member-profile-hero::after {
            content: "";
            position: absolute;
            inset: 0;
            pointer-events: none;
            background: radial-gradient(120% 120% at 20% 10%, rgba(129, 199, 255, 0.18), transparent 60%);
            mix-blend-mode: screen;
            z-index: 0;
        }

        .member-profile-avatar {
            position: relative;
            width: 72px;
            height: 72px;
            border-radius: 50%;
            background: linear-gradient(140deg, rgba(41, 71, 120, 0.95), rgba(26, 40, 68, 0.95));
            display: flex;
            align-items: center;
            justify-content: center;
            overflow: hidden;
            color: #a5caff;
            font-size: 1.85rem;
            box-shadow: 0 20px 36px rgba(6, 13, 26, 0.55);
            z-index: 1;
        }

        .member-profile-avatar::before {
            content: "";
            position: absolute;
            inset: 0;
            border-radius: 50%;
            border: 1px solid rgba(132, 184, 255, 0.4);
            box-shadow: inset 0 0 18px rgba(128, 187, 255, 0.24);
            pointer-events: none;
        }

        .member-profile-avatar img {
            width: 100%;
            height: 100%;
            object-fit: cover;
            border-radius: 50%;
        }

        .member-profile-details {
            position: relative;
            z-index: 1;
            display: flex;
            flex-direction: column;
            gap: 0.2rem;
        }

        .member-profile-details h4 {
            margin: 0;
            color: #f2f6ff;
            font-size: 1.18rem;
            font-weight: 700;
        }

        .member-profile-details p {
            margin: 2px 0;
            color: #a7b8d6;
            font-size: 0.85rem;
        }

        .member-role {
            color: #9dc6ff;
            font-weight: 600;
            letter-spacing: 0.04em;
            text-transform: uppercase;
        }

        .member-profile-stats {
            display: grid;
            grid-template-columns: repeat(2, minmax(0, 1fr));
            gap: 1rem;
            position: relative;
        }

        .member-profile-stats > div {
            display: grid;
            grid-template-columns: 44px 1fr;
            grid-template-rows: auto auto;
            column-gap: 0.85rem;
            row-gap: 0.3rem;
            align-items: center;
            padding: 0.95rem 1.05rem;
            border-radius: 14px;
            background: linear-gradient(140deg, rgba(17, 25, 40, 0.92), rgba(11, 17, 32, 0.92));
            border: 1px solid rgba(72, 108, 166, 0.32);
            box-shadow: 0 16px 26px rgba(7, 12, 24, 0.45);
            position: relative;
            overflow: hidden;
        }

        .member-profile-stats > div::before {
            content: "";
            grid-column: 1;
            grid-row: 1 / span 2;
            position: relative;
            width: 38px;
            height: 38px;
            border-radius: 12px;
            display: grid;
            place-items: center;
            background: linear-gradient(135deg, rgba(96, 165, 250, 0.32), rgba(124, 58, 237, 0.24));
            border: 1px solid rgba(81, 125, 196, 0.35);
            color: #d7e8ff;
            font-family: "Font Awesome 6 Free";
            font-weight: 900;
            font-size: 0.95rem;
            box-shadow: 0 10px 18px rgba(11, 20, 38, 0.45);
            justify-self: center;
        }

        .member-profile-stats .label {
            grid-column: 2;
            align-self: end;
        }

        .member-profile-stats span:last-child {
            grid-column: 2;
            align-self: start;
        }

        @media (max-width: 540px) {
            .member-profile-stats {
                grid-template-columns: 1fr;
            }

            .member-profile-stats > div {
                grid-template-columns: 42px 1fr;
            }
        }

        .member-profile-stats > div:nth-child(1)::before {
            content: "\f133";
        }

        .member-profile-stats > div:nth-child(2)::before {
            content: "\f044";
        }

        .member-profile-stats > div:nth-child(3)::before {
            content: "\f500";
        }

        .member-profile-stats > div:nth-child(4)::before {
            content: "\f2b5";
        }

        .member-profile-stats .label {
            display: block;
            font-size: 0.75rem;
            color: #8fa2c2;
            text-transform: uppercase;
            letter-spacing: 0.05em;
        }

        .member-profile-stats span:last-child {
            display: block;
            color: #f2f6ff;
            font-weight: 700;
            font-size: 1.1rem;
            margin-top: 0.12rem;
        }

        .member-profile-actions {
            display: grid;
            grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
            gap: 0.6rem;
        }

        .member-profile-actions .btn {
            font-size: 0.82rem;
            padding: 0.5rem 0.9rem;
            border-radius: 12px;
            box-shadow: 0 12px 24px rgba(28, 47, 86, 0.35);
            transition: transform 0.18s ease, box-shadow 0.2s ease;
        }

        .member-profile-actions .btn:hover {
            transform: translateY(-1px);
            box-shadow: 0 16px 32px rgba(35, 57, 103, 0.42);
        }

        .member-mutual-friends h4 {
            margin: 0 0 0.65rem 0;
            color: #f0f4ff;
            font-size: 0.98rem;
            font-weight: 600;
        }
        .thread-hero-notice i {
            font-size: 15px;
            color: inherit;
        }

        .thread-hero-notice-body {
            display: flex;
            flex-direction: column;
            gap: 2px;
        }

        .thread-hero-notice-body strong {
            font-size: 13px;
            font-weight: 600;
            color: inherit;
        }

        .thread-hero-notice-body span {
            font-size: 12px;
            color: #a8b7d8;
        }

        .thread-hero-notice--locked {
            background: rgba(70, 21, 34, 0.82);
            border-color: rgba(248, 113, 113, 0.4);
            color: #fda4af;
        }

        .thread-hero-notice--pinned {
            background: rgba(25, 63, 45, 0.82);
            border-color: rgba(74, 222, 128, 0.35);
            color: #86efac;
        }

        .thread-status-indicators {
            display: inline-flex;
            gap: 6px;
            align-items: center;
        }

        .status-indicator {
            display: inline-flex;
            align-items: center;
            gap: 6px;
            padding: 4px 10px;
            border-radius: 999px;
            font-size: 10px;
            font-weight: 700;
            letter-spacing: 0.06em;
            text-transform: uppercase;
            border: 1px solid rgba(91, 167, 255, 0.35);
            background: rgba(34, 45, 70, 0.75);
            color: #dbeafe;
        }

        .status-indicator.locked {
            background: rgba(112, 26, 45, 0.8);
            border-color: rgba(248, 113, 113, 0.45);
            color: #fecdd3;
        }

        .status-indicator.pinned {
            background: rgba(34, 81, 57, 0.8);
            border-color: rgba(74, 222, 128, 0.35);
            color: #bbf7d0;
        }

        .thread-hero.thread-hero--locked {
            border-color: #fecaca;
            box-shadow: 0 8px 18px rgba(248, 113, 113, 0.25);
        }

        .thread-hero.thread-hero--pinned {
            border-color: #bbf7d0;
            box-shadow: 0 8px 18px rgba(52, 211, 153, 0.2);
        }
        
        /* Thread Posts */
        .thread-posts {
            display: flex;
            flex-direction: column;
            gap: 14px;
        }
        
        .thread-post {
            background: rgba(16, 23, 38, 0.96);
            border: 1px solid rgba(52, 72, 109, 0.5);
            border-radius: 12px;
            overflow: hidden;
            box-shadow: 0 14px 32px rgba(4, 10, 24, 0.45);
            transition: transform 0.2s ease, box-shadow 0.2s ease;
        }

        .thread-post.post-highlight {
            box-shadow: 0 0 0 2px rgba(96, 165, 250, 0.5), 0 18px 36px rgba(14, 25, 45, 0.6);
            background: rgba(30, 41, 59, 0.95);
        }
        
        .thread-post:hover {
            transform: translateY(-2px);
            box-shadow: 0 18px 36px rgba(6, 14, 32, 0.55);
        }
        
        .thread-post.original-post {
            border-color: rgba(129, 140, 248, 0.55);
            box-shadow: 0 0 0 1px rgba(129, 140, 248, 0.3), 0 18px 36px rgba(8, 15, 32, 0.5);
        }
        
        .post-header {
            display: flex;
            align-items: center;
            justify-content: space-between;
            padding: 18px 22px;
            background: rgba(27, 36, 55, 0.92);
            border-bottom: 1px solid rgba(58, 80, 120, 0.45);
        }
        
        .post-tool {
            background: rgba(38, 52, 78, 0.55);
            border: 1px solid rgba(97, 120, 162, 0.38);
            color: #e5ecff;
            padding: 6px 12px;
            border-radius: 6px;
            cursor: pointer;
            transition: all 0.2s ease;
        }

        .post-tool:hover {
            background: rgba(68, 88, 124, 0.7);
            border-color: rgba(147, 178, 232, 0.6);
            color: #ffffff;
        }

        .post-avatar {
            width: 42px;
            height: 42px;
            border-radius: 50%;
            overflow: hidden;
            display: flex;
            align-items: center;
            justify-content: center;
            position: relative;
            background: linear-gradient(140deg, rgba(24, 37, 63, 0.95), rgba(14, 22, 39, 0.95));
            box-shadow: 0 14px 24px rgba(5, 10, 20, 0.5);
        }

        .post-avatar::before {
            content: "";
            position: absolute;
            inset: -2px;
            border-radius: 50%;
            background: linear-gradient(135deg, rgba(96, 165, 250, 0.7), rgba(236, 72, 153, 0.6));
            z-index: 1;
        }

        .post-avatar::after {
            content: "";
            position: absolute;
            inset: 2px;
            border-radius: 50%;
            background: linear-gradient(145deg, rgba(15, 23, 42, 0.95), rgba(10, 15, 26, 0.98));
            z-index: 0;
        }

        .post-avatar img {
            width: 100%;
            height: 100%;
            object-fit: cover;
            border-radius: 50%;
            position: relative;
            z-index: 2;
        }

        .post-avatar i {
            color: #9cc7ff;
            font-size: 16px;
            position: relative;
            z-index: 2;
        }

        .post-author-info h4 {
            color: #f2f5ff;
            font-size: 15px;
            font-weight: 600;
            margin: 0;
        }

        .post-author-role {
            font-size: 11px;
            text-transform: uppercase;
            font-weight: 600;
            letter-spacing: 0.05em;
            margin-top: 2px;
            color: #9fb2d6;
        }

        .rich-text-content {
            color: #e7ecff;
            line-height: 1.8;
            word-break: break-word;
        }

        .rich-text-fragment {
            display: inline;
            font-size: inherit;
        }

        .rich-text-link {
            color: #7dd3fc;
            text-decoration: underline;
            word-break: break-word;
            transition: color 0.2s ease;
        }

        .rich-text-link:hover {
            color: #38bdf8;
        }

        .rich-text-underline {
            text-decoration: underline;
            text-decoration-thickness: 2px;
            text-decoration-color: rgba(148, 182, 224, 0.6);
        }

        .rich-text-media {
            margin: 12px 0;
            border-radius: 12px;
            overflow: hidden;
            background: rgba(15, 23, 42, 0.85);
            border: 1px solid rgba(91, 120, 166, 0.4);
        }

        .rich-text-media img {
            width: 100%;
            max-height: 420px;
            object-fit: contain;
            display: block;
            background: #0f172a;
        }

        .rich-quote {
            margin: 16px 0;
            padding: 14px 16px;
            border-left: 3px solid rgba(96, 165, 250, 0.7);
            background: rgba(30, 58, 138, 0.22);
            border-radius: 6px;
        }

        .rich-quote-header {
            display: flex;
            flex-wrap: wrap;
            gap: 8px;
            align-items: center;
            margin-bottom: 8px;
            color: #bfdbfe;
            font-size: 12px;
            text-transform: uppercase;
            letter-spacing: 0.05em;
        }

        .rich-quote-author {
            font-weight: 600;
        }

        .rich-quote-time {
            font-size: 11px;
            color: #dbeafe;
        }

        .rich-quote-link {
            cursor: pointer;
            color: #93c5fd;
            text-decoration: underline dotted;
        }

        .rich-quote-link:hover {
            color: #bfdbfe;
        }

        .rich-quote-separator {
            color: rgba(191, 219, 254, 0.6);
        }

        .rich-quote-body {
            color: #e2e8f0;
            line-height: 1.7;
            font-size: 0.95rem;
        }

        .post-meta {
            display: flex;
            align-items: center;
            gap: 16px;
            color: #a6b4d2;
            font-size: 12px;
        }

        .post-number {
            background: rgba(99, 102, 241, 0.25);
            color: #e0e7ff;
            padding: 2px 8px;
            border-radius: 999px;
            font-weight: 600;
        }

        .quick-reply-form {
            background: rgba(18, 26, 42, 0.95);
            border: 1px solid rgba(52, 72, 109, 0.5);
            border-radius: 12px;
            padding: 22px;
            margin-top: 18px;
            box-shadow: 0 14px 32px rgba(4, 10, 24, 0.45);
        }

        .quick-reply-form h4 {
            color: #f2f5ff;
            font-size: 16px;
            font-weight: 600;
            margin: 0 0 16px 0;
        }

        .reply-form textarea {
            width: 100%;
            min-height: 130px;
            background: rgba(13, 19, 32, 0.96);
            border: 1px solid rgba(58, 80, 120, 0.45);
            border-radius: 10px;
            padding: 14px;
            color: #e7ecff;
            font-size: 14px;
            line-height: 1.7;
            resize: vertical;
            font-family: inherit;
        }

        .reply-form textarea:focus {
            outline: none;
            border-color: rgba(99, 102, 241, 0.55);
            box-shadow: 0 0 0 2px rgba(99, 102, 241, 0.25);
        }

        .reply-actions {
            display: flex;
            justify-content: flex-end;
            gap: 12px;
            margin-top: 14px;
        }

        .rich-text-size-xs {
            font-size: 0.8rem;
        }

        .rich-text-size-sm {
            font-size: 0.95rem;
        }

        .rich-text-size-md {
            font-size: 1rem;
        }

        .rich-text-size-lg {
            font-size: 1.2rem;
        }

        .rich-text-size-xl {
            font-size: 1.4rem;
        }

        .rich-text-size-2xl {
            font-size: 1.7rem;
        }

        .post-content p {
            margin: 0 0 16px 0;
        }

        .post-content p:last-child {
            margin-bottom: 0;
        }
        
        .post-actions {
            padding: 14px 22px;
            background: rgba(23, 32, 50, 0.92);
            border-top: 1px solid rgba(58, 80, 120, 0.4);
            display: flex;
            justify-content: space-between;
            align-items: center;
        }

        .reply-item {
            border-bottom: 1px solid rgba(58, 80, 120, 0.35);
            padding: 16px 0;
        }

        .reply-item:last-child {
            border-bottom: none;
        }

        .reply-header {
            display: flex;
            justify-content: space-between;
            align-items: flex-start;
            gap: 12px;
            margin-bottom: 10px;
        }

        .reply-author {
            display: flex;
            flex-wrap: wrap;
            align-items: center;
            gap: 8px;
        }

        .reply-author-name {
            color: #f2f5ff;
            font-weight: 600;
            font-size: 14px;
        }

        .reply-timestamp {
            color: #96a3c2;
            font-size: 12px;
        }

        .reply-content {
            font-size: 14px;
            color: #dfe6ff;
            line-height: 1.7;
        }

        .reply-content .rich-text-media {
            margin-top: 14px;
        }

        /* Rich text composer */
        .rich-composer {
            background: linear-gradient(160deg, rgba(13, 19, 33, 0.95), rgba(9, 14, 26, 0.95));
            border: 1px solid rgba(45, 63, 94, 0.6);
            border-radius: 12px;
            overflow: visible;
            margin-bottom: 12px;
            box-shadow: 0 16px 32px rgba(5, 10, 24, 0.45);
            position: relative;
        }

        .rich-composer-toolbar {
            display: flex;
            flex-wrap: wrap;
            align-items: center;
            gap: 8px;
            padding: 11px 14px;
            background: rgba(18, 27, 44, 0.9);
            border-bottom: 1px solid rgba(58, 80, 120, 0.5);
            position: relative;
        }

        .composer-control {
            position: relative;
            display: flex;
            align-items: center;
        }

        .composer-btn {
            width: 34px;
            height: 34px;
            border-radius: 8px;
            border: 1px solid rgba(91, 120, 166, 0.32);
            background: rgba(42, 58, 88, 0.6);
            color: #e2ecff;
            cursor: pointer;
            display: flex;
            align-items: center;
            justify-content: center;
            transition: background 0.2s ease, transform 0.2s ease, border-color 0.2s ease;
        }

        .composer-btn:hover {
            background: rgba(68, 92, 132, 0.75);
            border-color: rgba(123, 164, 226, 0.6);
            color: #ffffff;
            transform: translateY(-1px);
        }

        .composer-btn i {
            font-size: 14px;
        }

        .composer-color-picker {
            appearance: none;
            width: 34px;
            height: 34px;
            border-radius: 8px;
            border: 1px solid rgba(91, 120, 166, 0.32);
            padding: 0;
            cursor: pointer;
            background: rgba(42, 58, 88, 0.6);
        }

        .composer-color-picker::-webkit-color-swatch,
        .composer-color-picker::-webkit-color-swatch-wrapper {
            border-radius: 8px;
            padding: 0;
            border: none;
        }

        .composer-color-picker::-moz-color-swatch {
            border-radius: 8px;
            border: none;
        }

        .rich-composer-textarea {
            background: rgba(9, 14, 24, 0.96);
            border: 1px solid rgba(58, 80, 120, 0.45);
            width: 100%;
            min-height: 140px;
            padding: 18px;
            color: #e7ecff;
            font-family: inherit;
            font-size: 14px;
            line-height: 1.65;
            resize: vertical;
            border-radius: 10px;
        }

        .rich-composer-textarea:focus {
            outline: none;
            box-shadow: 0 0 0 1px rgba(99, 102, 241, 0.4);
            border-color: rgba(99, 102, 241, 0.5);
        }

        .composer-panel {
            position: absolute;
            top: calc(100% + 10px);
            left: 0;
            background: #0f172a;
            border: 1px solid rgba(59, 130, 246, 0.2);
            border-radius: 12px;
            padding: 12px;
            box-shadow: 0 18px 40px rgba(8, 15, 32, 0.45);
            min-width: 240px;
            display: none;
            z-index: 50;
        }

        .composer-select {
            cursor: pointer;
            appearance: none;
            -webkit-appearance: none;
            -moz-appearance: none;
            position: relative;
            background: rgba(148, 163, 184, 0.14);
            border: 1px solid rgba(148, 163, 184, 0.22);
            border-radius: 8px;
            color: #e2e8f0;
            padding: 6px 10px;
        }

        .composer-select option {
            background: #0f172a;
            color: #e2e8f0;
        }
        .composer-panel::before {
            content: '';
            position: absolute;
            top: -8px;
            left: 16px;
            width: 14px;
            height: 14px;
            background: inherit;
            transform: rotate(45deg);
            border-left: inherit;
            border-top: inherit;
        }

        .composer-panel.open {
            display: block;
            animation: composerPanelFade 0.16s ease;
        }

        @keyframes composerPanelFade {
            from {
                opacity: 0;
                transform: translateY(-4px);
            }
            to {
                opacity: 1;
                transform: translateY(0);
            }
        }

        .composer-field-group {
            display: flex;
            flex-direction: column;
            gap: 6px;
            margin-bottom: 10px;
        }

        .composer-field-group label {
            font-size: 12px;
            color: #94a3b8;
            text-transform: uppercase;
            letter-spacing: 0.05em;
        }

        .composer-field-group input {
            background: rgba(30, 41, 59, 0.85);
            border: 1px solid rgba(59, 130, 246, 0.25);
            border-radius: 8px;
            padding: 8px 10px;
            color: #e2e8f0;
        }

        .composer-field-group input:focus {
            outline: none;
            border-color: rgba(59, 130, 246, 0.55);
            box-shadow: 0 0 0 1px rgba(59, 130, 246, 0.25);
        }

        .composer-panel .btn {
            width: 100%;
            margin-top: 6px;
        }

        .composer-panel-header {
            font-size: 12px;
            text-transform: uppercase;
            color: #94a3b8;
            letter-spacing: 0.06em;
            margin-bottom: 4px;
        }

        .composer-panel-description {
            font-size: 12px;
            color: #cbd5f5;
            margin-bottom: 12px;
        }

        .composer-emoji-panel {
            min-width: 220px;
            max-width: 260px;
        }

        .composer-size-panel {
            min-width: 220px;
        }

        .composer-size-grid {
            display: grid;
            grid-template-columns: repeat(2, minmax(0, 1fr));
            gap: 8px;
            margin-bottom: 10px;
        }

        .composer-size-btn {
            background: rgba(30, 41, 59, 0.85);
            border: 1px solid rgba(59, 130, 246, 0.25);
            border-radius: 10px;
            padding: 10px;
            color: #e2e8f0;
            display: flex;
            flex-direction: column;
            align-items: flex-start;
            gap: 4px;
            cursor: pointer;
            transition: border 0.2s ease, background 0.2s ease, transform 0.2s ease;
        }

        .composer-size-btn:hover {
            background: rgba(59, 130, 246, 0.15);
            border-color: rgba(59, 130, 246, 0.45);
            transform: translateY(-1px);
        }

        .composer-size-preview {
            font-weight: 600;
            display: block;
            line-height: 1.1;
        }

        .composer-size-label {
            font-size: 11px;
            letter-spacing: 0.03em;
            color: #94a3b8;
        }

        .composer-size-reset {
            width: 100%;
            padding: 10px;
            border-radius: 8px;
            border: 1px solid rgba(148, 163, 184, 0.35);
            background: rgba(15, 23, 42, 0.8);
            color: #e2e8f0;
            font-size: 12px;
            cursor: pointer;
            transition: border 0.2s ease, background 0.2s ease;
        }

        .composer-size-reset:hover {
            border-color: rgba(59, 130, 246, 0.45);
            background: rgba(59, 130, 246, 0.12);
        }

        .composer-emoji-search {
            width: 100%;
            border-radius: 8px;
            border: 1px solid rgba(148, 163, 184, 0.35);
            background: rgba(30, 41, 59, 0.85);
            padding: 8px;
            color: #e2e8f0;
            margin-bottom: 10px;
        }

        .composer-emoji-grid {
            display: grid;
            grid-template-columns: repeat(6, 1fr);
            gap: 6px;
        }

        .composer-emoji-btn {
            border: none;
            background: rgba(148, 163, 184, 0.15);
            border-radius: 6px;
            font-size: 18px;
            padding: 6px;
            cursor: pointer;
            transition: background 0.2s ease;
        }

        .composer-emoji-btn:hover {
            background: rgba(148, 163, 184, 0.3);
        }

        @media (max-width: 768px) {
            .rich-composer {
                border-radius: 10px;
            }

            .rich-composer-toolbar {
                gap: 6px;
            }

            .composer-panel {
                position: static;
                width: 100%;
                margin-top: 8px;
            }

            .composer-panel::before {
                display: none;
            }

            .composer-emoji-grid {
                grid-template-columns: repeat(5, 1fr);
            }
        }
        
        .post-reactions {
            display: flex;
            gap: 8px;
            align-items: center;
        }
        
        .reaction-btn {
            background: transparent;
            border: 1px solid #374151;
            color: #9ca3af;
            border-radius: 4px;
            padding: 4px 8px;
            font-size: 11px;
            cursor: pointer;
            transition: all 0.2s ease;
            display: flex;
            align-items: center;
            gap: 4px;
        }
        
        .reaction-btn:hover {
            background: #374151;
            color: #e1e5e9;
        }

        .reaction-btn.active {
            background: rgba(96, 165, 250, 0.12);
            border-color: rgba(96, 165, 250, 0.55);
            color: #bfdbfe;
        }

        .reaction-btn.loading {
            opacity: 0.6;
            cursor: progress;
            pointer-events: none;
        }

        .reaction-btn .like-count {
            font-weight: 600;
            min-width: 1.5em;
            text-align: center;
        }
        
        .post-tools {
            display: flex;
            gap: 6px;
        }
        
        .post-tool {
            background: transparent;
            border: 1px solid #374151;
            color: #9ca3af;
            border-radius: 3px;
            padding: 4px 6px;
            font-size: 11px;
            cursor: pointer;
            transition: all 0.2s ease;
        }
        
        /* Thread Navigation */
        .thread-view .forum-breadcrumb {
            display: flex;
            align-items: center;
            gap: 8px;
            color: #9ca3af;
            font-size: 13px;
        }
        
        .breadcrumb-sep {
            color: #6b7280;
        }
        
        /* Responsive Design for Thread View */
        @media (max-width: 1024px) {
            .thread-toolbar {
                flex-direction: column;
                align-items: flex-start;
                gap: 12px;
            }

            .thread-toolbar-actions {
                width: 100%;
                justify-content: flex-start;
            }

            .thread-meta-row {
                flex-direction: column;
                align-items: flex-start;
                gap: 18px;
            }

            .thread-meta-stats {
                width: 100%;
            }
        }

        @media (max-width: 768px) {
            .thread-hero {
                padding: 20px;
                gap: 16px;
            }

            .thread-back-button {
                width: 100%;
                justify-content: center;
            }

            .thread-toolbar-actions {
                flex-wrap: wrap;
            }

            .thread-title {
                font-size: clamp(1.5rem, 5vw, 2rem);
            }

            .thread-meta-stats {
                width: 100%;
                display: grid;
                grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
                gap: 16px;
            }

            .post-header {
                flex-direction: column;
                align-items: flex-start;
                gap: 12px;
                padding: 12px 16px;
            }

            .post-meta {
                flex-wrap: wrap;
                gap: 8px;
            }

            .post-content {
                padding: 16px;
                font-size: 14px;
            }

            .post-actions {
                flex-direction: column;
                align-items: flex-start;
                gap: 12px;
                padding: 12px 16px;
            }
        }

        @media (max-width: 540px) {
            .thread-toolbar-actions {
                width: 100%;
                flex-direction: column;
                align-items: stretch;
                gap: 8px;
            }

            .thread-reply-btn {
                width: 100%;
                text-align: center;
            }

            .thread-meta-stats {
                grid-template-columns: 1fr;
            }

            .thread-toolbar-actions .thread-moderation {
                flex-direction: column;
                align-items: stretch;
                width: 100%;
            }

            .moderation-group {
                width: 100%;
                justify-content: space-between;
                gap: 6px;
            }

            .moderation-group:not(:last-child) {
                border-right: none;
                margin-right: 0;
                padding-right: 0;
                border-bottom: 1px solid #e5e7ef;
                padding-bottom: 6px;
                margin-bottom: 6px;
            }
        }
        
        .moderation-btn {
            background: rgba(55, 65, 81, 0.8);
            border: 1px solid #4b5563;
            color: #9ca3af;
            border-radius: 3px;
            padding: 4px 6px;
            font-size: 11px;
            cursor: pointer;
            transition: all 0.2s ease;
        }
        
        .moderation-btn:hover {
            background: #374151;
            color: #e1e5e9;
        }
        
        .moderation-btn.delete:hover {
            background: #ef4444;
            border-color: #dc2626;
            color: white;
        }

        /* Enhanced Thread Moderation Controls */
        .thread-moderation {
            display: flex;
            gap: 10px;
            align-items: center;
            flex-wrap: wrap;
            background: #f8fafc;
            border: 1px solid #d8dde6;
            border-radius: 10px;
            padding: 10px 14px;
        }

        .moderation-group {
            display: flex;
            gap: 8px;
            align-items: center;
        }

        .moderation-group:not(:last-child) {
            border-right: 1px solid #e5e7ef;
            padding-right: 12px;
            margin-right: 8px;
        }

        .thread-action-btn {
            display: inline-flex;
            align-items: center;
            gap: 6px;
            padding: 6px 12px;
            background: #ffffff;
            border: 1px solid #d8dde6;
            border-radius: 8px;
            color: #1f2937;
            font-size: 12px;
            font-weight: 500;
            transition: all 0.2s ease;
            cursor: pointer;
        }

        .thread-action-btn:hover {
            background: #f9fafb;
            border-color: #c7d2fe;
            color: #111827;
            transform: translateY(-1px);
            box-shadow: 0 3px 8px rgba(15, 23, 42, 0.12);
        }

        .thread-action-btn.active {
            background: #e5edff;
            border-color: #6366f1;
            color: #1e293b;
            box-shadow: 0 0 0 1px rgba(99, 102, 241, 0.2);
        }

        .thread-action-btn .action-text {
            font-size: 12px;
            font-weight: 600;
            letter-spacing: 0.01em;
        }

        .thread-moderation .btn-warning {
            background: #fef3c7;
            border-color: #facc15;
            color: #92400e;
        }

        .thread-moderation .btn-warning:hover {
            background: #fde68a;
            border-color: #f59e0b;
            color: #78350f;
        }

        /* Dropdown Styles */
        .dropdown {
            position: relative;
            display: inline-block;
        }

        .dropdown-menu {
            position: absolute;
            top: 100%;
            right: 0;
            background: #ffffff;
            border: 1px solid #d8dde6;
            border-radius: 10px;
            box-shadow: 0 16px 35px rgba(15, 23, 42, 0.18);
            z-index: 1000;
            min-width: 200px;
            margin-top: 6px;
            padding: 6px 0;
        }

        .dropdown-item {
            display: flex;
            align-items: center;
            gap: 8px;
            width: 100%;
            padding: 10px 16px;
            background: none;
            border: none;
            color: #1f2937;
            font-size: 13px;
            cursor: pointer;
            transition: background-color 0.2s ease, color 0.2s ease;
        }

        .dropdown-item:hover {
            background: #f3f4f6;
            color: #111827;
        }

        .dropdown-item.danger {
            color: #dc2626;
        }

        .dropdown-item.danger:hover {
            background: #fee2e2;
            color: #b91c1c;
        }

        .dropdown-divider {
            border: none;
            border-top: 1px solid #e5e7ef;
            margin: 6px 0;
        }

        /* Thread Status Indicators */
        .thread-status-indicators {
            display: flex;
            gap: 6px;
            align-items: center;
            margin-left: 12px;
        }

        .status-indicator {
            display: flex;
            align-items: center;
            gap: 4px;
            padding: 4px 10px;
            border-radius: 999px;
            border: 1px solid transparent;
            font-size: 10px;
            font-weight: 600;
            text-transform: uppercase;
            letter-spacing: 0.08em;
        }

        .status-indicator.locked {
            background: #fee2e2;
            color: #b91c1c;
            border-color: #fecaca;
        }

        .status-indicator.pinned {
            background: #fef3c7;
            color: #b45309;
            border-color: #fde68a;
        }

        /* Responsive moderation controls */
        @media (max-width: 768px) {
            .thread-moderation {
                flex-direction: column;
                gap: 8px;
                align-items: stretch;
            }
            
            .moderation-group {
                justify-content: space-between;
            }
            
            .thread-action-btn {
                flex: 1;
                justify-content: center;
                min-width: 80px;
            }
            
            .thread-status-indicators {
                margin-left: 0;
                justify-content: center;
            }
        }
        
        /* Ensure sidebar is always visible */
        .forum-container.active .forum-sidebar {
            display: flex !important;
        }
        
        /* XenForo-style sidebar enhancements */
        .sidebar-widget {
            background: linear-gradient(145deg, #1a1f2e 0%, #1e2530 100%);
            border: 1px solid #2a3441;
            border-radius: 8px;
            padding: 16px;
            box-shadow: 0 4px 12px rgba(0,0,0,.15);
            transition: all 0.2s ease;
        }
        
        .sidebar-widget:hover {
            border-color: #3b4b5c;
            box-shadow: 0 6px 16px rgba(0,0,0,.2);
        }
        
        .sidebar-widget h4 {
            color: #60a5fa;
            font-size: 14px;
            font-weight: 600;
            margin: 0 0 12px 0;
            padding-bottom: 8px;
            border-bottom: 1px solid #2a3441;
            display: flex;
            align-items: center;
            gap: 8px;
        }
        
        .activity-item:hover {
            background: rgba(96, 165, 250, 0.05);
            border-radius: 4px;
            margin: 0 -4px;
            padding-left: 12px !important;
            padding-right: 8px !important;
        }

        /* Breadcrumb Navigation */
        .breadcrumb-nav {
            background: #1a1f2e;
            border: 1px solid #2a3441;
            border-radius: 6px;
            padding: 12px 16px;
            margin-bottom: 20px;
            font-size: 12px;
        }

        .breadcrumb-nav a {
            color: #4facfe;
            text-decoration: none;
        }

        .breadcrumb-nav a:hover {
            text-decoration: underline;
        }

        .breadcrumb-nav .breadcrumb-item.current {
            color: #e5e7eb;
            font-weight: 500;
        }

        .breadcrumb-sep {
            margin: 0 8px;
            color: #6b7280;
        }

        .forum-header-section {
            display: grid;
          /*  grid-template-columns: 1fr auto;*/
            gap: 20px;
            align-items: center;
            margin-bottom: 20px;
        }

    /* Main forum layout with sidebar */
        .forum-main-layout {
            display: grid !important;
            grid-template-columns: minmax(0, 1fr) clamp(260px, 28vw, 320px);
            grid-template-areas: "content sidebar";
            align-items: start;
            gap: 20px;
            margin-top: 20px;
            width: 100%;
        }

        .forum-main-content {
            min-width: 0;
            grid-area: content;
        }

        .forum-sidebar {
            display: flex;
            flex-direction: column;
            gap: 15px;
            grid-area: sidebar;
        }

        @supports not (display: grid) {
            .forum-main-layout {
                display: flex !important;
                align-items: flex-start;
                gap: 20px;
                flex-wrap: nowrap;
            }

            .forum-main-content {
                flex: 1 1 0;
            }

            .forum-sidebar {
                flex: 0 0 clamp(260px, 28vw, 320px);
                max-width: clamp(260px, 28vw, 320px);
            }
        }

        /* Sidebar widgets */
        .sidebar-widget {
            background: #1a1f2e;
            border: 1px solid #2a3441;
            border-radius: 8px;
            padding: 15px;
            box-shadow: 0 2px 8px rgba(0,0,0,.2);
        }

        .sidebar-widget h4 {
            color: #4facfe;
            font-size: 14px;
            font-weight: 600;
            margin: 0 0 12px 0;
            padding-bottom: 8px;
            border-bottom: 1px solid #2a3441;
        }

        /* Role Management Styles */
        .role-description {
            margin-bottom: 12px;
        }

        .role-item {
            margin-bottom: 8px;
            padding: 6px 8px;
            background: #0f1419;
            border-radius: 4px;
            border-left: 3px solid #4facfe;
            font-size: 12px;
            line-height: 1.4;
        }

        .thread-description .rich-text-content {
            margin: 0;
        }

        .role-item strong {
            color: #4facfe;
        }

        .current-role-info {
            text-align: center;
        }

        .role-badge {
            display: inline-block;
            padding: 4px 12px;
            border-radius: 12px;
            font-size: 11px;
            font-weight: 600;
            text-transform: uppercase;
            letter-spacing: 0.5px;
            margin-bottom: 8px;
        }

        .role-badge.admin {
            background: #dc2626;
            color: white;
        }

        .role-badge.moderator {
            background: #f59e0b;
            color: white;
        }

        .role-badge.member {
            background: #10b981;
            color: white;
        }

        .role-permissions {
            font-size: 11px;
            color: #9ca3af;
            line-height: 1.4;
        }

        .role-selector {
            display: flex;
            flex-direction: column;
            align-items: flex-start;
        }

        .user-profile {
            background: #1a1f2e;
            border: 1px solid #2a3441;
            border-radius: 8px;
            padding: 15px;
            display: flex;
            align-items: center;
            gap: 1rem;
        }

        .user-avatar {
            width: 48px;
            height: 48px;
            border-radius: 50%;
            background: #0f1419;
            display: flex;
            align-items: center;
            justify-content: center;
            overflow: hidden;
            position: relative;
        }

        .user-avatar img {
            width: 100%;
            height: 100%;
            object-fit: cover;
            border-radius: 50%;
        }

        .user-avatar i {
            color: #2c5aa0;
            font-size: 18px;
        }

        .edit-avatar-btn {
            position: absolute;
            bottom: -2px;
            right: -2px;
            width: 16px;
            height: 16px;
            border-radius: 50%;
            background: #2c5aa0;
            border: 2px solid #fff;
            color: white;
            font-size: 7px;
            display: flex;
            align-items: center;
            justify-content: center;
            cursor: pointer;
            transition: background-color 0.2s;
        }

        .edit-avatar-btn:hover {
            background: #254786;
        }

        .user-info {
            flex: 1;
        }

        .user-info h3 {
            color: #e1e5e9;
            font-size: 16px;
            font-weight: 600;
            margin: 0 0 4px 0;
        }

        .user-info p {
            color: #9ca3af;
            font-size: 13px;
            margin: 0;
        }

        .user-meta {
            margin-top: 4px;
            font-size: 12px;
            color: #8a97aa;
        }

        .user-stats {
            display: flex;
            flex-wrap: wrap;
            align-items: center;
            gap: 0.5rem;
            margin-top: 6px;
            font-size: 12px;
            color: #7f8ea3;
        }

        .user-stats .meta-separator {
            color: #3a4756;
        }

        .user-actions {
            display: flex;
            gap: 0.5rem;
        }

        .profile-link {
            border: none;
            background: none;
            color: #8ab4ff;
            padding: 0;
            cursor: pointer;
            font: inherit;
        }

        .profile-link:hover {
            text-decoration: underline;
        }

        .badge {
            display: inline-flex;
            align-items: center;
            justify-content: center;
            min-width: 1.2rem;
            height: 1.2rem;
            padding: 0 0.4rem;
            margin-left: 0.35rem;
            border-radius: 999px;
            background: #ef4444;
            color: #fff;
            font-size: 0.65rem;
            font-weight: 600;
        }

        .btn-small {
            padding: 0.5rem 1rem;
            font-size: 0.875rem;
            border-radius: 6px;
        }

        .online-users {
            background: #111;
            border-radius: 12px;
            padding: 1.5rem;
        }

        .online-users h4 {
            color: #fff;
            margin-bottom: 1rem;
            display: flex;
            align-items: center;
            gap: 0.5rem;
        }

        .online-indicator {
            width: 8px;
            height: 8px;
            background: #10b981;
            border-radius: 50%;
            animation: pulse 2s infinite;
        }

        @keyframes pulse {
            0%, 100% { opacity: 1; }
            50% { opacity: 0.5; }
        }

        .online-user-list {
            display: flex;
            flex-direction: column;
            gap: 8px;
            max-height: 200px;
            overflow-y: auto;
        }

        .online-user {
            display: flex;
            align-items: center;
            gap: 8px;
            padding: 6px 8px;
            border-radius: 3px;
            transition: background-color 0.2s;
            font-size: 12px;
        }

        .online-user:hover {
            background: rgba(79, 172, 254, 0.1);
        }

        .online-user-avatar {
            width: 20px;
            height: 20px;
            border-radius: 50%;
            background: #0f1419;
            display: flex;
            align-items: center;
            justify-content: center;
            border: 1px solid #2a3441;
            overflow: hidden;
            flex-shrink: 0;
        }

        .online-user-avatar img {
            width: 100%;
            height: 100%;
            object-fit: cover;
            border-radius: 50%;
        }

        .online-user-avatar i {
            color: #4facfe;
            font-size: 8px;
        }

        .online-user-name {
            color: #4facfe;
            font-size: 12px;
            text-decoration: none;
        }

        .online-user-name:hover {
            text-decoration: underline;
        }

        /* Sidebar Statistics */
        .stat-item {
            display: flex;
            justify-content: space-between;
            align-items: center;
            padding: 4px 0;
            font-size: 12px;
            color: #b8c5d1;
        }

        .stat-item strong {
            color: #4facfe;
            font-weight: 600;
        }

        /* Recent Activity */
        .recent-activity-list {
            font-size: 12px;
        }

        .activity-item {
            padding: 6px 0;
            border-bottom: 1px solid #f0f0f0;
        }

        .activity-item:last-child {
            border-bottom: none;
        }

        .activity-author {
            color: #2c5aa0;
            text-decoration: none;
            font-weight: 500;
        }

        .activity-author:hover {
            text-decoration: underline;
        }

        .activity-text {
            color: #7a8996;
            margin: 2px 0;
        }

        .activity-time {
            color: #a8b3bd;
            font-size: 11px;
        }

        /* Recent Activity Styles */
        .activity-item {
            padding: 8px 0;
            border-bottom: 1px solid #2a3441;
            display: flex;
            align-items: flex-start;
            gap: 8px;
            cursor: pointer;
            transition: background-color 0.2s ease;
        }

        .activity-item:last-child {
            border-bottom: none;
        }

        .activity-item:hover {
            background: rgba(79, 172, 254, 0.05);
            border-radius: 4px;
        }

        .activity-item i {
            color: #4facfe;
            margin-top: 2px;
            font-size: 11px;
        }

        .activity-content {
            flex: 1;
            min-width: 0;
        }

        .activity-text {
            color: #b8c5d1;
            font-size: 12px;
            line-height: 1.4;
        }

        .activity-author {
            color: #4facfe;
            text-decoration: none;
            font-weight: 500;
        }

        .activity-author:hover {
            text-decoration: underline;
        }

        .activity-time {
            color: #6b7280;
            font-size: 11px;
            margin-top: 2px;
        }

        .featured-activity i {
            color: #fbbf24;
        }

        .community-activity i {
            color: #4facfe;
        }

        .forum-section {
            background: #1a1f2e;
            border: 1px solid #2a3441;
            border-radius: 8px;
            margin-bottom: 20px;
            overflow: hidden;
            box-shadow: 0 2px 8px rgba(0,0,0,.2);
        }

        /* Category Management Styles */
        .forum-admin-controls {
            background: #0f1419;
            border-bottom: 1px solid #2a3441;
            padding: 12px 16px;
            display: flex;
            justify-content: space-between;
            align-items: center;
        }

        .admin-actions {
            display: flex;
            gap: 8px;
        }

        /* Categories List Styles */
        .categories-list {
            padding: 20px;
        }

        .category-item {
            background: #161c29;
            border: 1px solid #2a3441;
            border-radius: 6px;
            margin-bottom: 12px;
            transition: all 0.2s ease;
            cursor: pointer;
            position: relative;
            overflow: hidden;
        }

        .category-item:hover {
            border-color: #4facfe;
            background: #1a2030;
            transform: translateY(-1px);
            box-shadow: 0 4px 12px rgba(79, 172, 254, 0.15);
        }

        .category-header {
            padding: 16px 20px;
            display: flex;
            align-items: center;
            justify-content: space-between;
        }

        .category-info {
            flex: 1;
        }

        .category-title {
            font-size: 16px;
            font-weight: 600;
            color: #e1e5e9;
            margin: 0 0 4px 0;
            display: flex;
            align-items: center;
            gap: 8px;
        }

        .category-description {
            font-size: 13px;
            color: #9ca3af;
            margin: 0;
            line-height: 1.4;
        }

        .category-stats {
            display: flex;
            align-items: center;
            gap: 16px;
            font-size: 12px;
            color: #6b7280;
        }

        .category-stat {
            display: flex;
            align-items: center;
            gap: 4px;
        }

        .category-actions {
            display: flex;
            align-items: center;
            gap: 8px;
            opacity: 0;
            transition: opacity 0.2s ease;
        }

        /* Make category actions visible in thread view header */
        .forum-header .category-actions {
            opacity: 1;
        }

        .category-item:hover .category-actions {
            opacity: 1;
        }

        .category-children {
            background: #0f1419;
            border-top: 1px solid #2a3441;
            padding: 8px 20px;
        }

        .subcategory-item {
            background: #1a1f2e;
            border: 1px solid #2a3441;
            border-radius: 4px;
            padding: 12px 16px;
            margin: 4px 0;
            display: flex;
            align-items: center;
            justify-content: space-between;
            transition: all 0.2s ease;
            cursor: pointer;
        }

        .subcategory-item:hover {
            border-color: #4facfe;
            background: #242938;
        }

        .subcategory-info h5 {
            font-size: 14px;
            font-weight: 500;
            color: #e1e5e9;
            margin: 0 0 2px 0;
        }

        .subcategory-info p {
            font-size: 11px;
            color: #9ca3af;
            margin: 0;
        }

        /* Forum breadcrumb styles */
        .forum-breadcrumb {
            display: flex;
            align-items: center;
            gap: 8px;
        }

        .breadcrumb-sep {
            color: #6b7280;
            font-weight: 500;
        }

        .btn-link {
            background: none;
            border: none;
            color: #4facfe;
            cursor: pointer;
            padding: 8px 12px;
            border-radius: 4px;
            transition: all 0.2s ease;
            font-size: 13px;
        }

        .btn-link:hover {
            background: rgba(79, 172, 254, 0.1);
            color: #369bfe;
        }

        /* Thread item moderation controls */
        .thread-moderation {
            display: flex;
            align-items: center;
            gap: 4px;
            opacity: 0;
            transition: opacity 0.2s ease;
        }

        .thread-item:hover .thread-moderation {
            opacity: 1;
        }

        /* Make thread moderation controls always visible in thread view */
        .thread-view .thread-moderation,
        #threadViewContainer .thread-moderation {
            opacity: 1 !important;
        }

        .moderation-btn {
            background: none;
            border: 1px solid #374151;
            color: #9ca3af;
            cursor: pointer;
            padding: 4px 6px;
            border-radius: 3px;
            font-size: 11px;
            transition: all 0.2s ease;
        }

        .moderation-btn:hover {
            background: #374151;
            color: #e5e7eb;
        }

        .moderation-btn.delete:hover {
            background: #dc2626;
            border-color: #dc2626;
            color: white;
        }

        .moderation-btn.pin:hover {
            background: #f59e0b;
            border-color: #f59e0b;
            color: white;
        }

        .moderation-btn.move:hover {
            background: #3b82f6;
            border-color: #3b82f6;
            color: white;
        }

        /* Pagination Styles */
        .pagination-container {
            padding: 20px;
            border-top: 1px solid #2a3441;
            display: flex;
            justify-content: center;
            align-items: center;
            gap: 8px;
        }

        .pagination-btn {
            background: #1a1f2e;
            border: 1px solid #2a3441;
            color: #9ca3af;
            cursor: pointer;
            padding: 8px 12px;
            border-radius: 4px;
            font-size: 12px;
            transition: all 0.2s ease;
        }

        .pagination-btn:hover {
            background: #4facfe;
            border-color: #4facfe;
            color: white;
        }

        .pagination-btn.active {
            background: #4facfe;
            border-color: #4facfe;
            color: white;
        }

        .pagination-btn:disabled {
            opacity: 0.5;
            cursor: not-allowed;
        }

        .pagination-btn:disabled:hover {
            background: #1a1f2e;
            border-color: #2a3441;
            color: #9ca3af;
        }

        .forum-tabs {
            display: none; /* Hide old tabs - no longer used */
        }
        

        .tab-btn:not(.active) .thread-count {
            background: #e8f2ff;
            color: #2c5aa0;
        }

        .text-warning {
            color: #f59e0b !important;
        }

        .text-primary {
            color: #3b82f6 !important;
        }

        .forum-content {
            display: none;
            padding: 1.5rem;
            min-height: 400px;
        }

        .forum-content.active {
            display: block;
        }

        .forum-description {
            color: #9ca3af;
            font-size: 14px;
            margin: 8px 0 0 0;
        }

        .forum-title {
            flex: 1;
        }

        .forum-header {
            padding: 1.5rem;
            border-bottom: 1px solid #d7dee4;
            display: flex;
            justify-content: space-between;
            align-items: center;
        }

        .forum-content {
            padding: 0;
        }

        .thread-item {
            background: #1a1f2e;
            border-bottom: 1px solid #2a3441;
            padding: 16px 20px;
            margin-bottom: 0;
            cursor: pointer;
            transition: all 0.2s ease;
            display: flex;
            align-items: center;
            gap: 16px;
        }

        .thread-item:hover {
            background: #212837;
        }

        .thread-item:last-child {
            border-bottom: none;
        }

        .node-icon {
            width: 48px;
            height: 48px;
            background: #4facfe;
            border-radius: 8px;
            display: flex;
            align-items: center;
            justify-content: center;
            color: white;
            font-size: 18px;
            flex-shrink: 0;
        }

        .featured-thread .node-icon {
            background: linear-gradient(135deg, #fbbf24, #f59e0b);
        }

        .community-thread .node-icon {
            background: linear-gradient(135deg, #4facfe, #00f2fe);
        }

        .locked-thread .node-icon {
            background: #6b7280;
        }

        .thread-info {
            flex: 1;
            min-width: 0;
        }

        .thread-title {
            margin: 0 0 4px 0;
        }

        .thread-title h3 {
            color: #e1e5e9;
            font-size: 15px;
            font-weight: 600;
            margin: 0;
            line-height: 1.3;
        }

        .thread-title h3:hover {
            color: #4facfe;
        }

        .locked-thread .thread-title h3 {
            color: #9ca3af !important;
        }

        .thread-description {
            color: #9ca3af;
            font-size: 12px;
            margin: 0;
            line-height: 1.4;
        }

        .thread-stats {
            display: flex;
            flex-direction: column;
            align-items: center;
            min-width: 80px;
            text-align: center;
        }

        .replies-count {
            color: #4facfe;
            font-size: 16px;
            font-weight: 600;
            margin-bottom: 2px;
        }

        .stats-label {
            color: #9ca3af;
            font-size: 11px;
            text-transform: uppercase;
        }

        .latest-post {
            min-width: 200px;
            text-align: right;
        }

        .latest-post-info {
            color: #9ca3af;
            font-size: 12px;
            line-height: 1.4;
        }

        .latest-post-author {
            color: #4facfe;
            text-decoration: none;
        }

        .latest-post-author:hover {
            text-decoration: underline;
        }

        .latest-post-date {
            display: block;
            margin-top: 2px;
        }

        .admin-badge {
            background: linear-gradient(135deg, #f59e0b, #d97706);
            color: white;
            font-size: 10px;
            font-weight: 600;
            padding: 2px 6px;
            border-radius: 10px;
            margin-left: 8px;
            text-transform: uppercase;
            letter-spacing: 0.5px;
        }

        .lock-notice {
            color: #6b7280;
            font-style: italic;
            font-size: 13px;
            margin-top: 8px;
            display: block;
        }

        .lock-notice i {
            margin-right: 4px;
        }

        .thread-header {
            display: flex;
            justify-content: space-between;
            align-items: flex-start;
            margin-bottom: 12px;
        }

        .thread-info {
            flex: 1;
        }

        .thread-title {
            display: flex;
            align-items: center;
            gap: 8px;
            margin-bottom: 8px;
        }

        .thread-title h3 {
            color: #f3f4f6;
            font-size: 16px;
            font-weight: 600;
            margin: 0;
            line-height: 1.4;
        }

        .thread-pinned {
            color: #f59e0b;
            font-size: 12px;
        }

        .thread-meta {
            display: flex;
            align-items: center;
            gap: 12px;
            font-size: 13px;
            color: #9ca3af;
        }

        .thread-author {
            display: flex;
            align-items: center;
            gap: 6px;
        }

        .author-avatar {
            width: 20px;
            height: 20px;
            border-radius: 50%;
            overflow: hidden;
            background: #374151;
            display: flex;
            align-items: center;
            justify-content: center;
        }

        .author-avatar img {
            width: 100%;
            height: 100%;
            object-fit: cover;
        }

        .author-avatar i {
            font-size: 10px;
            color: #9ca3af;
        }

        .author-name {
            font-weight: 500;
        }

        .thread-stats {
            display: flex;
            flex-direction: column;
            align-items: flex-end;
            gap: 4px;
        }

        .replies-count {
            display: flex;
            align-items: center;
            gap: 4px;
            color: #9ca3af;
            font-size: 13px;
        }

        .thread-preview {
            color: #d1d5db;
            font-size: 14px;
            line-height: 1.5;
            margin-top: 8px;
        }

        .no-threads {
            text-align: center;
            color: #9ca3af;
            font-style: italic;
            padding: 40px 20px;
        }

        .latest-reply {
            margin-top: 12px;
            padding: 8px 12px;
            background: rgba(55, 65, 81, 0.3);
            border-radius: 6px;
            border-left: 3px solid #3b82f6;
            font-size: 0.875rem;
        }

        .latest-reply-info {
            display: flex;
            align-items: center;
            gap: 0.5rem;
            margin-bottom: 4px;
            color: #9ca3af;
        }

        .latest-reply-author {
            color: #e5e7eb;
            font-weight: 500;
        }

        .latest-reply-date {
            color: #6b7280;
            font-size: 0.8rem;
        }

        .latest-reply-content {
            color: #d1d5db;
            line-height: 1.4;
        }

        .featured-thread .latest-reply {
            border-left-color: #f59e0b;
        }

        .latest-reply {
            margin-top: 12px;
            padding: 8px 12px;
            background: rgba(55, 65, 81, 0.3);
            border-radius: 6px;
            border-left: 3px solid #3b82f6;
            font-size: 0.875rem;
        }

        .latest-reply-info {
            display: flex;
            align-items: center;
            gap: 0.5rem;
            margin-bottom: 4px;
            color: #9ca3af;
        }

        .latest-reply-author {
            color: #e5e7eb;
            font-weight: 500;
        }

        .latest-reply-date {
            color: #6b7280;
            font-size: 0.8rem;
        }

        .latest-reply-content {
            color: #d1d5db;
            line-height: 1.4;
        }

        .featured-thread .latest-reply {
            border-left-color: #f59e0b;
        }

        .error-message {
            text-align: center;
            color: #ef4444;
            padding: 20px;
        }

        .latest-reply {
            margin-top: 12px;
            padding: 8px 12px;
            background: rgba(55, 65, 81, 0.3);
            border-radius: 6px;
            border-left: 3px solid #3b82f6;
            font-size: 0.875rem;
        }

        .latest-reply-info {
            display: flex;
            align-items: center;
            gap: 0.5rem;
            margin-bottom: 4px;
            color: #9ca3af;
        }

        .latest-reply-author {
            color: #e5e7eb;
            font-weight: 500;
        }

        .latest-reply-date {
            color: #6b7280;
            font-size: 0.8rem;
        }

        .latest-reply-content {
            color: #d1d5db;
            line-height: 1.4;
        }

        .featured-thread .latest-reply {
            border-left-color: #f59e0b;
        }

        .create-thread-btn {
            margin-left: auto;
        }

        /* Modal Styles */
        .modal {
            position: fixed;
            top: 0;
            left: 0;
            width: 100%;
            height: 100%;
            background: rgba(0, 0, 0, 0.8);
            display: none;
            align-items: center;
            justify-content: center;
            z-index: 1000;
            backdrop-filter: blur(5px);
        }

        .modal.active {
            display: flex;
        }

        .modal-content {
            background: #1a1f2e;
            border-radius: 8px;
            max-width: 500px;
            width: 90%;
            max-height: 90vh;
            overflow-y: auto;
            position: relative;
            border: 1px solid #2a3441;
            box-shadow: 0 8px 32px rgba(0,0,0,.4);
        }

        .modal-content.category-modal {
            max-width: 720px;
            width: min(720px, 94%);
            border-radius: 12px;
            background: radial-gradient(circle at top, rgba(37, 81, 133, 0.12), transparent 65%),
                        linear-gradient(160deg, #171d2b 0%, #0f151f 100%);
            border: 1px solid rgba(70, 94, 129, 0.45);
            box-shadow: 0 28px 60px rgba(3, 8, 17, 0.65), 0 0 0 1px rgba(37, 56, 82, 0.25);
        }

        .modal-content.redeem-modal {
            max-width: 440px;
            background: linear-gradient(150deg, rgba(18, 24, 38, 0.98) 0%, rgba(22, 30, 45, 0.94) 55%, rgba(15, 19, 28, 0.96) 100%);
            border: 1px solid rgba(249, 115, 22, 0.35);
            box-shadow: 0 18px 48px rgba(249, 115, 22, 0.18), 0 6px 20px rgba(0, 0, 0, 0.45);
        }

        .redeem-modal-body {
            display: flex;
            flex-direction: column;
            gap: 20px;
            padding: 24px;
            background: radial-gradient(circle at top right, rgba(249, 115, 22, 0.12), transparent 60%);
        }

        .redeem-description {
            color: #cbd5f5;
            font-size: 0.9rem;
            line-height: 1.5;
        }

        .redeem-modal-body .form-group label {
            color: #f9fafb;
        }

        #redeemKeyInput {
            text-transform: uppercase;
            letter-spacing: 2px;
        }

        .input-hint {
            display: block;
            margin-top: 8px;
            font-size: 0.75rem;
            color: #94a3b8;
        }

        .redeem-status {
            min-height: 20px;
            font-size: 0.85rem;
            color: #9ca3af;
        }

        .redeem-status.success {
            color: #34d399;
        }

        .redeem-status.error {
            color: #f87171;
        }

        .redeem-modal-footer {
            padding: 18px 24px;
        }

        #redeemKeySubmitBtn[disabled] {
            opacity: 0.7;
            cursor: not-allowed;
            box-shadow: none;
            transform: none;
        }

        .modal-header {
            padding: 20px;
            border-bottom: 1px solid #2a3441;
            display: flex;
            align-items: center;
            justify-content: space-between;
        }

        .modal-header h3 {
            color: #e1e5e9;
            margin: 0;
        }

        .modal-close {
            background: none;
            border: none;
            color: #9ca3af;
            font-size: 1.5rem;
            cursor: pointer;
            padding: 0;

        .modal-subsection {
            margin-top: 8px;
            padding: 16px;
            border-radius: 10px;
            background: rgba(15, 23, 42, 0.8);
            border: 1px solid rgba(79, 172, 254, 0.18);
            display: flex;
            flex-direction: column;
            gap: 14px;
        }

        .modal-subsection .form-group {
            margin-bottom: 0;
        }

        .subsection-header h4 {
            margin: 0;
            font-size: 15px;
            color: #e2e8f0;
        }

        .subsection-header p {
            margin: 6px 0 0 0;
            font-size: 12px;
            color: #94a3b8;
        }

        .subsection-actions {
            display: flex;
            justify-content: flex-end;
        }
            width: 30px;
            height: 30px;
            display: flex;
            align-items: center;
            justify-content: center;
            border-radius: 50%;
            transition: all 0.2s;
        }

        .modal-close:hover {
            background: rgba(239, 68, 68, 0.2);
            color: #ef4444;
        }

        .modal-body {
            padding: 20px;
        }

        .category-modal-body,
        .thread-modal-body,
        .reply-modal-body {
            padding: 28px;
            display: flex;
            flex-direction: column;
            gap: 24px;
            background: linear-gradient(180deg, rgba(12, 18, 27, 0.92) 0%, rgba(10, 15, 23, 0.98) 100%);
        }

        .thread-modal-body {
            background: linear-gradient(180deg, rgba(13, 24, 38, 0.94) 0%, rgba(10, 16, 27, 0.98) 100%);
        }

        .reply-modal-body {
            background: linear-gradient(180deg, rgba(11, 18, 30, 0.93) 0%, rgba(9, 14, 22, 0.98) 100%);
        }

        .category-modal-body .modal-section,
        .thread-modal-body .modal-section,
        .reply-modal-body .modal-section {
            background: rgba(15, 22, 32, 0.85);
            border: 1px solid rgba(55, 78, 112, 0.35);
            border-radius: 14px;
            padding: 22px 24px;
            box-shadow: 0 16px 38px rgba(3, 8, 17, 0.45);
            backdrop-filter: blur(6px);
        }

        .category-modal-body .section-header,
        .thread-modal-body .section-header,
        .reply-modal-body .section-header {
            display: flex;
            align-items: flex-start;
            gap: 16px;
        }

        .category-modal-body .section-header h4,
        .thread-modal-body .section-header h4,
        .reply-modal-body .section-header h4 {
            margin: 0;
            color: #f1f5f9;
            font-size: 16px;
            letter-spacing: 0.01em;
        }

        .category-modal-body .section-subtitle,
        .thread-modal-body .section-subtitle,
        .reply-modal-body .section-subtitle {
            margin: 4px 0 0 0;
            color: #94a3b8;
            font-size: 13px;
            line-height: 1.5;
        }

        .category-modal-body .section-icon,
        .thread-modal-body .section-icon,
        .reply-modal-body .section-icon {
            width: 46px;
            height: 46px;
            border-radius: 12px;
            display: flex;
            align-items: center;
            justify-content: center;
            font-size: 18px;
            color: #dbeafe;
            flex-shrink: 0;
            box-shadow: 0 10px 28px rgba(15, 76, 129, 0.28);
        }

        .category-modal-body .section-icon-primary,
        .thread-modal-body .section-icon-primary,
        .reply-modal-body .section-icon-primary {
            background: linear-gradient(135deg, rgba(79, 172, 254, 0.28), rgba(0, 242, 254, 0.16));
            border: 1px solid rgba(75, 129, 224, 0.4);
        }

        .category-modal-body .section-icon-accent,
        .thread-modal-body .section-icon-accent,
        .reply-modal-body .section-icon-accent {
            background: linear-gradient(135deg, rgba(76, 201, 240, 0.28), rgba(91, 148, 255, 0.16));
            border: 1px solid rgba(91, 148, 255, 0.4);
        }

        .thread-modal-body .section-icon-soft,
        .reply-modal-body .section-icon-soft {
            background: linear-gradient(135deg, rgba(254, 240, 138, 0.28), rgba(253, 224, 71, 0.16));
            border: 1px solid rgba(245, 209, 66, 0.45);
            color: #fef9c3;
            box-shadow: 0 10px 28px rgba(180, 150, 20, 0.2);
        }

        .category-modal-body .section-body,
        .thread-modal-body .section-body,
        .reply-modal-body .section-body {
            margin-top: 18px;
            display: grid;
            gap: 18px;
        }

        .category-modal-body .category-form-grid,
        .category-modal-body .category-permission-grid {
            grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
        }

        .thread-modal-body .thread-form-grid {
            grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
        }

        .category-modal-body .form-group,
        .thread-modal-body .form-group,
        .reply-modal-body .form-group {
            margin: 0;
        }

        .category-modal-body .form-group.full-width,
        .category-modal-body .section-body > .full-width,
        .thread-modal-body .form-group.full-width,
        .thread-modal-body .section-body > .full-width,
        .reply-modal-body .form-group.full-width,
        .reply-modal-body .section-body > .full-width {
            grid-column: 1 / -1;
        }

        .category-modal-body .form-group label,
        .thread-modal-body .form-group label,
        .reply-modal-body .form-group label {
            margin-bottom: 6px;
            font-size: 13px;
            letter-spacing: 0.02em;
        }

        .category-modal-body .form-group input,
        .category-modal-body .form-group select,
        .category-modal-body .form-group textarea,
        .thread-modal-body .form-group input,
        .thread-modal-body .form-group select,
        .thread-modal-body .form-group textarea,
        .reply-modal-body .form-group input,
        .reply-modal-body .form-group select,
        .reply-modal-body .form-group textarea {
            width: 100%;
            padding: 12px 14px;
            border-radius: 10px;
            border: 1px solid rgba(56, 85, 122, 0.45);
            background: rgba(10, 15, 22, 0.85);
            color: #e2e8f0;
            font-size: 14px;
            font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
            transition: border-color 0.2s ease, box-shadow 0.2s ease;
        }

        .thread-modal-body .form-group textarea,
        .reply-modal-body .form-group textarea,
        .category-modal-body .form-group textarea {
            min-height: 140px;
            resize: vertical;
        }

        .category-modal-body .form-group input:focus,
        .category-modal-body .form-group select:focus,
        .category-modal-body .form-group textarea:focus,
        .thread-modal-body .form-group input:focus,
        .thread-modal-body .form-group select:focus,
        .thread-modal-body .form-group textarea:focus,
        .reply-modal-body .form-group input:focus,
        .reply-modal-body .form-group select:focus,
        .reply-modal-body .form-group textarea:focus {
            outline: none;
            border-color: rgba(79, 172, 254, 0.8);
            box-shadow: 0 0 0 3px rgba(79, 172, 254, 0.24);
            background: rgba(10, 18, 28, 0.95);
        }

        .category-modal-body .field-hint,
        .thread-modal-body .field-hint,
        .reply-modal-body .field-hint {
            margin-top: 8px;
            margin-bottom: 0;
            color: #7b8aa4;
            font-size: 12px;
            line-height: 1.5;
        }

        .category-modal-body .label-badge,
        .thread-modal-body .label-badge,
        .reply-modal-body .label-badge {
            display: inline-flex;
            align-items: center;
            gap: 4px;
            background: rgba(79, 172, 254, 0.18);
            border-radius: 999px;
            padding: 2px 10px;
            margin-left: 8px;
            color: #93c5fd;
            font-size: 11px;
            font-weight: 600;
            letter-spacing: 0.03em;
            text-transform: uppercase;
        }

        .modal-section-soft {
            background: rgba(16, 24, 36, 0.78) !important;
            border: 1px solid rgba(71, 103, 143, 0.28) !important;
            box-shadow: 0 12px 30px rgba(10, 25, 46, 0.32) !important;
        }

        .thread-modal {
            display: flex;
            flex-direction: column;
            overflow: hidden;
            border: 1px solid rgba(46, 64, 92, 0.6);
        }

        .thread-modal .thread-modal-body {
            flex: 1;
            overflow-y: auto;
            min-height: 0;
        }

        .thread-modal .thread-modal-footer {
            flex-shrink: 0;
        }

        .reply-modal {
            max-width: 520px;
        }

        .thread-modal-body .rich-text-hint,
        .reply-modal-body .rich-text-hint {
            margin-top: 10px;
            display: flex;
            align-items: center;
            gap: 10px;
            padding: 10px 12px;
            border-radius: 10px;
            background: rgba(79, 172, 254, 0.12);
            color: #9ca3af;
            font-size: 12.5px;
            line-height: 1.5;
        }

        .thread-modal-body .rich-text-hint i,
        .reply-modal-body .rich-text-hint i {
            color: #60a5fa;
            font-size: 14px;
        }

        .modal-tip-list {
            list-style: none;
            margin: 0;
            padding: 0;
            display: grid;
            gap: 12px;
        }

        .modal-tip-list li {
            display: flex;
            align-items: flex-start;
            gap: 12px;
            color: #cbd5f5;
            font-size: 13px;
            line-height: 1.6;
        }

        .modal-tip-list li i {
            color: #38bdf8;
            font-size: 16px;
            margin-top: 2px;
        }

        .modal-callout {
            display: flex;
            align-items: flex-start;
            gap: 12px;
            padding: 14px 16px;
            border-radius: 12px;
            background: rgba(59, 130, 246, 0.12);
            border: 1px solid rgba(59, 130, 246, 0.26);
            color: #cbd5f5;
            font-size: 13px;
            line-height: 1.6;
        }

        .modal-callout i {
            color: #60a5fa;
            font-size: 18px;
            margin-top: 2px;
        }

        .category-modal-footer,
        .thread-modal-footer,
        .reply-modal-footer {
            justify-content: space-between;
            align-items: center;
            flex-wrap: wrap;
            gap: 18px;
            padding: 22px 28px;
            background: rgba(13, 19, 29, 0.95);
            border-top: 1px solid rgba(50, 73, 106, 0.35);
            border-radius: 0 0 12px 12px;
        }

        .category-modal-footer .footer-note,
        .thread-modal-footer .footer-note,
        .reply-modal-footer .footer-note {
            display: flex;
            align-items: center;
            gap: 12px;
            color: #9ca3af;
            font-size: 12.5px;
            letter-spacing: 0.01em;
        }

        .category-modal-footer .footer-note i,
        .thread-modal-footer .footer-note i,
        .reply-modal-footer .footer-note i {
            color: #60a5fa;
            font-size: 16px;
        }

        .category-modal-footer .footer-actions,
        .thread-modal-footer .footer-actions,
        .reply-modal-footer .footer-actions {
            display: flex;
            align-items: center;
            gap: 12px;
        }

        .category-modal-footer .btn-secondary,
        .thread-modal-footer .btn-secondary,
        .reply-modal-footer .btn-secondary {
            background: rgba(31, 41, 55, 0.6);
            border-color: rgba(71, 85, 105, 0.45);
            color: #cbd5f5;
        }

        .category-modal-footer .btn-secondary:hover,
        .thread-modal-footer .btn-secondary:hover,
        .reply-modal-footer .btn-secondary:hover {
            background: rgba(59, 77, 102, 0.6);
            border-color: rgba(103, 126, 156, 0.6);
            color: #f8fafc;
        }

        @media (max-width: 640px) {
            .category-modal-body,
            .thread-modal-body,
            .reply-modal-body {
                padding: 22px 20px;
            }

            .category-modal-body .modal-section,
            .thread-modal-body .modal-section,
            .reply-modal-body .modal-section {
                padding: 18px 18px;
            }

            .category-modal-body .section-header,
            .thread-modal-body .section-header,
            .reply-modal-body .section-header {
                flex-direction: column;
                gap: 10px;
            }

            .category-modal-footer,
            .thread-modal-footer,
            .reply-modal-footer {
                flex-direction: column;
                align-items: stretch;
                text-align: center;
            }

            .category-modal-footer .footer-actions,
            .thread-modal-footer .footer-actions,
            .reply-modal-footer .footer-actions {
                justify-content: center;
            }
        }

        .form-row {
            display: grid;
            grid-template-columns: 1fr 1fr;
            gap: 1rem;
        }

        .textarea {
            width: 100%;
            padding: 16px;
            background: #0f1419;
            border: 2px solid #2a3441;
            border-radius: 8px;
            color: #e1e5e9;
            font-size: 14px;
            font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
            line-height: 1.5;
            resize: vertical;
            min-height: 140px;
            transition: all 0.2s ease;
            box-shadow: 0 2px 8px rgba(0,0,0,.1);
        }

        .textarea:focus {
            outline: none;
            border-color: #4facfe;
            box-shadow: 0 0 0 3px rgba(79, 172, 254, 0.15), 0 4px 12px rgba(0,0,0,.2);
            background: #0f1419;
        }

        .textarea::placeholder {
            color: #6b7280;
            font-style: italic;
        }

        .modal-footer {
            padding: 1.5rem;
            border-top: 1px solid #2a3441;
            display: flex;
            gap: 1rem;
            justify-content: flex-end;
        }

        .modal-loading {
            display: flex;
            align-items: center;
            gap: 10px;
            color: #9ca3af;
            font-size: 13px;
            padding: 8px 0;
        }

        .modal-loading i {
            font-size: 16px;
        }

        .modal-error {
            margin-top: 12px;
            padding: 12px 14px;
            border-radius: 6px;
            border: 1px solid rgba(248, 113, 113, 0.35);
            background: rgba(248, 113, 113, 0.12);
            color: #fecaca;
            font-size: 13px;
        }

        .confirmation-modal .modal-body {
            padding: 24px 24px 12px;
        }

        .confirmation-modal-body {
            display: flex;
            align-items: flex-start;
            gap: 16px;
        }

        .confirmation-icon {
            width: 48px;
            height: 48px;
            border-radius: 14px;
            display: flex;
            align-items: center;
            justify-content: center;
            font-size: 20px;
            flex-shrink: 0;
            transition: background 0.2s ease, color 0.2s ease;
        }

        .confirmation-icon.danger {
            background: rgba(239, 68, 68, 0.18);
            color: #fca5a5;
            box-shadow: 0 0 0 1px rgba(239, 68, 68, 0.2);
        }

        .confirmation-icon.warning {
            background: rgba(245, 158, 11, 0.18);
            color: #fcd34d;
            box-shadow: 0 0 0 1px rgba(245, 158, 11, 0.2);
        }

        .confirmation-icon.info {
            background: rgba(59, 130, 246, 0.18);
            color: #93c5fd;
            box-shadow: 0 0 0 1px rgba(59, 130, 246, 0.2);
        }

        .confirmation-icon.success {
            background: rgba(34, 197, 94, 0.18);
            color: #86efac;
            box-shadow: 0 0 0 1px rgba(34, 197, 94, 0.2);
        }

        .confirmation-text {
            display: flex;
            flex-direction: column;
            gap: 8px;
        }

        .confirmation-text p {
            margin: 0;
            color: #d1d5db;
            line-height: 1.5;
            font-size: 14px;
        }

        .confirmation-text .confirmation-emphasis {
            color: #fca5a5;
            font-weight: 600;
        }

        .confirmation-modal .modal-footer {
            padding-top: 12px;
        }

        .move-thread-category-list {
            margin-top: 16px;
            max-height: 320px;
            overflow-y: auto;
            display: flex;
            flex-direction: column;
            gap: 10px;
        }

        .move-thread-option {
            display: flex;
            align-items: flex-start;
            gap: 12px;
            padding: 12px 14px;
            border-radius: 8px;
            border: 1px solid #2a3441;
            background: #111827;
            cursor: pointer;
            transition: border-color 0.2s ease, background 0.2s ease;
        }

        .move-thread-option:hover {
            border-color: #4f46e5;
            background: rgba(79, 70, 229, 0.12);
        }

        .move-thread-option.selected {
            border-color: #818cf8;
            background: rgba(129, 140, 248, 0.18);
        }

        .move-thread-option input[type="radio"] {
            margin-top: 3px;
        }

        .move-thread-option .option-content {
            display: flex;
            flex-direction: column;
            gap: 4px;
        }

        .move-thread-option .option-name {
            color: #f9fafb;
            font-weight: 600;
        }

        .move-thread-option .option-meta {
            color: #9ca3af;
            font-size: 12px;
        }

        .move-thread-option.disabled {
            cursor: not-allowed;
            opacity: 0.55;
        }

        .move-thread-option.disabled:hover {
            border-color: #2a3441;
            background: #111827;
        }

        .btn-outline {
            background: transparent;
            border: 1px solid #333;
            color: #e5e7eb;
        }

        .btn-outline:hover {
            background: rgba(129, 140, 248, 0.1);
            border-color: #818cf8;
        }

        /* Community Chat */
        .global-chat-body {
            display: flex;
            flex-direction: column;
            gap: 12px;
        }

        .global-chat-placeholder {
            padding: 14px;
            border-radius: 8px;
            background: rgba(15, 23, 42, 0.45);
            border: 1px dashed rgba(129, 140, 248, 0.35);
            color: #94a3b8;
            font-size: 12px;
            text-align: center;
        }

        .global-chat-history {
            display: flex;
            flex-direction: column;
            gap: 8px;
            max-height: 260px;
            overflow-y: auto;
            padding: 12px;
            border-radius: 10px;
            background: rgba(15, 23, 42, 0.55);
            border: 1px solid rgba(129, 140, 248, 0.2);
        }

        .global-chat-history::-webkit-scrollbar {
            width: 6px;
        }

        .global-chat-history::-webkit-scrollbar-thumb {
            background: rgba(148, 163, 184, 0.35);
            border-radius: 999px;
        }

        .global-chat-message {
            display: flex;
            flex-direction: row;
            gap: 0;
            padding: 8px 12px;
            border-radius: 8px;
            background: transparent;
            border: 1px solid transparent;
            max-width: 100%;
            word-break: break-word;
            position: relative;
            transition: background 0.2s ease;
        }

        .global-chat-message:hover {
            background: rgba(30, 41, 59, 0.35);
        }

        .global-chat-message.self {
            align-self: flex-end;
            background: transparent;
            border-color: transparent;
            box-shadow: none;
            flex-direction: row-reverse;
            justify-content: flex-end;
        }

        .global-chat-container {
            display: flex;
            flex-direction: row;
            gap: 12px;
            align-items: flex-start;
            width: 100%;
        }

        .global-chat-message.self .global-chat-container {
            flex-direction: row-reverse;
            justify-content: flex-end;
        }

        .global-chat-avatar {
            width: 40px;
            height: 40px;
            border-radius: 50%;
            object-fit: cover;
            flex-shrink: 0;
            background: rgba(30, 41, 59, 0.5);
            border: 2px solid rgba(129, 140, 248, 0.3);
        }

        .global-chat-message.self .global-chat-avatar {
            border-color: rgba(129, 140, 248, 0.6);
        }

        .global-chat-content {
            display: flex;
            flex-direction: column;
            gap: 4px;
            flex: 1;
            min-width: 0;
        }

        .global-chat-message .global-chat-header {
            display: flex;
            align-items: baseline;
            gap: 8px;
            font-size: 11px;
            color: rgba(203, 213, 225, 0.78);
        }

        .global-chat-message.self .global-chat-header {
            color: rgba(226, 232, 240, 0.85);
        }

        .global-chat-timestamp {
            font-size: 10px;
            color: rgba(148, 163, 184, 0.6);
            margin-left: auto;
        }

        .global-chat-author {
            font-weight: 600;
            color: #f8fafc;
            text-transform: none;
            letter-spacing: 0.2px;
        }

        .global-chat-message.self .global-chat-author {
            color: #f1f5f9;
        }

        .global-chat-role {
            display: inline-flex;
            align-items: center;
            justify-content: center;
            gap: 4px;
            padding: 1px 6px;
            border-radius: 999px;
            background: rgba(129, 140, 248, 0.16);
            border: 1px solid rgba(129, 140, 248, 0.32);
            color: #c7d2fe;
            font-size: 9.5px;
            letter-spacing: 0.45px;
        }

        .global-chat-text {
            font-size: 12.5px;
            line-height: 1.5;
            color: #e2e8f0;
        }

        .global-chat-message.self .global-chat-text {
            color: #f8fafc;
        }

        .global-chat-form {
            display: flex;
            flex-direction: column;
            gap: 8px;
        }

        .global-chat-form textarea {
            width: 100%;
            resize: vertical;
            min-height: 64px;
            max-height: 160px;
            border-radius: 9px;
            background: rgba(15, 23, 42, 0.6);
            border: 1px solid rgba(129, 140, 248, 0.25);
            color: #e2e8f0;
            font-size: 12.5px;
            line-height: 1.5;
            padding: 10px 12px;
            transition: border-color 0.2s ease, box-shadow 0.2s ease;
        }

        .global-chat-form textarea:focus {
            outline: none;
            border-color: rgba(129, 140, 248, 0.65);
            box-shadow: 0 0 0 3px rgba(129, 140, 248, 0.2);
        }

        .global-chat-form textarea:disabled {
            background: rgba(15, 23, 42, 0.35);
            color: rgba(148, 163, 184, 0.7);
            cursor: not-allowed;
        }

        .global-chat-actions {
            display: flex;
            align-items: center;
            justify-content: flex-end;
            gap: 8px;
        }

        #globalChatSendButton[disabled] {
            opacity: 0.65;
            cursor: not-allowed;
        }

        /* Direct Messaging */
        .messages-widget-body {
            display: flex;
            flex-direction: column;
            gap: 12px;
        }

        .messages-placeholder {
            padding: 14px;
            border-radius: 8px;
            background: rgba(15, 23, 42, 0.45);
            border: 1px dashed rgba(129, 140, 248, 0.35);
            color: #94a3b8;
            font-size: 12px;
            text-align: center;
        }

        .conversation-list {
            display: flex;
            flex-direction: column;
            gap: 8px;
            max-height: 260px;
            overflow-y: auto;
            padding-right: 4px;
        }

        .conversation-list::-webkit-scrollbar {
            width: 6px;
        }

        .conversation-list::-webkit-scrollbar-thumb {
            background: rgba(148, 163, 184, 0.35);
            border-radius: 999px;
        }

        .conversation-item {
            display: flex;
            flex-direction: column;
            gap: 4px;
            padding: 10px 12px;
            border-radius: 9px;
            background: rgba(15, 23, 42, 0.65);
            border: 1px solid transparent;
            cursor: pointer;
            transition: border-color 0.2s ease, background 0.2s ease;
        }

        .conversation-item:hover {
            border-color: rgba(129, 140, 248, 0.45);
            background: rgba(30, 41, 59, 0.72);
        }

        .conversation-item.active {
            border-color: rgba(129, 140, 248, 0.8);
            background: rgba(79, 70, 229, 0.2);
            box-shadow: 0 8px 20px rgba(79, 70, 229, 0.18);
        }

        .conversation-title {
            display: flex;
            align-items: center;
            justify-content: space-between;
            font-weight: 600;
            color: #f8fafc;
            font-size: 13px;
        }

        /* Support Tickets */
        .support-widget-body {
            display: flex;
            flex-direction: column;
            gap: 12px;
        }

        .support-placeholder {
            padding: 14px;
            border-radius: 8px;
            background: rgba(15, 23, 42, 0.45);
            border: 1px dashed rgba(129, 140, 248, 0.35);
            color: #94a3b8;
            font-size: 12px;
            text-align: center;
        }

        .support-limit-message {
            display: block;
            font-size: 12px;
            color: #f59e0b;
            background: rgba(254, 243, 199, 0.08);
            border: 1px solid rgba(251, 191, 36, 0.35);
            padding: 10px 12px;
            border-radius: 8px;
            text-align: left;
            line-height: 1.5;
        }

        .support-ticket-list {
            display: flex;
            flex-direction: column;
            gap: 8px;
            max-height: 260px;
            overflow-y: auto;
            padding-right: 4px;
        }

        .support-staff-toolbar {
            display: flex;
            align-items: center;
            gap: 8px;
            margin-bottom: 10px;
            padding: 8px 10px;
            border-radius: 8px;
            background: rgba(15, 23, 42, 0.55);
            border: 1px solid rgba(79, 70, 229, 0.25);
        }

        .support-filter-label {
            font-size: 11px;
            font-weight: 600;
            color: #c7d2fe;
            text-transform: uppercase;
            letter-spacing: 0.04em;
        }

        .support-staff-toolbar select {
            flex: 1;
            background: rgba(15, 23, 42, 0.85);
            border: 1px solid rgba(79, 70, 229, 0.35);
            border-radius: 8px;
            color: #e2e8f0;
            font-size: 12px;
            padding: 6px 10px;
        }

        .support-toolbar-counter {
            font-size: 11px;
            color: #cbd5f5;
            display: inline-flex;
            gap: 4px;
            align-items: baseline;
        }

        .support-toolbar-counter strong {
            color: #f9fafb;
        }

        .support-ticket-list::-webkit-scrollbar {
            width: 6px;
        }

        .support-ticket-list::-webkit-scrollbar-thumb {
            background: rgba(148, 163, 184, 0.35);
            border-radius: 999px;
        }

        .btn.btn-disabled,
        .btn.btn-disabled:hover,
        .btn.btn-disabled:focus {
            cursor: not-allowed;
            opacity: 0.6;
            box-shadow: none;
            pointer-events: none;
        }

        .support-ticket-item {
            display: flex;
            align-items: center;
            justify-content: space-between;
            gap: 10px;
            padding: 10px 12px;
            border-radius: 9px;
            background: rgba(15, 23, 42, 0.65);
            border: 1px solid transparent;
            cursor: pointer;
            transition: border-color 0.2s ease, background 0.2s ease;
            text-align: left;
            color: #e2e8f0;
            flex-wrap: wrap;
        }

        .support-ticket-item:hover,
        .support-ticket-item:focus {
            border-color: rgba(129, 140, 248, 0.45);
            background: rgba(30, 41, 59, 0.72);
        }

        .support-ticket-item.unread {
            border-color: rgba(129, 140, 248, 0.7);
            box-shadow: 0 12px 24px rgba(79, 70, 229, 0.18);
            background: linear-gradient(135deg, rgba(79, 70, 229, 0.2), rgba(129, 140, 248, 0.15));
        }

        .support-ticket-subject {
            flex: 1;
            font-weight: 600;
            color: #f9fafb;
        }

        .support-ticket-status {
            display: inline-flex;
            align-items: center;
            justify-content: center;
            padding: 4px 10px;
            border-radius: 999px;
            font-size: 11px;
            font-weight: 600;
            text-transform: capitalize;
            background: rgba(71, 85, 105, 0.45);
            color: #e2e8f0;
        }

        .support-ticket-status.badge-open,
        .support-status-badge.open {
            background: rgba(34, 197, 94, 0.18);
            color: #86efac;
            border: 1px solid rgba(34, 197, 94, 0.4);
        }

        .support-ticket-status.badge-pending_support,
        .support-status-badge.pending_support {
            background: rgba(129, 140, 248, 0.18);
            color: #c7d2fe;
            border: 1px solid rgba(129, 140, 248, 0.4);
        }

        .support-ticket-status.badge-pending_customer,
        .support-status-badge.pending_customer {
            background: rgba(250, 204, 21, 0.18);
            color: #fde68a;
            border: 1px solid rgba(250, 204, 21, 0.4);
        }

        .support-ticket-status.badge-closed,
        .support-status-badge.closed {
            background: rgba(107, 114, 128, 0.2);
            color: #d1d5db;
            border: 1px solid rgba(107, 114, 128, 0.4);
        }

        .support-ticket-meta {
            font-size: 11px;
            color: #94a3b8;
            white-space: nowrap;
        }

        .support-ticket-requester {
            flex-basis: 100%;
            font-size: 11px;
            color: #c7d2fe;
            opacity: 0.9;
        }

        .support-modal-header .support-ticket-requester {
            font-size: 12px;
            margin-top: 4px;
        }

        .support-modal,
        .support-ticket-modal {
            max-width: 680px;
            width: 100%;
        }

        .support-modal-body {
            max-height: 420px;
            overflow-y: auto;
            padding-right: 6px;
            display: flex;
            flex-direction: column;
            gap: 16px;
        }

        .support-modal-body::-webkit-scrollbar {
            width: 6px;
        }

        .support-modal-body::-webkit-scrollbar-thumb {
            background: rgba(148, 163, 184, 0.35);
            border-radius: 999px;
        }

        .support-modal-header {
            display: flex;
            align-items: flex-start;
            gap: 16px;
        }

        .support-ticket-badges {
            display: flex;
            flex-wrap: wrap;
            gap: 8px;
            justify-content: flex-end;
        }

        .support-status-badge,
        .support-priority-badge,
        .support-category-badge {
            display: inline-flex;
            align-items: center;
            justify-content: center;
            padding: 4px 10px;
            border-radius: 999px;
            font-size: 11px;
            font-weight: 600;
        }

        .support-priority-badge.low {
            background: rgba(56, 189, 248, 0.18);
            color: #7dd3fc;
            border: 1px solid rgba(56, 189, 248, 0.4);
        }

        .support-priority-badge.normal {
            background: rgba(148, 163, 184, 0.2);
            color: #cbd5f5;
            border: 1px solid rgba(148, 163, 184, 0.4);
        }

        .support-priority-badge.high {
            background: rgba(249, 115, 22, 0.2);
            color: #fdba74;
            border: 1px solid rgba(249, 115, 22, 0.4);
        }

        .support-priority-badge.urgent {
            background: rgba(248, 113, 113, 0.2);
            color: #fecaca;
            border: 1px solid rgba(248, 113, 113, 0.45);
        }

        .support-category-badge {
            background: rgba(99, 102, 241, 0.18);
            color: #a5b4fc;
            border: 1px solid rgba(99, 102, 241, 0.4);
        }

        .support-ticket-subtitle {
            margin-top: 4px;
            font-size: 12px;
            color: #94a3b8;
        }

        .support-message-list {
            display: flex;
            flex-direction: column;
            gap: 12px;
        }

        .support-message {
            border-radius: 10px;
            padding: 12px 14px;
            display: flex;
            flex-direction: column;
            gap: 6px;
            background: rgba(15, 23, 42, 0.7);
            border: 1px solid rgba(51, 65, 85, 0.65);
            color: #e2e8f0;
        }

        .support-message.from-staff {
            background: linear-gradient(135deg, rgba(79, 70, 229, 0.78), rgba(129, 140, 248, 0.88));
            border-color: rgba(129, 140, 248, 0.6);
            color: #f8fafc;
            box-shadow: 0 12px 26px rgba(79, 70, 229, 0.22);
        }

        .support-message-header {
            display: flex;
            justify-content: space-between;
            align-items: center;
            font-size: 12px;
            color: inherit;
        }

        .support-message-author {
            font-weight: 600;
        }

        .support-message-time {
            opacity: 0.8;
        }

        .support-message-body {
            font-size: 13px;
            line-height: 1.5;
        }

        .support-ticket-notice {
            padding: 12px 14px;
            border-radius: 8px;
            background: rgba(248, 250, 252, 0.05);
            color: #cbd5f5;
            font-size: 12px;
            border: 1px solid rgba(148, 163, 184, 0.2);
        }

        .support-modal-footer {
            display: flex;
            flex-direction: column;
            gap: 12px;
        }

        .support-footer-actions {
            display: flex;
            flex-direction: column;
            gap: 12px;
        }

        .support-status-actions {
            display: flex;
            flex-wrap: wrap;
            gap: 8px;
            justify-content: flex-start;
        }

        .support-staff-actions {
            display: flex;
            flex-wrap: wrap;
            gap: 8px;
            justify-content: flex-start;
        }

        .support-staff-actions .btn {
            display: inline-flex;
            align-items: center;
            gap: 6px;
            border-color: rgba(129, 140, 248, 0.35);
            color: #c7d2fe;
        }

        .support-staff-actions .btn.active {
            background: rgba(79, 70, 229, 0.25);
            border-color: rgba(129, 140, 248, 0.6);
            color: #ede9fe;
        }

        .support-staff-actions .btn.danger {
            border-color: rgba(248, 113, 113, 0.45);
            color: #fecaca;
        }

        .support-staff-actions .btn.danger:hover {
            border-color: rgba(248, 113, 113, 0.6);
            background: rgba(248, 113, 113, 0.18);
            color: #fee2e2;
        }

        .support-staff-actions .btn:disabled {
            opacity: 0.6;
            cursor: not-allowed;
        }

        .support-reply-form {
            display: flex;
            flex-direction: column;
            gap: 8px;
        }

        .support-reply-form textarea {
            width: 100%;
            min-height: 96px;
            resize: vertical;
            background: rgba(15, 23, 42, 0.88);
            border: 1px solid rgba(51, 65, 85, 0.7);
            color: #e2e8f0;
            border-radius: 8px;
            padding: 10px 12px;
            font-family: inherit;
        }

        .support-reply-form textarea:disabled {
            opacity: 0.6;
            cursor: not-allowed;
        }

        .support-reply-buttons {
            display: flex;
            justify-content: flex-end;
            gap: 10px;
            flex-wrap: wrap;
        }

        .support-disclaimer {
            margin: 0;
            font-size: 12px;
            color: #9ca3af;
        }

        .visually-hidden {
            position: absolute !important;
            width: 1px !important;
            height: 1px !important;
            padding: 0 !important;
            margin: -1px !important;
            overflow: hidden !important;
            clip: rect(0, 0, 0, 0) !important;
            white-space: nowrap !important;
            border: 0 !important;
        }

        .label-optional {
            font-size: 11px;
            color: #9ca3af;
            font-weight: 500;
            margin-left: 4px;
        }

        .conversation-preview {
            font-size: 12px;
            color: #cbd5f5;
            line-height: 1.4;
        }

        .conversation-meta {
            display: flex;
            align-items: center;
            gap: 6px;
            font-size: 11px;
            color: #94a3b8;
        }

        .conversation-unread {
            display: inline-flex;
            align-items: center;
            justify-content: center;
            min-width: 22px;
            padding: 2px 8px;
            border-radius: 999px;
            background: rgba(129, 140, 248, 0.28);
            color: #c7d2fe;
            font-size: 11px;
            font-weight: 600;
        }

        .message-modal {
            max-width: 640px;
            width: 100%;
        }

        .message-modal-body {
            max-height: 420px;
            overflow-y: auto;
            padding-right: 6px;
        }

        .message-modal-body::-webkit-scrollbar {
            width: 6px;
        }

        .message-modal-body::-webkit-scrollbar-thumb {
            background: rgba(148, 163, 184, 0.35);
            border-radius: 999px;
        }

        .conversation-messages {
            display: flex;
            flex-direction: column;
            gap: 12px;
        }

        .conversation-empty-state {
            text-align: center;
            color: #94a3b8;
            padding: 1.5rem 1rem;
            font-size: 13px;
        }

        .message-bubble {
            max-width: 82%;
            padding: 12px 14px;
            border-radius: 14px;
            background: rgba(30, 41, 59, 0.82);
            border: 1px solid rgba(51, 65, 85, 0.7);
            color: #e2e8f0;
            display: inline-flex;
            flex-direction: column;
            gap: 6px;
            box-shadow: 0 10px 24px rgba(15, 23, 42, 0.25);
        }

        .message-bubble.self {
            margin-left: auto;
            background: linear-gradient(135deg, rgba(79, 70, 229, 0.78), rgba(129, 140, 248, 0.88));
            border-color: rgba(129, 140, 248, 0.6);
            box-shadow: 0 14px 28px rgba(79, 70, 229, 0.25);
        }

        .message-bubble .message-text {
            white-space: pre-wrap;
            word-break: break-word;
            font-size: 13px;
        }

        .message-bubble .message-meta {
            font-size: 11px;
            color: #a5b4fc;
            display: flex;
            justify-content: flex-end;
            gap: 8px;
        }

        .message-bubble.self .message-meta {
            color: rgba(226, 232, 240, 0.78);
        }

        .message-modal-footer {
            display: flex;
            flex-direction: column;
            gap: 10px;
            border-top: 1px solid rgba(30, 41, 59, 0.9);
        }

        .message-modal-footer textarea,
        #newMessageContent {
            width: 100%;
            resize: vertical;
            min-height: 82px;
            background: rgba(15, 23, 42, 0.6);
            border: 1px solid rgba(51, 65, 85, 0.75);
            border-radius: 10px;
            color: #f8fafc;
            padding: 10px 12px;
            font-size: 13px;
        }

        .message-modal-footer textarea:focus,
        #newMessageContent:focus {
            outline: none;
            border-color: rgba(129, 140, 248, 0.9);
            box-shadow: 0 0 0 1px rgba(129, 140, 248, 0.4);
        }

        .message-form-actions {
            display: flex;
            justify-content: flex-end;
            gap: 10px;
        }

        @media (max-width: 768px) {
            .conversation-list {
                max-height: 220px;
            }

            .message-modal {
                max-width: 100%;
            }

            .message-bubble {
                max-width: 100%;
            }
        }

        /* Loading and Error States */
        .loading {
            text-align: center;
            padding: 3rem;
            color: #9ca3af;
        }

        .loading i {
            font-size: 2rem;
            margin-bottom: 1rem;
            animation: spin 1s linear infinite;
        }

        @keyframes spin {
            0% { transform: rotate(0deg); }
            100% { transform: rotate(360deg); }
        }

        .error {
            text-align: center;
           /* padding: 3rem;*/
            color: #ef4444;
        }


        /* Responsive */
        @media (max-width: 768px) {
            .app-header {
                padding: 12px 16px;
            }

            .app-branding {
                padding: 12px 16px;
            }

            .header-actions {
                padding: 12px 16px;
            }

            .auth-overlay {
                padding: 16px;
            }

            .auth-container {
                margin: 30px auto;
                padding: 0 16px;
            }

            .auth-form {
                padding: 20px;
            }

            .forum-container {
                padding: 16px;
            }

            .forum-main-layout {
                grid-template-columns: 1fr;
                grid-template-areas:
                    "sidebar"
                    "content";
                gap: 15px;
            }

            .forum-sidebar {
                max-width: 100%;
            }

            .forum-main-content {
                min-width: 0;
            }

            @supports not (display: grid) {
                .forum-main-layout {
                    flex-direction: column;
                    align-items: stretch;
                }

                .forum-sidebar {
                    flex: 0 0 auto;
                }

                .forum-main-content {
                    flex: 1 1 auto;
                }
            }

            .sidebar-widget {
                padding: 12px;
            }

            .breadcrumb-nav {
                padding: 10px 12px;
                font-size: 11px;
            }
        }

        /* Custom Banner Styles */
        .custom-banner {
            display: none;
            width: 100%;
            background: #1a1f2e;
            border-bottom: 1px solid #2a3441;
            overflow: hidden;
            position: relative;
        }

        .custom-banner.active {
            display: block;
        }

        .banner-content {
            position: relative;
            max-width: 1200px;
            margin: 0 auto;
            padding: 0;
        }

        .banner-image {
            width: 100%;
            height: 200px;
            object-fit: cover;
            display: block;
        }

        .banner-overlay {
            position: absolute;
            top: 0;
            left: 0;
            right: 0;
            bottom: 0;
            background: linear-gradient(45deg, rgba(26, 31, 46, 0), rgba(26, 31, 46, 0));
            display: flex;
            align-items: center;
            justify-content: center;
        }

        .banner-text {
            color: white;
            text-align: center;
            z-index: 2;
        }

        .banner-title {
            font-size: 28px;
            font-weight: 700;
            margin: 0 0 8px 0;
            text-shadow: 0 2px 4px rgba(0,0,0,0.5);
        }

        .banner-subtitle {
            font-size: 16px;
            margin: 0;
            opacity: 0.9;
            text-shadow: 0 1px 2px rgba(0,0,0,0.5);
        }

        @media (max-width: 768px) {
            .banner-image {
                height: 150px;
            }
            
            .banner-title {
                font-size: 22px;
            }
            
            .banner-subtitle {
                font-size: 14px;
            }
        }