/* Post Rating System - Frontend Styles */

/* Wrapper containers for proper row separation */
.prs-star-rating-wrapper {
    display: block;
    width: 100%;
    clear: both;
    margin: 15px 0;
}

.prs-actions-wrapper {
    display: block;
    width: 100%;
    clear: both;
    margin: 20px 0;
}

/* Common Star Rating Display */
.prs-star-rating {
    display: flex;
    align-items: center;
    font-size: 20px;
    margin: 0;
    line-height: 1;
    width: 100%;
    clear: both;
}

/* Common star styles for both versions */
.prs-star-rating .prs-star {
    font-size: 30px;
    margin-right: 2px;
    display: inline-block;
    transition: transform 0.2s ease;
}

.prs-star-rating .prs-star:hover {
    transform: scale(1.1);
}

/* Filled stars - same red for both styles */
.prs-star-rating .prs-star.filled {
    color: #e74c3c;
}

/* Empty stars - same gray for both styles */
.prs-star-rating .prs-star.empty {
    color: #ddd;
}

/* Half star - same style for both */
.prs-star-rating .prs-star.half {
    position: relative;
    color: #ddd;
}

.prs-star-rating .prs-star.half::before {
    content: '★';
    position: absolute;
    left: 0;
    top: 0;
    width: 50%;
    overflow: hidden;
    color: #e74c3c;
}

/* Style 1 specific text */
.prs-star-rating.style1 .prs-rating-text {
    font-size: 14px;
    /*color: #333;*/
    margin-left: 8px;
    /*font-weight: 600;*/
    text-decoration: none; /* Removed underline */
    cursor: default;
}

.prs-star-rating.style1 .prs-rating-score {
    font-weight: 700;
    text-decoration: underline;
    text-decoration: rgb(183, 47, 47); /* Only underline the score number */
}

/* Style 2 specific text */
.prs-star-rating.style2 {
    gap: 2px;
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
}

.prs-star-rating.style2 .prs-rating-text-v2 {
    font-size: 14px;
    /**color: #666;**/
    font-weight: 400;
}

.prs-star-rating.style2 .prs-like-count {
    font-weight: 600;
    /*color: #333;*/
}

/* Common for both styles */
.prs-like-count {
    transition: all 0.3s ease;
}

/* Post Actions Bar */
.prs-actions-bar {
    display: flex;
    gap: 0;
    margin: 0;
    /*border: 1px solid #ddd;*/
    border-radius: 4px;
    overflow: hidden;
    max-width: fit-content;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
    width: auto;
    clear: both;
}

.prs-action-btn {
    padding: 12px 24px;
    background: #F5F6EA;
    border: none;
    /*border-right: 1px solid #ddd;*/
    cursor: pointer;
    font-size: 14px;
    font-weight: 600;
    display: flex;
    align-items: center;
    gap: 8px;
    transition: all 0.3s ease;
    color: #333;
    position: relative;
    overflow: hidden;
}

.prs-action-btn:last-child {
    border-right: none;
}

.prs-action-btn:hover {
    background: #e9e9e9;
    transform: translateY(-1px);
}

.prs-action-btn:active {
    transform: translateY(0);
}

/* Like Button Special Styling */
.prs-like-btn {
    background: #fff;
    color: #e74c3c;
    /*border-right: 1px solid #ddd;*/
}

.prs-like-btn:hover {
    background: rgb(176, 215, 245);
    color: #c0392b;
}

.prs-like-btn.liked {
    background: #e74c3c;
    color: white;
}

.prs-like-btn.liked:hover {
    background: #c0392b;
}

.prs-like-btn.liked .prs-star-icon {
    animation: pulse 0.5s ease;
}

/* Button Icons */
.prs-star-icon {
    font-size: 23px;
    transition: transform 0.3s ease;
}

.prs-like-btn:hover .prs-star-icon {
    transform: rotate(72deg) scale(1.2);
}

.prs-print-icon,
.prs-share-icon {
    font-size: 16px;
}

/* Animations */
@keyframes pulse {
    0% {
        transform: scale(1);
    }
    50% {
        transform: scale(1.3);
    }
    100% {
        transform: scale(1);
    }
}

@keyframes like-burst {
    0% {
        opacity: 1;
        transform: scale(0);
    }
    50% {
        opacity: 1;
    }
    100% {
        opacity: 0;
        transform: scale(1.5);
    }
}

/* Like Animation Effect */
.prs-like-btn.animate::after {
    content: '★';
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    font-size: 30px;
    color: #e74c3c;
    pointer-events: none;
    animation: like-burst 0.6s ease-out;
}

/* Share Button Tooltip */
.prs-share-btn {
    position: relative;
}

.prs-share-tooltip {
    position: absolute;
    bottom: 120%;
    left: 50%;
    transform: translateX(-50%);
    background: #333;
    color: white;
    padding: 5px 10px;
    border-radius: 4px;
    font-size: 12px;
    white-space: nowrap;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.3s ease;
}

.prs-share-tooltip.show {
    opacity: 1;
}

.prs-share-tooltip::after {
    content: '';
    position: absolute;
    top: 100%;
    left: 50%;
    transform: translateX(-50%);
    border: 5px solid transparent;
    border-top-color: #333;
}

/* Mobile Responsive */
@media (max-width: 768px) {
    .prs-actions-bar {
        flex-direction: row;
        width: 100%;
        max-width: 100%;
    }
    
    .prs-action-btn {
        flex: 1;
        justify-content: center;
        padding: 12px 16px;
    }
    
    .prs-btn-text {
        font-size: 12px;
    }
    
    .prs-star-rating {
        font-size: 18px;
    }
    
    .prs-star-rating .prs-star {
        font-size: 30px;
    }
    
    .prs-star-rating.style1 .prs-rating-text {
        font-size: 16px;
    }
    
    .prs-star-rating.style2 .prs-rating-text-v2 {
        font-size: 14px;
    }
}

@media (max-width: 480px) {
    .prs-action-btn {
        padding: 10px 12px;
    }
    
    .prs-btn-text {
        display: none;
    }
    
    .prs-star-icon,
    .prs-print-icon,
    .prs-share-icon {
        font-size: 20px;
    }
}

/* Loading State */
.prs-loading {
    opacity: 0.6;
    pointer-events: none;
}

.prs-loading::after {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 20px;
    height: 20px;
    border: 2px solid #f3f3f3;
    border-top: 2px solid #333;
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

@keyframes spin {
    0% { transform: translate(-50%, -50%) rotate(0deg); }
    100% { transform: translate(-50%, -50%) rotate(360deg); }
}

/* Ensure proper spacing when elements are adjacent */
.prs-star-rating-wrapper + .prs-actions-wrapper {
    margin-top: 15px;
}

/* Blocksy specific adjustments */
.entry-card .prs-star-rating-wrapper,
.entry-card .prs-actions-wrapper {
    margin: 10px 0;
}

/* For single post content */
.single-content .prs-star-rating-wrapper,
.single-content .prs-actions-wrapper {
    margin: 20px 0;
}

/* Blocksy loop card specific */
[data-cards="boxed"] .prs-star-rating-wrapper,
[data-cards="boxed"] .prs-actions-wrapper,
[data-cards="simple"] .prs-star-rating-wrapper,
[data-cards="simple"] .prs-actions-wrapper {
    padding: none;
}

/* Ensure elements don't touch card edges */
.card-content .prs-star-rating-wrapper:first-child {
    margin-top: 0;
}

.card-content .prs-actions-wrapper:last-child {
    margin-bottom: 10px;
}