/**
 * Chat Reactions System - CSS Styles
 * Version: 2.0
 */

/* Reactions Display - Now positioned under message content */

/* Emoji Picker */
.emoji-picker {
    position: absolute;
    display: flex;
    gap: 2px;
    padding: 3px;
    background-color: #fff;
    border: 1px solid #ddd;
    border-radius: 8px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
    z-index: 1000;
    white-space: nowrap;
    margin-bottom: 8px;
}

.emoji-option {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 28px;
    height: 28px;
    font-size: 16px;
    cursor: pointer;
    border-radius: 4px;
    user-select: none;
}

.emoji-option:hover {
    background-color: #f0f0f0;
}

/* Reactions Display - Inline within message content */
.reactions-display {
    display: inline-flex;
    gap: 2px;
    flex-wrap: wrap;
    align-items: center;
    margin-left: 4px;
    vertical-align: baseline;
}

/* Message text hover effect - for clickable messages (other users only) */
/* Hover effect will be applied via JavaScript for other users' messages */

.reaction-item {
    display: inline-flex;
    align-items: center;
    gap: 2px;
    padding: 1px 4px;
    font-size: 11px;
    line-height: 1;
    cursor: pointer;
    border: 1px solid #ddd;
    border-radius: 10px;
    background-color: #f8f9fa;
    user-select: none;
    margin: 0 1px;
    position: relative; /* Tooltip için gerekli */
}



.reaction-item.user-reacted {
    background-color: #007bff;
    border-color: #007bff;
    color: #fff;
}


.reaction-emoji {
    font-size: 14px;
    line-height: 1;
}

.reaction-count {
    font-weight: 600;
    font-size: 11px;
    min-width: 12px;
    text-align: center;
}

/* Responsive Design */
@media (max-width: 768px) {
    .reactions-display {
        gap: 1px;
        margin-left: 2px;
    }

    .emoji-picker {
        gap: 1px;
        padding: 6px;
        margin-bottom: 5px;
    }

    .emoji-option {
        width: 24px;
        height: 24px;
        font-size: 14px;
    }

    .reaction-item {
        padding: 1px 3px;
        font-size: 10px;
        gap: 1px;
        margin: 0 1px;
    }

    .reaction-emoji {
        font-size: 12px;
    }

    .reaction-count {
        font-size: 10px;
        min-width: 10px;
    }
}

/* Dark Theme Support */
@media (prefers-color-scheme: dark) {
    .emoji-picker {
        background-color: #2d3748;
        border-color: #4a5568;
    }

    .emoji-option:hover {
        background-color: #4a5568;
    }

    .reaction-item {
        background-color: #2d3748;
        border-color: #4a5568;
        color: #e2e8f0;
    }

}


/* Accessibility */
.emoji-option:focus,
.reaction-item:focus {
    outline: 2px solid #007bff;
    outline-offset: 2px;
}

/* High Contrast Mode */
@media (prefers-contrast: high) {
    .emoji-picker,
    .reaction-item {
        border-width: 2px;
    }

    .reaction-item.user-reacted {
        background-color: #000;
        border-color: #000;
        color: #fff;
    }
}

/* Reaction Tooltip */
.reaction-tooltip {
    position: absolute;
    bottom: calc(100% + 5px);
    left: 50%;
    transform: translateX(-50%);
    background: rgba(0, 0, 0, 0.9);
    color: white;
    padding: 6px 10px;
    border-radius: 6px;
    font-size: 12px;
    font-weight: 500;
    white-space: nowrap;
    z-index: 1000;
    pointer-events: none;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.3);
    max-width: 250px;
    word-wrap: break-word;
    white-space: normal;
}

.reaction-tooltip::after {
    content: '';
    position: absolute;
    top: 100%;
    left: 50%;
    transform: translateX(-50%);
    border: 5px solid transparent;
    border-top-color: rgba(0, 0, 0, 0.9);
}

/* Dark theme tooltip */
@media (prefers-color-scheme: dark) {
    .reaction-tooltip {
        background: rgba(0, 0, 0, 0.95);
    }

    .reaction-tooltip::after {
        border-top-color: rgba(0, 0, 0, 0.95);
    }
}

/* Mobile tooltip adjustments */
@media (max-width: 768px) {
    .reaction-tooltip {
        font-size: 11px;
        padding: 5px 8px;
        max-width: 200px;
    }
}