/* 
 * Post Actions - Improved Compact and Animated Design
 * Reactions, Comments, and Share functionality
 */

/* Main Post Actions Container */
.post-actions-wrapper {
    margin-top: 0.75rem;
    border-top: 1px solid #e9ecef;
    padding-top: 0.75rem;
}

/* Reaction Picker - Compact Horizontal Layout */
.reaction-picker {
    position: absolute;
    bottom: 100%;
    left: 0;
    background: white;
    border-radius: 50px;
    padding: 8px 12px;
    display: none;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.15);
    margin-bottom: 8px;
    z-index: 100;
    animation: reactionPickerSlideUp 0.3s cubic-bezier(0.68, -0.55, 0.265, 1.55);
}

.reaction-picker.show {
    display: flex;
    gap: 8px;
    align-items: center;
}

@keyframes reactionPickerSlideUp {
    from {
        opacity: 0;
        transform: translateY(10px) scale(0.8);
    }
    to {
        opacity: 1;
        transform: translateY(0) scale(1);
    }
}

.reaction-picker-item {
    cursor: pointer;
    transition: transform 0.2s ease;
    position: relative;
}

.reaction-picker-item img {
    width: 36px;
    height: 36px;
    transition: transform 0.2s ease;
}

.reaction-picker-item:hover img {
    transform: scale(1.3);
}

.reaction-picker-item:active img {
    transform: scale(1.1);
}

/* Reaction tooltip */
.reaction-picker-item::after {
    content: attr(data-reaction);
    position: absolute;
    bottom: 100%;
    left: 50%;
    transform: translateX(-50%) translateY(-8px);
    background: rgba(0, 0, 0, 0.8);
    color: white;
    padding: 4px 8px;
    border-radius: 6px;
    font-size: 11px;
    white-space: nowrap;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.2s ease, transform 0.2s ease;
}

.reaction-picker-item:hover::after {
    opacity: 1;
    transform: translateX(-50%) translateY(-4px);
}

/* Compact Action Buttons */
.post-actions-compact {
    display: flex;
    gap: 8px;
    align-items: center;
    justify-content: space-between;
    padding: 0;
}

.action-btn-compact {
    flex: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    padding: 8px 12px;
    border: none;
    background: transparent;
    color: #65676b;
    font-weight: 600;
    font-size: 14px;
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.2s ease;
    position: relative;
    white-space: nowrap;
}

.action-btn-compact i {
    font-size: 18px;
}

.action-btn-compact:hover {
    background: #f2f3f5;
}

.action-btn-compact:active {
    transform: scale(0.96);
}

.action-btn-compact.active {
    color: #1877f2;
}

.action-btn-compact.liked,
.action-btn-compact.reacted {
    color: #1877f2;
    animation: likeAnimation 0.4s ease;
    font-weight: 700;
}

.reaction-icon-btn {
    width: 20px;
    height: 20px;
    object-fit: contain;
}

@keyframes likeAnimation {
    0%, 100% { transform: scale(1); }
    25% { transform: scale(1.2); }
    50% { transform: scale(0.95); }
    75% { transform: scale(1.05); }
}

/* Reaction Summary - Compact Display */
.reactions-summary-compact {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 0.5rem 0;
    font-size: 13px;
    color: #65676b;
}

.reactions-icons-group {
    display: flex;
    align-items: center;
    margin-right: 4px;
}

.reaction-icon-small {
    width: 18px;
    height: 18px;
    margin-left: -4px;
    border: 2px solid white;
    border-radius: 50%;
    background: white;
}

.reaction-icon-small:first-child {
    margin-left: 0;
}

.reactions-count {
    font-weight: 500;
    cursor: pointer;
    transition: text-decoration 0.2s ease;
}

.reactions-count:hover {
    text-decoration: underline;
}

.comments-count {
    margin-left: auto;
    cursor: pointer;
    font-weight: 500;
    transition: text-decoration 0.2s ease;
}

.comments-count:hover {
    text-decoration: underline;
}

