/* Reviews Page Styles - Pixel-Perfect Gray Revision */

.reviews-page {
    background-color: #f1f5f9 !important; 
    color: #1e293b;
    padding-bottom: 100px;
}

.reviews-hero {
    padding: 80px 0 40px;
    background: #f1f5f9 !important; /* Reverted to Gray as requested */
    text-align: center;
    color: #1a1a1a;
}

.reviews-title {
    font-size: 3.2rem;
    font-weight: 800;
    margin-bottom: 15px;
    color: #1a1a1a;
    letter-spacing: -1.2px;
}

.reviews-subtitle {
    font-size: 1.1rem;
    color: #64748b;
    max-width: 650px;
    margin: 0 auto 40px;
}

/* Compact Stats Box - Final Polish for Light Theme */
.reviews-stats-compact {
    display: inline-flex;
    align-items: center;
    background: #ffffff;
    border: 1px solid rgba(0, 0, 0, 0.08);
    padding: 24px 30px;
    border-radius: 20px;
    gap: 30px;
    margin: 0 auto;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.06);
}

.stats-rating-box {
    background: #2563eb;
    color: #ffffff;
    font-size: 48px; 
    font-weight: 800;
    padding: 12px 20px;
    border-radius: 8px;
    line-height: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    min-width: 110px;
}

.stats-info {
    text-align: left;
    display: flex;
    flex-direction: column;
    justify-content: center;
    gap: 12px;
}

/* Decimal Stars Styling - Fixed Layout */
.stars-decimal-wrap {
    display: flex;
    align-items: center;
}

.stars-decimal-outer {
    position: relative;
    display: inline-flex; /* Use inline-flex for tight containment */
    line-height: 0; /* Prevent line-height shifts */
}

.star-row {
    display: flex;
    gap: 4px; /* Maintain gap for spacing */
    line-height: 1;
}

.star-row svg {
    width: 30px;
    height: 30px;
    display: block;
    color: #facc15; /* Warmer Gold */
    filter: drop-shadow(0 0 5px rgba(250, 204, 21, 0.4)); /* Soft Glow */
}

.star-row.gray svg {
    color: rgba(255, 255, 255, 0.1); /* Subtle Gray on dark */
    filter: none;
}

.stars-decimal-inner {
    position: absolute;
    top: 0;
    left: 0;
    height: 100%;
    overflow: hidden;
    z-index: 2;
    pointer-events: none;
}

.stars-decimal-inner .star-row {
    width: max-content;
}

.stats-text {
    font-size: 14px;
    color: #ffffff;
    font-weight: 700;
    background: #2563eb;
    padding: 8px 16px;
    border-radius: 8px;
    display: inline-block;
    width: fit-content;
    line-height: 1;
    box-shadow: 0 4px 12px rgba(37, 99, 235, 0.3);
}

/* Grid Layout */
.reviews-grid-section {
    padding: 30px 0 80px;
    background: transparent !important; /* Ensure no blackness behind */
}

.reviews-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 30px 10px; /* Matched to the spacing in your screenshot */
    align-items: start; /* Prevents other cards in the row from stretching when one expands */
}

/* Review Card Styling - Light Theme Alignment */
.review-card {
    position: relative;
    padding: 0 !important;
    padding-top: 35px !important; /* Offset for avatar overlap */
    height: auto !important; /* CRITICAL: Prevent the item container from stretching the whole row */
    max-width: none !important; 
    flex: 1 1 auto !important; 
    width: auto !important;
    background: transparent !important;
    border: none !important;
    box-shadow: none !important;
    transition: transform 0.3s ease;
}

.review-card:hover {
    transform: translateY(-10px);
}

.review-card-inner {
    background: #ffffff;
    border: 1px solid rgba(0, 0, 0, 0.05);
    border-radius: 20px;
    padding: 25px 35px 22px; 
    height: auto;
    min-height: 290px; /* Restored to original horizontal-ish proportions */
    display: flex;
    flex-direction: column;
    text-align: left;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.04);
}

