/**
 * Frontend styles for Google Reviews
 */

/* Base Widget Styles */
.cgr-widget {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, Cantarell, sans-serif;
    max-width: 100%;
    margin: 20px 0;
}

/* Header Styles */
.cgr-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 20px;
    background: #fff;
    border-radius: 8px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.1);
    margin-bottom: 20px;
    flex-wrap: wrap;
    gap: 15px;
}

.cgr-header-left {
    display: flex;
    align-items: center;
    gap: 15px;
    flex-wrap: wrap;
}

.cgr-rating-badge {
    font-size: 18px;
    font-weight: 600;
    color: #1a1a1a;
}

.cgr-rating-number {
    font-size: 24px;
    font-weight: 700;
    color: #1a1a1a;
}

.cgr-google-info {
    display: flex;
    align-items: center;
    gap: 8px;
}

.cgr-google-logo {
    height: 20px;
    width: auto;
}

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

.cgr-write-review-btn {
    display: inline-block;
    padding: 10px 24px;
    background: #1a73e8;
    color: #fff !important;
    text-decoration: none !important;
    border-radius: 4px;
    font-weight: 500;
    font-size: 14px;
    transition: background 0.2s;
}

.cgr-write-review-btn:hover {
    background: #1557b0;
}

/* Stars */
.cgr-stars-container {
    display: inline-flex;
    gap: 2px;
}

.cgr-star {
    color: #fbbc04;
}

.cgr-star-empty {
    color: #e0e0e0;
}

.cgr-stars-small .cgr-star {
    font-size: 16px;
}

.cgr-stars-medium .cgr-star {
    font-size: 20px;
}

.cgr-stars-large .cgr-star {
    font-size: 24px;
}

/* Badge Layout */
.cgr-badge-widget {
    display: inline-block;
}

.cgr-badge-container {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 15px 20px;
    background: #fff;
    border-radius: 8px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.1);
    border-top: 3px solid #4285f4;
}

.cgr-badge-google-logo {
    height: 40px;
    width: auto;
}

.cgr-badge-title {
    font-size: 12px;
    color: #5f6368;
    margin-bottom: 4px;
}

.cgr-badge-rating {
    font-size: 20px;
    font-weight: 700;
    color: #1a1a1a;
    display: flex;
    align-items: center;
    gap: 8px;
}

.cgr-badge-reviews {
    font-size: 12px;
    color: #1a73e8;
    margin-top: 4px;
}

/* Grid Layout */
.cgr-reviews-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
    gap: 20px;
}

@media (max-width: 768px) {
    .cgr-reviews-grid {
        grid-template-columns: 1fr;
    }
}

/* List Layout */
.cgr-reviews-list {
    display: flex;
    flex-direction: column;
    gap: 15px;
}

.cgr-review-list {
    display: flex;
    gap: 15px;
}

/* Masonry Layout */
.cgr-reviews-masonry {
    column-count: 3;
    column-gap: 20px;
}

@media (max-width: 1024px) {
    .cgr-reviews-masonry {
        column-count: 2;
    }
}

@media (max-width: 768px) {
    .cgr-reviews-masonry {
        column-count: 1;
    }
}

.cgr-reviews-masonry .cgr-review-card {
    break-inside: avoid;
    margin-bottom: 20px;
}

/* Review Cards */
.cgr-review-card {
    background: #fff;
    border-radius: 8px;
    padding: 20px;
    box-shadow: 0 1px 3px rgba(0,0,0,0.1);
    transition: box-shadow 0.2s;
    display: flex;
    flex-direction: column;
    height: 100%;
    width: 100%;
    box-sizing: border-box;
}

.cgr-review-card:hover {
    box-shadow: 0 4px 12px rgba(0,0,0,0.15);
}

/* Make all cards in slider/carousel same height */
.cgr-slider-slide,
.cgr-carousel-slide {
    display: flex;
}

.cgr-slider-slide .cgr-review-card,
.cgr-carousel-slide .cgr-review-card {
    min-height: 280px;
}

.cgr-review-header {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 15px;
}

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

.cgr-review-author-info {
    flex: 1;
}

.cgr-review-author {
    font-weight: 600;
    color: #1a1a1a;
    font-size: 14px;
}

.cgr-review-date {
    font-size: 12px;
    color: #5f6368;
    margin-top: 2px;
}

