/* ============================================
   Hodlr.chat Web App Styles
   ============================================ */

/* App Container */
#app-content {
    min-height: calc(100vh - 200px);
    padding-top: 120px;
}

/* ============================================
   Trending Page
   ============================================ */
.trending-page {
    max-width: 1000px;
    margin: 0 auto;
    padding: 40px 24px;
}

.trending-header {
    text-align: center;
    margin-bottom: 48px;
}

.trending-header h1 {
    font-family: 'Outfit', sans-serif;
    font-size: 48px;
    font-weight: 800;
    margin-bottom: 16px;
    background: linear-gradient(180deg, #fff 0%, #a5a5b0 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.trending-header p {
    font-size: 18px;
    color: var(--text-secondary);
}

/* Token Search */
.token-search {
    display: flex;
    gap: 12px;
    max-width: 600px;
    margin: 0 auto 60px;
}

.token-search input {
    flex: 1;
    padding: 16px 20px;
    background: var(--bg-secondary);
    border: 1px solid var(--border-color);
    border-radius: 12px;
    color: #fff;
    font-size: 15px;
    font-family: 'JetBrains Mono', monospace;
    outline: none;
    transition: all 0.2s;
}

.token-search input:focus {
    border-color: var(--accent);
    box-shadow: 0 0 0 3px var(--accent-glow);
}

.token-search input::placeholder {
    color: var(--text-secondary);
}

/* Trending Section */
.trending-section {
    margin-bottom: 40px;
}

.trending-section-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 24px;
    flex-wrap: wrap;
    gap: 16px;
}

.trending-section h2 {
    font-family: 'Outfit', sans-serif;
    font-size: 24px;
    font-weight: 700;
    color: #fff;
    margin: 0;
}

.sort-controls {
    display: flex;
    align-items: center;
    gap: 8px;
}

.sort-label {
    font-size: 13px;
    color: var(--text-secondary);
    margin-right: 4px;
}

.sort-btn {
    background: var(--bg-secondary);
    border: 1px solid var(--border-color);
    border-radius: 100px;
    padding: 6px 14px;
    font-size: 12px;
    font-weight: 500;
    color: var(--text-secondary);
    cursor: pointer;
    transition: all 0.2s;
}

.sort-btn:hover {
    border-color: var(--accent);
    color: #fff;
}

.sort-btn.active {
    background: rgba(0, 238, 189, 0.1);
    border-color: var(--accent);
    color: var(--accent);
}

.trending-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
    gap: 16px;
}

/* Token Card */
.token-card {
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: 16px;
    padding: 20px;
    text-decoration: none;
    color: inherit;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 12px;
    transition: all 0.2s;
    position: relative;
}

.token-card:hover {
    border-color: var(--border-hover);
    transform: translateY(-4px);
    box-shadow: 0 12px 40px rgba(0, 0, 0, 0.3);
}

.token-card-image {
    width: 56px;
    height: 56px;
    border-radius: 50%;
    object-fit: cover;
    border: 2px solid var(--border-color);
}

.token-card-info {
    text-align: center;
}

.token-card-name {
    display: block;
    font-weight: 600;
    font-size: 14px;
    color: #fff;
    margin-bottom: 4px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    max-width: 140px;
}

.token-card-symbol {
    font-family: 'JetBrains Mono', monospace;
    font-size: 12px;
    color: var(--text-secondary);
}

.token-card-online {
    position: absolute;
    top: 12px;
    right: 12px;
    font-size: 10px;
    font-family: 'JetBrains Mono', monospace;
    color: var(--accent);
    background: rgba(0, 238, 189, 0.1);
    padding: 4px 8px;
    border-radius: 100px;
    border: 1px solid rgba(0, 238, 189, 0.2);
}

.token-card-mcap {
    font-family: 'JetBrains Mono', monospace;
    font-size: 12px;
    color: var(--text-secondary);
    margin-top: 4px;
}

.token-card-change {
    font-family: 'JetBrains Mono', monospace;
    font-size: 11px;
    padding: 2px 6px;
    border-radius: 4px;
    margin-top: 4px;
}

.token-card-change.positive {
    color: #00c853;
    background: rgba(0, 200, 83, 0.1);
}

.token-card-change.negative {
    color: #ff5252;
    background: rgba(255, 82, 82, 0.1);
}

.trending-loading,
.trending-empty,
.trending-error {
    grid-column: 1 / -1;
    text-align: center;
    padding: 60px 20px;
    color: var(--text-secondary);
    font-size: 16px;
}