.review-card:hover .review-card-inner {
    box-shadow: 0 25px 50px rgba(0, 0, 0, 0.1);
}

.review-avatar {
    position: absolute;
    top: 0;
    left: 25px;
    width: 60px;
    height: 60px;
    border-radius: 50%;
    background: #ffffff;
    border: 4px solid #f1f5f9; /* Matches global page background */
    box-shadow: 0 8px 15px rgba(0, 0, 0, 0.08);
    z-index: 5;
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
}

.review-avatar img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.avatar-placeholder {
    color: #2563eb;
    font-size: 22px;
    font-weight: 800;
}

.author-name {
    font-size: 1.15rem;
    font-weight: 700;
    color: #1e293b; /* Dark navy for text */
    margin: 10px 0 2px 0;
}

.review-date {
    font-size: 0.85rem;
    color: #94a3b8;
    margin-bottom: 20px;
    font-weight: 500;
}

.review-rating {
    display: flex;
    gap: 4px;
    margin-bottom: 22px;
}

.review-rating svg.star {
    width: 18px;
    height: 18px;
    color: #e2e8f0; /* Gray for inactive */
}

.review-rating svg.star.active {
    color: #facc15; /* Same Gold as aggregate stars */
    filter: drop-shadow(0 0 3px rgba(250, 204, 21, 0.2));
}

.review-content {
    font-size: 0.95rem; /* Slightly smaller to fit better */
    line-height: 1.65;
    color: #475569;
    flex-grow: 1;
    overflow-wrap: break-word;
    word-wrap: break-word;
    word-break: break-word; /* Fix for Mokokokoko... overflow */
}

.review-text-excerpt {
    margin-bottom: 12px;
    display: -webkit-box;
    -webkit-line-clamp: 4;
    line-clamp: 4; /* Standard property for compatibility */
    -webkit-box-orient: vertical;
    overflow: hidden;
    min-height: 6.6em; /* Ensures equal height for the text area */
    line-height: 1.65;
}

.review-text-full {
    display: none; /* Hidden by default */
    margin-bottom: 20px;
}

.review-card.expanded .review-text-excerpt {
    display: none;
}

.review-card.expanded .review-text-full {
    display: block;
}

.read-more-toggle {
    display: inline-block;
    color: #2563eb; 
    font-size: 0.88rem;
    font-weight: 700;
    text-decoration: none; /* Removed underline as per screenshot */
    margin-top: auto;
    padding-top: 15px; /* Restored original spacing */
    transition: color 0.2s;
}

/* No arrow (::after) in original design */

.read-more-toggle:hover {
    color: #1d4ed8;
    text-decoration: underline;
}

/* Pagination */
.reviews-pagination {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 12px;
    margin-top: 60px;
    padding-top: 40px;
    border-top: 1px solid rgba(0, 0, 0, 0.05);
}

.page-numbers {
    display: flex;
    align-items: center;
    justify-content: center;
    min-width: 44px;
    height: 44px;
    padding: 0 16px;
    background: #ffffff;
    border: 1px solid rgba(0, 0, 0, 0.08);
    border-radius: 12px;
    color: #475569;
    font-size: 0.95rem;
    font-weight: 700;
    text-decoration: none;
    transition: all 0.3s ease;
}

.page-numbers:hover {
    background: #f8fafc;
    border-color: #2563eb;
    color: #2563eb;
    transform: translateY(-2px);
}

.page-numbers.current {
    background: #2563eb;
    color: #ffffff;
    border-color: #2563eb;
    box-shadow: 0 8px 20px rgba(37, 99, 235, 0.25);
}

.page-numbers.prev,
.page-numbers.next {
    font-size: 0.85rem;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

/* Responsive */
@media (max-width: 1200px) {
    .reviews-grid {
        grid-template-columns: repeat(2, 1fr);
    }
}

@media (max-width: 768px) {
    .reviews-title {
        font-size: 2.2rem;
    }
    
    .reviews-grid {
        grid-template-columns: 1fr;
    }
}
