/* =========================
   Reactions Component Styles
   ========================= */

/* Container */
.reactions-container {
    display: flex;
    gap: 2rem;
    margin: 2rem 0;
    align-items: center;
    padding: 1.5rem 0;
    border-top: 1px solid rgba(255, 255, 255, 0.1);
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

/* Right Corner Buttons */
.right-corner-buttons {
    display: flex;
    gap: 1.5rem;
    justify-content: flex-end;
    align-items: center;
    margin: 1.5rem 0;
    flex-wrap: wrap;
}

/* =========================
   Reaction Buttons
   ========================= */
.reaction-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.75rem;
    padding: 0.5rem 1.5rem;
    border: none;
    border-radius: 8px;
    background-color: rgba(255, 255, 255, 0.05);
    color: rgba(255, 255, 255, 0.7);
    font-weight: 500;
    font-size: 0.95rem;
    cursor: pointer;
    transition: background-color 0.3s ease, color 0.3s ease;
    outline: none;
}

/* Focus for accessibility */
.reaction-btn:focus-visible {
    outline: 2px solid #3b82f6;
    outline-offset: 2px;
}

/* Hover State */
.reaction-btn:hover:not(:disabled):not(.active) {
    background-color: rgba(255, 255, 255, 0.1);
    color: rgba(255, 255, 255, 0.9);
}

/* Like Button */
.reaction-btn.like {
    color: rgba(34, 211, 238, 0.7);
}

.reaction-btn.like:hover:not(:disabled):not(.active) {
    color: #22d3ee;
}

/* Dislike Button */
.reaction-btn.dislike {
    color: rgba(217, 70, 239, 0.7);
}

.reaction-btn.dislike:hover:not(:disabled):not(.active) {
    color: #d946ef;
}

/* Active State */
.reaction-btn.active {
}

/* Like Active */
.reaction-btn.like.active {
    background-color: rgba(34, 211, 238, 0.15);
    color: #22d3ee;
}

/* Dislike Active */
.reaction-btn.dislike.active {
    background-color: rgba(217, 70, 239, 0.15);
    color: #d946ef;
}

/* Disabled State */
.reaction-btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

/* =========================
   Loading Animation
   ========================= */
.reaction-btn.loading {
    position: relative;
    pointer-events: none;
}

.reaction-btn.loading::after {
    content: '';
    position: absolute;
    width: 1rem;
    height: 1rem;
    border: 2px solid rgba(100,116,139,0.2);
    border-top-color: #64748b;
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
    left: 50%;
    top: 50%;
    transform: translate(-50%, -50%);
}

/* =========================
   Reaction Count
   ========================= */
.reaction-count {
    font-size: 0.85rem;
    font-weight: 600;
    min-width: 1.25rem;
    text-align: center;
    display: inline-block;
}

/* =========================
   Error Message
   ========================= */
.reaction-error {
    position: absolute;
    bottom: -1.6rem;
    left: 0;
    right: 0;
    text-align: center;
    font-size: 0.8rem;
    color: #ef4444;
    opacity: 1;
    transition: opacity 0.3s ease;
}

/* =========================
   Success Message
   ========================= */
.reaction-success {
    text-align: center;
    font-weight: 500;
    opacity: 1;
}

/* =========================
   Responsive Design
   ========================= */
@media (max-width: 640px) {
    .reactions-container {
        gap: 1rem;
        justify-content: flex-start;
    }
    .reaction-btn {
        padding: 0.4rem 1rem;
        font-size: 0.9rem;
    }
    .reaction-count {
        font-size: 0.8rem;
    }
}

/* =========================
   Animations
   ========================= */
@keyframes spin {
    to { transform: rotate(360deg); }
}

@keyframes fadeInOut {
    0% {
        opacity: 0;
        transform: translateY(-5px);
    }
    20% {
        opacity: 1;
        transform: translateY(0);
    }
    80% {
        opacity: 1;
        transform: translateY(0);
    }
    100% {
        opacity: 0;
        transform: translateY(-5px);
    }
}

/* =========================
   Icon Styling
   ========================= */
.reaction-icon {
    font-size: 1.15rem;
    display: inline-block;
    line-height: 1;
}

/* =========================
   Light Mode Support
   ========================= */
@media (prefers-color-scheme: light) {
    .reactions-container {
        border-top: 1px solid rgba(0, 0, 0, 0.1);
        border-bottom: 1px solid rgba(0, 0, 0, 0.1);
    }

    .reaction-btn {
        background-color: rgba(0, 0, 0, 0.05);
        color: rgba(0, 0, 0, 0.6);
    }

    .reaction-btn:hover:not(:disabled):not(.active) {
        background-color: rgba(0, 0, 0, 0.08);
        color: rgba(0, 0, 0, 0.8);
    }

    .reaction-btn.like {
        color: rgba(34, 211, 238, 0.8);
    }

    .reaction-btn.like:hover:not(:disabled):not(.active) {
        color: #06b6d4;
    }

    .reaction-btn.like.active {
        background-color: rgba(34, 211, 238, 0.15);
        color: #06b6d4;
    }

    .reaction-btn.dislike {
        color: rgba(217, 70, 239, 0.8);
    }

    .reaction-btn.dislike:hover:not(:disabled):not(.active) {
        color: #c026d3;
    }

    .reaction-btn.dislike.active {
        background-color: rgba(217, 70, 239, 0.15);
        color: #c026d3;
    }
}