/* ============================================
   Token Page
   ============================================ */
.token-page {
    max-width: 800px;
    margin: 0 auto;
    padding: 24px;
    display: flex;
    flex-direction: column;
    height: calc(100vh - 150px);
}

.token-header {
    display: flex;
    align-items: center;
    gap: 16px;
    padding-bottom: 20px;
    border-bottom: 1px solid var(--border-color);
    margin-bottom: 20px;
}

.back-btn {
    color: var(--text-secondary);
    text-decoration: none;
    font-size: 14px;
    font-weight: 500;
    transition: color 0.2s;
}

.back-btn:hover {
    color: #fff;
}

.token-info {
    flex: 1;
    display: flex;
    align-items: center;
    gap: 12px;
}

.token-image {
    width: 48px;
    height: 48px;
    border-radius: 50%;
    border: 2px solid var(--border-color);
}

.token-info h1 {
    font-family: 'Outfit', sans-serif;
    font-size: 20px;
    font-weight: 700;
    color: #fff;
    margin-bottom: 2px;
}

.token-mint {
    font-family: 'JetBrains Mono', monospace;
    font-size: 11px;
    color: var(--text-secondary);
}

.token-actions {
    display: flex;
    align-items: center;
    gap: 12px;
}

.online-badge {
    font-family: 'JetBrains Mono', monospace;
    font-size: 12px;
    color: var(--accent);
    background: rgba(0, 238, 189, 0.1);
    padding: 6px 12px;
    border-radius: 100px;
    border: 1px solid rgba(0, 238, 189, 0.2);
}

.wallet-badge {
    font-family: 'JetBrains Mono', monospace;
    font-size: 12px;
    color: #fff;
    background: var(--bg-secondary);
    padding: 6px 12px;
    border-radius: 100px;
    border: 1px solid var(--border-color);
}

/* ============================================
   Chat Container
   ============================================ */
.chat-container {
    flex: 1;
    display: flex;
    flex-direction: column;
    background: var(--bg-secondary);
    border: 1px solid var(--border-color);
    border-radius: 16px;
    overflow: hidden;
}

.chat-messages {
    flex: 1;
    padding: 20px;
    overflow-y: auto;
    display: flex;
    flex-direction: column;
    gap: 16px;
}

.chat-loading,
.chat-empty,
.chat-error {
    text-align: center;
    padding: 40px;
    color: var(--text-secondary);
}

/* Chat Message - Telegram Style */
.msg {
    position: relative;
    padding: 4px 48px 4px 52px;
    margin: 2px 0;
    transition: background 0.15s;
}

.msg:hover {
    background: rgba(255, 255, 255, 0.03);
}

.msg:first-child,
.msg:not(.msg-cont) {
    margin-top: 12px;
}

