/* =============================================
   REACTION BUTTONS (smaller)
   ============================================= */

.lesson-reactions {
    margin: 0.5rem 0 1rem 0;
}

.reaction-buttons {
    display: flex;
    flex-wrap: wrap;
    gap: 0.4rem;
    align-items: center;
}

.reaction-btn {
    display: inline-flex;
    align-items: center;
    gap: 0.25rem;
    padding: 0.25rem 0.5rem;
    border: 1px solid #e0e0e0;
    border-radius: 999px;
    background: #f8f9fa;
    cursor: pointer;
    font-size: 0.9rem;
    line-height: 1;
    transition: all 0.15s ease;
    font-family: inherit;
}

.reaction-btn:hover {
    background: #e9ecef;
    border-color: #ced4da;
    transform: scale(1.05);
}

.reaction-btn.has-reactions {
    background: #e7f3ff;
    border-color: #91c9ff;
}

.reaction-btn.has-reactions:hover {
    background: #d0e8ff;
}

.reaction-btn.user-reacted {
    background: #cce5ff;
    border-color: #66b3ff;
    box-shadow: 0 0 0 1px #66b3ff;
}

.reaction-btn .emoji {
    font-size: 0.95rem;
    line-height: 1;
}

.reaction-btn .count {
    font-size: 0.7rem;
    font-weight: 600;
    color: #495057;
    min-width: 0.6rem;
    text-align: center;
}

.reaction-btn.user-reacted .count {
    color: #0066cc;
}

.reaction-btn.loading {
    opacity: 0.6;
    pointer-events: none;
}

@keyframes pop {
    0% { transform: scale(1); }
    50% { transform: scale(1.2); }
    100% { transform: scale(1); }
}

.reaction-btn.just-changed .count {
    animation: pop 0.2s ease;
}

/* Add button */
.reaction-btn.add-reaction-btn {
    background: transparent;
    border: 1px dashed #ccc;
    color: #999;
    padding: 0.25rem 0.45rem;
}

.reaction-btn.add-reaction-btn:hover {
    background: #f0f0f0;
    border-color: #999;
    color: #666;
}

.reaction-btn.add-reaction-btn .plus-icon {
    font-size: 0.85rem;
    font-weight: 400;
}

/* =============================================
   EMOJI PICKER
   ============================================= */

.emoji-picker-backdrop {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.25);
    z-index: 99998;
}

.emoji-picker {
    position: fixed;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    background: #fff;
    border-radius: 12px;
    box-shadow: 0 8px 30px rgba(0, 0, 0, 0.18);
    z-index: 99999;
    width: 300px;
    max-width: 90vw;
    max-height: 75vh;
    display: flex;
    flex-direction: column;
    overflow: hidden;
}

.emoji-picker-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0.6rem 0.9rem;
    border-bottom: 1px solid #eee;
    font-weight: 600;
    font-size: 0.85rem;
    color: #333;
}

.emoji-picker-close {
    background: none;
    border: none;
    font-size: 1.3rem;
    cursor: pointer;
    color: #999;
    line-height: 1;
    padding: 0;
    width: 24px;
    height: 24px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 4px;
}

.emoji-picker-close:hover {
    background: #f0f0f0;
    color: #333;
}

.emoji-picker-tabs {
    display: flex;
    gap: 0.2rem;
    padding: 0.4rem;
    border-bottom: 1px solid #eee;
    background: #fafafa;
}

.emoji-tab {
    flex: 1;
    background: none;
    border: none;
    padding: 0.4rem;
    font-size: 1rem;
    cursor: pointer;
    border-radius: 6px;
    transition: background 0.15s;
}

.emoji-tab:hover {
    background: #e9ecef;
}

.emoji-tab.active {
    background: #e7f3ff;
}

.emoji-picker-grid {
    padding: 0.6rem;
    overflow-y: auto;
    flex: 1;
}

.emoji-category {
    display: none;
    flex-wrap: wrap;
    gap: 0.15rem;
}

.emoji-category.active {
    display: flex;
}

.emoji-option {
    background: none;
    border: none;
    font-size: 1.35rem;
    padding: 0.3rem;
    cursor: pointer;
    border-radius: 6px;
    transition: background 0.1s, transform 0.1s;
    line-height: 1;
}

.emoji-option:hover {
    background: #e9ecef;
    transform: scale(1.15);
}

/* =============================================
   MOBILE
   ============================================= */

@media (max-width: 480px) {
    .reaction-btn {
        padding: 0.2rem 0.4rem;
    }
    
    .reaction-btn .emoji {
        font-size: 0.85rem;
    }
    
    .emoji-picker {
        width: 95vw;
    }
    
    .emoji-option {
        font-size: 1.2rem;
        padding: 0.25rem;
    }
}
