/* Reactions Modal Styles */
.reactions-modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.8);
    z-index: 10001;
    display: flex;
    justify-content: center;
    align-items: center;
    /* No animation - instant open */
}

.reactions-modal {
    background: #1a1a1a;
    border: 1px solid #333;
    border-radius: 12px;
    width: 90%;
    max-width: 600px;
    height: 80vh;
    max-height: 700px;
    display: flex;
    flex-direction: column;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.5);
}

/* Modal Header */
.reactions-modal-header {
    padding: 16px 20px;
    border-bottom: 1px solid #333;
    display: flex;
    justify-content: space-between;
    align-items: center;
    background: #242424;
    border-radius: 12px 12px 0 0;
}

.reactions-modal-title {
    font-size: 18px;
    font-weight: 600;
    color: #fff;
}

.reactions-modal-close {
    background: none;
    border: none;
    color: #999;
    font-size: 24px;
    cursor: pointer;
    padding: 0;
    width: 32px;
    height: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 6px;
    transition: background 0.2s;
}

.reactions-modal-close:hover {
    background: #333;
    color: #fff;
}

/* Search Section */
.reactions-search-container {
    padding: 12px 20px;
    border-bottom: 1px solid #333;
    background: #1a1a1a;
}

.reactions-search-input {
    width: 100%;
    padding: 10px 16px;
    background: #242424;
    border: 1px solid #333;
    border-radius: 8px;
    color: #fff;
    font-size: 14px;
}

.reactions-search-input::placeholder {
    color: #666;
}

.reactions-search-input:focus {
    outline: none;
    border-color: #4a9eff;
}

/* Category Tabs */
.reactions-tabs {
    display: flex;
    gap: 8px;
    padding: 12px 20px;
    background: #1a1a1a;
    border-bottom: 1px solid #333;
    overflow-x: auto;
    scrollbar-width: thin;
    scrollbar-color: #333 #1a1a1a;
}

.reactions-tabs::-webkit-scrollbar {
    height: 6px;
}

.reactions-tabs::-webkit-scrollbar-track {
    background: #1a1a1a;
}

.reactions-tabs::-webkit-scrollbar-thumb {
    background: #333;
    border-radius: 3px;
}

.reactions-tab {
    padding: 8px 16px;
    background: #242424;
    border: 1px solid #333;
    border-radius: 20px;
    color: #999;
    cursor: pointer;
    font-size: 14px;
    white-space: nowrap;
    transition: all 0.2s;
    display: flex;
    align-items: center;
    gap: 6px;
}

.reactions-tab:hover {
    background: #2a2a2a;
    color: #fff;
}

.reactions-tab.active {
    background: #4a9eff;
    color: #fff;
    border-color: #4a9eff;
}

.reactions-tab-icon {
    font-size: 16px;
}

/* Current Reactions Section */
.reactions-current {
    padding: 16px 20px;
    background: #242424;
    border-bottom: 1px solid #333;
    max-height: 120px;
    overflow-y: auto;
}

.reactions-current-title {
    font-size: 14px;
    color: #999;
    margin-bottom: 12px;
    font-weight: 500;
}

.reactions-current-list {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

.reaction-item {
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 6px 12px;
    background: #1a1a1a;
    border: 1px solid #333;
    border-radius: 16px;
    font-size: 14px;
    position: relative;
}

.reaction-item.user-reacted {
    background: rgba(74, 158, 255, 0.15);
    border-color: #4a9eff;
    cursor: pointer;
}

.reaction-item.user-reacted:hover {
    background: rgba(74, 158, 255, 0.25);
}

.reaction-item.pending-remove {
    background: rgba(255, 74, 74, 0.15);
    border-color: #ff4a4a;
    opacity: 0.7;
}

.reaction-emoji {
    font-size: 18px;
    font-family: 'Noto Color Emoji', 'Apple Color Emoji', 'Segoe UI Emoji', sans-serif;
}

.reaction-count {
    color: #fff;
    font-weight: 500;
}

.reaction-users {
    color: #666;
    font-size: 12px;
    max-width: 150px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.reaction-users .you-label {
    color: #4a9eff;
    font-weight: 500;
}

.reaction-item .remove-hint {
    margin-left: 4px;
    color: #666;
    font-size: 16px;
    font-weight: bold;
}

.reaction-item.user-reacted:hover .remove-hint {
    color: #ff4a4a;
}

/* Emoji Grid Container */
.reactions-content {
    flex: 1;
    overflow-y: auto;
    padding: 20px;
    background: #1a1a1a;
    scrollbar-width: thin;
    scrollbar-color: #333 #1a1a1a;
}

.reactions-content::-webkit-scrollbar {
    width: 8px;
}

.reactions-content::-webkit-scrollbar-track {
    background: #1a1a1a;
}

.reactions-content::-webkit-scrollbar-thumb {
    background: #333;
    border-radius: 4px;
}

/* Category Sections */
.emoji-category {
    margin-bottom: 32px;
}

.emoji-category-title {
    font-size: 16px;
    font-weight: 600;
    color: #fff;
    margin-bottom: 12px;
    padding-bottom: 8px;
    border-bottom: 1px solid #333;
}

.emoji-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(44px, 1fr));
    gap: 8px;
}