.msg::before {
    content: '';
    position: absolute;
    left: 12px;
    top: 6px;
    width: 32px;
    height: 32px;
    border-radius: 50%;
    background: linear-gradient(135deg, var(--user-color, #7c5cff) 0%, var(--user-color-2, #5c7cff) 100%);
}

.msg-cont::before {
    display: none;
}

.msg-cont {
    padding-top: 1px;
    padding-bottom: 1px;
}

.msg-cont-row {
    display: flex;
    align-items: center;
    gap: 8px;
    min-height: 16px;
}

.msg-header {
    display: flex;
    align-items: baseline;
    gap: 8px;
}

.msg-author {
    font-size: 14px;
    font-weight: 600;
    color: var(--user-color, #7c5cff);
}

.msg-author.author-dev {
    color: #FFD700;
}

.msg-badge {
    font-size: 9px;
    padding: 1px 5px;
    border-radius: 3px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.msg-badge.owner {
    background: linear-gradient(135deg, #FFD700, #FFA500);
    color: #000;
}

.msg-badge.mod {
    background: #5865F2;
    color: #fff;
}

.msg-timestamp {
    font-size: 11px;
    color: var(--text-secondary);
    margin-left: 8px;
    flex-shrink: 0;
}

.msg-body {
    font-size: 14px;
    line-height: 1.45;
    color: #fff;
    word-wrap: break-word;
}

/* Reply Reference - Telegram Style */
.msg-reply {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 4px 8px;
    margin-bottom: 4px;
    background: rgba(255, 255, 255, 0.05);
    border-radius: 4px;
    cursor: pointer;
    max-width: fit-content;
}

.msg-reply:hover {
    background: rgba(255, 255, 255, 0.08);
}

.msg-reply-bar {
    width: 2px;
    height: 24px;
    background: var(--accent);
    border-radius: 2px;
}

.msg-reply-user {
    font-size: 12px;
    font-weight: 600;
    color: var(--accent);
}

.msg-reply-text {
    font-size: 12px;
    color: var(--text-secondary);
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    max-width: 200px;
}

/* Continuation Time Hover */
.msg-time-hover {
    position: absolute;
    left: 4px;
    top: 50%;
    transform: translateY(-50%);
    font-size: 9px;
    color: var(--text-secondary);
    opacity: 0;
    transition: opacity 0.15s;
    font-family: 'JetBrains Mono', monospace;
}

.msg-cont:hover .msg-time-hover {
    opacity: 1;
}

/* Hover Actions - Inline in header */
.msg-actions {
    display: inline-flex;
    gap: 4px;
    margin-left: 8px;
    opacity: 0;
    transition: opacity 0.15s;
}

.msg:hover .msg-actions {
    opacity: 1;
}

.msg-action {
    background: none;
    border: none;
    padding: 4px 8px;
    font-size: 14px;
    cursor: pointer;
    color: var(--text-secondary);
    border-radius: 4px;
    transition: all 0.15s;
}

.msg-action:hover {
    background: rgba(255, 255, 255, 0.1);
    color: #fff;
}

/* Reactions Inline */
.msg-reactions {
    display: inline-flex;
    gap: 4px;
    margin-left: 8px;
}

.msg-reaction {
    font-size: 13px;
    padding: 2px 6px;
    background: rgba(255, 255, 255, 0.08);
    border-radius: 10px;
    cursor: pointer;
}

.msg-reaction:hover {
    background: rgba(255, 255, 255, 0.15);
}

/* Reaction Picker */
.msg-reaction-picker {
    position: absolute;
    top: 100%;
    right: 0;
    display: none;
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: 8px;
    padding: 4px;
    gap: 2px;
    z-index: 100;
}

.msg-reaction-picker.active {
    display: flex;
}

.msg-reaction-btn {
    background: none;
    border: none;
    font-size: 18px;
    padding: 4px;
    cursor: pointer;
    border-radius: 4px;
}

.msg-reaction-btn:hover {
    background: rgba(255, 255, 255, 0.1);
}

/* Pinned Message */
.msg-pinned {
    background: rgba(255, 215, 0, 0.05);
    border-left: 2px solid #FFD700;
}

/* User color variations based on wallet hash */
.msg:nth-child(5n+1) {
    --user-color: #f97316;
    --user-color-2: #fb923c;
}

.msg:nth-child(5n+2) {
    --user-color: #ec4899;
    --user-color-2: #f472b6;
}

.msg:nth-child(5n+3) {
    --user-color: #8b5cf6;
    --user-color-2: #a78bfa;
}

.msg:nth-child(5n+4) {
    --user-color: #06b6d4;
    --user-color-2: #22d3ee;
}

.msg:nth-child(5n+5) {
    --user-color: #22c55e;
    --user-color-2: #4ade80;
}

.msg-me .msg-author {
    color: var(--accent);
}

@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(4px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Own Message */
.chat-message-me {
    align-self: flex-end;
}

.chat-message-me .chat-message-header {
    flex-direction: row-reverse;
}

.chat-message-me .chat-message-sender {
    color: var(--accent);
}

.chat-message-me .chat-message-text {
    background: rgba(0, 238, 189, 0.1);
    border-color: rgba(0, 238, 189, 0.2);
    border-radius: 16px 4px 16px 16px;
}

/* Chat Input */
.chat-input-area {
    padding: 16px;
    background: rgba(255, 255, 255, 0.02);
    border-top: 1px solid var(--border-color);
    display: flex;
    gap: 12px;
}

.chat-input-area input {
    flex: 1;
    padding: 14px 18px;
    background: var(--bg-primary);
    border: 1px solid var(--border-color);
    border-radius: 12px;
    color: #fff;
    font-size: 14px;
    outline: none;
    transition: all 0.2s;
}

.chat-input-area input:focus {
    border-color: var(--accent);
}

.connect-prompt {
    display: flex;
    align-items: center;
    justify-content: space-between;
    width: 100%;
    color: var(--text-secondary);
    font-size: 14px;
}

/* Token Footer */
.token-footer {
    margin-top: 16px;
    text-align: center;
}

.external-link {
    color: var(--text-secondary);
    text-decoration: none;
    font-size: 13px;
    transition: color 0.2s;
}

.external-link:hover {
    color: var(--accent);
}

/* Chat Tool Button */
.chat-tool-btn {
    padding: 10px 16px;
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: 12px;
    color: var(--accent);
    font-size: 12px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s;
}

.chat-tool-btn:hover {
    background: rgba(0, 238, 189, 0.1);
    border-color: var(--accent);
}

/* GIF in Chat */
.chat-gif {
    max-width: 200px;
    max-height: 150px;
    border-radius: 8px;
    display: block;
}

/* Mention Highlight */
.chat-mention {
    color: var(--accent);
    font-weight: 600;
}

/* GIF Picker */
.gif-picker {
    position: absolute;
    bottom: 80px;
    left: 16px;
    right: 16px;
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: 16px;
    overflow: hidden;
    z-index: 100;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.4);
}

.gif-picker-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 12px 16px;
    border-bottom: 1px solid var(--border-color);
    font-weight: 600;
    font-size: 14px;
}

.gif-picker-close {
    background: none;
    border: none;
    color: var(--text-secondary);
    font-size: 20px;
    cursor: pointer;
    line-height: 1;
}

.gif-picker-close:hover {
    color: #fff;
}

.gif-search {
    padding: 12px;
    border-bottom: 1px solid var(--border-color);
}

.gif-search input {
    width: 100%;
    padding: 10px 14px;
    background: var(--bg-primary);
    border: 1px solid var(--border-color);
    border-radius: 8px;
    color: #fff;
    font-size: 13px;
    outline: none;
}

.gif-search input:focus {
    border-color: var(--accent);
}

.gif-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(140px, 1fr));
    gap: 8px;
    padding: 12px;
    height: 320px;
    overflow-y: auto;
}

.gif-item {
    aspect-ratio: 1.5;
    /* More standard video/gif ratio */
    border-radius: 8px;
    overflow: hidden;
    cursor: pointer;
    transition: transform 0.2s;
    background: #000;
    /* Placeholder bg */
}

.gif-item:hover {
    transform: scale(1.05);
    z-index: 1;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.5);
}

.gif-item img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.gif-loading {
    grid-column: 1 / -1;
    text-align: center;
    padding: 40px;
    color: var(--text-secondary);
}

.gif-powered {
    padding: 8px;
    text-align: center;
    font-size: 10px;
    color: var(--text-secondary);
    border-top: 1px solid var(--border-color);
}

/* Mention Picker */
.mention-picker {
    position: absolute;
    bottom: 80px;
    left: 16px;
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: 12px;
    overflow: hidden;
    z-index: 100;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.4);
    min-width: 180px;
}