/* Comments Section - Improved and Compact */
.comment-section-improved {
    padding: 1rem 0 0;
    width: 100%;
    background: transparent;
    border-top: 1px solid #e9ecef;
    margin-top: 0.5rem;
    display: none;
    animation: commentSectionSlideDown 0.3s ease;
}

.comment-section-improved.show {
    display: block;
}

@keyframes commentSectionSlideDown {
    from {
        opacity: 0;
        transform: translateY(-10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Comment Input Form - Compact */
.comment-form-compact {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 0.75rem 0;
    background: transparent;
}

.comment-form-compact .user-avatar-small {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    flex-shrink: 0;
}

.comment-input-wrapper {
    flex: 1;
    position: relative;
}

.comment-input-compact {
    width: 100%;
    padding: 8px 40px 8px 12px;
    border: 1px solid #ccd0d5;
    border-radius: 20px;
    font-size: 14px;
    resize: none;
    min-height: 36px;
    max-height: 100px;
    transition: all 0.2s ease;
    background: #f0f2f5;
}

.comment-input-compact:focus {
    outline: none;
    border-color: #1877f2;
    background: white;
}

.comment-submit-btn {
    position: absolute;
    right: 8px;
    top: 50%;
    transform: translateY(-50%);
    background: transparent;
    border: none;
    color: #1877f2;
    cursor: pointer;
    padding: 4px 8px;
    border-radius: 4px;
    transition: all 0.2s ease;
    font-size: 14px;
    font-weight: 600;
    opacity: 0;
    pointer-events: none;
}

.comment-input-compact:focus ~ .comment-submit-btn,
.comment-input-compact:not(:placeholder-shown) ~ .comment-submit-btn {
    opacity: 1;
    pointer-events: all;
}

.comment-submit-btn:hover {
    background: #e7f3ff;
}

/* Comment List - Animated */
.comment-list-compact {
    margin-top: 0.5rem;
}

.single-comment-compact {
    display: flex;
    gap: 8px;
    padding: 0.5rem 0;
    animation: commentSlideIn 0.4s cubic-bezier(0.68, -0.55, 0.265, 1.55);
}

@keyframes commentSlideIn {
    from {
        opacity: 0;
        transform: translateX(-20px) scale(0.95);
    }
    to {
        opacity: 1;
        transform: translateX(0) scale(1);
    }
}

.comment-avatar {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    flex-shrink: 0;
}

.comment-content-wrapper {
    flex: 1;
    min-width: 0;
}

.comment-bubble {
    background: #f0f2f5;
    border-radius: 18px;
    padding: 8px 12px;
    display: inline-block;
    max-width: 100%;
    word-wrap: break-word;
}

.comment-author {
    font-weight: 600;
    font-size: 13px;
    color: #050505;
    margin-bottom: 2px;
}

.comment-text {
    font-size: 14px;
    color: #050505;
    line-height: 1.4;
    margin: 0;
}

.comment-actions {
    display: flex;
    gap: 12px;
    padding: 4px 12px;
    font-size: 12px;
    color: #65676b;
}

.comment-action-btn {
    background: none;
    border: none;
    padding: 0;
    cursor: pointer;
    font-weight: 600;
    transition: color 0.2s ease;
}

.comment-action-btn:hover {
    color: #050505;
    text-decoration: underline;
}

.comment-time {
    color: #65676b;
}

/* Share Modal - Native Mobile Support */
.share-modal-compact {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    background: white;
    border-radius: 20px 20px 0 0;
    box-shadow: 0 -2px 20px rgba(0, 0, 0, 0.15);
    padding: 1.5rem;
    z-index: 1000;
    transform: translateY(100%);
    transition: transform 0.3s cubic-bezier(0.68, -0.55, 0.265, 1.55);
}

.share-modal-compact.show {
    transform: translateY(0);
}

.share-modal-header {
    text-align: center;
    padding-bottom: 1rem;
    border-bottom: 1px solid #e9ecef;
    margin-bottom: 1rem;
}

.share-modal-title {
    font-weight: 700;
    font-size: 18px;
    color: #050505;
    margin: 0;
}

.share-options-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 1rem;
    margin-bottom: 1rem;
}

.share-option-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 8px;
    cursor: pointer;
    padding: 12px;
    border-radius: 12px;
    transition: background 0.2s ease;
}

.share-option-item:hover {
    background: #f2f3f5;
}

.share-option-icon {
    width: 56px;
    height: 56px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 28px;
    color: white;
}

.share-option-icon.facebook { background: #1877f2; }
.share-option-icon.whatsapp { background: #25d366; }
.share-option-icon.twitter { background: #1da1f2; }
.share-option-icon.telegram { background: #0088cc; }
.share-option-icon.instagram { background: linear-gradient(45deg, #f09433 0%, #e6683c 25%, #dc2743 50%, #cc2366 75%, #bc1888 100%); }
.share-option-icon.messenger { background: #0084ff; }
.share-option-icon.copy { background: #65676b; }
.share-option-icon.more { background: #65676b; }

.share-option-label {
    font-size: 12px;
    color: #050505;
    font-weight: 500;
    text-align: center;
}

.share-cancel-btn {
    width: 100%;
    padding: 12px;
    background: #f2f3f5;
    border: none;
    border-radius: 12px;
    font-weight: 600;
    font-size: 16px;
    color: #050505;
    cursor: pointer;
    transition: background 0.2s ease;
}

.share-cancel-btn:hover {
    background: #e4e6e9;
}

/* Modal Overlay */
.modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.5);
    z-index: 999;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.3s ease;
}

.modal-overlay.show {
    opacity: 1;
    pointer-events: all;
}

/* Responsive Adjustments */
@media (max-width: 768px) {
    .action-btn-compact span {
        display: none;
    }
    
    .action-btn-compact {
        padding: 8px;
    }
    
    .share-options-grid {
        grid-template-columns: repeat(4, 1fr);
        gap: 0.75rem;
    }
    
    .share-option-icon {
        width: 48px;
        height: 48px;
        font-size: 24px;
    }
}

@media (min-width: 769px) {
    .share-modal-compact {
        position: fixed;
        bottom: auto;
        top: 50%;
        left: 50%;
        right: auto;
        transform: translate(-50%, -50%) scale(0.8);
        opacity: 0;
        max-width: 500px;
        width: 90%;
        border-radius: 20px;
    }
    
    .share-modal-compact.show {
        transform: translate(-50%, -50%) scale(1);
        opacity: 1;
    }
}

/* Loading States */
.action-btn-compact.loading {
    pointer-events: none;
    opacity: 0.6;
}

.action-btn-compact.loading::after {
    content: '';
    position: absolute;
    width: 16px;
    height: 16px;
    border: 2px solid currentColor;
    border-top-color: transparent;
    border-radius: 50%;
    animation: spin 0.6s linear infinite;
}

@keyframes spin {
    to { transform: rotate(360deg); }
}

/* Accessibility */
.action-btn-compact:focus,
.comment-submit-btn:focus,
.share-option-item:focus,
.share-cancel-btn:focus {
    outline: 2px solid #1877f2;
    outline-offset: 2px;
}

/* Success Animation */
@keyframes successPulse {
    0%, 100% { transform: scale(1); }
    50% { transform: scale(1.1); }
}

.action-btn-compact.success {
    animation: successPulse 0.5s ease;
}

/* Copy to Clipboard Notification */
.copy-notification {
    position: fixed;
    bottom: 20px;
    left: 50%;
    transform: translateX(-50%) translateY(100px);
    background: #050505;
    color: white;
    padding: 12px 24px;
    border-radius: 8px;
    font-size: 14px;
    font-weight: 500;
    z-index: 10000;
    opacity: 0;
    transition: all 0.3s ease;
}

.copy-notification.show {
    transform: translateX(-50%) translateY(0);
    opacity: 1;
}