.cgr-review-content {
    margin-bottom: 15px;
    flex-grow: 1;
}

.cgr-review-text {
    color: #3c4043;
    font-size: 14px;
    line-height: 1.6;
}

.cgr-read-more-btn {
    background: none;
    border: none;
    color: #1a73e8;
    cursor: pointer;
    font-size: 14px;
    font-weight: 500;
    padding: 5px 0;
    margin-top: 5px;
    text-decoration: none;
    display: inline-block;
}

.cgr-read-more-btn:hover {
    text-decoration: underline;
}

.cgr-review-footer {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.cgr-review-google-icon {
    height: 20px;
    width: auto;
    opacity: 0.7;
}

/* Slider Layout */
.cgr-slider-container {
    position: relative;
    overflow: hidden;
    padding: 0 50px;
}

.cgr-slider-track {
    display: flex;
    transition: transform 0.3s ease;
}

.cgr-slider-slide {
    min-width: 100%;
    padding: 0 10px;
}

.cgr-slider-prev,
.cgr-slider-next {
    position: absolute;
    top: calc(50% - 10px);
    transform: translateY(-50%);
    background: #fff;
    border: 1px solid #e0e0e0;
    border-radius: 50%;
    width: 40px;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    font-size: 40px;
    line-height: 0;
    color: #5f6368;
    z-index: 10;
    transition: all 0.2s;
    padding: 0;
    padding-bottom: 7px;
}

.cgr-slider-prev:hover,
.cgr-slider-next:hover {
    background: #f8f9fa;
    border-color: #5f6368;
}

.cgr-slider-prev {
    left: 0;
    padding-right: 3px;
}

.cgr-slider-next {
    right: 0;
    padding-left: 3px;
}

/* Carousel Layout */
.cgr-carousel-widget {
    position: relative;
}

.cgr-carousel-container {
    position: relative;
    overflow: hidden;
    padding: 0 50px;
    width: 100%;
    margin-top: 20px;
}

.cgr-carousel-track {
    display: flex;
    transition: transform 0.4s ease-in-out;
}

.cgr-carousel-page {
    min-width: 100%;
    max-width: 100%;
    flex-shrink: 0;
    display: flex;
    gap: 20px;
    padding: 0 5px;
    box-sizing: border-box;
}

.cgr-carousel-slide {
    flex: 1 1 0;
    min-width: 0;
    max-width: 33.333%;
    box-sizing: border-box;
}

@media (max-width: 1024px) {
    .cgr-carousel-slide {
        max-width: 50%;
    }
    
    .cgr-carousel-page {
        gap: 15px;
    }
}

@media (max-width: 768px) {
    .cgr-carousel-slide {
        max-width: 100%;
    }
    
    .cgr-carousel-page {
        gap: 10px;
    }
}

.cgr-carousel-prev,
.cgr-carousel-next {
    position: absolute;
    top: calc(50% - 10px);
    transform: translateY(-50%);
    background: #fff;
    border: 1px solid #e0e0e0;
    border-radius: 50%;
    width: 40px;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    font-size: 40px;
    line-height: 0;
    color: #5f6368;
    z-index: 10;
    transition: all 0.2s;
    padding: 0;
    padding-bottom: 7px;
}

.cgr-carousel-prev:hover,
.cgr-carousel-next:hover {
    background: #f8f9fa;
    border-color: #5f6368;
}

.cgr-carousel-prev:disabled,
.cgr-carousel-next:disabled {
    opacity: 0.3;
    cursor: not-allowed;
}

.cgr-carousel-prev:disabled:hover,
.cgr-carousel-next:disabled:hover {
    background: #fff;
    border-color: #e0e0e0;
}

.cgr-carousel-prev {
    left: 0;
    padding-right: 3px;
}

.cgr-carousel-next {
    right: 0;
    padding-left: 3px;
}

/* Mobile Responsive */
@media (max-width: 768px) {
    .cgr-header {
        flex-direction: column;
        align-items: flex-start;
    }
    
    .cgr-header-left {
        flex-direction: column;
        align-items: flex-start;
    }
    
    .cgr-slider-container,
    .cgr-carousel-container {
        padding: 0 35px;
    }
    
    .cgr-slider-prev,
    .cgr-slider-next,
    .cgr-carousel-prev,
    .cgr-carousel-next {
        width: 30px;
        height: 30px;
        font-size: 18px;
    }
}