.mention-item {
    padding: 10px 14px;
    cursor: pointer;
    transition: background 0.2s;
}

.mention-item:hover,
.mention-selected {
    background: rgba(0, 238, 189, 0.1);
}

.mention-addr {
    font-family: 'JetBrains Mono', monospace;
    font-size: 13px;
    color: var(--accent);
}

.mention-empty {
    padding: 16px;
    text-align: center;
    color: var(--text-secondary);
    font-size: 13px;
}

/* Admin Badges */
.chat-badge {
    font-size: 10px;
    padding: 2px 6px;
    border-radius: 4px;
    margin-left: 6px;
    font-weight: 600;
}

.chat-badge-owner {
    background: linear-gradient(135deg, #FFD700 0%, #FFA500 100%);
    color: #1a1a1a;
}

.chat-badge-mod {
    background: rgba(100, 149, 237, 0.2);
    color: #6495ED;
    border: 1px solid rgba(100, 149, 237, 0.3);
}

/* Owner message highlight */
.chat-message-owner .chat-message-text {
    border-left: 2px solid #FFD700;
}

/* Reactions */
.chat-reactions {
    display: flex;
    flex-wrap: wrap;
    gap: 4px;
    margin-top: 8px;
}

.chat-reaction {
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: 12px;
    padding: 2px 8px;
    font-size: 12px;
    cursor: pointer;
    transition: all 0.2s;
    display: flex;
    align-items: center;
    gap: 4px;
}

.chat-reaction:hover {
    border-color: var(--accent);
    background: rgba(0, 238, 189, 0.1);
}

.chat-reaction span {
    font-family: 'JetBrains Mono', monospace;
    font-size: 10px;
    color: var(--text-secondary);
}

.chat-add-reaction-wrap {
    position: relative;
    display: inline-block;
    margin-top: 6px;
}

.chat-add-reaction {
    background: none;
    border: none;
    font-size: 14px;
    cursor: pointer;
    opacity: 0.4;
    transition: opacity 0.2s;
}

.chat-add-reaction:hover {
    opacity: 1;
}

.chat-reaction-picker {
    position: absolute;
    bottom: 100%;
    left: 0;
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: 12px;
    padding: 6px;
    display: none;
    gap: 4px;
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.3);
}

