/**
 * REVA Reviews Frontend Styles
 */

.reva-reviews {
    font-family: 'Nunito', -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Oxygen-Sans, Ubuntu, Cantarell, "Helvetica Neue", sans-serif;
    color: #333;
    line-height: 1.6;
}

/* Summary Section */
.reva-summary {
    background: #f8f9fa;
    border-radius: 8px;
    padding: 25px;
    margin-bottom: 30px;
    box-shadow: 0 2px 4px rgba(0,0,0,0.08);
}

.reva-summary-wrapper {
    display: flex;
    gap: 30px;
    align-items: stretch;
}

.reva-summary-header {
    display: flex;
    flex-wrap: wrap;
    gap: 30px;
    align-items: flex-start;
    flex: 1;
    min-width: 0;
}

.reva-score-section {
    flex: 0 0 auto;
    text-align: center;
    min-width: 120px;
}

.reva-score {
    font-size: 48px;
    font-weight: 700;
    color: #335963;
    line-height: 1;
    margin-bottom: 8px;
}

.reva-stars {
    margin-bottom: 8px;
}

.reva-stars-display {
    font-size: 20px;
    color: #ffa500;
}

.star.full {
    color: #ffa500;
}

.star.half {
    position: relative;
    color: #ddd;
}

.star.half::before {
    content: '★';
    position: absolute;
    left: 0;
    width: 50%;
    overflow: hidden;
    color: #ffa500;
}

.star.empty {
    color: #ddd;
}

.reva-count {
    font-size: 14px;
    color: #666;
}

/* Breakdown Section */
.reva-breakdown {
    flex: 1;
    min-width: 250px;
}

.reva-breakdown-row {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 8px;
}

.reva-breakdown-stars {
    flex: 0 0 40px;
    font-size: 14px;
    color: #666;
}

.reva-breakdown-bar {
    flex: 1;
    height: 8px;
    background: #e0e0e0;
    border-radius: 4px;
    overflow: hidden;
}

.reva-breakdown-fill {
    height: 100%;
    background: #ffa500;
    border-radius: 4px;
    transition: width 0.3s ease;
}

.reva-breakdown-count {
    flex: 0 0 40px;
    font-size: 12px;
    color: #999;
    text-align: right;
}

/* Review List */
.reva-review-list {
    margin-top: 30px;
    display: grid;
    grid-template-columns: 1fr;
    gap: 20px;
}

/* 2-column layout on desktop */
@media (min-width: 992px) {
    .reva-review-list {
        grid-template-columns: repeat(2, 1fr);
    }
}

.reva-review {
    background: #fff;
    border: 1px solid #e0e0e0;
    border-radius: 8px;
    padding: 20px;
    transition: box-shadow 0.2s ease;
}

.reva-review:hover {
    box-shadow: 0 4px 8px rgba(0,0,0,0.1);
}

.reva-review-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    margin-bottom: 15px;
    flex-wrap: wrap;
    gap: 10px;
}

.reva-review-author {
    display: flex;
    align-items: center;
    gap: 10px;
}

.reva-name {
    font-weight: 700;
    color: #333;
    font-size: 16px;
}


.reva-review-meta {
    display: flex;
    align-items: center;
    gap: 15px;
}

.reva-rating {
    font-size: 16px;
}

.reva-date {
    color: #666;
    font-size: 14px;
}

.reva-review-title {
    font-size: 18px;
    font-weight: 600;
    margin: 0 0 10px 0;
    color: #333;
}

.reva-review-text {
    color: #555;
    line-height: 1.6;
    margin-bottom: 15px;
    font-size: 14px;
}

/* Tags Summary */
.reva-tags-summary {
    flex: 1;
    max-width: 50%;
    background: #fff;
    padding: 20px;
    border-radius: 8px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
}

.reva-tags-title {
    margin: 0 0 15px 0;
    font-size: 16px;
    font-weight: 600;
    color: #335963;
}

