/* Google Review Widget Container */
.google-review-widget {
    position: fixed;
    z-index: 9999;
    background-color: #ffffff;
    border-radius: 12px;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.2);
    font-family: 'Roboto', Arial, sans-serif;
    color: #3c4043;
    transition: all 0.3s cubic-bezier(0.25, 0.8, 0.25, 1);
    overflow: hidden;
    /* Keep hidden to maintain border-radius effect, handle scroll inside body */
    /* Improved floating appearance with border */
    border: 1px solid rgba(0, 0, 0, 0.05);
    display: flex;
    flex-direction: column;
}

/* Desktop Styles */
@media screen and (min-width: 501px) {
    .google-review-widget {
        bottom: 20px;
        left: 20px;
        width: 350px;
        height: 60px;
        /* Explicit initial height */
        max-height: 60px;
        /* Collapsed height */
    }

    .google-review-widget.expanded {
        height: 500px;
        /* Explicit expanded height */
        max-height: 500px;
        /* Expanded height */
    }
}

/* Mobile Styles */
@media screen and (max-width: 500px) {
    .google-review-widget {
        bottom: 0px;
        /* right: 15px; */
        left: auto;
        /* width: 90%; */
        /* max-width: 350px; */
        height: 60px;
        /* Explicit initial height */
        max-height: 60px;
        /* Collapsed height */
    }

    .google-review-widget.expanded {
        height: -webkit-fill-available;
        /* Explicit expanded height */
        max-height: 1200px;
        /* Expanded height */
    }
}

/* Header Styles */
.widget-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 10px 16px;
    background-color: #fff;
    cursor: pointer;
    border-bottom: 1px solid #f1f3f4;
    height: 60px;
    /* Fixed header height */
    box-sizing: border-box;
}

.header-left {
    display: flex;
    align-items: center;
    gap: 12px;
}

.google-logo img {
    width: 28px;
    height: 28px;
}

.header-info {
    display: flex;
    flex-direction: column;
}

.header-title {
    font-size: 15px;
    font-weight: 500;
    color: #202124;
    line-height: 1.2;
}

.header-stats {
    display: flex;
    align-items: center;
    gap: 5px;
    font-size: 13px;
    margin-top: 2px;
}

.avg-score {
    font-weight: bold;
    color: #202124;
}

.stars {
    color: #FFD700;
    /* Yellow stars */
    font-size: 12px;
}

.review-count {
    color: #70757a;
}

.header-toggle {
    color: #5f6368;
    transition: transform 0.3s ease;
}

/* Widget Body */
.widget-body {
    background-color: #fff;
    opacity: 0;
    transition: opacity 0.3s ease;
    overflow-y: auto;
    /* Use flex column to ensure content fills available space */
    display: flex;
    flex-direction: column;
    height: 0;
}

.google-review-widget.expanded .widget-body {
    opacity: 1;
    height: calc(100% - 60px);
    /* Use remaining height */
}

/* Reviews List */
.reviews-list {
    padding: 0;
    flex: 1;
    overflow-y: auto;
    min-height: 0;
    /* Important for flex child scrolling */
}

.review-item {
    padding: 16px;
    border-bottom: 1px solid #f1f3f4;
}

.review-head {
    display: flex;
    align-items: flex-start;
    gap: 12px;
    margin-bottom: 8px;
}

.review-avatar {
    width: 36px;
    height: 36px;
}

.review-user {
    display: flex;
    flex-direction: column;
    flex: 1;
}

.review-top-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    width: 100%;
}

.author-name {
    font-size: 14px;
    font-weight: bold;
    color: #202124;
}

.publish-time {
    font-size: 12px;
    color: #70757a;
}

.review-rating .stars {
    color: #ffb100;
    font-size: 12px;
}

.review-text {
    font-size: 14px;
    color: #3c4043;
    line-height: 1.5;
    margin-top: 8px;
}

/* Footer */
.widget-footer {
    padding: 12px;
    text-align: center;
    background-color: #f8f9fa;
    border-top: 1px solid #f1f3f4;
}

.widget-footer a {
    font-size: 13px;
    color: #1a73e8;
    text-decoration: none;
    font-weight: 500;
}

.widget-footer a:hover {
    text-decoration: underline;
}