.chat-reaction-picker.active {
    display: flex;
}

.chat-quick-reaction {
    background: none;
    border: none;
    font-size: 18px;
    cursor: pointer;
    padding: 4px;
    border-radius: 4px;
    transition: background 0.2s;
}

.chat-quick-reaction:hover {
    background: rgba(0, 238, 189, 0.1);
}

/* Whale Alert Message */
.chat-message[data-id^="whale-"] .chat-message-text {
    background: linear-gradient(135deg, rgba(0, 200, 83, 0.1) 0%, rgba(255, 215, 0, 0.1) 100%);
    border: 1px solid rgba(255, 215, 0, 0.3);
    font-weight: 600;
}

.chat-message[data-id^="whale-"] .chat-message-sender {
    color: #FFD700;
}

/* ============================================
   Token Price Display
   ============================================ */
.token-price-info {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-top: 4px;
}

.token-price {
    font-family: 'JetBrains Mono', monospace;
    font-size: 14px;
    font-weight: 600;
    color: var(--text-primary);
}

.token-change {
    font-family: 'JetBrains Mono', monospace;
    font-size: 12px;
    padding: 2px 6px;
    border-radius: 4px;
}

.token-change.price-up {
    color: #00c853;
    background: rgba(0, 200, 83, 0.15);
}

.token-change.price-down {
    color: #ff4444;
    background: rgba(255, 68, 68, 0.15);
}

/* ============================================
   Typing Indicator
   ============================================ */
.typing-indicator {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 8px 16px;
    font-size: 12px;
    color: var(--text-secondary);
}

.typing-dots {
    display: flex;
    gap: 3px;
}

.typing-dots span {
    width: 6px;
    height: 6px;
    background: var(--accent);
    border-radius: 50%;
    animation: typing-bounce 1.4s infinite ease-in-out both;
}

.typing-dots span:nth-child(1) {
    animation-delay: -0.32s;
}

.typing-dots span:nth-child(2) {
    animation-delay: -0.16s;
}

.typing-dots span:nth-child(3) {
    animation-delay: 0s;
}

@keyframes typing-bounce {

    0%,
    80%,
    100% {
        transform: scale(0.6);
        opacity: 0.5;
    }

    40% {
        transform: scale(1);
        opacity: 1;
    }
}

/* ============================================
   Theme Toggle
   ============================================ */
.icon-btn {
    background: none;
    border: none;
    font-size: 18px;
    cursor: pointer;
    padding: 8px;
    border-radius: 8px;
    transition: background 0.2s;
}

.icon-btn:hover {
    background: rgba(255, 255, 255, 0.1);
}

/* ============================================
   Sticker Picker
   ============================================ */
.sticker-picker {
    position: absolute;
    bottom: 100%;
    left: 0;
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: 12px;
    padding: 12px;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.3);
    margin-bottom: 8px;
}

.sticker-grid {
    display: grid;
    grid-template-columns: repeat(6, 1fr);
    gap: 4px;
}

.sticker-item {
    font-size: 28px;
    background: none;
    border: none;
    cursor: pointer;
    padding: 8px;
    border-radius: 8px;
    transition: all 0.2s;
}

.sticker-item:hover {
    background: rgba(0, 238, 189, 0.15);
    transform: scale(1.2);
}

.chat-sticker {
    font-size: 48px;
    display: block;
}

/* ============================================
   Reply UI
   ============================================ */
.reply-preview {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 8px 16px;
    background: rgba(0, 238, 189, 0.1);
    border-left: 3px solid var(--accent);
    font-size: 12px;
    color: var(--text-secondary);
}

.cancel-reply-btn {
    background: none;
    border: none;
    color: var(--text-secondary);
    cursor: pointer;
    font-size: 16px;
    padding: 4px 8px;
    border-radius: 4px;
}

.cancel-reply-btn:hover {
    background: rgba(255, 255, 255, 0.1);
}

.chat-reply-ref {
    font-size: 11px;
    color: var(--text-secondary);
    padding: 4px 8px;
    background: rgba(255, 255, 255, 0.05);
    border-radius: 6px;
    margin-bottom: 6px;
    cursor: pointer;
}

.chat-reply-ref:hover {
    background: rgba(255, 255, 255, 0.1);
}

