/* PYM Reviews Carousel Widget Styles */

.pym-reviews-carousel-widget {
    font-family: inherit;
    direction: rtl;
}

.pym-reviews-carousel {
    display: flex;
    flex-wrap: wrap;
    gap: 5px;
}

.review-card {
    background: url('https://avoo.seoamoozan.ir/wp-content/uploads/2025/07/bgcomm.png') no-repeat center center;
    background-size: cover;
    width: 285px;
    height: 272px;
    border-radius: 8px;
    padding: 16px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
    flex-shrink: 0;
    transition: transform 0.3s ease, box-shadow 0.3s ease;
    position: relative;
    overflow: hidden;
    display: flex;
    flex-direction: column;
    justify-content: center;
}

.review-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.15);
}

/* Review Header */
.review-header {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    margin-bottom: 12px;
    gap: 15px;
}

.review-header-left {
    display: flex;
    align-items: center;
    gap: 10px;
}

.user-avatar {
    width: 40px;
    height: 40px;
    background: url('https://avoo.seoamoozan.ir/wp-content/uploads/2025/07/usercomm.svg') no-repeat center center;
    background-size: cover;
    border-radius: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.user-avatar img {
    width: 100%;
    height: 100%;
    border-radius: 50%;
    object-fit: cover;
}

.user-info {
    display: flex;
    flex-direction: column;
    gap: 5px;
}

.user-name {
    font-weight: 600;
    font-size: 14px;
    color: #333333;
    line-height: 1.2;
    margin: 0;
}

.review-date {
    font-size: 12px;
    color: #666666;
    line-height: 1.2;
    margin: 0;
}

.review-header-right {
    display: flex;
    align-items: center;
}

.rating-stars {
    display: flex;
    gap: 2px;
    align-items: center;
}

.rating-stars .star {
    width: 16px;
    height: 16px;
    background-size: contain;
    background-repeat: no-repeat;
    background-position: center;
}

.rating-stars .star.filled {
    background-image: var(--star-filled-icon, url('data:image/svg+xml,<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" fill="%234CAF50"><path d="M12 2l3.09 6.26L22 9.27l-5 4.87 1.18 6.88L12 17.77l-6.18 3.25L7 14.14 2 9.27l6.91-1.01L12 2z"/></svg>'));
}

.rating-stars .star.empty {
    background-image: var(--star-empty-icon, url('data:image/svg+xml,<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" fill="%23E0E0E0"><path d="M12 2l3.09 6.26L22 9.27l-5 4.87 1.18 6.88L12 17.77l-6.18 3.25L7 14.14 2 9.27l6.91-1.01L12 2z"/></svg>'));
}

/* Review Content */
.review-content {
    margin-bottom: 5px;
}

.review-text {
    font-size: 14px;
    line-height: 1.6;
    color: #333333;
    text-align: justify;
    flex: 1;
    margin-bottom: 12px;
}

/* Review Divider */
.review-divider {
    height: 1px;
    background: #E0E0E0;
    margin: 15px 0;
}

/* Book Details */
.book-details {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 15px;
}

.book-details-left {
    display: flex;
    align-items: flex-start;
    gap: 10px;
}

.book-cover {
    width: 60px;
    height: 80px;
    flex-shrink: 0;
    border-radius: 4px;
    overflow: hidden;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

.book-cover img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.book-cover a {
    display: block;
    width: 100%;
    height: 100%;
}

.placeholder-image {
    width: 100%;
    height: 100%;
    background: linear-gradient(135deg, #f5f5f5 0%, #e0e0e0 100%);
    display: flex;
    align-items: center;
    justify-content: center;
    color: #999999;
    font-size: 12px;
}

.book-info {
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.book-title {
    font-size: 14px;
    font-weight: 600;
    color: #333333;
    line-height: 1.2;
    margin: 0;
}

.book-title a {
    color: inherit;
    text-decoration: none;
    transition: color 0.3s ease;
}

.book-title a:hover {
    color: #4CAF50;
}

.book-author {
    font-size: 12px;
    color: #666666;
    line-height: 1.2;
    margin: 0;
}

.book-publisher {
    font-size: 12px;
    color: #666666;
    line-height: 1.2;
    margin: 0;
}

.book-details-right {
    display: flex;
    align-items: center;
}

.book-rating {
    display: flex;
    align-items: center;
    gap: 5px;
    flex-shrink: 0;
}

.star-icon {
    width: 14px;
    height: 14px;
    background-size: contain;
    background-repeat: no-repeat;
    background-position: center;
    background-image: var(--star-filled-icon, url('data:image/svg+xml,<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" fill="%234CAF50"><path d="M12 2l3.09 6.26L22 9.27l-5 4.87 1.18 6.88L12 17.77l-6.18 3.25L7 14.14 2 9.27l6.91-1.01L12 2z"/></svg>'));
}

.rating-number {
    font-size: 14px;
    font-weight: 600;
    color: #333333;
}

/* Carousel Navigation */
.pym-reviews-carousel-widget .slick-arrow {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    width: 40px;
    height: 40px;
    background: #ffffff;
    border: 1px solid #E0E0E0;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    z-index: 10;
    transition: all 0.3s ease;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

.pym-reviews-carousel-widget .slick-arrow:hover {
    background: #4CAF50;
    border-color: #4CAF50;
    color: #ffffff;
}

.pym-reviews-carousel-widget .slick-prev {
    right: -50px;
}

.pym-reviews-carousel-widget .slick-next {
    left: -50px;
}

.pym-reviews-carousel-widget .slick-dots {
    display: flex;
    justify-content: center;
    list-style: none;
    padding: 0;
    margin: 20px 0 0 0;
    gap: 8px;
}

.pym-reviews-carousel-widget .slick-dots li {
    margin: 0;
}

.pym-reviews-carousel-widget .slick-dots button {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: #E0E0E0;
    border: none;
    cursor: pointer;
    transition: background 0.3s ease;
    font-size: 0;
    padding: 0;
}

.pym-reviews-carousel-widget .slick-dots .slick-active button {
    background: #4CAF50;
}

/* Responsive Design */
@media (max-width: 768px) {
    .pym-reviews-carousel {
        flex-direction: row;
        flex-wrap: nowrap;
        overflow-x: auto;
        scroll-snap-type: x mandatory;
        -webkit-overflow-scrolling: touch;
    }
    
    .review-card {
        min-width: 285px;
        max-width: 285px;
        margin-right: 15px;
        scroll-snap-align: start;
        flex-shrink: 0;
    }
    
    .pym-reviews-carousel-widget .slick-arrow {
        display: flex !important;
    }
}

@media (max-width: 480px) {
    .review-card {
        padding: 15px;
    }
    
    .book-cover {
        width: 50px;
        height: 70px;
    }
    
    .rating-stars .star {
        font-size: 14px;
    }
    
    .user-name {
        font-size: 13px;
    }
    
    .review-text {
        font-size: 13px;
    }
    
    .book-title {
        font-size: 13px;
    }
    
    .book-author,
    .book-publisher {
        font-size: 11px;
    }
}

/* RTL Specific Adjustments */
.pym-reviews-carousel-widget[dir="rtl"] .slick-prev {
    left: -50px;
    right: auto;
}

.pym-reviews-carousel-widget[dir="rtl"] .slick-next {
    right: -50px;
    left: auto;
}

/* Loading State */
.pym-reviews-carousel-widget.loading {
    opacity: 0.7;
    pointer-events: none;
}

.pym-reviews-carousel-widget.loading::after {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 30px;
    height: 30px;
    border: 3px solid #f3f3f3;
    border-top: 3px solid #4CAF50;
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

@keyframes spin {
    0% { transform: translate(-50%, -50%) rotate(0deg); }
    100% { transform: translate(-50%, -50%) rotate(360deg); }
}

/* Accessibility */
.pym-reviews-carousel-widget .slick-arrow:focus {
    outline: 2px solid #4CAF50;
    outline-offset: 2px;
}

.pym-reviews-carousel-widget .book-title a:focus {
    outline: 2px solid #4CAF50;
    outline-offset: 2px;
}

/* Print Styles */
@media print {
    .pym-reviews-carousel-widget .slick-arrow,
    .pym-reviews-carousel-widget .slick-dots {
        display: none !important;
    }
    
    .review-card {
        break-inside: avoid;
        box-shadow: none;
        border: 1px solid #E0E0E0;
    }
} 