/* =============================================================================
   COMMUNITY HUB, CHAT & SUGGESTIONS
   ============================================================================= */

/* =============================================================================
   GENERAL FORM ELEMENTS
   ============================================================================= */

/* Multi-line textareas (modals, forms with large max length) should be resizable */
textarea[maxlength]:not([maxlength="100"]):not([maxlength="50"]):not(.chat-textarea) {
    resize: vertical;
    min-height: 72px; /* ~3 rows */
}

/* =============================================================================
   CHAT HEADER
   ============================================================================= */

.chat-header-icon {
    width: 42px;
    height: 42px;
    background: linear-gradient(135deg, var(--chat-accent) 0%, #ff9500 100%);
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #000;
    box-shadow: 0 4px 20px rgba(245,194,17,0.25);
}

.chat-header-info {
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.chat-header-title {
    font-size: 1.1rem;
    font-weight: 700;
    color: #fff;
    letter-spacing: 0.3px;
}

.chat-header-status {
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: 0.75rem;
    color: #888;
}

.status-dot {
    width: 8px;
    height: 8px;
    background: #4ade80;
    border-radius: 50%;
}

@keyframes pulse {
    0%, 100% { transform: scale(1); opacity: 1; }
    50% { transform: scale(1.2); opacity: 0.7; }
}

.chat-header-actions {
    display: flex;
    gap: 8px;
}

.chat-header-btn {
    width: 38px;
    height: 38px;
    background: rgba(255,255,255,0.05);
    border: 1px solid rgba(255,255,255,0.08);
    border-radius: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #888;
    cursor: pointer;
    transition: all 0.2s ease;
}

.chat-header-btn:hover {
    background: rgba(255,255,255,0.1);
    color: #fff;
    transform: translateY(-1px);
}

/* =============================================================================
   CHAT SETTINGS PANEL
   ============================================================================= */
.chat-settings-panel {
    display: flex;
    flex-direction: column;
    gap: 12px;
    padding: 16px 24px;
    background: rgba(20,20,20,0.95);
    border-bottom: 1px solid rgba(255,255,255,0.06);
    animation: slideDown 0.2s ease;
}

.chat-setting-item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    font-size: 0.85rem;
    color: #ccc;
}

/* =============================================================================
   PINNED MESSAGE AREA
   ============================================================================= */

.chat-pinned-area {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px 24px;
    background: linear-gradient(135deg, rgba(245,194,17,0.08) 0%, rgba(255,152,0,0.05) 100%);
    border-bottom: 1px solid rgba(245,194,17,0.15);
    animation: slideDown 0.25s ease;
}

.pinned-icon {
    font-size: 1.1rem;
}

.pinned-content {
    flex: 1;
    font-size: 0.85rem;
    color: #ccc;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.pinned-close {
    width: 24px;
    height: 24px;
    background: transparent;
    border: none;
    color: #666;
    font-size: 1.2rem;
    cursor: pointer;
    border-radius: 4px;
    transition: all 0.15s;
}

.pinned-close:hover {
    color: #f44336;
    background: rgba(244,67,54,0.1);
}

/* =============================================================================
   NEW MESSAGES INDICATOR
   ============================================================================= */

.chat-new-messages {
    position: absolute;
    bottom: 120px;
    left: 50%;
    transform: translateX(-50%);
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 10px 20px;
    background: linear-gradient(135deg, var(--chat-accent) 0%, #ff9500 100%);
    color: #000;
    font-size: 0.8rem;
    font-weight: 700;
    border-radius: 25px;
    cursor: pointer;
    z-index: 20;
    box-shadow: 0 4px 20px rgba(245,194,17,0.4);
    animation: bounceIn 0.3s cubic-bezier(0.68, -0.55, 0.265, 1.55);
    transition: transform 0.2s, box-shadow 0.2s;
}

.chat-new-messages:hover {
    transform: translateX(-50%) scale(1.05);
    box-shadow: 0 6px 30px rgba(245,194,17,0.5);
}

@keyframes bounceIn {
    0% { transform: translateX(-50%) scale(0.8); opacity: 0; }
    100% { transform: translateX(-50%) scale(1); opacity: 1; }
}

/* =============================================================================
   MESSAGES CONTAINER
   ============================================================================= */

.chat-messages-v2 {
    flex: 1;
    overflow-y: auto;
    overflow-x: hidden;
    padding: 20px;
    display: flex;
    flex-direction: column;
    gap: 4px;
    background: linear-gradient(180deg, #0a0a0a 0%, #0d0d0d 100%);
    -webkit-overflow-scrolling: touch;
    transform: translateZ(0);
    backface-visibility: hidden;
    contain: layout style;
    will-change: scroll-position;
}

.chat-messages-v2::-webkit-scrollbar {
    width: 6px;
}

.chat-messages-v2::-webkit-scrollbar-track {
    background: transparent;
}

.chat-messages-v2::-webkit-scrollbar-thumb {
    background: rgba(255,255,255,0.1);
    border-radius: 3px;
}

.chat-messages-v2::-webkit-scrollbar-thumb:hover {
    background: rgba(255,255,255,0.2);
}

.chat-messages-v2.compact-mode .chat-message-group {
    gap: 6px;
}

.chat-messages-v2.compact-mode .chat-avatar-v2 {
    width: 28px;
    height: 28px;
}

.chat-messages-v2.compact-mode .chat-text-content {
    font-size: 0.85rem;
}

/* =============================================================================
   CHAT WELCOME SCREEN
   ============================================================================= */

.chat-welcome-v2 {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 60px 30px;
    text-align: center;
    margin: auto;
}

.welcome-graphic {
    position: relative;
    margin-bottom: 24px;
}

.welcome-circles {
    position: absolute;
    inset: -30px;
}

.welcome-circles .circle {
    position: absolute;
    border-radius: 50%;
    border: 2px solid rgba(245,194,17,0.2);
    animation: circleExpand 3s infinite ease-out;
}

.welcome-circles .c1 {
    width: 80px;
    height: 80px;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    animation-delay: 0s;
}

.welcome-circles .c2 {
    width: 110px;
    height: 110px;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    animation-delay: 1s;
}

.welcome-circles .c3 {
    width: 140px;
    height: 140px;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    animation-delay: 2s;
}

@keyframes circleExpand {
    0% { transform: translate(-50%, -50%) scale(0.8); opacity: 0.6; }
    100% { transform: translate(-50%, -50%) scale(1.5); opacity: 0; }
}

.welcome-graphic > svg {
    position: relative;
    color: var(--chat-accent);
    filter: drop-shadow(0 0 20px rgba(245,194,17,0.3));
}

.chat-welcome-v2 h3 {
    font-size: 1.5rem;
    font-weight: 800;
    color: #fff;
    margin-bottom: 8px;
    letter-spacing: -0.5px;
}

.chat-welcome-v2 p {
    font-size: 0.95rem;
    color: #666;
    margin-bottom: 30px;
}

.welcome-features {
    display: flex;
    gap: 24px;
    flex-wrap: wrap;
    justify-content: center;
}

.feature-item {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 10px 16px;
    background: rgba(255,255,255,0.03);
    border: 1px solid rgba(255,255,255,0.06);
    border-radius: 25px;
    font-size: 0.8rem;
    color: #888;
}

.feature-icon {
    font-size: 1rem;
}

/* Date Divider */
.chat-date-divider {
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px 0;
    position: relative;
}

.chat-date-divider::before,
.chat-date-divider::after {
    content: '';
    flex: 1;
    height: 1px;
    background: linear-gradient(90deg, transparent, rgba(255,255,255,0.08), transparent);
}

.chat-date-divider span {
    padding: 6px 16px;
    background: rgba(30,30,30,0.8);
    border: 1px solid rgba(255,255,255,0.06);
    border-radius: 15px;
    font-size: 0.7rem;
    font-weight: 600;
    color: #666;
    text-transform: uppercase;
    letter-spacing: 1px;
}

/* =============================================================================
   MESSAGE GROUPS & STANDALONE MESSAGES
   ============================================================================= */

/* Message Group (legacy - keeping for backwards compatibility) */
.chat-message-group {
    display: flex;
    gap: 12px;
    padding: 8px 0;
    contain: layout style;
}

.chat-group-me {
    flex-direction: row-reverse;
}

/* === STANDALONE MESSAGE (avatar + username on every message) === */
.chat-message-standalone {
    display: flex;
    gap: 12px;
    padding: 10px 0;
    contain: layout style;
}

.chat-standalone-me {
    flex-direction: row-reverse;
}

.chat-standalone-avatar {
    flex-shrink: 0;
    padding-top: 4px;
}

.chat-standalone-content {
    display: flex;
    flex-direction: column;
    gap: 4px;
    max-width: 70%;
    min-width: 0;
    overflow: visible;
}

.chat-standalone-me .chat-standalone-content {
    align-items: flex-end;
}

.chat-standalone-header {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 0 4px;
}

.chat-standalone-me .chat-standalone-header {
    flex-direction: row-reverse;
}

/* === END STANDALONE MESSAGE === */

.chat-group-avatar {
    flex-shrink: 0;
    padding-top: 4px;
}

.chat-avatar-v2 {
    width: 40px;
    height: 40px;
    border-radius: 12px;
    object-fit: cover;
    border: 2px solid rgba(255,255,255,0.1);
    transition: transform 0.2s, border-color 0.2s;
}

.chat-avatar-v2:hover {
    transform: scale(1.1);
    border-color: var(--chat-accent);
}

.chat-group-content {
    display: flex;
    flex-direction: column;
    gap: 4px;
    max-width: 70%;
    min-width: 0;
}

.chat-group-me .chat-group-content {
    align-items: flex-end;
}

.chat-group-header {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 0 4px;
}

.chat-group-me .chat-group-header {
    flex-direction: row-reverse;
}

.chat-username {
    font-size: 0.8rem;
    font-weight: 700;
    color: #fff;
    letter-spacing: 0.3px;
}

.chat-time {
    font-size: 0.65rem;
    color: #555;
    font-weight: 500;
}

.chat-inline-time {
    font-size: 0.6rem;
    color: #444;
    margin-left: 8px;
    opacity: 0;
    transition: opacity 0.2s;
}

.chat-message-item:hover .chat-inline-time {
    opacity: 1;
}

.chat-group-messages {
    display: flex;
    flex-direction: column;
    gap: 3px;
}

/* Message Item - community chat specific */
.chat-messages-v2 .chat-message-item {
    position: relative;
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    gap: 4px;
    background: transparent !important;
    border: none !important;
    border-width: 0 !important;
    border-radius: 0;
    padding: 0;
    box-shadow: none !important;
    backdrop-filter: none !important;
    content-visibility: auto;
    contain-intrinsic-size: auto 80px;
    overflow: visible;
}

/* For "my" messages (right-aligned) */
.chat-group-me .chat-message-item {
    align-items: flex-end;
}

/* =============================================================================
   MESSAGE NOTIFICATION HIGHLIGHTS
   ============================================================================= */

.chat-message-item.notification-highlight,
.chat-message-item.highlight-flash {
    background: transparent !important;
}

.chat-message-item.notification-highlight .message-content,
.chat-message-item.highlight-flash .message-content {
    outline: 3px solid var(--accent, #ff9800) !important;
    outline-offset: 2px;
    border-radius: 18px;
    box-shadow: 0 0 30px rgba(255,152,0,0.5) !important;
    animation: chatMessageHighlight 3s ease-out !important;
}

@keyframes chatMessageHighlight {
    0% { box-shadow: 0 0 40px rgba(255,152,0,0.7); outline-color: rgba(255,152,0,1); }
    50% { box-shadow: 0 0 25px rgba(255,152,0,0.5); outline-color: rgba(255,152,0,0.8); }
    100% { box-shadow: 0 0 10px rgba(255,152,0,0.2); outline-color: rgba(255,152,0,0.5); }
}

/* Override global bubble styles on the chat-message-item wrapper - they should only apply to .message-content */
/* Only apply to community chat messages (chat-messages-v2), not floating chat */
.chat-messages-v2 .chat-message-item.bubble-style-glossy,
.chat-messages-v2 .chat-message-item.bubble-style-glass,
.chat-messages-v2 .chat-message-item.bubble-style-gradient,
.chat-messages-v2 .chat-message-item.bubble-style-neon,
.chat-messages-v2 .chat-message-item.bubble-style-modern,
.chat-messages-v2 .chat-message-item.bubble-style-flat {
    background: transparent !important;
    box-shadow: none !important;
    backdrop-filter: none !important;
    border: none !important;
    border-width: 0 !important;
}

.chat-message-item .message-content {
    background: var(--bubble-color, #2a2a2a);
    padding: 12px 16px;
    border-radius: 18px;
    border-top-left-radius: 6px;
    max-width: 100%;
    cursor: pointer;
    position: relative;
    word-wrap: break-word;
    overflow-wrap: break-word;
    box-sizing: border-box;
    contain: layout style paint;
    transform: translateZ(0);
}

.chat-group-me .chat-message-item .message-content {
    border-top-left-radius: 18px;
    border-top-right-radius: 6px;
    cursor: default;
}

.chat-message-item .message-content:hover {
    filter: brightness(1.1);
}

/* =============================================================================
   BUBBLE STYLES
   ============================================================================= */

.bubble-style-modern .message-content {
    /* Clean modern look - no extra effects */
}

.bubble-style-flat .message-content {
    /* Flat style - no effects */
}

.bubble-style-glass .message-content {
    background: rgba(255,255,255,0.05) !important;
    backdrop-filter: blur(10px);
    box-shadow: 0 2px 10px rgba(0,0,0,0.2);
}

.bubble-style-gradient .message-content {
    background: linear-gradient(135deg, var(--bubble-color, #2a2a2a), rgba(0,0,0,0.3)) !important;
}

.bubble-style-neon .message-content {
    background: rgba(0, 0, 0, 0.8) !important;
    border: 2px solid var(--bubble-color, #ffc107) !important;
    border-radius: 18px !important;
    position: relative;
}

/* Neon glow effect using pseudo-element for perfect rounded corners */
.bubble-style-neon .message-content::before {
    content: '';
    position: absolute;
    inset: -2px;
    border-radius: 20px;
    background: transparent;
    box-shadow: 
        0 0 10px var(--bubble-color, #ffc107),
        0 0 20px var(--bubble-color, #ffc107),
        0 0 30px color-mix(in srgb, var(--bubble-color, #ffc107) 60%, transparent);
    z-index: -1;
    pointer-events: none;
}

/* All neon bubbles get uniform rounded corners */
.bubble-style-neon .message-content,
.chat-message-standalone .bubble-style-neon .message-content,
.chat-message-group .bubble-style-neon .message-content,
.chat-standalone-me .bubble-style-neon .message-content,
.chat-group-me .bubble-style-neon .message-content {
    border-radius: 18px !important;
}

/* =============================================================================
   MESSAGE CONTENT & MENTIONS
   ============================================================================= */

.chat-text-content {
    font-size: 0.95rem;
    line-height: 1.55;
    color: #f0f0f0;
}

.chat-mention {
    color: var(--chat-accent);
    font-weight: 700;
    background: rgba(245,194,17,0.15);
    padding: 2px 6px;
    border-radius: 4px;
    transition: background 0.2s;
}

.chat-mention:hover {
    background: rgba(245,194,17,0.25);
}

/* =============================================================================
   REPLY & QUOTE BLOCKS
   ============================================================================= */

.chat-reply-block {
    display: flex;
    gap: 10px;
    margin-bottom: 8px;
    padding: 8px 12px;
    background: rgba(0,0,0,0.3);
    border-radius: 8px;
    position: relative;
}

.reply-quote-line {
    width: 3px;
    background: var(--chat-accent);
    border-radius: 2px;
    flex-shrink: 0;
}

.reply-quote-text {
    font-size: 0.8rem;
    color: #999;
    font-style: italic;
    line-height: 1.4;
}

/* =============================================================================
   GIF MESSAGES
   ============================================================================= */

.chat-gif {
    max-width: 300px;
    max-height: 200px;
    border-radius: 12px;
    display: block;
    cursor: pointer;
    transition: transform 0.2s, box-shadow 0.2s;
}

.chat-gif:hover {
    transform: scale(1.02);
    box-shadow: 0 4px 20px rgba(0,0,0,0.4);
}

/* Clickable chat images */
.clickable-chat-image {
    cursor: pointer;
}

.clickable-chat-image:hover {
    opacity: 0.9;
}

/* =============================================================================
   UPLOADED IMAGES
   ============================================================================= */

.chat-image-container {
    margin-top: 8px;
}

.chat-uploaded-image {
    max-width: 400px;
    max-height: 300px;
    border-radius: 12px;
    cursor: pointer;
    transition: transform 0.2s, box-shadow 0.2s;
    display: block;
}

.chat-uploaded-image:hover {
    transform: scale(1.02);
    box-shadow: 0 4px 20px rgba(0,0,0,0.4);
}

/* Uploaded Images in Suggestions */
.suggestion-image-container {
    margin: 12px 0;
}

.suggestion-uploaded-image {
    max-width: 100%;
    max-height: 400px;
    border-radius: 12px;
    cursor: pointer;
    transition: transform 0.2s, box-shadow 0.2s;
    display: block;
}

.suggestion-uploaded-image:hover {
    transform: scale(1.01);
    box-shadow: 0 4px 20px rgba(0,0,0,0.4);
}

/* Image Preview before sending */
.image-preview-container {
    position: relative;
    display: inline-block;
    margin: 10px 0;
    padding: 10px;
    background: rgba(0,0,0,0.3);
    border: 1px solid rgba(255,255,255,0.1);
    border-radius: 12px;
}

.image-preview-img {
    max-width: 200px;
    max-height: 150px;
    border-radius: 8px;
    display: block;
}

.image-preview-remove {
    position: absolute;
    top: 4px;
    right: 4px;
    width: 24px;
    height: 24px;
    background: rgba(244,67,54,0.9);
    border: none;
    border-radius: 50%;
    color: #fff;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s;
}

.image-preview-remove:hover {
    background: #f44336;
    transform: scale(1.1);
}

/* =============================================================================
   FULLSCREEN IMAGE MODAL
   ============================================================================= */

.image-modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0,0,0,0.95);
    z-index: 100000;
    display: flex;
    align-items: center;
    justify-content: center;
    animation: fadeIn 0.2s ease;
}

.image-modal-content {
    position: relative;
    max-width: 90vw;
    max-height: 90vh;
}

.image-modal-content img {
    max-width: 90vw;
    max-height: 90vh;
    border-radius: 8px;
    box-shadow: 0 10px 50px rgba(0,0,0,0.5);
}

.image-modal-close {
    position: absolute;
    top: -40px;
    right: 0;
    width: 36px;
    height: 36px;
    background: rgba(255,255,255,0.1);
    border: 1px solid rgba(255,255,255,0.2);
    border-radius: 50%;
    color: #fff;
    font-size: 24px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s;
}

.image-modal-close:hover {
    background: rgba(255,255,255,0.2);
    transform: scale(1.1);
}

/* Open in new tab button for image modal */
.image-modal-open-new {
    position: absolute;
    top: -40px;
    right: 50px;
    width: 36px;
    height: 36px;
    background: rgba(255,255,255,0.1);
    border: 1px solid rgba(255,255,255,0.2);
    border-radius: 50%;
    color: #fff;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s;
    text-decoration: none;
}

.image-modal-open-new:hover {
    background: rgba(255,255,255,0.2);
    transform: scale(1.1);
}

/* =============================================================================
   IMAGE APPROVAL SYSTEM
   ============================================================================= */

.suggestion-image-container.pending-approval {
    position: relative;
}

.suggestion-image-container.pending-approval .suggestion-uploaded-image {
    opacity: 0.7;
}

.image-approval-banner {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    background: linear-gradient(to bottom, rgba(255, 152, 0, 0.95), rgba(255, 152, 0, 0.8));
    color: #000;
    padding: 8px 12px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-size: 0.85rem;
    font-weight: 600;
    z-index: 10;
    border-radius: 8px 8px 0 0;
}

.approval-actions {
    display: flex;
    gap: 8px;
}

.approve-btn, .reject-btn {
    padding: 4px 12px;
    border: none;
    border-radius: 4px;
    font-size: 0.75rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s;
}

.approve-btn {
    background: #4caf50;
    color: #fff;
}

.approve-btn:hover {
    background: #45a049;
    transform: scale(1.05);
}

.reject-btn {
    background: #f44336;
    color: #fff;
}

.reject-btn:hover {
    background: #da190b;
    transform: scale(1.05);
}

/* Pending image placeholder for non-developers */
.suggestion-image-container.pending-approval-hidden {
    margin-top: 10px;
}

.pending-image-placeholder {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 30px 20px;
    background: rgba(255, 255, 255, 0.03);
    border: 2px dashed rgba(255, 255, 255, 0.1);
    border-radius: 8px;
    color: #666;
    gap: 8px;
}

.pending-image-placeholder svg {
    opacity: 0.5;
}

.pending-image-placeholder span {
    font-size: 0.85rem;
    font-style: italic;
}

/* =============================================================================
   MESSAGE ACTIONS
   ============================================================================= */

.message-actions {
    display: flex;
    gap: 4px;
    opacity: 0;
    transition: opacity 0.2s;
    padding: 4px;
    z-index: 5;
    align-items: center;
    flex-shrink: 0;
    overflow: visible;
}

.chat-group-me .message-actions {
    justify-content: flex-start;
    padding-left: 4px;
    padding-right: 0;
}

.chat-group-me .reaction-actions-row {
    flex-direction: row-reverse;
}

.chat-message-item:hover .message-actions {
    opacity: 1;
}

.msg-action-btn {
    width: 32px;
    height: 32px;
    background: rgba(30,30,30,0.95);
    border: 1px solid rgba(255,255,255,0.1);
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #888;
    cursor: pointer;
    transition: all 0.15s;
    flex-shrink: 0;
}

.msg-action-btn:hover {
    background: rgba(50,50,50,0.95);
    color: #fff;
    transform: scale(1.1);
    z-index: 10;
}

.msg-action-btn.delete-btn:hover {
    background: rgba(244,67,54,0.2);
    color: #f44336;
    border-color: rgba(244,67,54,0.3);
}

/* =============================================================================
   REACTION BAR
   ============================================================================= */

.chat-message-item .reaction-bar {
    display: flex;
    gap: 4px;
    flex-wrap: wrap;
    margin-top: 4px;
    padding: 0 4px;
}

/* Container for reactions and actions on same row */
.chat-message-item .reaction-actions-row {
    display: flex;
    gap: 8px;
    align-items: center;
    margin-top: 4px;
    overflow: visible;
}

/* Sender's standalone messages - reactions at bottom right corner, actions to the left */
.chat-standalone-me .chat-message-item .reaction-actions-row {
    width: 100%;
    justify-content: flex-end;
}

.chat-standalone-me .chat-message-item .reaction-actions-row .message-actions {
    order: -1;
}

/* Ensure reaction-bar doesn't have extra margin in the row */
.chat-message-item .reaction-actions-row .reaction-bar {
    display: flex;
    gap: 4px;
    flex-wrap: wrap;
    margin-top: 0;
    padding: 0 4px;
}

.chat-message-item .reaction-bar .reaction-pill {
    padding: 2px 8px;
    font-size: 0.8rem;
    border-radius: 12px;
    background: rgba(255,255,255,0.08);
    border: none;
}

.chat-message-item .reaction-bar .reaction-pill:hover {
    background: rgba(255,255,255,0.15);
}

.chat-message-item .reaction-bar .reaction-pill.active {
    background: rgba(255, 255, 255, 0.18);
    border: 1px solid rgba(255, 255, 255, 0.2);
}

.chat-message-item .reaction-bar .reaction-count {
    font-size: 0.7rem;
}

.chat-group-me .chat-message-item {
    align-items: flex-end;
}

.chat-group-me .chat-message-item .reaction-bar {
    justify-content: flex-end;
}

/* =============================================================================
   TYPING INDICATOR
   ============================================================================= */

.typing-indicator-v2 {
    padding: 0 24px;
    min-height: 0;
    overflow: hidden;
    transition: all 0.3s ease;
}

.typing-indicator-v2.active {
    padding: 12px 24px;
    min-height: 44px;
}

.typing-indicator-v2-inner {
    display: flex;
    align-items: center;
    gap: 12px;
    animation: fadeSlideIn 0.3s ease;
}

@keyframes fadeSlideIn {
    from { opacity: 0; transform: translateX(-10px); }
    to { opacity: 1; transform: translateX(0); }
}

.typing-avatars {
    display: flex;
}

.typing-avatar {
    width: 24px;
    height: 24px;
    background: linear-gradient(135deg, #333, #222);
    border: 2px solid #1a1a1a;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.65rem;
    font-weight: 700;
    color: #888;
    margin-left: -8px;
}

.typing-avatar:first-child {
    margin-left: 0;
}

.typing-content {
    display: flex;
    align-items: center;
    gap: 10px;
}

.typing-dots-v2 {
    display: flex;
    gap: 4px;
}

.typing-dots-v2 span {
    width: 6px;
    height: 6px;
    background: var(--chat-accent);
    border-radius: 50%;
    animation: typingBounce 1.4s infinite ease-in-out both;
}

.typing-dots-v2 span:nth-child(1) { animation-delay: -0.32s; }
.typing-dots-v2 span:nth-child(2) { animation-delay: -0.16s; }

@keyframes typingBounce {
    0%, 80%, 100% { transform: scale(0.6); opacity: 0.4; }
    40% { transform: scale(1); opacity: 1; }
}

.typing-text {
    font-size: 0.75rem;
    color: #666;
    font-style: italic;
}

/* =============================================================================
   REPLY PREVIEW
   ============================================================================= */

.chat-reply-preview-v2 {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 12px 24px;
    background: linear-gradient(135deg, rgba(245,194,17,0.06) 0%, rgba(255,152,0,0.04) 100%);
    border-top: 1px solid rgba(245,194,17,0.15);
    animation: slideUp 0.25s ease;
}

@keyframes slideUp {
    from { opacity: 0; transform: translateY(10px); }
    to { opacity: 1; transform: translateY(0); }
}

.reply-preview-left {
    display: flex;
    flex-direction: column;
    gap: 4px;
    flex: 1;
    min-width: 0;
}

.reply-info {
    display: flex;
    align-items: center;
    gap: 8px;
}

.reply-info svg {
    color: var(--chat-accent);
}

.reply-label {
    font-size: 0.7rem;
    color: #666;
}

.reply-username {
    font-size: 0.8rem;
    font-weight: 700;
    color: var(--chat-accent);
}

.reply-text {
    font-size: 0.75rem;
    color: #888;
    font-style: italic;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    padding-left: 22px;
}

.reply-cancel {
    width: 32px;
    height: 32px;
    background: transparent;
    border: none;
    color: #666;
    cursor: pointer;
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.15s;
}

.reply-cancel:hover {
    background: rgba(244,67,54,0.15);
    color: #f44336;
}

/* =============================================================================
   CHAT INPUT
   ============================================================================= */

.chat-input-v2 {
    display: flex;
    flex-direction: column;
    gap: 8px;
    padding: 12px 24px 16px;
    background: linear-gradient(180deg, rgba(15,15,15,0.98) 0%, rgba(10,10,10,0.99) 100%);
    border-top: 1px solid rgba(255,255,255,0.04);
    position: relative;
}

.chat-input-row {
    display: flex;
    align-items: flex-end;
    gap: 12px;
}

.chat-auth-overlay {
    position: absolute;
    inset: 0;
    background: rgba(10,10,10,0.9);
    backdrop-filter: blur(8px);
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 12px;
    z-index: 10;
}

.chat-auth-overlay svg {
    color: var(--chat-accent);
}

.chat-auth-overlay span {
    font-size: 0.9rem;
    font-weight: 600;
    color: #888;
}

.input-toolbar {
    display: flex;
    flex-direction: row;
    align-items: center;
    gap: 8px;
    position: relative;
    z-index: 15;
}

.toolbar-btn {
    width: 34px;
    height: 34px;
    background: rgba(255,255,255,0.04);
    border: 1px solid rgba(255,255,255,0.06);
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #666;
    cursor: pointer;
    transition: all 0.2s;
    padding: 0;
    font-family: inherit;
    -webkit-appearance: none;
    appearance: none;
}

.toolbar-btn svg {
    pointer-events: none;
}

.toolbar-btn:hover {
    background: rgba(245,194,17,0.1);
    border-color: rgba(245,194,17,0.2);
    color: var(--chat-accent);
    transform: translateY(-1px);
}

/* iOS-Style Emoji Font Stack */
.emoji-picker-v2,
.emoji-item,
.emoji-cat,
.chat-message-text,
.message-content,
.chat-reaction-badge {
    font-family: "Apple Color Emoji", "Segoe UI Emoji", "Noto Color Emoji", "Twemoji Mozilla", sans-serif;
}

/* =============================================================================
   EMOJI PICKER
   ============================================================================= */

.emoji-picker-v2 {
    position: fixed;
    bottom: 140px;
    left: 24px;
    width: 380px;
    max-width: calc(100vw - 40px);
    max-height: 420px;
    background: #1a1a1a;
    border: 1px solid rgba(255,255,255,0.15);
    border-radius: 16px;
    display: flex;
    flex-direction: column;
    box-shadow: 0 12px 50px rgba(0,0,0,0.9), 0 0 0 1px rgba(255,255,255,0.1);
    z-index: 999999;
    animation: pickerSlideUp 0.25s cubic-bezier(0.4, 0, 0.2, 1);
}

@keyframes pickerSlideUp {
    from { opacity: 0; transform: translateY(15px) scale(0.95); }
    to { opacity: 1; transform: translateY(0) scale(1); }
}

.emoji-picker-header {
    padding: 12px;
    border-bottom: 1px solid rgba(255,255,255,0.06);
}

.emoji-search {
    width: 100%;
    background: rgba(0,0,0,0.4);
    border: 1px solid rgba(255,255,255,0.08);
    border-radius: 10px;
    padding: 10px 14px;
    color: #fff;
    font-size: 0.85rem;
    outline: none;
    transition: border-color 0.2s;
}

.emoji-search:focus {
    border-color: var(--chat-accent);
}

.emoji-search::placeholder {
    color: #555;
}

.emoji-categories {
    display: flex;
    gap: 2px;
    padding: 6px 8px;
    border-bottom: 1px solid rgba(255,255,255,0.06);
    overflow-x: auto;
    scrollbar-width: none;
    -ms-overflow-style: none;
}

.emoji-categories::-webkit-scrollbar {
    display: none;
}

.emoji-cat {
    flex-shrink: 0;
    padding: 6px 8px;
    background: transparent;
    border: none;
    border-radius: 8px;
    font-size: 1rem;
    cursor: pointer;
    transition: all 0.15s;
    opacity: 0.5;
}

.emoji-cat:hover {
    background: rgba(255,255,255,0.05);
    opacity: 0.8;
}

.emoji-cat.active {
    background: rgba(245,194,17,0.15);
    opacity: 1;
}

.emoji-grid-v2 {
    display: grid;
    grid-template-columns: repeat(8, 1fr);
    gap: 2px;
    padding: 10px;
    overflow-y: auto;
    max-height: 280px;
    scrollbar-width: thin;
    scrollbar-color: rgba(255,255,255,0.2) transparent;
}

.emoji-grid-v2::-webkit-scrollbar {
    width: 6px;
}

.emoji-grid-v2::-webkit-scrollbar-track {
    background: transparent;
}

.emoji-grid-v2::-webkit-scrollbar-thumb {
    background: rgba(255,255,255,0.2);
    border-radius: 3px;
}

.emoji-item {
    font-size: 1.5rem;
    padding: 5px;
    cursor: pointer;
    border-radius: 8px;
    text-align: center;
    transition: all 0.15s;
    line-height: 1;
    aspect-ratio: 1;
    display: flex;
    align-items: center;
    justify-content: center;
}

.emoji-item:hover {
    background: rgba(255,255,255,0.1);
    transform: scale(1.25);
}

/* =============================================================================
   GIF PICKER
   ============================================================================= */

.gif-picker {
    position: fixed;
    bottom: 140px;
    left: 24px;
    width: 380px;
    max-width: calc(100vw - 40px);
    max-height: 420px;
    background: #1a1a1a;
    border: 1px solid rgba(255,255,255,0.15);
    border-radius: 16px;
    display: flex;
    flex-direction: column;
    box-shadow: 0 12px 50px rgba(0,0,0,0.9), 0 0 0 1px rgba(255,255,255,0.1);
    z-index: 999999;
    animation: pickerSlideUp 0.25s cubic-bezier(0.4, 0, 0.2, 1);
}

.gif-search-wrap {
    padding: 12px;
    border-bottom: 1px solid rgba(255,255,255,0.06);
}

.gif-search {
    width: 100%;
    background: rgba(0,0,0,0.4);
    border: 1px solid rgba(255,255,255,0.08);
    border-radius: 10px;
    padding: 10px 14px;
    color: #fff;
    font-size: 0.85rem;
    outline: none;
    transition: border-color 0.2s;
}

.gif-search:focus {
    border-color: var(--chat-accent);
}

.gif-search::placeholder {
    color: #555;
}

.gif-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 8px;
    padding: 12px;
    overflow-y: auto;
    max-height: 320px;
}

.gif-item {
    width: 100%;
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.2s;
}

.gif-item:hover {
    transform: scale(1.02);
    box-shadow: 0 4px 20px rgba(0,0,0,0.4);
}

.gif-placeholder,
.gif-loading {
    grid-column: 1 / -1;
    text-align: center;
    padding: 40px 20px;
    color: #555;
    font-size: 0.85rem;
}

.gif-loading {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 12px;
}

.loading-spinner {
    width: 24px;
    height: 24px;
    border: 2px solid rgba(255,255,255,0.1);
    border-top-color: var(--chat-accent);
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
}

@keyframes spin {
    to { transform: rotate(360deg); }
}

.gif-powered {
    padding: 8px;
    text-align: center;
    font-size: 0.65rem;
    color: #444;
    border-top: 1px solid rgba(255,255,255,0.06);
}

/* =============================================================================
   INPUT WRAPPER & SEND BUTTON
   ============================================================================= */

.input-wrapper {
    flex: 1;
    position: relative;
    display: flex;
    align-items: center;
}

.chat-textarea {
    width: 100%;
    background: rgba(0,0,0,0.4);
    border: 1px solid rgba(255,255,255,0.08);
    border-radius: 20px;
    padding: 14px 55px 14px 20px;
    color: #fff;
    font-size: 0.95rem;
    font-family: inherit;
    outline: none;
    resize: none;
    min-height: 48px;
    max-height: 150px;
    transition: all 0.2s;
    line-height: 1.4;
}

/* Inline Send Button */
.chat-send-inline {
    position: absolute;
    right: 8px;
    top: 50%;
    transform: translateY(-50%);
    width: 38px;
    height: 38px;
    background: linear-gradient(135deg, var(--chat-accent) 0%, #ff9500 100%);
    border: none;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #000;
    cursor: pointer;
    transition: all 0.2s ease;
    flex-shrink: 0;
    box-shadow: 0 2px 10px rgba(245,194,17,0.3);
    z-index: 5;
}

.chat-send-inline:hover:not(:disabled) {
    transform: translateY(-50%) scale(1.1);
    box-shadow: 0 4px 20px rgba(245,194,17,0.5);
}

.chat-send-inline:active:not(:disabled) {
    transform: translateY(-50%) scale(0.95);
}

.chat-send-inline:disabled {
    opacity: 0.4;
    cursor: not-allowed;
    box-shadow: none;
}

.chat-textarea:focus {
    border-color: var(--chat-accent);
    background: rgba(0,0,0,0.6);
    box-shadow: 0 0 0 3px rgba(245,194,17,0.1);
}

.chat-textarea::placeholder {
    color: #555;
}

.chat-textarea:disabled {
    opacity: 0.4;
    cursor: not-allowed;
}

.input-extras {
    position: absolute;
    bottom: 6px;
    right: 52px;
    display: flex;
    align-items: center;
    gap: 8px;
}

.char-count {
    font-size: 0.65rem;
    color: #444;
    font-weight: 600;
}

/* Send Button V2 */
.chat-send-v2 {
    width: 52px;
    height: 52px;
    background: linear-gradient(135deg, var(--chat-accent) 0%, #ff9500 100%);
    border: none;
    border-radius: 16px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #000;
    cursor: pointer;
    transition: all 0.25s cubic-bezier(0.4, 0, 0.2, 1);
    flex-shrink: 0;
    box-shadow: 0 4px 20px rgba(245,194,17,0.35);
}

.chat-send-v2:hover:not(:disabled) {
    transform: scale(1.08) rotate(-3deg);
    box-shadow: 0 8px 35px rgba(245,194,17,0.5);
}

.chat-send-v2:active:not(:disabled) {
    transform: scale(0.95);
}

.chat-send-v2:disabled {
    opacity: 0.4;
    cursor: not-allowed;
    box-shadow: none;
}

/* =============================================================================
   LEGACY CHAT INPUT
   ============================================================================= */

#chat-input {
    flex: 1;
    background: rgba(0,0,0,0.5);
    border: 1px solid rgba(255,255,255,0.08);
    color: #fff;
    padding: 14px 20px;
    border-radius: 25px;
    font-size: 0.95rem;
    outline: none;
    transition: 0.2s;
    font-family: inherit;
    overflow: hidden;
    resize: none;
}

#chat-input:focus {
    border-color: var(--accent);
    background: rgba(0,0,0,0.7);
    box-shadow: 0 0 0 3px rgba(255,152,0,0.1);
}

#chat-input::placeholder {
    color: #555;
}

.chat-send-btn {
    background: linear-gradient(135deg, var(--accent), #ff8c00);
    color: #000;
    border: none;
    width: 48px;
    height: 48px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: 0.25s cubic-bezier(0.4, 0, 0.2, 1);
    flex-shrink: 0;
    box-shadow: 0 4px 20px rgba(255,152,0,0.3);
}

.chat-send-btn:hover {
    transform: scale(1.08) rotate(-5deg);
    box-shadow: 0 6px 30px rgba(255,152,0,0.5);
}

.chat-send-btn:active {
    transform: scale(0.95);
}

/* Typing Indicator */
.typing-indicator-wrap {
    padding: 8px 24px 0;
    color: #666;
    font-size: 0.8rem;
    display: flex;
    align-items: center;
    gap: 10px;
    min-height: 28px;
}

.typing-dots {
    display: inline-flex;
    gap: 4px;
    align-items: center;
}

.typing-dot {
    width: 6px;
    height: 6px;
    background: var(--accent);
    border-radius: 50%;
    animation: typingPulse 1.2s infinite ease-in-out;
}

.typing-dot:nth-child(2) { animation-delay: 0.15s; }
.typing-dot:nth-child(3) { animation-delay: 0.3s; }

@keyframes typingPulse {
    0%, 80%, 100% { opacity: 0.3; transform: scale(0.8); }
    40% { opacity: 1; transform: scale(1.1); }
}

/* =============================================================================
   SUGGESTIONS CONTAINER
   ============================================================================= */

.suggestions-container {
    flex: 1;
    display: flex;
    flex-direction: column;
    min-height: 0;
    overflow: hidden;
}

/* =============================================================================
   SUGGESTION COMPOSER
   ============================================================================= */

.suggestion-composer {
    background: rgba(0,0,0,0.3);
    border-bottom: 1px solid rgba(255,255,255,0.05);
    overflow: hidden;
}

.composer-header {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 10px 16px;
    color: #999;
    font-size: 0.85rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s ease;
    user-select: none;
    background: rgba(255,152,0,0.05);
    border-bottom: 1px solid rgba(255,152,0,0.1);
}

.composer-header-left {
    display: flex;
    align-items: center;
    gap: 8px;
}

.composer-header-right {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-left: auto;
    margin-right: 8px;
}

.composer-search-box {
    display: flex;
    align-items: center;
    gap: 6px;
    background: rgba(0, 0, 0, 0.3);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 6px;
    padding: 4px 10px;
    transition: all 0.2s ease;
}

.composer-search-box:focus-within {
    border-color: var(--accent);
    background: rgba(0, 0, 0, 0.4);
}

.composer-search-box svg {
    color: #666;
    flex-shrink: 0;
}

.composer-search-box input {
    background: transparent;
    border: none;
    color: #fff;
    font-size: 0.8rem;
    width: 140px;
    outline: none;
}

.composer-search-box input::placeholder {
    color: #555;
}

.composer-guidelines-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 28px;
    height: 28px;
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 6px;
    color: #666;
    cursor: pointer;
    transition: all 0.2s ease;
}

.composer-guidelines-btn:hover {
    background: rgba(255, 152, 0, 0.1);
    border-color: rgba(255, 152, 0, 0.3);
    color: var(--accent);
}

.composer-guidelines-btn svg {
    width: 14px;
    height: 14px;
}

.composer-header:hover {
    background: rgba(255,152,0,0.1);
    color: #ccc;
}

.composer-header-left svg {
    color: var(--accent);
    width: 16px;
    height: 16px;
}

.composer-header .toggle-icon {
    margin-left: auto;
    transition: transform 0.3s ease;
    color: var(--accent);
    background: rgba(255,152,0,0.15);
    border-radius: 4px;
    padding: 4px;
    width: 20px;
    height: 20px;
}

.suggestion-composer.collapsed .composer-header .toggle-icon {
    transform: rotate(-90deg);
}

.composer-body {
    padding: 12px 16px 14px 16px;
    transition: all 0.3s ease;
    max-height: none;
    opacity: 1;
    overflow: visible;
}

.suggestion-composer.collapsed .composer-body {
    max-height: 0;
    padding-top: 0;
    padding-bottom: 0;
    opacity: 0;
    overflow: hidden;
}

/* Guidelines Button */
.guidelines-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 32px;
    height: 32px;
    background: rgba(255,255,255,0.05);
    border: 1px solid rgba(255,255,255,0.1);
    border-radius: 8px;
    color: #888;
    cursor: pointer;
    transition: all 0.2s ease;
}

.guidelines-btn:hover {
    background: rgba(255,152,0,0.15);
    border-color: rgba(255,152,0,0.3);
    color: var(--accent);
}

/* =============================================================================
   FORMATTING TOOLBAR
   ============================================================================= */

.formatting-toolbar {
    position: relative;
    display: flex;
    align-items: center;
    gap: 4px;
    padding: 5px 8px;
    margin-bottom: 8px;
    background: rgba(0,0,0,0.4);
    border: 1px solid rgba(255,255,255,0.08);
    border-radius: 6px;
    flex-wrap: wrap;
}

.toolbar-group {
    display: flex;
    align-items: center;
    gap: 1px;
}

.format-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 26px;
    height: 26px;
    background: transparent;
    border: 1px solid transparent;
    border-radius: 4px;
    color: #888;
    cursor: pointer;
    transition: all 0.15s ease;
}

.format-btn:hover {
    background: rgba(255,255,255,0.1);
    border-color: rgba(255,255,255,0.1);
    color: #fff;
}

.format-btn:active {
    background: rgba(245,194,17,0.2);
    border-color: rgba(245,194,17,0.3);
    color: var(--accent);
    transform: scale(0.95);
}

.format-btn svg {
    width: 13px;
    height: 13px;
}

.toolbar-divider {
    width: 1px;
    height: 18px;
    background: rgba(255,255,255,0.1);
    margin: 0 4px;
}

.toolbar-help {
    margin-left: auto;
}

.toolbar-help .help-text {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 20px;
    height: 20px;
    background: rgba(255,255,255,0.05);
    border-radius: 50%;
    color: #666;
    font-size: 0.7rem;
    font-weight: 700;
    cursor: help;
    transition: all 0.15s ease;
}

.toolbar-help .help-text:hover {
    background: rgba(255,255,255,0.1);
    color: #999;
}

/* =============================================================================
   COLOR PICKER DROPDOWN
   ============================================================================= */

.color-picker-dropdown {
    position: fixed;
    padding: 10px;
    background: rgba(26,26,26,0.98);
    border: 1px solid rgba(255,255,255,0.2);
    border-radius: 10px;
    box-shadow: 0 12px 40px rgba(0,0,0,0.6);
    display: none;
    z-index: 99999;
}

.color-picker-dropdown.show {
    display: block;
}

.color-grid {
    display: grid;
    grid-template-columns: repeat(6, 1fr);
    gap: 4px;
}

.color-swatch {
    width: 24px;
    height: 24px;
    border-radius: 4px;
    cursor: pointer;
    border: 2px solid transparent;
    transition: all 0.15s ease;
}

.color-swatch:hover {
    transform: scale(1.15);
    border-color: #fff;
}

/* =============================================================================
   FONT PICKER DROPDOWN
   ============================================================================= */

.font-picker-dropdown {
    position: fixed;
    padding: 8px;
    background: rgba(26,26,26,0.98);
    border: 1px solid rgba(255,255,255,0.2);
    border-radius: 10px;
    box-shadow: 0 12px 40px rgba(0,0,0,0.6);
    display: none;
    z-index: 99999;
    min-width: 160px;
    max-height: 300px;
    overflow-y: auto;
}

.font-picker-dropdown.show {
    display: block;
}

.font-list {
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.font-option {
    padding: 8px 12px;
    cursor: pointer;
    border-radius: 4px;
    color: #ccc;
    font-size: 0.85rem;
    transition: all 0.15s ease;
    white-space: nowrap;
}

.font-option:hover {
    background: rgba(255,255,255,0.1);
    color: #fff;
}

.font-option:active {
    background: rgba(245,194,17,0.2);
    color: var(--accent);
}

/* =============================================================================
   LINK INPUT MODAL
   ============================================================================= */

.link-input-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: 1000;
    opacity: 0;
    visibility: hidden;
    transition: all 0.2s ease;
}

.link-input-modal.show {
    opacity: 1;
    visibility: visible;
}

.link-input-content {
    background: rgba(30,30,30,0.98);
    border: 1px solid rgba(255,255,255,0.15);
    border-radius: 12px;
    padding: 24px;
    width: 90%;
    max-width: 400px;
    box-shadow: 0 16px 48px rgba(0,0,0,0.5);
}

.link-input-content h3 {
    margin: 0 0 16px;
    color: #fff;
    font-size: 1.1rem;
}

.link-input-content input {
    width: 100%;
    padding: 12px 14px;
    background: rgba(0,0,0,0.4);
    border: 1px solid rgba(255,255,255,0.1);
    border-radius: 8px;
    color: #fff;
    font-size: 0.95rem;
    margin-bottom: 12px;
    outline: none;
}

.link-input-content input:focus {
    border-color: var(--accent);
}

.link-input-content input::placeholder {
    color: #666;
}

.link-input-actions {
    display: flex;
    gap: 10px;
    justify-content: flex-end;
    margin-top: 8px;
}

.link-input-actions button {
    padding: 10px 20px;
    border-radius: 8px;
    font-size: 0.9rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.15s ease;
}

.link-cancel-btn {
    background: transparent;
    border: 1px solid rgba(255,255,255,0.2);
    color: #888;
}

.link-cancel-btn:hover {
    background: rgba(255,255,255,0.05);
    color: #fff;
}

.link-confirm-btn {
    background: var(--accent);
    border: none;
    color: #111;
}

.link-confirm-btn:hover {
    background: #e6b30f;
}

/* =============================================================================
   FORMATTED CONTENT RENDERING
   ============================================================================= */

.formatted-content .format-bold {
    font-weight: 700;
}

.formatted-content .format-italic {
    font-style: italic;
}

.formatted-content .format-underline {
    text-decoration: underline;
}

.formatted-content .format-strike {
    text-decoration: line-through;
    opacity: 0.7;
}

.formatted-content .format-heading {
    display: block;
    font-size: 1.2em;
    font-weight: 700;
    margin: 8px 0;
    color: var(--accent);
}

.formatted-content .format-quote {
    display: block;
    padding: 10px 14px;
    margin: 8px 0;
    background: rgba(255,255,255,0.05);
    border-left: 3px solid var(--accent);
    border-radius: 0 8px 8px 0;
    color: #aaa;
    font-style: italic;
}

.formatted-content .format-code {
    font-family: 'Consolas', 'Monaco', monospace;
    background: rgba(0,0,0,0.4);
    padding: 2px 6px;
    border-radius: 4px;
    font-size: 0.9em;
    color: #ff9800;
}

.formatted-content .format-code-block {
    display: block;
    font-family: 'Consolas', 'Monaco', monospace;
    background: rgba(0,0,0,0.5);
    padding: 12px 16px;
    margin: 8px 0;
    border-radius: 8px;
    font-size: 0.9em;
    color: #aaa;
    white-space: pre-wrap;
    overflow-x: auto;
}

.formatted-content .format-link {
    color: var(--accent);
    text-decoration: none;
    border-bottom: 1px dashed var(--accent);
    transition: all 0.15s ease;
}

.formatted-content .format-link:hover {
    border-bottom-style: solid;
}

.formatted-content .format-spoiler {
    background: #333;
    color: #333;
    padding: 2px 6px;
    border-radius: 4px;
    cursor: pointer;
    transition: all 0.2s ease;
}

.formatted-content .format-spoiler:hover,
.formatted-content .format-spoiler.revealed {
    background: rgba(255,255,255,0.1);
    color: #fff;
}

.formatted-content .format-list {
    display: block;
    margin: 8px 0;
    padding-left: 20px;
}

.formatted-content .format-list-item {
    display: list-item;
    margin: 4px 0;
}

.formatted-content ul.format-list {
    list-style-type: disc;
}

.formatted-content ol.format-list {
    list-style-type: decimal;
}

.textarea-wrapper {
    position: relative;
}

.suggestion-textarea {
    width: 100%;
    background: rgba(0,0,0,0.4);
    border: 1px solid rgba(255,255,255,0.08);
    border-radius: 10px;
    color: #fff;
    padding: 10px 14px;
    font-size: 0.9rem;
    font-family: inherit;
    resize: vertical;
    min-height: 72px; /* Approx 3 rows */
    outline: none;
    transition: 0.2s;
}

.suggestion-textarea:focus {
    border-color: var(--accent);
    background: rgba(0,0,0,0.6);
}

.suggestion-textarea::placeholder {
    color: #555;
}

/* =============================================================================
   SUGGESTION EMOJI PICKER
   ============================================================================= */

.suggestion-emoji-picker {
    position: fixed;
    z-index: 99999;
    width: 432px;
    background: rgba(20,20,20,0.98);
    border: 1px solid rgba(255,255,255,0.15);
    border-radius: 16px;
    box-shadow: 0 16px 48px rgba(0,0,0,0.7);
    overflow: hidden;
    backdrop-filter: blur(10px);
}

.suggestion-emoji-grid {
    display: grid;
    grid-template-columns: repeat(10, 36px);
    gap: 4px;
    padding: 16px;
    width: 100%;
    max-height: 340px;
    overflow-y: auto;
    justify-content: center;
    box-sizing: border-box;
}

.suggestion-emoji-item {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 36px;
    height: 36px;
    font-size: 1.4rem;
    cursor: pointer;
    border-radius: 8px;
    transition: background 0.15s, transform 0.15s;
}

.suggestion-emoji-item:hover {
    background: rgba(245,194,17,0.25);
    transform: scale(1.15);
}

/* =============================================================================
   REPLY EMOJI PICKER
   ============================================================================= */

.reply-emoji-picker {
    position: absolute;
    bottom: 100%;
    left: 0;
    margin-bottom: 8px;
    z-index: 100;
}

/* Portal emoji picker (appended to body to avoid clipping) */
.reply-emoji-picker-portal {
    position: fixed;
    z-index: 100001;
}

.reply-emoji-picker-portal .reply-emoji-grid {
    animation: fadeIn 0.15s ease;
}

.reply-emoji-grid {
    display: grid;
    grid-template-columns: repeat(8, 32px);
    gap: 4px;
    padding: 12px;
    background: #1a1a1a;
    border: 1px solid #333;
    border-radius: 12px;
    box-shadow: 0 8px 32px rgba(0,0,0,0.4);
    width: 296px; /* 8 * 32px + 7 * 4px + 24px padding */
    justify-content: center;
    box-sizing: border-box;
}

.reply-emoji-item {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 32px;
    height: 32px;
    font-size: 1.25rem;
    cursor: pointer;
    border-radius: 6px;
    transition: background 0.15s, transform 0.15s;
}

.reply-emoji-item:hover {
    background: rgba(245,194,17,0.2);
    transform: scale(1.15);
}

/* Reply Image Preview Container */
.reply-image-preview-container {
    min-height: 0;
}

.textarea-footer {
    display: flex;
    justify-content: flex-end;
    align-items: center;
    gap: 8px;
    margin-top: 6px;
}

.textarea-footer .char-counter {
    color: #555;
    font-size: 0.7rem;
    font-weight: 600;
}

.composer-footer {
    display: flex;
    justify-content: flex-start;
    align-items: center;
    margin-top: 6px;
}

.auth-warning {
    display: flex;
    align-items: center;
    gap: 5px;
    color: #f44336;
    font-size: 0.75rem;
    font-weight: 600;
}

.composer-actions {
    display: flex;
    align-items: center;
    gap: 10px;
}

.char-counter {
    color: #555;
    font-size: 0.7rem;
    font-weight: 600;
}

.post-idea-btn {
    display: flex;
    align-items: center;
    gap: 4px;
    background: linear-gradient(135deg, var(--accent), #ff8c00);
    color: #000;
    border: none;
    padding: 5px 12px;
    border-radius: 14px;
    font-size: 0.72rem;
    font-weight: 700;
    cursor: pointer;
    transition: 0.2s cubic-bezier(0.4, 0, 0.2, 1);
    box-shadow: 0 2px 10px rgba(255,152,0,0.2);
}

.post-idea-btn:hover:not(:disabled) {
    transform: translateY(-1px);
    box-shadow: 0 4px 15px rgba(255,152,0,0.35);
}

.post-idea-btn:disabled {
    opacity: 0.4;
    cursor: not-allowed;
}

/* =============================================================================
   SUGGESTIONS TOOLBAR
   ============================================================================= */

.suggestions-toolbar {
    padding: 14px 24px;
    border-bottom: 1px solid rgba(255,255,255,0.05);
    background: rgba(0,0,0,0.2);
}

.sort-options {
    display: flex;
    align-items: center;
    gap: 10px;
}

.sort-label {
    color: #666;
    font-size: 0.8rem;
    font-weight: 600;
    margin-right: 6px;
}

.sort-btn {
    background: transparent;
    border: 1px solid transparent;
    color: #888;
    padding: 6px 14px;
    border-radius: 20px;
    font-size: 0.8rem;
    font-weight: 600;
    cursor: pointer;
    transition: 0.2s;
}

.sort-btn:hover {
    background: rgba(255,255,255,0.03);
    color: #bbb;
}

.sort-btn.active {
    background: rgba(255,152,0,0.1);
    border-color: rgba(255,152,0,0.2);
    color: var(--accent);
}

/* =============================================================================
   ARCHIVED CONTROLS
   ============================================================================= */

.archived-controls {
    display: flex;
    align-items: center;
    gap: 8px;
    flex-wrap: wrap;
}

.archived-sort-btn {
    background: transparent;
    border: 1px solid transparent;
    color: #888;
    padding: 6px 12px;
    border-radius: 20px;
    font-size: 0.75rem;
    font-weight: 600;
    cursor: pointer;
    transition: 0.2s;
    white-space: nowrap;
}

.archived-sort-btn:hover {
    background: rgba(255,255,255,0.03);
    color: #bbb;
}

.archived-sort-btn.active {
    background: rgba(255,152,0,0.1);
    border-color: rgba(255,152,0,0.2);
    color: var(--accent);
}

/* Archived Status Count Badges */
.archived-count {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 18px;
    height: 18px;
    padding: 0 5px;
    margin-left: 4px;
    background: rgba(255,255,255,0.08);
    border-radius: 10px;
    font-size: 0.65rem;
    font-weight: 700;
    color: #888;
}

.archived-sort-btn.active .archived-count {
    background: rgba(255,152,0,0.2);
    color: var(--accent);
}

/* =============================================================================
   ARCHIVED PAGINATION
   ============================================================================= */

.archived-pagination {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 12px;
    padding: 20px 0;
    margin-top: 16px;
    border-top: 1px solid #222;
}

.pagination-info {
    color: #666;
    font-size: 0.8rem;
}

.pagination-controls {
    display: flex;
    align-items: center;
    gap: 6px;
}

.pagination-btn {
    background: rgba(255,255,255,0.05);
    border: 1px solid #333;
    color: #888;
    padding: 8px 12px;
    min-width: 36px;
    border-radius: 8px;
    font-size: 0.85rem;
    font-weight: 600;
    cursor: pointer;
    transition: 0.2s;
    display: flex;
    align-items: center;
    justify-content: center;
}

.pagination-btn:hover:not(.disabled) {
    background: rgba(255,255,255,0.1);
    border-color: #444;
    color: #bbb;
}

.pagination-btn.active {
    background: var(--accent);
    border-color: var(--accent);
    color: #000;
}

.pagination-btn.disabled {
    opacity: 0.3;
    cursor: not-allowed;
}

.pagination-ellipsis {
    color: #555;
    padding: 0 4px;
}

/* Top pagination has bottom margin, bottom pagination has top margin */
.archived-pagination-top {
    margin-bottom: 16px;
    padding-bottom: 16px;
    border-bottom: 1px solid #222;
    border-top: none;
    margin-top: 0;
}

.archived-pagination-bottom {
    margin-top: 16px;
    padding-top: 16px;
    border-top: 1px solid #222;
}

/* =============================================================================
   SUGGESTIONS FEED
   ============================================================================= */

.suggestions-feed {
    flex: 1;
    overflow-y: auto;
    overflow-x: hidden;
    padding: 12px 8px;
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.suggestions-empty {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 60px 20px;
    text-align: center;
    color: #444;
}

.suggestions-empty svg {
    opacity: 0.2;
    margin-bottom: 20px;
}

.suggestions-empty h3 {
    font-size: 1.1rem;
    font-weight: 700;
    color: #555;
    margin-bottom: 8px;
}

.suggestions-empty p {
    font-size: 0.9rem;
    color: #444;
}

/* =============================================================================
   FORUM-STYLE THREAD LIST
   ============================================================================= */

/* Forum Thread Row - Compact uniform rows */
.forum-thread-row {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px 16px;
    background: rgba(25, 25, 25, 0.95);
    border: 1px solid rgba(255, 255, 255, 0.06);
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.2s ease;
    height: 64px;
    box-sizing: border-box;
}

.forum-thread-row:hover {
    background: rgba(40, 40, 40, 0.95);
    border-color: rgba(255, 152, 0, 0.2);
    transform: translateX(4px);
}

.forum-thread-row.pinned {
    background: linear-gradient(135deg, rgba(255, 152, 0, 0.08), rgba(25, 25, 25, 0.95));
    border-color: rgba(255, 152, 0, 0.15);
}

.forum-thread-category {
    width: 36px;
    height: 36px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.2rem;
    background: rgba(255, 255, 255, 0.05);
    border-radius: 8px;
    flex-shrink: 0;
}

.forum-thread-main {
    flex: 1;
    min-width: 0;
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.forum-thread-title {
    font-size: 0.95rem;
    font-weight: 600;
    color: #e0e0e0;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    line-height: 1.3;
}

.forum-thread-row:hover .forum-thread-title {
    color: #fff;
}

.forum-thread-meta {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 0.75rem;
    color: #666;
}

.forum-thread-author {
    color: #888;
    font-weight: 500;
}

.forum-thread-stats {
    display: flex;
    align-items: center;
    gap: 16px;
    flex-shrink: 0;
}

.forum-thread-stat {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 2px;
    min-width: 50px;
}

.forum-thread-stat-value {
    font-size: 0.9rem;
    font-weight: 700;
    color: #aaa;
}

.forum-thread-stat-label {
    font-size: 0.65rem;
    color: #555;
    text-transform: uppercase;
}

.forum-thread-status {
    padding: 4px 10px;
    border-radius: 12px;
    font-size: 0.7rem;
    font-weight: 600;
    white-space: nowrap;
    flex-shrink: 0;
}

.forum-thread-time {
    font-size: 0.75rem;
    color: #555;
    min-width: 70px;
    text-align: right;
    flex-shrink: 0;
}

/* Forum Thread Action Buttons */
.forum-thread-actions {
    display: flex;
    align-items: center;
    gap: 4px;
    opacity: 0;
    transition: opacity 0.2s;
    flex-shrink: 0;
    margin-left: 8px;
}

.forum-thread-row:hover .forum-thread-actions {
    opacity: 1;
}

.forum-action-btn {
    width: 28px;
    height: 28px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(255, 255, 255, 0.08);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 6px;
    cursor: pointer;
    font-size: 0.85rem;
    transition: all 0.15s;
    color: #999;
}

.forum-action-btn:hover {
    background: rgba(255, 255, 255, 0.15);
    border-color: rgba(255, 255, 255, 0.2);
    color: #fff;
    transform: scale(1.1);
}

.forum-action-btn.forum-delete-btn:hover {
    background: rgba(255, 68, 68, 0.2);
    border-color: rgba(255, 68, 68, 0.4);
    color: #ff6666;
}

/* Forum Table Header */
.forum-header {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 8px 16px;
    background: rgba(15, 15, 15, 0.9);
    border-radius: 8px;
    margin-bottom: 8px;
    font-size: 0.7rem;
    font-weight: 700;
    color: #666;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.forum-header-title {
    flex: 1;
    padding-left: 48px;
}

.forum-header-stats {
    display: flex;
    gap: 16px;
}

.forum-header-stat {
    min-width: 50px;
    text-align: center;
}

.forum-header-time {
    min-width: 70px;
    text-align: right;
}

/* =============================================================================
   THREAD DETAIL MODAL
   ============================================================================= */

.thread-modal-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.9);
    z-index: 10000;
    display: flex;
    justify-content: center;
    overflow-y: auto;
    padding: 20px;
    animation: fadeIn 0.2s ease;
}

.thread-modal-content {
    width: 100%;
    max-width: 900px;
    background: #121212;
    border-radius: 16px;
    border: 1px solid rgba(255, 255, 255, 0.1);
    margin: auto;
    max-height: none;
    animation: slideUp 0.3s ease;
}

@keyframes slideUp {
    from { opacity: 0; transform: translateY(30px); }
    to { opacity: 1; transform: translateY(0); }
}

.thread-modal-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 16px 20px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.08);
    background: rgba(20, 20, 20, 0.95);
    border-radius: 16px 16px 0 0;
    position: sticky;
    top: 0;
    z-index: 10;
}

.thread-back-btn {
    display: flex;
    align-items: center;
    gap: 8px;
    background: none;
    border: none;
    color: #aaa;
    font-size: 0.9rem;
    font-weight: 600;
    cursor: pointer;
    padding: 8px 12px;
    border-radius: 8px;
    transition: all 0.2s;
}

.thread-back-btn:hover {
    background: rgba(255, 255, 255, 0.1);
    color: #fff;
}

.thread-modal-body {
    padding: 20px;
    overflow-y: auto;
    max-height: calc(100vh - 140px);
    scroll-behavior: auto !important; /* Prevent smooth scroll that causes jumping */
}

/* Thread detail view styling */
.thread-detail {
    display: flex;
    flex-direction: column;
    gap: 20px;
    overflow: visible;
}

.thread-detail-header {
    display: flex;
    gap: 16px;
    padding-bottom: 20px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.08);
    overflow: visible;
}

.thread-detail-avatar {
    flex-shrink: 0;
}

.thread-detail-info {
    flex: 1;
    overflow: visible;
}

.thread-detail-badges {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-bottom: 12px;
    overflow: visible;
}

.thread-detail-title {
    font-size: 1.3rem;
    font-weight: 700;
    color: #fff;
    margin-bottom: 8px;
    line-height: 1.4;
}

.thread-detail-meta {
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
    font-size: 0.85rem;
    color: #666;
    overflow: visible;
}

.thread-detail-body {
    padding: 20px 0;
    color: #ddd;
    line-height: 1.7;
    font-size: 1rem;
}

.thread-detail-actions {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 16px 0;
    border-top: 1px solid rgba(255, 255, 255, 0.08);
    border-bottom: 1px solid rgba(255, 255, 255, 0.08);
}

.thread-replies-section {
    margin-top: 20px;
}

.thread-replies-header {
    font-size: 1rem;
    font-weight: 700;
    color: #fff;
    margin-bottom: 16px;
    display: flex;
    align-items: center;
    gap: 8px;
}

/* =============================================================================
   FORUM-STYLE RESPONSIVE (MOBILE)
   ============================================================================= */

@media (max-width: 768px) {
    .forum-thread-row {
        height: auto;
        min-height: 64px;
        padding: 12px;
        flex-wrap: wrap;
        position: relative;
    }
    
    .forum-thread-category {
        width: 32px;
        height: 32px;
        font-size: 1rem;
    }
    
    .forum-thread-main {
        flex: 1;
        min-width: calc(100% - 100px);
    }
    
    .forum-thread-title {
        font-size: 0.9rem;
    }
    
    .forum-thread-stats {
        display: none;
    }
    
    .forum-thread-time {
        position: absolute;
        right: 12px;
        top: 12px;
        font-size: 0.7rem;
    }
    
    .forum-thread-actions {
        opacity: 1;
        position: absolute;
        right: 12px;
        bottom: 10px;
    }
    
    .forum-action-btn {
        width: 24px;
        height: 24px;
        font-size: 0.75rem;
    }
    
    .forum-header {
        display: none;
    }
    
    .thread-modal-overlay {
        padding: 0;
    }
    
    .thread-modal-content {
        border-radius: 0;
        max-height: 100vh;
        margin: 0;
    }
    
    .thread-modal-body {
        max-height: calc(100vh - 60px);
        padding: 12px;
    }
    
    .thread-detail-title {
        font-size: 1.1rem;
    }
    
    .thread-detail-meta {
        font-size: 0.8rem;
    }
}

@media (max-width: 480px) {
    .forum-thread-row {
        padding: 10px;
        gap: 10px;
        position: relative;
    }
    
    .forum-thread-meta {
        font-size: 0.7rem;
    }
    
    .forum-thread-title {
        font-size: 0.85rem;
    }
    
    .thread-detail-header {
        flex-direction: column;
        gap: 12px;
    }
    
    .thread-detail-avatar {
        display: flex;
        justify-content: center;
    }
}

/* =============================================================================
   SUGGESTION CARD (LEGACY)
   ============================================================================= */

/* Legacy Suggestion Card - hidden in forum mode, shown in thread detail */
.suggestion-card {
    background: linear-gradient(145deg, rgba(30,30,30,0.95), rgba(18,18,18,0.98));
    border: 1px solid rgba(255,255,255,0.06);
    border-radius: 16px;
    padding: 20px;
    position: relative;
    transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1), box-shadow 0.3s cubic-bezier(0.4, 0, 0.2, 1), border-color 0.3s;
    overflow: visible;
    width: 100%;
    box-sizing: border-box;
}

.suggestion-card::before {
    content: "";
    position: absolute;
    inset: -1px;
    border-radius: 16px;
    background: linear-gradient(135deg, rgba(255,152,0,0.15), rgba(79,195,247,0.1));
    opacity: 0;
    transition: opacity 0.3s;
    pointer-events: none;
    z-index: 0;
}

.suggestion-card:hover {
    transform: translateY(-3px);
    box-shadow: 0 12px 40px rgba(0,0,0,0.4);
    border-color: rgba(255,152,0,0.15);
}

.suggestion-card:hover::before {
    opacity: 1;
}

.suggestion-card .card-header,
.suggestion-card .card-body,
.suggestion-card .card-actions,
.suggestion-card .replies-container {
    position: relative;
    z-index: 1;
}

.suggestion-avatar {
    flex-shrink: 0;
}

.suggestion-author {
    font-weight: 700;
    font-size: 0.95rem;
}

.time-stamp {
    font-size: 0.75rem;
    color: #666;
}

.card-body {
    color: #ddd;
    line-height: 1.6;
    font-size: 0.95rem;
    margin: 16px 0;
}

.card-actions {
    display: flex;
    align-items: center;
    gap: 16px;
    padding-top: 16px;
    border-top: 1px solid rgba(255,255,255,0.05);
}

.text-btn {
    background: none;
    border: none;
    color: var(--accent);
    font-size: 0.8rem;
    font-weight: 700;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 6px 0;
    transition: 0.2s;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.text-btn:hover {
    color: #ffb74d;
}

/* =============================================================================
   REPLIES
   ============================================================================= */

.replies-container {
    margin-top: 16px;
    padding-left: 20px;
    border-left: 2px solid rgba(255,255,255,0.05);
}

.reply-item {
    background: linear-gradient(145deg, rgba(20,20,20,0.9), rgba(15,15,15,0.95));
    border: 1px solid rgba(255,255,255,0.04);
    border-radius: 12px;
    padding: 14px;
    margin-top: 12px;
    transition: 0.2s;
    overflow: visible;
}

.reply-item:hover {
    border-color: rgba(255,255,255,0.08);
}

.reply-avatar {
    width: 28px;
    height: 28px;
    min-width: 28px;
    max-width: 28px;
    min-height: 28px;
    max-height: 28px;
    flex-shrink: 0;
    border-radius: 50%;
    object-fit: cover;
}

.reply-author {
    font-size: 0.8rem;
    font-weight: 700;
    overflow: visible;
}

.nested-reply-item {
    display: flex;
    gap: 8px;
    background: rgba(0,0,0,0.3);
    border-radius: 8px;
    padding: 10px;
    margin-top: 10px;
    border-left: 2px solid rgba(255,152,0,0.2);
    overflow: visible;
}

/* "Replying to @username" reference link */
.reply-to-ref {
    display: inline-block;
    font-size: 0.65rem;
    color: rgba(255, 152, 0, 0.8);
    font-weight: 500;
    cursor: pointer;
    padding: 1px 6px;
    margin-left: 4px;
    background: rgba(255, 152, 0, 0.1);
    border-radius: 4px;
    transition: all 0.2s ease;
    vertical-align: middle;
}

.reply-to-ref:hover {
    background: rgba(255, 152, 0, 0.2);
    color: #ff9800;
    text-decoration: none;
}

/* Flat container for all nested replies */
.nested-replies-flat-container {
    margin-top: 10px;
}

/* =============================================================================
   REACTIONS
   ============================================================================= */

.reaction-bar {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-top: 12px;
    max-width: 100%;
}

.reaction-pill {
    background: rgba(0,0,0,0.4);
    border: 1px solid rgba(255,255,255,0.08);
    padding: 4px 10px;
    border-radius: 15px;
    display: flex;
    align-items: center;
    gap: 5px;
    cursor: pointer;
    transition: 0.2s;
    user-select: none;
}

.reaction-pill:hover {
    background: rgba(255,255,255,0.05);
    border-color: rgba(255,255,255,0.15);
}

.reaction-pill.active {
    background: rgba(255, 255, 255, 0.12);
    border-color: rgba(255, 255, 255, 0.25);
    color: #fff;
}

.reaction-count {
    font-size: 0.75rem;
    font-weight: 800;
}

.reaction-anchor {
    position: relative;
}

.reaction-hover-trigger {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border-radius: 6px;
    transition: background 0.15s ease;
}

.reaction-hover-trigger:hover {
    background: rgba(255,255,255,0.08);
}

.reaction-hover-trigger span {
    display: flex;
    align-items: center;
    justify-content: center;
}

.reaction-picker {
    display: none;
    position: fixed;
    background: rgba(0, 0, 0, 0.85);
    border: 1px solid rgba(255,255,255,0.15);
    border-radius: 25px;
    padding: 10px 14px;
    gap: 10px;
    box-shadow: 0 12px 40px rgba(0,0,0,0.7);
    z-index: 10001;
    align-items: center;
    animation: pickerPop 0.2s cubic-bezier(0.175, 0.885, 0.32, 1.275);
    white-space: nowrap;
    backdrop-filter: blur(10px);
}

.chat-msg-me .reaction-picker {
    /* Fixed positioning - inherits from parent rule */
}

@keyframes pickerPop {
    from { opacity: 0; transform: scale(0.8) translateY(5px); }
    to { opacity: 1; transform: scale(1) translateY(0); }
}

.reaction-picker.show {
    display: flex;
}

.picker-emoji {
    cursor: pointer;
    font-size: 1.2rem;
    transition: 0.15s;
    padding: 4px;
}

.picker-emoji:hover {
    transform: scale(1.3);
}

.add-reaction-trigger {
    background: rgba(255,255,255,0.03);
    border: 1px solid rgba(255,255,255,0.08);
    color: #888;
    cursor: pointer;
    border-radius: 8px;
    padding: 4px 8px;
    font-size: 0.9rem;
    transition: 0.2s;
}

.add-reaction-trigger:hover {
    background: rgba(255,152,0,0.1);
    border-color: rgba(255,152,0,0.2);
    color: var(--accent);
}

/* =============================================================================
   REPLY INPUT BOX
   ============================================================================= */

/* Reply Input Box - Uses same styles as global chat */
.reply-input-box {
    margin-top: 15px;
    animation: fadeInUp 0.2s;
}

.reply-input-box .input-toolbar {
    margin-bottom: 8px;
}

.reply-input-box .input-wrapper {
    position: relative;
}

.reply-input-box .chat-textarea {
    min-height: 36px;
}

/* Nested Reply Input Box */
.nested-reply-input-box {
    margin-top: 10px;
    animation: fadeInUp 0.2s;
}

.nested-reply-input-box .input-toolbar {
    margin-bottom: 6px;
}

.nested-reply-input-box .chat-textarea {
    min-height: 32px;
    font-size: 0.8rem;
}

/* =============================================================================
   COMMUNITY GUIDELINES BANNER
   ============================================================================= */

.community-guidelines-banner {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px 16px;
    background: linear-gradient(135deg, rgba(79,195,247,0.1), rgba(255,152,0,0.08));
    border: 1px solid rgba(79,195,247,0.2);
    border-radius: 10px;
    margin-bottom: 16px;
}

.guidelines-icon {
    font-size: 1.2rem;
}

.guidelines-content {
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.guidelines-content strong {
    color: var(--blue);
    font-size: 0.85rem;
}

.guidelines-content span {
    color: #888;
    font-size: 0.75rem;
}

.guidelines-expand {
    background: rgba(255,255,255,0.05);
    border: 1px solid rgba(255,255,255,0.1);
    border-radius: 6px;
    padding: 6px;
    cursor: pointer;
    color: #888;
    transition: all 0.2s;
}

.guidelines-expand:hover {
    background: rgba(79,195,247,0.15);
    border-color: rgba(79,195,247,0.3);
    color: var(--blue);
}

/* =============================================================================
   GUIDELINES MODAL
   ============================================================================= */

.guidelines-modal {
    position: fixed;
    inset: 0;
    background: rgba(0,0,0,0.8);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 1000;
    padding: 20px;
    animation: fadeIn 0.2s ease;
}

.guidelines-modal-content {
    background: linear-gradient(145deg, #1a1a1a, #141414);
    border: 1px solid rgba(255,255,255,0.1);
    border-radius: 16px;
    max-width: 500px;
    width: 100%;
    max-height: 80vh;
    overflow-y: auto;
}

.guidelines-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 20px;
    border-bottom: 1px solid rgba(255,255,255,0.05);
}

.guidelines-header h3 {
    margin: 0;
    font-size: 1.1rem;
    color: #fff;
}

.guidelines-close {
    background: none;
    border: none;
    color: #666;
    font-size: 1.5rem;

    cursor: pointer;
    transition: 0.2s;
}

.guidelines-close:hover {
    color: #fff;
}

/* =============================================================================
   @ MENTION AUTOCOMPLETE POPUP
   ============================================================================= */

.mention-autocomplete-popup {
    display: none;
    position: fixed;
    z-index: 10000;
    background: linear-gradient(145deg, #1a1a1a, #0f0f0f);
    border: 1px solid rgba(245, 194, 17, 0.3);
    border-radius: 12px;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.6), 0 0 20px rgba(245, 194, 17, 0.1);
    max-height: 320px;
    overflow-y: auto;
    padding: 8px;
    backdrop-filter: blur(10px);
}

.mention-autocomplete-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 10px 14px;
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.15s ease;
    border: 1px solid transparent;
}

.mention-autocomplete-item:hover {
    background: rgba(245, 194, 17, 0.1);
    border-color: rgba(245, 194, 17, 0.2);
}

.mention-autocomplete-item.selected {
    background: rgba(245, 194, 17, 0.15);
    border-color: rgba(245, 194, 17, 0.4);
}

.mention-avatar {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    object-fit: cover;
    border: 2px solid rgba(245, 194, 17, 0.4);
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.3);
}

.mention-username {
    font-size: 0.95rem;
    font-weight: 600;
    color: #fff;
}

.mention-autocomplete-popup::-webkit-scrollbar {
    width: 6px;
}

.mention-autocomplete-popup::-webkit-scrollbar-track {
    background: transparent;
}

.mention-autocomplete-popup::-webkit-scrollbar-thumb {
    background: rgba(245, 194, 17, 0.3);
    border-radius: 3px;
}

.mention-autocomplete-popup::-webkit-scrollbar-thumb:hover {
    background: rgba(245, 194, 17, 0.5);
}

/* @everyone option styling */
.mention-autocomplete-item.everyone-option {
    background: rgba(76, 175, 80, 0.1);
    border-color: rgba(76, 175, 80, 0.3);
}

.mention-autocomplete-item.everyone-option:hover {
    background: rgba(76, 175, 80, 0.2);
    border-color: rgba(76, 175, 80, 0.4);
}

.mention-autocomplete-item.everyone-option.selected {
    background: rgba(76, 175, 80, 0.25);
    border-color: rgba(76, 175, 80, 0.5);
}

.everyone-hint {
    font-size: 0.75rem;
    color: rgba(76, 175, 80, 0.9);
    font-weight: 400;
    margin-left: 4px;
}

/* =============================================================================
   LOADING SKELETON FOR SUGGESTIONS
   ============================================================================= */

.suggestions-loading-skeleton {
    padding: 10px;
    display: flex;
    flex-direction: column;
    gap: 15px;
}

.skeleton-card {
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid rgba(255, 255, 255, 0.06);
    border-radius: 12px;
    padding: 16px;
}

.skeleton-header {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 12px;
}

.skeleton-avatar {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background: linear-gradient(90deg, rgba(255,255,255,0.05) 25%, rgba(255,255,255,0.1) 50%, rgba(255,255,255,0.05) 75%);
    background-size: 200% 100%;
    animation: skeleton-shimmer 1.5s infinite;
}

.skeleton-text {
    height: 14px;
    border-radius: 4px;
    background: linear-gradient(90deg, rgba(255,255,255,0.05) 25%, rgba(255,255,255,0.1) 50%, rgba(255,255,255,0.05) 75%);
    background-size: 200% 100%;
    animation: skeleton-shimmer 1.5s infinite;
}

.skeleton-title {
    width: 150px;
    height: 16px;
}

.skeleton-body {
    width: 100%;
    margin-bottom: 8px;
}

.skeleton-body.short {
    width: 70%;
}

@keyframes skeleton-shimmer {
    0% { background-position: 200% 0; }
    100% { background-position: -200% 0; }
}

/* Hide skeleton when content loads */
.suggestions-feed:not(:empty) .suggestions-loading-skeleton {
    display: none;
}

/* Override: show skeleton only when it's the only child */
.suggestions-loading-skeleton:only-child {
    display: flex !important;
}

/* =============================================================================
   USER DIRECTORY
   ============================================================================= */

/* User Directory Modal Panel */
.ud-modal-panel {
    background: var(--bg-card);
    border-radius: var(--radius-lg, 16px);
    border: 1px solid var(--border-color);
    width: 94vw;
    max-width: 1200px;
    max-height: 88vh;
    display: flex;
    flex-direction: column;
    overflow: hidden;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.5);
    animation: modalSlideIn 0.25s ease;
    position: relative;
}

.ud-modal-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 18px 24px 8px;
    border-bottom: none;
    position: relative;
}

.ud-modal-header .modal-close {
    position: static;
    font-size: 1.8rem;
    color: #888;
    background: none;
    border: none;
    cursor: pointer;
    padding: 4px 8px;
    line-height: 1;
    flex-shrink: 0;
}
.ud-modal-header .modal-close:hover {
    color: #fff;
}

.ud-modal-header .directory-title {
    margin-bottom: 0;
}

@keyframes modalSlideIn {
    from { opacity: 0; transform: translateY(-20px) scale(0.97); }
    to   { opacity: 1; transform: translateY(0) scale(1); }
}

.user-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 12px;
    padding: 14px 20px 24px;
    flex: 1;
    min-height: 0;
    overflow-y: auto;
    scroll-behavior: smooth;
}

/* User Card (compact tile) */
.ud-user-card {
    display: flex;
    align-items: center;
    gap: 14px;
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: 10px;
    padding: 12px 16px;
    padding-top: 18px; /* extra room for party hat overflow */
    cursor: pointer;
    transition: all 0.2s ease;
    position: relative;
    min-width: 0;
    overflow: visible;
}
.ud-user-card:hover {
    background: rgba(255, 152, 0, 0.08);
    border-color: var(--accent);
}

/* Avatar wrapper with status indicator */
.ud-avatar-wrap {
    position: relative;
    flex-shrink: 0;
    width: 48px;
    height: 48px;
    overflow: visible;
}

/* Party hat wrapper inside directory cards */
.ud-avatar-wrap .avatar-phat-wrap {
    display: block;
    width: 48px;
    height: 48px;
    overflow: visible;
}
.ud-avatar-wrap .avatar-phat-wrap::before {
    width: 62%;
    height: 62%;
    top: -36%;
}

.ud-avatar {
    width: 48px;
    height: 48px;
    border-radius: 50%;
    object-fit: cover;
    border: 2px solid var(--border-color);
    background: var(--bg-input);
}
.ud-user-card:hover .ud-avatar {
    border-color: var(--accent);
}

/* Name column: stacks name row + title vertically */
.ud-name-col {
    display: flex;
    flex-direction: column;
    min-width: 0;
    flex: 1;
    gap: 1px;
}

/* Name row: name + badge + linked count */
.ud-name-row {
    display: flex;
    align-items: center;
    gap: 6px;
    min-width: 0;
}

/* Online/offline dot */
.ud-status-dot {
    position: absolute;
    bottom: 0px;
    right: 0px;
    width: 12px;
    height: 12px;
    border-radius: 50%;
    border: 2px solid var(--bg-card);
}
.ud-status-dot.online {
    background: #4ade80;
    box-shadow: 0 0 6px rgba(74, 222, 128, 0.5);
}
.ud-status-dot.offline {
    background: #555;
}

/* User name */
.ud-user-name {
    font-size: 0.95rem;
    font-weight: 600;
    color: #fff;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    min-width: 0;
}

/* User title (below name) */
.ud-user-title {
    font-size: 0.75rem;
    font-weight: 500;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    opacity: 0.8;
    line-height: 1.2;
}

/* Linked players badge */
.ud-linked-badge {
    font-size: 0.7rem;
    color: var(--text-dim);
    white-space: nowrap;
    flex-shrink: 0;
    opacity: 0.85;
}

/* Online indicator dot beside name */
.ud-online-dot {
    width: 6px;
    height: 6px;
    border-radius: 50%;
    background: #4ade80;
    flex-shrink: 0;
    box-shadow: 0 0 4px rgba(74, 222, 128, 0.5);
}

/* =============================================================================
   USER DIRECTORY — Responsive
   ============================================================================= */

@media (max-width: 600px) {
    .ud-modal-panel {
        width: 96vw;
        max-height: 90vh;
    }
    .user-grid {
        grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
        gap: 8px;
        padding: 8px 10px 32px;
    }
    .ud-user-card {
        padding: 10px 12px;
        padding-top: 14px;
        gap: 10px;
    }
    .ud-avatar-wrap,
    .ud-avatar {
        width: 36px;
        height: 36px;
    }
    .ud-avatar-wrap .avatar-phat-wrap {
        width: 36px;
        height: 36px;
    }
    .ud-status-dot {
        width: 8px;
        height: 8px;
    }
    .ud-user-name {
        font-size: 0.85rem;
    }
    .ud-user-title {
        font-size: 0.68rem;
    }
}

/* =============================================================================
   CLAN COMPETITIONS
   ============================================================================= */

/* Panel in left column */
.competitions-list {
    display: flex;
    flex-direction: column;
    gap: 6px;
    padding: 8px;
    max-height: 320px;
    overflow-y: auto;
}

.comp-empty, .comp-loading {
    text-align: center;
    color: #666;
    padding: 16px 8px;
    font-size: 0.82rem;
}

/* Competition Card */
.comp-card {
    background: rgba(255,255,255,0.03);
    border: 1px solid rgba(255,255,255,0.06);
    border-radius: 8px;
    padding: 10px 12px;
    cursor: pointer;
    transition: background 0.2s, border-color 0.2s;
}
.comp-card:hover {
    background: rgba(255,255,255,0.06);
    border-color: rgba(255,255,255,0.12);
}

.comp-card-header {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 4px;
}

.comp-card-icon {
    width: 20px;
    height: 20px;
    border-radius: 4px;
    flex-shrink: 0;
}

.comp-card-title {
    font-weight: 600;
    font-size: 0.85rem;
    color: #eee;
    flex: 1;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.comp-badge {
    font-size: 0.65rem;
    padding: 2px 6px;
    border-radius: 4px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    flex-shrink: 0;
}

.comp-badge.active {
    background: rgba(76,175,80,0.15);
    color: #4caf50;
    border: 1px solid rgba(76,175,80,0.3);
}
.comp-badge.upcoming {
    background: rgba(33,150,243,0.15);
    color: #2196f3;
    border: 1px solid rgba(33,150,243,0.3);
}
.comp-badge.finished {
    background: rgba(158,158,158,0.15);
    color: #9e9e9e;
    border: 1px solid rgba(158,158,158,0.3);
}

.comp-card-meta {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 0.72rem;
    color: #888;
}

.comp-card-meta span {
    display: flex;
    align-items: center;
    gap: 3px;
}

/* Modal Styles */
.comp-modal-content {
    max-width: 520px;
    width: 95%;
}

.comp-view-content {
    max-width: 620px;
}

.comp-modal-body {
    display: flex;
    flex-direction: column;
    gap: 14px;
    padding: 16px 20px 20px;
}

.comp-form-group {
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.comp-form-group label {
    font-size: 0.78rem;
    font-weight: 600;
    color: #ccc;
}

.comp-optional {
    font-weight: 400;
    color: #666;
    font-size: 0.72rem;
}

.comp-input {
    background: rgba(255,255,255,0.05);
    border: 1px solid rgba(255,255,255,0.1);
    border-radius: 6px;
    padding: 8px 10px;
    color: #eee;
    font-size: 0.85rem;
    font-family: inherit;
    transition: border-color 0.2s;
}
.comp-input:focus {
    outline: none;
    border-color: rgba(245,194,17,0.5);
}

select.comp-input {
    appearance: none;
    -webkit-appearance: none;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 24 24' fill='none' stroke='%23888' stroke-width='2'%3E%3Cpolyline points='6 9 12 15 18 9'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 10px center;
    padding-right: 30px;
    cursor: pointer;
}

select.comp-input option,
select.comp-input optgroup {
    background: #1a1a1a;
    color: #eee;
}

.comp-textarea {
    resize: vertical;
    min-height: 60px;
    max-height: 120px;
}

.comp-form-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 12px;
}

.comp-error {
    background: rgba(244,67,54,0.1);
    border: 1px solid rgba(244,67,54,0.3);
    color: #f44336;
    padding: 8px 10px;
    border-radius: 6px;
    font-size: 0.8rem;
}

.comp-submit-btn {
    margin-top: 4px;
}

/* View Competition Modal */
.comp-view-header {
    display: flex;
    align-items: center;
    gap: 10px;
    padding-bottom: 12px;
    border-bottom: 1px solid rgba(255,255,255,0.06);
}

.comp-view-icon {
    width: 32px;
    height: 32px;
    border-radius: 6px;
}

.comp-view-info {
    flex: 1;
}

.comp-view-metric {
    font-weight: 600;
    color: #eee;
    font-size: 0.9rem;
}

.comp-view-dates {
    font-size: 0.75rem;
    color: #888;
    margin-top: 2px;
}

.comp-view-desc {
    font-size: 0.8rem;
    color: #aaa;
    line-height: 1.4;
    padding: 8px 0;
}

.comp-view-status {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 0.78rem;
    color: #aaa;
}

.comp-view-countdown {
    font-weight: 600;
    color: #f5c211;
}

/* Leaderboard */
.comp-leaderboard {
    display: flex;
    flex-direction: column;
    gap: 2px;
    margin-top: 8px;
}

.comp-lb-header {
    display: grid;
    grid-template-columns: 32px 1fr 100px;
    padding: 6px 8px;
    font-size: 0.7rem;
    font-weight: 600;
    color: #888;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    border-bottom: 1px solid rgba(255,255,255,0.06);
}

.comp-lb-row {
    display: grid;
    grid-template-columns: 32px 1fr 100px;
    padding: 8px;
    border-radius: 6px;
    align-items: center;
    transition: background 0.2s;
}
.comp-lb-row:hover {
    background: rgba(255,255,255,0.03);
}

.comp-lb-row:nth-child(2) { /* First actual row after header */
    background: rgba(255,215,0,0.05);
}

.comp-lb-rank {
    font-weight: 700;
    font-size: 0.85rem;
    color: #888;
    text-align: center;
}

.comp-lb-row:nth-child(2) .comp-lb-rank {
    color: #ffd700;
}
.comp-lb-row:nth-child(3) .comp-lb-rank {
    color: #c0c0c0;
}
.comp-lb-row:nth-child(4) .comp-lb-rank {
    color: #cd7f32;
}

.comp-lb-name {
    font-weight: 500;
    color: #eee;
    font-size: 0.82rem;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.comp-lb-gained {
    font-weight: 600;
    color: #4caf50;
    font-size: 0.82rem;
    text-align: right;
    font-variant-numeric: tabular-nums;
}

.comp-lb-empty {
    text-align: center;
    color: #666;
    padding: 20px;
    font-size: 0.8rem;
}

/* Competition Actions */
.comp-actions {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
    margin-top: 8px;
    padding-top: 12px;
    border-top: 1px solid rgba(255,255,255,0.06);
}

.comp-action-btn {
    padding: 6px 14px;
    border-radius: 6px;
    border: 1px solid rgba(255,255,255,0.1);
    background: rgba(255,255,255,0.05);
    color: #ccc;
    font-size: 0.78rem;
    cursor: pointer;
    transition: background 0.2s, border-color 0.2s;
}
.comp-action-btn:hover {
    background: rgba(255,255,255,0.1);
    border-color: rgba(255,255,255,0.2);
}

.comp-action-btn.primary {
    background: rgba(245,194,17,0.15);
    border-color: rgba(245,194,17,0.3);
    color: #f5c211;
}
.comp-action-btn.primary:hover {
    background: rgba(245,194,17,0.25);
}

.comp-action-btn.danger {
    background: rgba(244,67,54,0.1);
    border-color: rgba(244,67,54,0.25);
    color: #f44336;
}
.comp-action-btn.danger:hover {
    background: rgba(244,67,54,0.2);
}

/* Panel Button */
.panel-actions {
    display: flex;
    gap: 4px;
    margin-left: auto;
    margin-right: 8px;
}

.panel-btn {
    width: 22px;
    height: 22px;
    border-radius: 4px;
    border: 1px solid rgba(255,255,255,0.1);
    background: rgba(255,255,255,0.05);
    color: #ccc;
    font-size: 0.85rem;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background 0.2s;
    padding: 0;
    line-height: 1;
}
.panel-btn:hover {
    background: rgba(255,255,255,0.12);
    color: #fff;
}

/* Responsive */
@media (max-width: 768px) {
    .comp-form-row {
        grid-template-columns: 1fr;
    }
    .comp-modal-content,
    .comp-view-content {
        max-width: 100%;
        width: 100%;
        margin: 10px;
    }
    .comp-lb-header,
    .comp-lb-row {
        grid-template-columns: 28px 1fr 80px;
    }
}