.reply-to-user {
    color: var(--accent);
    font-weight: 500;
    margin-right: 4px;
}

/* Highlight flash when scrolling to parent */
.highlight-flash {
    animation: flash-highlight 1.5s ease-out;
}

@keyframes flash-highlight {

    0%,
    30% {
        background: rgba(0, 238, 189, 0.3);
    }

    100% {
        background: transparent;
    }
}

/* ============================================
   Message Actions
   ============================================ */
.chat-actions {
    display: flex;
    align-items: center;
    gap: 4px;
    margin-top: 4px;
    opacity: 0;
    transition: opacity 0.2s;
}

.chat-message:hover .chat-actions {
    opacity: 1;
}

.chat-action-btn {
    background: none;
    border: none;
    font-size: 14px;
    cursor: pointer;
    padding: 4px 6px;
    border-radius: 4px;
    opacity: 0.6;
    transition: all 0.2s;
}

.chat-action-btn:hover {
    opacity: 1;
    background: rgba(255, 255, 255, 0.1);
}

/* ============================================
   Pinned Messages
   ============================================ */
.pinned-messages {
    background: rgba(255, 215, 0, 0.08);
    border-bottom: 1px solid rgba(255, 215, 0, 0.2);
    padding: 8px 16px;
}

.pinned-header {
    font-size: 11px;
    font-weight: 600;
    color: #FFD700;
    margin-bottom: 6px;
}

.pinned-message {
    font-size: 12px;
    color: var(--text-secondary);
    padding: 4px 0;
    cursor: pointer;
}

.pinned-message:hover {
    color: var(--text-primary);
}

.chat-message-pinned {
    border-left: 2px solid #FFD700;
    padding-left: 12px;
}

.pinned-indicator {
    font-size: 10px;
    margin-left: 4px;
}

/* ============================================
   Light Theme
   ============================================ */
[data-theme="light"] {
    --bg-base: #f5f5f5;
    --bg-card: #ffffff;
    --text-primary: #111111;
    --text-secondary: #666666;
    --border-color: #e0e0e0;
}

[data-theme="light"] .token-page,
[data-theme="light"] .trending-page {
    background: var(--bg-base);
}

[data-theme="light"] .chat-message {
    background: var(--bg-card);
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
}

[data-theme="light"] .chat-input-area input {
    background: var(--bg-card);
    border-color: var(--border-color);
}

/* ============================================
   Responsive
   ============================================ */
@media (max-width: 768px) {
    .trending-header h1 {
        font-size: 32px;
    }

    .token-search {
        flex-direction: column;
    }

    .trending-grid {
        grid-template-columns: repeat(2, 1fr);
    }

    .token-header {
        flex-wrap: wrap;
    }

    .token-actions {
        width: 100%;
        justify-content: space-between;
        margin-top: 12px;
    }

    .chat-message {
        max-width: 85%;
    }

    .gif-grid {
        grid-template-columns: repeat(2, 1fr);
    }
}

/* --- Markdown & Embeds --- */
.msg-body strong {
    font-weight: 700;
    color: #fff;
}

.msg-body em {
    font-style: italic;
    opacity: 0.9;
}

.msg-body code {
    background: rgba(0, 0, 0, 0.3);
    padding: 2px 4px;
    border-radius: 4px;
    font-family: 'JetBrains Mono', monospace;
    font-size: 0.9em;
    color: #00ff9d;
}

.msg-body del {
    text-decoration: line-through;
    opacity: 0.6;
}

.msg-body blockquote {
    border-left: 3px solid var(--accent);
    margin: 4px 0;
    padding-left: 10px;
    padding-top: 2px;
    padding-bottom: 2px;
    opacity: 0.8;
    background: rgba(255, 255, 255, 0.05);
    font-style: italic;
    border-radius: 0 4px 4px 0;
}

.chat-embed-container {
    margin-top: 8px;
    max-width: 320px;
    max-height: 320px;
    border-radius: 12px;
    overflow: hidden;
    cursor: pointer;
    border: 1px solid rgba(255, 255, 255, 0.1);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.2);
    transition: transform 0.2s, box-shadow 0.2s;
}

.chat-embed-container:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 16px rgba(0, 0, 0, 0.3);
}

.chat-embed-img {
    width: 100%;
    height: 100%;
    object-fit: contain;
    display: block;
}

