/**
 * Post Actions Component - Global Styles
 * Modern design with optimistic UI updates
 * @version 1.0.0
 * @updated 2026-02-12
 */

/* ================================================
   POST ACTIONS BAR
   ================================================ */

.post-actions {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0.75rem 1rem;
    border-top: 1px solid var(--border-light, #e5e7eb);
    gap: 0.5rem;
}

.post-actions-left {
    display: flex;
    align-items: center;
    gap: 1rem;
    flex: 1;
}

.post-actions-right {
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

/* ================================================
   ACTION BUTTONS
   ================================================ */

.action-btn {
    display: flex;
    align-items: center;
    gap: 0.375rem;
    padding: 0.5rem 0.75rem;
    background: transparent;
    border: none;
    border-radius: 8px;
    color: var(--text-secondary, #6b7280);
    font-size: 0.875rem;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
    position: relative;
    user-select: none;
    -webkit-tap-highlight-color: transparent;
}

.action-btn:hover {
    background: var(--bg-hover, rgba(0, 0, 0, 0.04));
    transform: translateY(-1px);
}

.action-btn:active {
    transform: scale(0.95);
}

.action-btn i {
    font-size: 1.25rem;
    transition: all 0.2s ease;
}

.action-btn span {
    font-size: 0.875rem;
    font-weight: 600;
}

/* ================================================
   LIKE BUTTON - Optimistic Animation
   ================================================ */

.action-btn.like-btn.active {
    color: var(--like-color);
    animation: likeHeartBeat 0.5s cubic-bezier(0.36, 0.07, 0.19, 0.97);
}

.action-btn.like-btn.active i {
    color: var(--like-color);
    font-weight: 900;
}

@keyframes likeHeartBeat {
    0%, 100% {
        transform: scale(1);
    }
    25% {
        transform: scale(1.3);
    }
    50% {
        transform: scale(0.9);
    }
    75% {
        transform: scale(1.1);
    }
}

/* Ripple effect on click */
.action-btn::after {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 0;
    height: 0;
    border-radius: 50%;
    background: var(--like-color-bg);
    transform: translate(-50%, -50%);
    opacity: 0;
}

.action-btn.like-btn.active::after {
    animation: ripple 0.6s ease-out;
}

@keyframes ripple {
    to {
        width: 60px;
        height: 60px;
        opacity: 0;
    }
}

/* ================================================
   COMMENT BUTTON
   ================================================ */

.action-btn.comment-btn:hover {
    color: var(--primary);
}

.action-btn.comment-btn:hover i {
    transform: rotate(-15deg) scale(1.1);
}

/* ================================================
   SAVE BUTTON - Optimistic Bookmark
   ================================================ */

.action-btn.save-btn.active {
    color: var(--save-color);
}

.action-btn.save-btn.active i {
    color: var(--save-color);
    font-weight: 900;
    animation: bookmarkDrop 0.4s cubic-bezier(0.68, -0.55, 0.265, 1.55);
}

@keyframes bookmarkDrop {
    0% {
        transform: translateY(-10px);
        opacity: 0;
    }
    50% {
        transform: translateY(3px);
    }
    100% {
        transform: translateY(0);
        opacity: 1;
    }
}

/* ================================================
   SHARE BUTTON
   ================================================ */

.action-btn.share-btn:hover {
    color: var(--primary);
}

.action-btn.share-btn:hover i {
    transform: rotate(15deg) scale(1.1);
}

/* ================================================
   LOADING STATE
   ================================================ */

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

.action-btn.loading i {
    animation: spin 1s linear infinite;
}

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

/* ================================================
   COUNT BADGE
   ================================================ */

.action-count {
    font-size: 0.875rem;
    font-weight: 600;
    color: var(--text-secondary, #6b7280);
    min-width: 20px;
    text-align: left;
}

.action-btn.active .action-count {
    color: inherit;
}

/* Increment animation */
.action-count.increment {
    animation: countUp 0.3s ease-out;
}

@keyframes countUp {
    0% {
        transform: translateY(10px);
        opacity: 0;
    }
    100% {
        transform: translateY(0);
        opacity: 1;
    }
}

/* ================================================
   RESPONSIVE DESIGN
   ================================================ */

@media (max-width: 640px) {
    .post-actions {
        padding: 0.625rem 0.75rem;
    }
    
    .post-actions-left {
        gap: 0.5rem;
    }
    
    .action-btn {
        padding: 0.5rem;
        gap: 0.25rem;
    }
    
    .action-btn span {
        display: none; /* Hide text on mobile, show only icons */
    }
    
    .action-count {
        font-size: 0.8125rem;
    }
}

@media (min-width: 768px) {
    .action-btn span {
        display: inline; /* Show text on tablet+ */
    }
}

/* ================================================
   DARK MODE SUPPORT
   ================================================ */

[data-theme="dark"] .post-actions {
    border-top-color: rgba(255, 255, 255, 0.1);
}

[data-theme="dark"] .action-btn {
    color: rgba(255, 255, 255, 0.7);
}

[data-theme="dark"] .action-btn:hover {
    background: rgba(255, 255, 255, 0.1);
    color: rgba(255, 255, 255, 0.9);
}

[data-theme="dark"] .action-count {
    color: rgba(255, 255, 255, 0.6);
}
