/**
 * Google Business Reviews - Frontend Styles
 * File: assets/css/gbr-styles.css
 */

/* ==========================================================================
   Grid Layout
   ========================================================================== */

.gbr-reviews-grid {
    display: grid;
    gap: 30px;
    margin: 30px 0;
}

.gbr-reviews-grid.gbr-columns-1 {
    grid-template-columns: 1fr;
}

.gbr-reviews-grid.gbr-columns-2 {
    grid-template-columns: repeat(2, 1fr);
}

.gbr-reviews-grid.gbr-columns-3 {
    grid-template-columns: repeat(3, 1fr);
}

.gbr-reviews-grid.gbr-columns-4 {
    grid-template-columns: repeat(4, 1fr);
}

.gbr-reviews-grid.gbr-columns-5 {
    grid-template-columns: repeat(5, 1fr);
}

.gbr-reviews-grid.gbr-columns-6 {
    grid-template-columns: repeat(6, 1fr);
}

@media (max-width: 1024px) {
    .gbr-reviews-grid.gbr-columns-4,
    .gbr-reviews-grid.gbr-columns-5,
    .gbr-reviews-grid.gbr-columns-6 {
        grid-template-columns: repeat(3, 1fr);
    }
}

@media (max-width: 768px) {
    .gbr-reviews-grid.gbr-columns-3,
    .gbr-reviews-grid.gbr-columns-4,
    .gbr-reviews-grid.gbr-columns-5,
    .gbr-reviews-grid.gbr-columns-6 {
        grid-template-columns: repeat(2, 1fr);
    }
}

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

/* ==========================================================================
   Review Card
   ========================================================================== */

.gbr-review-card {
    background: #fff;
    border: 1px solid #e5e5e5;
    border-radius: 8px;
    padding: 24px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.05);
    transition: transform 0.2s ease, box-shadow 0.2s ease;
    display: flex;
    flex-direction: column;
    height: 100%;
}

.gbr-review-card:hover {
    transform: translateY(-4px);
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.1);
}

.gbr-review-header {
    display: flex;
    align-items: flex-start;
    gap: 12px;
    margin-bottom: 16px;
}

.gbr-reviewer-photo {
    width: 48px;
    height: 48px;
    border-radius: 50%;
    object-fit: cover;
    flex-shrink: 0;
}

.gbr-reviewer-placeholder {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: #fff;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 600;
    font-size: 20px;
}

.gbr-reviewer-info {
    flex: 1;
    min-width: 0;
}

.gbr-reviewer-name {
    margin: 0 0 4px 0;
    font-size: 16px;
    font-weight: 600;
    line-height: 1.3;
}

.gbr-reviewer-name a {
    color: inherit;
    text-decoration: none;
}

.gbr-reviewer-name a:hover {
    text-decoration: underline;
}

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

.gbr-review-date {
    color: #666;
    font-size: 13px;
}

.gbr-review-content {
    flex: 1;
    margin: 0 0 16px 0;
    color: #333;
    line-height: 1.6;
    font-size: 14px;
}

.gbr-review-footer {
    display: flex;
    justify-content: flex-end;
    margin-top: auto;
}

.gbr-source-badge {
    display: inline-flex;
    align-items: center;
    opacity: 0.7;
    transition: opacity 0.2s ease;
}

.gbr-source-badge:hover {
    opacity: 1;
}

.gbr-source-icon {
    width: 18px;
    height: 18px;
    display: block;
}

/* Different badge positions in list view */
.gbr-review-header-inline .gbr-source-badge {
    margin-left: auto;
}

.screen-reader-text {
    clip: rect(1px, 1px, 1px, 1px);
    clip-path: inset(50%);
    height: 1px;
    width: 1px;
    margin: -1px;
    overflow: hidden;
    padding: 0;
    position: absolute;
    word-wrap: normal;
}

/* ==========================================================================
   List Layout
   ========================================================================== */

.gbr-reviews-list {
    margin: 30px 0;
}

.gbr-review-list-item {
    background: #fff;
    border: 1px solid #e5e5e5;
    border-radius: 8px;
    padding: 24px;
    margin-bottom: 20px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.05);
}

.gbr-review-main {
    display: flex;
    gap: 16px;
}

.gbr-review-body {
    flex: 1;
    min-width: 0;
}

.gbr-review-header-inline {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 12px;
    flex-wrap: wrap;
}

.gbr-review-header-inline .gbr-reviewer-name {
    margin: 0;
    font-size: 16px;
}

.gbr-review-response {
    margin-top: 16px;
    padding: 16px;
    background: #f8f9fa;
    border-left: 3px solid #4285f4;
    border-radius: 4px;
}