/* --- Link Preview Cards --- */
.link-preview {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 4px 10px;
    background: rgba(255, 255, 255, 0.06);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 6px;
    color: var(--accent);
    text-decoration: none;
    font-size: 13px;
    transition: all 0.2s;
    max-width: 100%;
    overflow: hidden;
}

.link-preview:hover {
    background: rgba(0, 238, 189, 0.1);
    border-color: var(--accent);
    transform: translateY(-1px);
}

.link-preview-icon {
    width: 16px;
    height: 16px;
    border-radius: 3px;
    flex-shrink: 0;
}

.link-preview-domain {
    font-weight: 600;
    color: #fff;
}

.link-preview-url {
    color: var(--text-secondary);
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

/* --- Message Animations --- */
@keyframes msgPopIn {
    0% {
        opacity: 0;
        transform: translateY(12px) scale(0.95);
    }

    100% {
        opacity: 1;
        transform: translateY(0) scale(1);
    }
}

.msg-animate-in {
    animation: msgPopIn 0.3s cubic-bezier(0.2, 0.8, 0.2, 1) forwards;
}

/* --- Juice Phase 2: Mentions & Swoosh --- */
.chat-mention {
    color: var(--accent);
    background: rgba(0, 238, 189, 0.1);
    padding: 2px 4px;
    border-radius: 4px;
    font-weight: 600;
    font-size: 0.95em;
}

/* Mention Pulse Animation (for self-mentions) */
@keyframes pulseGlow {
    0% {
        box-shadow: 0 0 0 0 rgba(0, 238, 189, 0.4);
        border-color: rgba(0, 238, 189, 0.6);
        background: rgba(0, 238, 189, 0.1);
    }

    70% {
        box-shadow: 0 0 0 10px rgba(0, 238, 189, 0);
        border-color: rgba(0, 238, 189, 0.2);
        background: rgba(0, 238, 189, 0.05);
    }

    100% {
        box-shadow: 0 0 0 0 rgba(0, 238, 189, 0);
        border-color: rgba(0, 238, 189, 0.6);
        background: rgba(0, 238, 189, 0.1);
    }
}

.msg-mentioned {
    border-left: 3px solid var(--accent);
    background: linear-gradient(90deg, rgba(0, 238, 189, 0.05) 0%, transparent 100%);
    animation: pulseGlow 2s infinite;
}

/* Input Swoosh Animation */
@keyframes inputSwoosh {
    0% {
        transform: translateY(0);
        opacity: 1;
    }

    20% {
        transform: translateY(-5px);
        opacity: 0.7;
    }

    100% {
        transform: translateY(0);
        opacity: 1;
    }
}

.input-swoosh {
    animation: inputSwoosh 0.3s cubic-bezier(0.2, 0.8, 0.2, 1);
}

/* --- System Messages (Command Output) --- */
.msg-system {
    padding: 12px 16px;
    margin: 8px 0;
    background: linear-gradient(135deg, rgba(88, 101, 242, 0.1) 0%, rgba(0, 238, 189, 0.05) 100%);
    border: 1px solid rgba(88, 101, 242, 0.2);
    border-radius: 12px;
    border-left: 3px solid #5865F2;
}

.msg-system::before {
    display: none;
}

.msg-system .msg-body {
    font-size: 13px;
    line-height: 1.6;
    white-space: pre-wrap;
}

.msg-system .msg-body strong {
    color: #5865F2;
}

.msg-system .msg-body a {
    color: var(--accent);
    text-decoration: none;
}

.msg-system .msg-body a:hover {
    text-decoration: underline;
}

.msg-system .msg-body code {
    background: rgba(0, 0, 0, 0.3);
    padding: 1px 4px;
    border-radius: 3px;
    font-size: 0.9em;
}

/* --- Chat Search Bar --- */
.chat-search-bar {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 12px 16px;
    background: var(--bg-secondary);
    border: 1px solid var(--border-color);
    border-radius: 12px;
    margin-bottom: 16px;
}

.chat-search-bar input {
    flex: 1;
    background: var(--bg-primary);
    border: 1px solid var(--border-color);
    border-radius: 8px;
    padding: 10px 14px;
    color: #fff;
    font-size: 14px;
    outline: none;
}

.chat-search-bar input:focus {
    border-color: var(--accent);
}

.search-close-btn {
    background: none;
    border: none;
    color: var(--text-secondary);
    font-size: 16px;
    cursor: pointer;
    padding: 6px;
    border-radius: 4px;
    transition: all 0.2s;
}

.search-close-btn:hover {
    background: rgba(255, 255, 255, 0.1);
    color: #fff;
}

.search-highlight {
    background: rgba(255, 215, 0, 0.3);
    border-radius: 2px;
    padding: 0 2px;
}

/* --- Poll Cards --- */
.msg-poll {
    padding: 12px 16px;
    margin: 8px 0;
}

.msg-poll::before {
    display: none;
}

.poll-card {
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: 12px;
    padding: 16px;
    max-width: 400px;
}

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

.poll-icon {
    font-size: 20px;
}

.poll-question {
    font-weight: 600;
    font-size: 15px;
    color: #fff;
}

.poll-options {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.poll-option {
    position: relative;
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 10px 12px;
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid var(--border-color);
    border-radius: 8px;
    cursor: pointer;
    overflow: hidden;
    text-align: left;
    color: #fff;
    font-size: 14px;
    transition: all 0.2s;
}

.poll-option:hover:not(.poll-disabled) {
    border-color: var(--accent);
    background: rgba(0, 238, 189, 0.1);
}

.poll-option.poll-voted {
    border-color: var(--accent);
    background: rgba(0, 238, 189, 0.15);
}

.poll-option.poll-disabled {
    cursor: default;
}

.poll-option-text {
    position: relative;
    z-index: 1;
}

.poll-bar {
    position: absolute;
    left: 0;
    top: 0;
    height: 100%;
    background: rgba(0, 238, 189, 0.2);
    border-radius: 8px 0 0 8px;
    transition: width 0.3s ease;
}

.poll-votes {
    position: relative;
    z-index: 1;
    font-size: 12px;
    color: var(--text-secondary);
    font-family: 'JetBrains Mono', monospace;
}

.poll-footer {
    margin-top: 12px;
    font-size: 12px;
    color: var(--text-secondary);
    text-align: center;
}

/* --- Settings Modal --- */
.settings-modal {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.7);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 200;
    backdrop-filter: blur(4px);
}

.settings-content {
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: 16px;
    padding: 20px;
    min-width: 280px;
    max-width: 90vw;
}

.settings-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    font-size: 16px;
    font-weight: 600;
    margin-bottom: 16px;
}

