/* Forum / Chat Page Styles */

/* Header Glow Adjustment */
.gradient-text-blue {
    background: linear-gradient(135deg, #60a5fa 0%, #3b82f6 100%);
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
}

/* Sidebar Channels */
.channel-btn {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    width: 100%;
    padding: 0.5rem 0.75rem;
    border-radius: 0.5rem;
    color: #94a3b8;
    font-weight: 500;
    transition: all 0.2s ease;
    margin-bottom: 0.25rem;
    position: relative;
}

.channel-btn:hover {
    background-color: rgba(30, 41, 59, 0.5);
    color: #f8fafc;
}

.channel-btn.active {
    background-color: rgba(59, 130, 246, 0.15);
    color: #60a5fa;
}

.channel-btn.active i {
    color: #60a5fa;
}

/* Channel Unread Badge */
.channel-unread {
    margin-left: auto;
    background: linear-gradient(135deg, #3b82f6, #6366f1);
    color: white;
    font-size: 0.65rem;
    font-weight: 700;
    line-height: 1;
    padding: 0.15rem 0.45rem;
    border-radius: 999px;
    min-width: 1.1rem;
    text-align: center;
    box-shadow: 0 0 8px rgba(59, 130, 246, 0.4);
}

/* Mobile channel pills */
#mobile-channel-list {
    scrollbar-width: none;
}

#mobile-channel-list::-webkit-scrollbar {
    display: none;
}

#mobile-channel-list .channel-btn {
    white-space: nowrap;
    width: auto;
    padding: 0.25rem 0.75rem;
    font-size: 0.875rem;
    background-color: rgba(30, 41, 59, 0.5);
    border: 1px solid rgba(51, 65, 85, 0.5);
}

#mobile-channel-list .channel-btn.active {
    border-color: rgba(59, 130, 246, 0.5);
}

/* ─── Pinned Message Bar ─── */
.pinned-message-bar {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.5rem 1rem;
    background: linear-gradient(90deg, rgba(59, 130, 246, 0.08), rgba(99, 102, 241, 0.05));
    border-bottom: 1px solid rgba(59, 130, 246, 0.15);
    animation: slideDown 0.3s ease;
}

.pinned-icon {
    color: #60a5fa;
    flex-shrink: 0;
}

