/* div#global-error-container {
    position: fixed;
    top: 20px;
    left: 50%;
    transform: translateX(-50%);
    z-index: 10000;
} */
.post-reactions-container {
    display: flex;
    gap: 20px;
    margin: 20px 0;
    padding: 15px;
    background: #f9f9f9;
    border-radius: 10px;
    justify-content: flex-start;
    align-items: center;
    max-width: 400px;
}

.reaction-button {
    display: flex;
    flex-direction: column;
    align-items: center;
    cursor: pointer;
    transition: transform 0.2s;
    padding: 10px;
    border-radius: 5px;
    min-width: 80px;
}

.reaction-button:hover {
    background-color: #f0f0f0;
    transform: translateY(-2px);
}

.reaction-button.active {
    background-color: #e6f3ff;
}

.reaction-emoji {
    font-size: 24px;
    margin-bottom: 5px;
}

.reaction-text {
    font-size: 14px;
    font-weight: 500;
    color: #333;
}

.reaction-count {
    font-size: 14px;
    color: #666;
    margin-top: 2px;
}

/* Animation for reaction */
@keyframes pulse {
    0% { transform: scale(1); }
    50% { transform: scale(1.2); }
    100% { transform: scale(1); }
}

.reaction-button.animating .reaction-emoji {
    animation: pulse 0.5s ease;
}
/* Popup Reaction Styles */
.reaction-popup-container {
    position: relative;
    display: inline-block;
}

.reaction-popup-trigger {
    background: #f0f0f0;
    border: none;
    border-radius: 20px;
    padding: 8px 15px;
    font-size: 14px;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 5px;
    transition: background-color 0.2s;
}

.reaction-popup-trigger:hover {
    background: #e0e0e0;
}

.button-icon {
    font-size: 16px;
}

.reaction-total-count {
    background: #e1e1e1;
    border-radius: 10px;
    padding: 2px 8px;
    font-weight: bold;
}

.reaction-popup {
    position: absolute;
    bottom: 100%;
    left: -120%;
    /* transform: translateX(-50%) translateY(10px); */
    display: none;
    background: white;
    padding: 10px;
    border-radius: 10px;
    box-shadow: 0 5px 20px rgba(0, 0, 0, 0.15);
    z-index: 1000;
    margin-bottom: 10px;
    white-space: nowrap;
    flex-direction: row;
}


@media (max-width:768px){
    .reaction-popup {
        left:0% !important;
    }
}

.reaction-popup::after {
    content: '';
    position: absolute;
    top: 100%;
    left: 50%;
    transform: translateX(-50%);
    border-width: 8px;
    border-style: solid;
    border-color: white transparent transparent transparent;
}

.reaction-popup.show {
    display: flex;
    animation: fadeIn 0.3s;
}

.popup-reaction-button {
    display: flex;
    flex-direction: column;
    align-items: center;
    padding: 8px 12px;
    cursor: pointer;
    border-radius: 8px;
    transition: transform 0.2s, background-color 0.2s;
}

.popup-reaction-button:hover {
    background: #f0f0f0;
    transform: translateY(-3px);
}

.popup-reaction-button.active {
    background: #e6f3ff;
}

@keyframes fadeIn {
    from { opacity: 0; transform: translateX(-50%) translateY(20px); }
    to { opacity: 1; transform: translateX(-50%) translateY(10px); }
}
/* Additional CSS for counts in popup reactions */
.popup-reaction-button .reaction-count {
    font-size: 12px;
    color: #666;
    margin-top: 3px;
    background: #f5f5f5;
    border-radius: 10px;
    padding: 1px 6px;
    min-width: 20px;
    text-align: center;
}

.popup-reaction-button.active .reaction-count {
    background: #dfecf7;
    color: #4a74a0;
}

/* Style for active state in popup reaction buttons */
.popup-reaction-button.active {
    background-color: #e6f3ff; /* Light blue background */
    border-radius: 8px;
    box-shadow: 0 0 0 2px #0d6efd22; /* Light blue border with transparency */
}

/* Animation for reaction emojis */
.reaction-emoji.animating {
    animation: pulse 0.5s ease-in-out;
}

@keyframes pulse {
    0% { transform: scale(1); }
    50% { transform: scale(1.3); }
    100% { transform: scale(1); }
}