.settings-options {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.setting-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 12px;
    background: rgba(255, 255, 255, 0.05);
    border-radius: 8px;
    cursor: pointer;
    transition: background 0.2s;
}

.setting-row:hover {
    background: rgba(255, 255, 255, 0.1);
}

.setting-row input[type="checkbox"] {
    width: 18px;
    height: 18px;
    accent-color: var(--accent);
}

/* --- Unread Message Indicator --- */
.unread-indicator {
    position: absolute;
    bottom: 80px;
    left: 50%;
    transform: translateX(-50%);
    background: var(--accent);
    color: #000;
    padding: 8px 16px;
    border-radius: 20px;
    font-size: 13px;
    font-weight: 600;
    cursor: pointer;
    z-index: 50;
    box-shadow: 0 4px 12px rgba(0, 238, 189, 0.3);
    animation: slideUp 0.3s ease;
}

@keyframes slideUp {
    from {
        transform: translateX(-50%) translateY(20px);
        opacity: 0;
    }

    to {
        transform: translateX(-50%) translateY(0);
        opacity: 1;
    }
}

.unread-indicator:hover {
    background: #fff;
}

/* --- Mobile Responsive (480px) --- */
@media (max-width: 480px) {
    .token-page {
        padding: 12px;
        height: calc(100vh - 100px);
    }

    .token-header {
        flex-direction: column;
        align-items: flex-start;
        gap: 12px;
    }

    .token-actions {
        width: 100%;
        flex-wrap: wrap;
        gap: 8px;
    }

    .token-actions .icon-btn,
    .token-actions .btn {
        min-width: 44px;
        min-height: 44px;
    }

    .chat-search-bar {
        padding: 8px 12px;
    }

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

    .chat-input-area input {
        padding: 10px 12px;
        font-size: 16px;
    }

    .chat-tool-btn {
        padding: 8px 12px;
        min-width: 44px;
        min-height: 44px;
    }

    .msg {
        padding: 4px 12px 4px 44px;
    }

    .msg::before {
        left: 8px;
        width: 28px;
        height: 28px;
    }

    .gif-picker,
    .sticker-picker,
    .mention-picker {
        left: 0;
        right: 0;
        border-radius: 12px 12px 0 0;
    }

    .gif-grid {
        grid-template-columns: repeat(2, 1fr);
        height: 250px;
    }

    .poll-card {
        max-width: 100%;
    }

    .settings-content {
        min-width: 90vw;
    }
}