.emoji-item {
    width: 44px;
    height: 44px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: #242424;
    border: 2px solid transparent;
    border-radius: 8px;
    cursor: pointer;
    font-size: 24px;
    transition: all 0.2s;
    position: relative;
    font-family: 'Noto Color Emoji', 'Apple Color Emoji', 'Segoe UI Emoji', sans-serif;
}

.emoji-item:hover {
    background: #2a2a2a;
    transform: scale(1.1);
}

.emoji-item.selected {
    background: #4a9eff;
    border-color: #4a9eff;
}

.emoji-item.user-reacted {
    background: #2a4a2a;
    border-color: #4a9a4a;
}

.emoji-item.pending-add {
    border-color: #4a9eff;
    background: rgba(74, 158, 255, 0.1);
}

.emoji-item.pending-remove {
    border-color: #ff4a4a;
    background: rgba(255, 74, 74, 0.1);
    opacity: 0.6;
}

/* Emoji Tooltip */
.emoji-tooltip {
    position: absolute;
    bottom: 100%;
    left: 50%;
    transform: translateX(-50%);
    background: #333;
    color: #fff;
    padding: 6px 10px;
    border-radius: 6px;
    font-size: 12px;
    white-space: nowrap;
    pointer-events: none;
    opacity: 0;
    transition: opacity 0.2s;
    z-index: 10001;
    margin-bottom: 8px;
}

.emoji-item:hover .emoji-tooltip {
    opacity: 1;
}

/* Modal Footer */
.reactions-modal-footer {
    padding: 16px 20px;
    border-top: 1px solid #333;
    display: flex;
    justify-content: space-between;
    align-items: center;
    background: #242424;
    border-radius: 0 0 12px 12px;
}

.reactions-pending-info {
    display: flex;
    align-items: center;
    gap: 12px;
    color: #999;
    font-size: 14px;
}

.pending-count {
    color: #4a9eff;
    font-weight: 500;
}

.reactions-modal-actions {
    display: flex;
    gap: 12px;
}

.reactions-btn {
    padding: 10px 20px;
    border-radius: 8px;
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
    transition: background 0.2s;
    border: none;
}

.reactions-btn-cancel {
    background: #333;
    color: #fff;
}

.reactions-btn-cancel:hover {
    background: #444;
}

.reactions-btn-apply {
    background: #4a9eff;
    color: #fff;
}

.reactions-btn-apply:hover {
    background: #3a8eef;
}

.reactions-btn-apply:disabled {
    background: #333;
    color: #666;
    cursor: not-allowed;
}

/* Loading State */
.reactions-loading {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    height: 200px;
    color: #666;
}

.reactions-loading-spinner {
    width: 40px;
    height: 40px;
    border: 3px solid #333;
    border-top-color: #4a9eff;
    border-radius: 50%;
    animation: spin 1s linear infinite;
    margin-bottom: 16px;
}

@keyframes spin {
    to { transform: rotate(360deg); }
}

/* Empty State */
.reactions-empty {
    text-align: center;
    padding: 40px;
    color: #666;
}

.reactions-empty-icon {
    font-size: 48px;
    margin-bottom: 16px;
    opacity: 0.5;
}

.reactions-empty-text {
    font-size: 14px;
}

/* Error State */
.reactions-error {
    padding: 20px;
    background: rgba(255, 74, 74, 0.1);
    border: 1px solid #ff4a4a;
    border-radius: 8px;
    color: #ff6666;
    text-align: center;
    margin: 20px;
}

/* Mobile Responsive */
@media (max-width: 640px) {
    .reactions-modal {
        width: 95%;
        height: 90vh;
        max-height: none;
        border-radius: 16px 16px 0 0;
    }
    
    .emoji-grid {
        grid-template-columns: repeat(auto-fill, minmax(40px, 1fr));
        gap: 6px;
    }
    
    .emoji-item {
        width: 40px;
        height: 40px;
        font-size: 20px;
    }
    
    .reactions-tabs {
        padding: 8px 16px;
    }
    
    .reactions-tab {
        padding: 6px 12px;
        font-size: 13px;
    }
}

/* Dark Theme Overrides */
@media (prefers-color-scheme: light) {
    .reactions-modal {
        background: #fff;
        border-color: #e0e0e0;
    }
    
    .reactions-modal-header {
        background: #f5f5f5;
    }
    
    .reactions-modal-title {
        color: #333;
    }
    
    .reactions-search-input {
        background: #fff;
        border-color: #e0e0e0;
        color: #333;
    }
    
    .reactions-tab {
        background: #fff;
        border-color: #e0e0e0;
        color: #666;
    }
    
    .emoji-item {
        background: #f5f5f5;
    }
    
    .emoji-item:hover {
        background: #e0e0e0;
    }
}