/* Make sure popup reactions have proper spacing */
.reaction-popup {
    padding: 8px;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.15);
    border-radius: 12px;
    background-color: white;
    z-index: 100;
    display: none;
}

.reaction-popup.show {
    display: flex;
}

.popup-reaction-button {
    padding: 5px 10px;
    margin: 2px;
    cursor: pointer;
    display: flex;
    flex-direction: column;
    align-items: center;
    transition: background-color 0.2s ease;
}

.popup-reaction-button {
    background-color: #f0f0f0;
    border-radius: 8px;
}

/* Style for the button icon in trigger */
.reaction-popup-trigger .button-icon img {
    width: 20px;
    height: 20px;
    vertical-align: middle;
}

/* Ensure counts are visible */
.reaction-count {
    font-size: 12px;
    margin-top: 2px;
    color: #666;
}

/* Make the reaction emoji images consistent size */
.reaction-emoji img {
    width: 24px;
    height: 24px;
    object-fit: contain;
}

.reaction-error-message {
    animation: slideIn 0.3s ease-out forwards;
}

@keyframes slideIn {
    from {
        transform: translateX(100%);
        opacity: 0;
    }
    to {
        transform: translateX(0);
        opacity: 1;
    }
}


/* reaction css */

/* Loader styles for reaction popup */

.reaction-popup.loading {
    pointer-events: none; /* Prevent interactions while loading */
}

.reaction-popup.loading .popup-reaction-button {
    opacity: 0.8;
    pointer-events: none;
}

.reaction-popup.loading .popup-reaction-button.disabled {
    cursor: not-allowed;
}

.reaction-loader {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(255, 255, 255, 0.9);
    display: none;
    align-items: center;
    justify-content: center;
    flex-direction: column;
    z-index: 10;
    border-radius: inherit;
    backdrop-filter: blur(2px);
}

.reaction-popup.loading .reaction-loader {
    display: flex !important;
}

/* .reaction-spinner {
    width: 24px;
    height: 24px;
    border: 3px solid #f3f3f3;
    border-top: 3px solid #007cba;
    border-radius: 50%;
    animation: spin 1s linear infinite;
    margin-bottom: 8px;
} */

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

.loader-text {
    font-size: 12px;
    color: #666;
    font-weight: 500;
}

/* Alternative spinner styles - you can choose which one you prefer */

/* Dots loader */
.reaction-spinner-dots {
    display: inline-block;
    position: relative;
    width: 24px;
    height: 24px;
}

.reaction-spinner-dots div {
    position: absolute;
    top: 8px;
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: #007cba;
    animation-timing-function: cubic-bezier(0, 1, 1, 0);
}

.reaction-spinner-dots div:nth-child(1) {
    left: 2px;
    animation: lds-ellipsis1 0.6s infinite;
}

.reaction-spinner-dots div:nth-child(2) {
    left: 2px;
    animation: lds-ellipsis2 0.6s infinite;
}

.reaction-spinner-dots div:nth-child(3) {
    left: 10px;
    animation: lds-ellipsis2 0.6s infinite;
}

.reaction-spinner-dots div:nth-child(4) {
    left: 18px;
    animation: lds-ellipsis3 0.6s infinite;
}

@keyframes lds-ellipsis1 {
    0% { transform: scale(0); }
    100% { transform: scale(1); }
}

@keyframes lds-ellipsis3 {
    0% { transform: scale(1); }
    100% { transform: scale(0); }
}

@keyframes lds-ellipsis2 {
    0% { transform: translate(0, 0); }
    100% { transform: translate(12px, 0); }
}

/* Pulse loader */
.reaction-spinner-pulse {
    width: 20px;
    height: 20px;
    background-color: #007cba;
    border-radius: 50%;
    animation: pulse-scale 1.0s ease-in-out infinite;
}

@keyframes pulse-scale {
    0% {
        transform: scale(0);
    }
    100% {
        transform: scale(1.0);
        opacity: 0;
    }
}

/* Dark mode support */
@media (prefers-color-scheme: dark) {
    .reaction-loader {
        background: rgba(0, 0, 0, 0.9);
    }
    
    .loader-text {
        color: #ccc;
    }
    
    .reaction-spinner {
        border: 3px solid #333;
        border-top: 3px solid #00a0d2;
    }
}