/* =====================================================
   СТИЛИ ВИДЖЕТА РЕАКЦИЙ ЭМОДЗИ
   ===================================================== */

/* Основной контейнер виджета */
#emoji-reactions-widget {
    max-width: 700px;
    margin: 20px auto;
    padding: 20px;
    background: white;
    border-radius: 12px;
    box-shadow: 0 2px 10px rgba(0,0,0,0.1);
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    border: 1px solid #e0e0e0;
}

/* Заголовок */
.reactions-header {
    text-align: center;
    margin-bottom: 20px;
}

.reactions-header h3 {
    margin: 0 0 5px 0;
    color: #333;
    font-size: 18px;
    font-weight: 600;
}

.total-responses {
    color: #666;
    font-size: 14px;
    font-weight: 500;
}

/* Контейнер реакций */
.reactions-container {
    display: flex;
    justify-content: space-between;
    flex-wrap: nowrap;
    gap: 8px;
    align-items: center;
}

/* Элемент реакции */
.reaction-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    cursor: pointer;
    padding: 12px 6px;
    border-radius: 8px;
    transition: all 0.2s ease;
    flex: 1;
    position: relative;
    user-select: none;
    min-width: 0;
    box-sizing: border-box;
    border: 2px solid transparent;
}

/* Счетчик реакции */
.reaction-count {
    background: #2196F3;
    color: white;
    border-radius: 50%;
    width: 28px;
    height: 28px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 12px;
    font-weight: bold;
    margin-bottom: 8px;
    transition: all 0.2s ease;
}

/* Эмодзи */
.reaction-emoji {
    font-size: 28px;
    margin-bottom: 6px;
    transition: all 0.2s ease;
    line-height: 1;
    font-family: "Segoe UI Emoji", "Apple Color Emoji", "Noto Color Emoji", "Android Emoji", "EmojiSymbols", "Segoe UI Symbol", "Arial Unicode MS", sans-serif;
    font-variant-emoji: emoji;
    text-rendering: optimizeLegibility;
    -webkit-font-feature-settings: "liga";
    font-feature-settings: "liga";
    display: inline-block;
}

/* Подпись реакции */
.reaction-label {
    font-size: 12px;
    color: #666;
    text-align: center;
    font-weight: 500;
}

/* Сообщения */
#success-message, #error-message, #duplicate-message, #cancel-success-message {
    text-align: center;
    font-size: 14px;
    padding: 12px;
    border-radius: 8px;
    margin: 15px 0;
    display: none;
}

#success-message {
    color: #4caf50;
    background: #e8f5e8;
    border-left: 4px solid #4caf50;
}

#error-message {
    color: #f44336;
    background: #ffebee;
    border-left: 4px solid #f44336;
}

#duplicate-message {
    color: #ff9800;
    background: #fff3e0;
    border-left: 4px solid #ff9800;
}

#cancel-success-message {
    color: #2196F3;
    background: #e3f2fd;
    border-left: 4px solid #2196F3;
}

/* Эмодзи в сообщениях */
#success-message span, #error-message span, #duplicate-message span, #cancel-success-message span {
    font-size: 16px;
    margin-right: 8px;
    font-family: "Segoe UI Emoji", "Apple Color Emoji", "Noto Color Emoji", "Android Emoji", "EmojiSymbols", "Segoe UI Symbol", "Arial Unicode MS", sans-serif;
    font-variant-emoji: emoji;
    text-rendering: optimizeLegibility;
    -webkit-font-feature-settings: "liga";
    font-feature-settings: "liga";
    display: inline-block;
}

/* Интерактивные состояния */
.reaction-item:hover {
    background: #f5f5f5 !important;
    transform: translateY(-2px) !important;
}

.reaction-item:active {
    transform: translateY(0) !important;
}

.reaction-item:hover .reaction-emoji {
    transform: scale(1.1) !important;
}

/* Стили для активной реакции */
.reaction-item.active {
    background: #e3f2fd !important;
    border-color: #2196F3 !important;
    transform: translateY(-2px) !important;
}

.reaction-item.active .reaction-count {
    background: #1976D2 !important;
    transform: scale(1.1) !important;
}

.reaction-item.active .reaction-emoji {
    transform: scale(1.15) !important;
}

.reaction-item.active .reaction-label {
    color: #1976D2 !important;
    font-weight: 600 !important;
}

/* Анимации */
@keyframes countUp {
    from { transform: scale(1.2); }
    to { transform: scale(1); }
}

.reaction-count.updated {
    animation: countUp 0.3s ease;
}

@media (max-width: 768px) {
    .reactions-container {
        display: grid !important;
        grid-template-columns: repeat(3, 1fr) !important;
        gap: 8px !important;
        justify-items: center !important;
    }
    
    .reaction-item {
        padding: 8px 4px !important;
        width: 100% !important;
        max-width: 80px !important;
    }
    
    .reaction-emoji {
        font-size: 24px !important;
    }
    
    .reaction-label {
        font-size: 10px !important;
    }
    
    .reaction-count {
        width: 24px !important;
        height: 24px !important;
        font-size: 10px !important;
    }
}

@media (max-width: 480px) {
    .reactions-container {
        grid-template-columns: repeat(2, 1fr) !important;
        gap: 6px !important;
    }
    
    .reaction-item {
        max-width: 70px !important;
    }
    
    .reaction-emoji {
        font-size: 20px !important;
    }
    
    .reaction-label {
        font-size: 9px !important;
    }
    
    .reaction-count {
        width: 20px !important;
        height: 20px !important;
        font-size: 9px !important;
    }
}
