/**
 * ER Google Reviews - Frontend Styles
 */

/* Container */
.er-google-reviews {
    max-width: 1200px;
    margin: 40px auto;
    padding: 0 20px;
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
}

/* Error Messages */
.er-google-reviews-error {
    background: #f8d7da;
    color: #721c24;
    padding: 15px 20px;
    border: 1px solid #f5c6cb;
    border-radius: 4px;
    margin: 20px 0;
}

/* Separated Layout */
.er-google-reviews-separated .er-google-reviews-location {
    margin-bottom: 60px;
}

.er-google-reviews-separated .er-google-reviews-location:last-child {
    margin-bottom: 0;
}

/* Header */
.er-reviews-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 30px;
    padding-bottom: 20px;
    border-bottom: 2px solid #e0e0e0;
    flex-wrap: wrap;
    gap: 20px;
}

.er-reviews-header-left {
    flex: 1;
    min-width: 250px;
}

.er-business-name {
    margin: 0 0 10px 0;
    font-size: 28px;
    font-weight: 600;
    color: #202124;
}

.er-rating-summary {
    display: flex;
    align-items: center;
    gap: 10px;
    flex-wrap: wrap;
}

.er-stars {
    display: inline-flex;
    gap: 2px;
    font-size: 20px;
    line-height: 1;
}

.er-star {
    display: inline-block;
}

.er-star-full,
.er-star-half {
    opacity: 1;
}

.er-star-empty {
    opacity: 0.3;
}

.er-rating-number {
    font-size: 18px;
    font-weight: 600;
    color: #202124;
}

.er-review-count {
    font-size: 14px;
    color: #5f6368;
}

/* Header Buttons */
.er-reviews-header-right {
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
}

.er-btn {
    display: inline-block;
    padding: 10px 20px;
    border-radius: 0;
    text-decoration: none;
    font-size: 14px;
    font-weight: 500;
    transition: all 0.2s ease;
    cursor: pointer;
    border: none;
    white-space: nowrap;
}

.er-btn-primary {
    background: #1a73e8;
    color: #fff;
}

.er-btn-primary:hover {
    background: #1557b0;
    color: #fff;
}

.er-btn-secondary {
    background: #fff;
    color: #1a73e8;
    border: 1px solid #dadce0;
}

.er-btn-secondary:hover {
    background: #f8f9fa;
    color: #1557b0;
    border-color: #1a73e8;
}

/* Reviews Grid */
.er-reviews-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 20px;
    margin-bottom: 40px;
}

/* Review Card */
.er-review-card {
    background: #fff;
    border: 1px solid #e0e0e0;
    padding: 20px;
    transition: box-shadow 0.2s ease;
    display: flex;
    flex-direction: column;
    height: 100%;
}

.er-review-card:hover {
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}

/* Review wrapper to maintain equal heights */
.er-review-wrapper {
    display: flex;
}

.er-review-wrapper .er-review-card {
    width: 100%;
}

/* Review Header */
.er-review-header {
    display: flex;
    align-items: flex-start;
    gap: 12px;
    margin-bottom: 15px;
}

.er-review-avatar {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background: #1a73e8;
    color: #fff;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 18px;
    font-weight: 600;
    flex-shrink: 0;
}

.er-review-header-info {
    flex: 1;
    min-width: 0;
}

.er-reviewer-name {
    font-size: 14px;
    font-weight: 600;
    color: #202124;
    margin-bottom: 5px;
}

.er-review-meta {
    display: flex;
    align-items: center;
    gap: 8px;
    flex-wrap: wrap;
}

.er-review-meta .er-stars {
    font-size: 14px;
}

.er-review-time {
    font-size: 12px;
    color: #5f6368;
}

/* Review Text */
.er-review-text {
    font-size: 14px;
    line-height: 1.6;
    color: #3c4043;
    margin-bottom: 15px;
    max-height: 150px;
    overflow-y: auto;
    flex: 1;
}

.er-review-text::-webkit-scrollbar {
    width: 6px;
}

.er-review-text::-webkit-scrollbar-track {
    background: #f1f1f1;
    border-radius: 3px;
}

.er-review-text::-webkit-scrollbar-thumb {
    background: #dadce0;
    border-radius: 3px;
}

.er-review-text::-webkit-scrollbar-thumb:hover {
    background: #bdc1c6;
}

/* Owner Response */
.er-owner-response {
    background: #f8f9fa;
    padding: 15px;
    border-radius: 4px;
    margin-top: 15px;
}

.er-owner-response-label {
    font-size: 12px;
    font-weight: 600;
    color: #5f6368;
    margin-bottom: 8px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.er-owner-response-text {
    font-size: 13px;
    line-height: 1.5;
    color: #3c4043;
}

/* No Reviews */
.er-no-reviews {
    text-align: center;
    padding: 40px 20px;
    color: #5f6368;
    font-size: 16px;
}

/* NEW: Hidden reviews for "See More" functionality */
.er-review-wrapper.er-review-hidden {
    display: none;
}

/* NEW: See More Button */
.er-btn-see-more {
    padding: 12px 30px;
    font-size: 15px;
    border-radius: 0;
}

/* NEW: Location Selector Modal */
.er-location-modal {
    position: fixed;
    z-index: 9999;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    overflow: auto;
    background-color: rgba(0, 0, 0, 0.5);
}

.er-location-modal-content {
    background-color: #fff;
    margin: 10% auto;
    padding: 30px;
    border-radius: 8px;
    width: 90%;
    max-width: 500px;
    position: relative;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.2);
}

.er-location-modal-close {
    color: #5f6368;
    float: right;
    font-size: 32px;
    font-weight: bold;
    line-height: 1;
    cursor: pointer;
    transition: color 0.2s;
}

.er-location-modal-close:hover,
.er-location-modal-close:focus {
    color: #202124;
}

.er-location-modal h3 {
    margin: 0 0 20px 0;
    color: #202124;
    font-size: 22px;
}

.er-location-list {
    list-style: none;
    padding: 0;
    margin: 0;
}

.er-location-list li {
    margin-bottom: 10px;
}

.er-location-link {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 15px;
    background: #f8f9fa;
    border-radius: 6px;
    text-decoration: none;
    color: #202124;
    transition: all 0.2s;
    border: 2px solid transparent;
}

.er-location-link:hover {
    background: #e8f0fe;
    border-color: #1a73e8;
    transform: translateY(-2px);
}

.er-location-link strong {
    font-size: 16px;
}

.er-location-rating {
    display: flex;
    align-items: center;
    gap: 5px;
    font-size: 14px;
}

.er-location-rating .er-stars {
    font-size: 14px;
}

/* NEW: Profile photo avatars */
.er-review-avatar-photo {
    padding: 0;
    overflow: hidden;
}

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

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

@media (max-width: 768px) {
    .er-google-reviews {
        padding: 0 15px;
        margin: 30px auto;
    }
    
    .er-reviews-header {
        flex-direction: column;
        align-items: flex-start;
    }
    
    .er-business-name {
        font-size: 24px;
    }
    
    .er-reviews-header-right {
        width: 100%;
    }
    
    .er-btn {
        flex: 1;
        text-align: center;
        justify-content: center;
    }
    
    .er-reviews-grid {
        grid-template-columns: 1fr;
        gap: 15px;
    }
}

@media (max-width: 480px) {
    .er-business-name {
        font-size: 20px;
    }
    
    .er-rating-summary {
        font-size: 14px;
    }
    
    .er-stars {
        font-size: 16px;
    }
    
    .er-reviews-header-right {
        flex-direction: column;
    }
    
    .er-btn {
        width: 100%;
    }
}