.pinned-content {
    flex: 1;
    min-width: 0;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.pinned-label {
    font-size: 0.7rem;
    font-weight: 700;
    color: #60a5fa;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    flex-shrink: 0;
}

.pinned-text {
    font-size: 0.8rem;
    color: #94a3b8;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.pinned-close {
    color: #64748b;
    transition: color 0.2s;
    flex-shrink: 0;
}

.pinned-close:hover {
    color: #f8fafc;
}

/* ─── Search Bar ─── */
.search-bar {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.5rem 1rem;
    background: rgba(15, 23, 42, 0.6);
    border-bottom: 1px solid rgba(51, 65, 85, 0.5);
    animation: slideDown 0.3s ease;
}

.search-bar input {
    font-size: 0.875rem;
}

@keyframes slideDown {
    from {
        opacity: 0;
        transform: translateY(-8px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* ─── Chat Messages ─── */
.message-card {
    display: flex;
    gap: 1rem;
    padding: 0.5rem 0.75rem;
    border-radius: 0.75rem;
    transition: background-color 0.2s;
    position: relative;
    group: true;
}

.message-card:hover {
    background-color: rgba(30, 41, 59, 0.3);
}

/* Message Actions (visible on hover) */
.message-actions {
    position: absolute;
    top: -0.5rem;
    right: 0.5rem;
    display: flex;
    gap: 0.25rem;
    background: #1e293b;
    border: 1px solid rgba(51, 65, 85, 0.8);
    border-radius: 0.5rem;
    padding: 0.15rem 0.25rem;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.15s ease, transform 0.15s ease;
    transform: translateY(4px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3);
    z-index: 5;
}

.message-card:hover .message-actions {
    opacity: 1;
    pointer-events: all;
    transform: translateY(0);
}

.message-action-btn {
    width: 1.75rem;
    height: 1.75rem;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 0.375rem;
    color: #94a3b8;
    transition: all 0.15s;
    cursor: pointer;
}

.message-action-btn:hover {
    background: rgba(59, 130, 246, 0.15);
    color: #60a5fa;
}

.message-avatar {
    width: 2.5rem;
    height: 2.5rem;
    border-radius: 50%;
    background: linear-gradient(135deg, #1e293b, #334155);
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: bold;
    font-size: 0.875rem;
    color: white;
    flex-shrink: 0;
}

.message-avatar.bot {
    background: linear-gradient(135deg, #3b82f6, #8b5cf6);
}

.message-content {
    flex: 1;
    min-width: 0;
}

.message-header {
    display: flex;
    align-items: baseline;
    gap: 0.5rem;
    margin-bottom: 0.25rem;
}

.message-sender {
    font-weight: 600;
    color: #f8fafc;
}

.message-sender.bot-name {
    color: #a78bfa;
}

.message-time {
    font-size: 0.7rem;
    color: #475569;
}

.message-text {
    color: #cbd5e1;
    line-height: 1.5;
    word-break: break-word;
    white-space: pre-wrap;
    font-size: 0.925rem;
}

/* ─── Reply Quote ─── */
.reply-quote {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.35rem 0.65rem;
    margin-bottom: 0.35rem;
    background: rgba(59, 130, 246, 0.06);
    border-left: 2px solid #3b82f6;
    border-radius: 0 0.375rem 0.375rem 0;
    font-size: 0.8rem;
    color: #94a3b8;
    cursor: pointer;
    transition: background 0.2s;
}

.reply-quote:hover {
    background: rgba(59, 130, 246, 0.12);
}

.reply-quote .reply-author {
    font-weight: 600;
    color: #60a5fa;
}

.reply-quote .reply-body {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    max-width: 300px;
}

/* ─── Reactions ─── */
.reactions-bar {
    display: flex;
    gap: 0.35rem;
    margin-top: 0.35rem;
    flex-wrap: wrap;
}

.reaction-chip {
    display: inline-flex;
    align-items: center;
    gap: 0.3rem;
    padding: 0.15rem 0.5rem;
    border-radius: 999px;
    font-size: 0.8rem;
    background: rgba(30, 41, 59, 0.6);
    border: 1px solid rgba(51, 65, 85, 0.5);
    cursor: pointer;
    transition: all 0.2s;
    user-select: none;
}

.reaction-chip:hover {
    border-color: rgba(59, 130, 246, 0.4);
    background: rgba(59, 130, 246, 0.1);
}

.reaction-chip.active {
    border-color: rgba(59, 130, 246, 0.5);
    background: rgba(59, 130, 246, 0.15);
    box-shadow: 0 0 6px rgba(59, 130, 246, 0.2);
}

.reaction-chip .reaction-count {
    font-size: 0.7rem;
    color: #94a3b8;
    font-weight: 600;
}

.reaction-chip.active .reaction-count {
    color: #60a5fa;
}

/* Image attachments */
.message-image {
    max-width: 100%;
    max-height: 300px;
    border-radius: 0.5rem;
    margin-top: 0.5rem;
    border: 1px solid rgba(51, 65, 85, 0.5);
    cursor: pointer;
    transition: transform 0.2s;
}

.message-image:hover {
    transform: scale(1.02);
}

/* Trade Idea Card in Chat */
.trade-idea-card {
    background: rgba(15, 23, 42, 0.6);
    border: 1px solid rgba(59, 130, 246, 0.3);
    border-radius: 0.75rem;
    padding: 1rem;
    margin-top: 0.5rem;
    max-width: 400px;
}

.trade-idea-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 0.75rem;
    padding-bottom: 0.5rem;
    border-bottom: 1px solid rgba(51, 65, 85, 0.5);
}

.trade-badge {
    padding: 0.125rem 0.5rem;
    border-radius: 0.25rem;
    font-size: 0.75rem;
    font-weight: 700;
    letter-spacing: 0.05em;
}

.trade-badge.LONG {
    background-color: rgba(34, 197, 94, 0.2);
    color: #4ade80;
    border: 1px solid rgba(34, 197, 94, 0.3);
}

.trade-badge.SHORT {
    background-color: rgba(239, 68, 68, 0.2);
    color: #f87171;
    border: 1px solid rgba(239, 68, 68, 0.3);
}

.trade-asset {
    font-weight: bold;
    color: #f8fafc;
}

.trade-details {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 0.5rem;
    font-size: 0.875rem;
}

.trade-detail-item .label {
    font-size: 0.75rem;
    color: #64748b;
}

.trade-detail-item .value {
    color: #cbd5e1;
    font-weight: 500;
}

/* Image preview thumbnails */
.image-preview-thumb {
    position: relative;
    width: 60px;
    height: 60px;
    border-radius: 0.5rem;
    overflow: hidden;
    border: 1px solid rgba(51, 65, 85, 0.5);
    flex-shrink: 0;
}

.image-preview-thumb img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.remove-image-btn {
    position: absolute;
    top: 2px;
    right: 2px;
    background: rgba(15, 23, 42, 0.8);
    color: white;
    border-radius: 50%;
    width: 18px;
    height: 18px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 10px;
    cursor: pointer;
}

.remove-image-btn:hover {
    background: rgba(239, 68, 68, 0.9);
}

/* ─── Typing Indicator ─── */
.typing-indicator {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.4rem 1.25rem;
    font-size: 0.75rem;
    color: #64748b;
    border-top: 1px solid rgba(51, 65, 85, 0.3);
}

.typing-dots {
    display: flex;
    gap: 3px;
    align-items: center;
}

.typing-dots span {
    width: 5px;
    height: 5px;
    border-radius: 50%;
    background: #64748b;
    animation: typingBounce 1.4s infinite ease-in-out;
}

.typing-dots span:nth-child(2) {
    animation-delay: 0.16s;
}

.typing-dots span:nth-child(3) {
    animation-delay: 0.32s;
}

@keyframes typingBounce {

    0%,
    60%,
    100% {
        transform: translateY(0);
        opacity: 0.4;
    }

    30% {
        transform: translateY(-4px);
        opacity: 1;
    }
}

/* ─── Reply Preview ─── */
.reply-preview {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.5rem;
    padding: 0.5rem 0.75rem;
    margin-bottom: 0.5rem;
    background: rgba(59, 130, 246, 0.08);
    border-left: 3px solid #3b82f6;
    border-radius: 0 0.5rem 0.5rem 0;
    animation: slideDown 0.2s ease;
}

.reply-preview-content {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    min-width: 0;
}

.reply-preview-sender {
    font-size: 0.8rem;
    font-weight: 600;
    color: #60a5fa;
    flex-shrink: 0;
}

.reply-preview-text {
    font-size: 0.8rem;
    color: #94a3b8;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.reply-cancel-btn {
    color: #64748b;
    transition: color 0.2s;
    flex-shrink: 0;
    padding: 0.25rem;
    border-radius: 0.25rem;
}

.reply-cancel-btn:hover {
    color: #ef4444;
    background: rgba(239, 68, 68, 0.1);
}

/* ─── Emoji Picker ─── */
.emoji-picker {
    position: absolute;
    bottom: calc(100% + 0.5rem);
    left: 0.5rem;
    width: 280px;
    max-height: 240px;
    background: #0f172a;
    border: 1px solid rgba(51, 65, 85, 0.8);
    border-radius: 0.75rem;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.4);
    z-index: 50;
    overflow: hidden;
    animation: slideDown 0.2s ease;
}

.emoji-picker-header {
    padding: 0.5rem 0.75rem;
    border-bottom: 1px solid rgba(51, 65, 85, 0.5);
}

.emoji-grid {
    display: grid;
    grid-template-columns: repeat(8, 1fr);
    gap: 2px;
    padding: 0.5rem;
    max-height: 180px;
    overflow-y: auto;
}

.emoji-grid button {
    width: 100%;
    aspect-ratio: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.25rem;
    border-radius: 0.375rem;
    transition: all 0.15s;
    cursor: pointer;
}

.emoji-grid button:hover {
    background: rgba(59, 130, 246, 0.15);
    transform: scale(1.15);
}

.emoji-grid::-webkit-scrollbar {
    width: 4px;
}

.emoji-grid::-webkit-scrollbar-track {
    background: transparent;
}

.emoji-grid::-webkit-scrollbar-thumb {
    background: rgba(51, 65, 85, 0.5);
    border-radius: 10px;
}

/* ─── Online Users Panel ─── */
.online-users-panel {
    width: 220px;
    border-left: 1px solid rgba(51, 65, 85, 0.5);
    background: rgba(15, 23, 42, 0.4);
    flex-shrink: 0;
    display: flex;
    flex-direction: column;
    animation: slideInRight 0.3s ease;
}

@keyframes slideInRight {
    from {
        opacity: 0;
        transform: translateX(20px);
    }

    to {
        opacity: 1;
        transform: translateX(0);
    }
}

.online-user-item {
    display: flex;
    align-items: center;
    gap: 0.65rem;
    padding: 0.45rem 0.5rem;
    border-radius: 0.5rem;
    transition: background 0.2s;
    cursor: default;
}

.online-user-item:hover {
    background: rgba(30, 41, 59, 0.4);
}

.online-user-avatar {
    width: 2rem;
    height: 2rem;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    font-size: 0.7rem;
    color: white;
    flex-shrink: 0;
    position: relative;
}

.online-user-avatar .status-dot {
    position: absolute;
    bottom: -1px;
    right: -1px;
    width: 8px;
    height: 8px;
    border-radius: 50%;
    border: 1.5px solid #0f172a;
}

.status-dot.online {
    background: #22c55e;
}

.status-dot.idle {
    background: #f59e0b;
}

.online-user-info {
    min-width: 0;
}

.online-user-name {
    font-size: 0.8rem;
    font-weight: 500;
    color: #e2e8f0;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.online-user-role {
    font-size: 0.65rem;
    color: #64748b;
}

.online-user-role.admin {
    color: #f59e0b;
}

.online-user-role.mod {
    color: #a78bfa;
}

/* Search highlight */
.search-highlight {
    background: rgba(59, 130, 246, 0.3);
    border-radius: 2px;
    padding: 0 1px;
}

/* Custom Scrollbar for chat */
.chat-feed::-webkit-scrollbar {
    width: 6px;
}

.chat-feed::-webkit-scrollbar-track {
    background: transparent;
}

.chat-feed::-webkit-scrollbar-thumb {
    background: rgba(51, 65, 85, 0.5);
    border-radius: 10px;
}

.chat-feed::-webkit-scrollbar-thumb:hover {
    background: rgba(51, 65, 85, 0.8);
}

/* Online users panel scrollbar */
.online-users-panel::-webkit-scrollbar,
#online-users-list::-webkit-scrollbar {
    width: 4px;
}

#online-users-list::-webkit-scrollbar-thumb {
    background: rgba(51, 65, 85, 0.4);
    border-radius: 10px;
}

/* Responsive: hide users panel on small screens */
@media (max-width: 1024px) {
    .online-users-panel {
        display: none !important;
    }
}