.gbr-review-response strong {
    display: block;
    margin-bottom: 8px;
    color: #4285f4;
    font-size: 13px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

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

/* ==========================================================================
   Star Rating
   ========================================================================== */

.gbr-stars {
    display: inline-flex;
    gap: 2px;
    color: #ffa500;
    font-size: 18px;
    line-height: 1;
}

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

.gbr-star-filled {
    color: #ffa500;
}

.gbr-star-empty {
    color: #ddd;
}

.gbr-rating {
    display: inline-flex;
    align-items: center;
}

/* ==========================================================================
   Aggregate Rating
   ========================================================================== */

.gbr-aggregate-rating {
    display: inline-flex;
    align-items: center;
    gap: 12px;
    padding: 16px 24px;
    background: #fff;
    border: 1px solid #e5e5e5;
    border-radius: 8px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.05);
}

.gbr-aggregate-stars {
    display: flex;
}

.gbr-aggregate-score {
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.gbr-rating-number {
    font-size: 24px;
    font-weight: 700;
    line-height: 1;
    color: #333;
}

.gbr-rating-count {
    font-size: 13px;
    color: #666;
}

/* ==========================================================================
   Slider Layout
   ========================================================================== */

.gbr-reviews-slider-wrapper {
    position: relative;
    margin: 30px 0;
    padding: 0 50px;
}

.gbr-reviews-slider {
    overflow: hidden;
    position: relative;
}

.gbr-slide {
    display: none;
    animation: fadeIn 0.5s ease;
}

.gbr-slide.active {
    display: block;
}

@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateX(20px);
    }
    to {
        opacity: 1;
        transform: translateX(0);
    }
}

.gbr-review-slide-card {
    background: #fff;
    border: 1px solid #e5e5e5;
    border-radius: 8px;
    padding: 32px;
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.08);
    max-width: 800px;
    margin: 0 auto;
    min-height: 250px;
    display: flex;
    flex-direction: column;
}

.gbr-slide-rating {
    margin-bottom: 16px;
}

.gbr-slide-content {
    flex: 1;
    margin-bottom: 20px;
    color: #333;
    line-height: 1.8;
    font-size: 16px;
}

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

.gbr-slide-reviewer {
    display: flex;
    align-items: center;
    gap: 12px;
}

.gbr-reviewer-photo-small {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    object-fit: cover;
}

.gbr-slide-date {
    display: block;
    color: #666;
    font-size: 13px;
    margin-top: 2px;
}

.gbr-slider-prev,
.gbr-slider-next {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    background: #fff;
    border: 1px solid #e5e5e5;
    border-radius: 50%;
    width: 40px;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    font-size: 24px;
    color: #333;
    transition: all 0.2s ease;
    z-index: 10;
}

.gbr-slider-prev:hover,
.gbr-slider-next:hover {
    background: #f8f9fa;
    border-color: #ddd;
}

.gbr-slider-prev {
    left: 0;
}

.gbr-slider-next {
    right: 0;
}

.gbr-slider-dots {
    display: flex;
    justify-content: center;
    gap: 8px;
    margin-top: 20px;
}

.gbr-slider-dot {
    width: 10px;
    height: 10px;
    border-radius: 50%;
    background: #ddd;
    border: none;
    cursor: pointer;
    padding: 0;
    transition: all 0.2s ease;
}

.gbr-slider-dot:hover {
    background: #bbb;
}

.gbr-slider-dot.active {
    background: #4285f4;
    width: 24px;
    border-radius: 5px;
}

/* ==========================================================================
   Utility Classes
   ========================================================================== */

.gbr-no-reviews {
    text-align: center;
    padding: 40px 20px;
    color: #666;
    font-style: italic;
}

.gbr-read-more-btn {
    background: none;
    border: none;
    color: #4285f4;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    padding: 8px 0 0 0;
    margin: 0;
    text-decoration: none;
    display: inline-block;
    transition: color 0.2s ease;
}

.gbr-read-more-btn:hover {
    color: #1a73e8;
    text-decoration: underline;
}

.gbr-read-more-btn:focus {
    outline: 2px solid #4285f4;
    outline-offset: 2px;
}

.gbr-review-content.gbr-has-readmore {
    position: relative;
}

.gbr-review-excerpt {
    margin-bottom: 4px;
}

.gbr-review-full {
    animation: fadeIn 0.3s ease;
}

@keyframes fadeIn {
    from {
        opacity: 0;
    }
    to {
        opacity: 1;
    }
}

/* ==========================================================================
   Responsive
   ========================================================================== */

@media (max-width: 768px) {
    .gbr-reviews-slider-wrapper {
        padding: 0 40px;
    }
    
    .gbr-review-slide-card {
        padding: 24px;
        min-height: 200px;
    }
    
    .gbr-slide-content {
        font-size: 15px;
    }
    
    .gbr-slider-prev,
    .gbr-slider-next {
        width: 36px;
        height: 36px;
        font-size: 20px;
    }
}

@media (max-width: 480px) {
    .gbr-reviews-grid {
        grid-template-columns: 1fr !important;
        gap: 20px;
    }
    
    .gbr-review-card {
        padding: 20px;
    }
    
    .gbr-review-list-item {
        padding: 20px;
    }
    
    .gbr-review-main {
        flex-direction: column;
    }
    
    .gbr-reviews-slider-wrapper {
        padding: 0 30px;
    }
    
    .gbr-review-header-inline {
        flex-direction: column;
        align-items: flex-start;
    }
}