.reva-tags-list {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

.reva-tag-pill {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    background: #f5fbfd;
    padding: 6px 12px;
    border-radius: 20px;
    font-size: 14px;
    color: #1a5a6b;
    font-weight: 500;
    transition: all 0.2s ease;
}

.reva-tag-pill:hover {
    background: #e8f6fa;
}

.reva-tag-count {
    color: #666;
    font-weight: 400;
    font-size: 13px;
}

/* Tags in individual reviews */
.reva-tags {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-top: 12px;
}

.reva-tag {
    background: #f5fbfd;
    color: #1a5a6b;
    padding: 4px 10px;
    border-radius: 16px;
    font-size: 12px;
    font-weight: 500;
    transition: all 0.2s ease;
}

.reva-tag:hover {
    background: #e8f6fa;
}

/* Response Section */
.reva-response-wrapper {
    margin-top: 15px;
    border-top: 1px solid #e0e0e0;
    padding-top: 15px;
}

.reva-response-toggle {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    color: #3dabc7;
    text-decoration: none;
    font-weight: 700;
    font-size: 14px;
    transition: color 0.2s ease;
}

.reva-response-toggle:hover {
    color: #2d8aa3; /* Overridden by dynamic CSS */
}

.reva-toggle-icon {
    font-size: 10px;
    transition: transform 0.3s ease;
}

.reva-response-toggle.active .reva-toggle-icon {
    transform: rotate(180deg);
}

.reva-response {
    margin-top: 15px;
    padding: 15px;
    background: #f5f5f5;
    border-left: 3px solid #335963;
    border-radius: 4px;
}

.reva-response strong {
    display: block;
    margin-bottom: 8px;
    color: #333;
    font-size: 14px;
}

.reva-response p {
    margin: 0;
    color: #555;
    line-height: 1.6;
}

/* Load More Button */
.reva-load-more-wrapper {
    text-align: center;
    margin-top: 30px;
    padding-top: 20px;
}

.reva-load-more {
    display: inline-block;
    padding: 12px 30px;
    background: #335963;
    color: #fff;
    border: none;
    border-radius: 4px;
    font-size: 16px;
    font-weight: 500;
    cursor: pointer;
    transition: background 0.2s ease;
}

.reva-load-more:hover {
    background: #254349;
}

.reva-load-more:disabled {
    background: #ccc;
    cursor: not-allowed;
}

.reva-load-more.loading {
    position: relative;
    color: transparent;
}

.reva-load-more.loading::after {
    content: '';
    position: absolute;
    width: 20px;
    height: 20px;
    top: 50%;
    left: 50%;
    margin: -10px 0 0 -10px;
    border: 2px solid #fff;
    border-radius: 50%;
    border-top-color: transparent;
    animation: spinner 0.6s linear infinite;
}

@keyframes spinner {
    to { transform: rotate(360deg); }
}

/* Empty State */
.reva-reviews-empty,
.reva-reviews-error {
    text-align: center;
    padding: 40px 20px;
    background: #f8f9fa;
    border-radius: 8px;
    color: #666;
}

/* Mobile Responsive */
@media (max-width: 992px) {
    .reva-summary-wrapper {
        flex-direction: column;
    }
    
    .reva-tags-summary {
        flex: 1 1 auto;
        max-width: 100%;
        width: 100%;
    }
}

@media (max-width: 768px) {
    .reva-summary-header {
        flex-direction: column;
        align-items: stretch;
    }
    
    .reva-score-section {
        text-align: left;
        display: flex;
        align-items: center;
        gap: 15px;
    }
    
    .reva-score {
        font-size: 36px;
    }
    
    .reva-review-header {
        flex-direction: column;
        align-items: flex-start;
    }
    
    .reva-review-meta {
        width: 100%;
        justify-content: space-between;
    }
    
    .reva-breakdown {
        min-width: auto;
    }
}

@media (max-width: 480px) {
    .reva-summary {
        padding: 20px 15px;
    }
    
    .reva-review {
        padding: 15px;
    }
    
    .reva-score {
        font-size: 32px;
    }
    
    .reva-stars-display {
        font-size: 16px;
    }
    
    .reva-name {
        font-size: 14px;
    }
    
    .reva-review-text {
        font-size: 14px;
    }
}