/**
 * Google Reviews Pro - Public Styles
 * Trustindex-Style Layout
 */

/* Variables */
:root {
    --grp-primary: #4285f4;
    --grp-star-color: #fbbc04;
    --grp-text-dark: #202124;
    --grp-text-gray: #5f6368;
    --grp-text-light: #9aa0a6;
    --grp-bg-light: #f1f3f4;
    --grp-bg-dark: #202124;
    --grp-border: #dadce0;
    --grp-white: #ffffff;
    --grp-shadow: 0 1px 3px rgba(0,0,0,0.08), 0 1px 2px rgba(0,0,0,0.04);
    --grp-shadow-lg: 0 4px 12px rgba(0,0,0,0.1);
    --grp-radius: 12px;
    --grp-radius-sm: 8px;
}

/* Container */
.grp-container {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, sans-serif;
    line-height: 1.5;
}

.grp-container * {
    box-sizing: border-box;
}

/* ========================================
   TRUSTINDEX-STYLE LAYOUT
   ======================================== */

.grp-trustindex-style {
    background: var(--grp-bg-light);
    border-radius: var(--grp-radius);
    padding: 20px;
    display: flex;
    gap: 20px;
    align-items: stretch;
}

.grp-theme-dark.grp-trustindex-style {
    background: #2a2a2a;
}

/* Layout Variations */
.grp-layout-with-aggregate {
    flex-direction: row;
}

.grp-layout-aggregate-top {
    flex-direction: column;
}

.grp-layout-slider-only {
    flex-direction: row;
}

.grp-layout-slider-only .grp-slider-section {
    flex: 1;
}

/* ========================================
   AGGREGATE SECTION (Left Side)
   ======================================== */

.grp-aggregate-section {
    flex: 0 0 200px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.grp-aggregate-inner {
    text-align: center;
    padding: 20px;
}

.grp-rating-label {
    font-size: 22px;
    font-weight: 700;
    color: var(--grp-text-dark);
    letter-spacing: 0.5px;
    margin-bottom: 12px;
}

.grp-theme-dark .grp-rating-label {
    color: var(--grp-white);
}

.grp-aggregate-stars {
    display: flex;
    justify-content: center;
    margin-bottom: 10px;
}

.grp-aggregate-stars .grp-stars {
    gap: 3px;
}

.grp-aggregate-stars .grp-star {
    width: 22px;
    height: 22px;
}

.grp-aggregate-meta {
    font-size: 13px;
    color: var(--grp-text-gray);
    margin-bottom: 15px;
}

.grp-aggregate-meta strong {
    color: var(--grp-primary);
    text-decoration: underline;
    cursor: pointer;
}

.grp-theme-dark .grp-aggregate-meta {
    color: var(--grp-text-light);
}

.grp-google-branding {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    font-size: 14px;
    font-weight: 500;
    color: var(--grp-text-dark);
    margin-bottom: 15px;
}

.grp-theme-dark .grp-google-branding {
    color: var(--grp-white);
}

.grp-google-icon {
    flex-shrink: 0;
}

.grp-write-review-btn {
    display: inline-block;
    padding: 10px 20px;
    background: var(--grp-primary);
    color: var(--grp-white);
    text-decoration: none;
    border-radius: 24px;
    font-size: 13px;
    font-weight: 500;
    transition: all 0.2s ease;
}

.grp-write-review-btn:hover {
    background: #3367d6;
    color: var(--grp-white);
    transform: translateY(-1px);
    box-shadow: var(--grp-shadow-lg);
}

/* ========================================
   SLIDER SECTION (Right Side)
   ======================================== */

.grp-slider-section {
    flex: 1;
    min-width: 0;
}

.grp-slider-wrapper {
    position: relative;
    padding: 0 50px;
}

.grp-slider {
    overflow: hidden;
}

.grp-slider .swiper-slide {
    height: auto;
}

/* Navigation Arrows */
.grp-slider-nav {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    width: 40px;
    height: 40px;
    background: var(--grp-white);
    border: 1px solid var(--grp-border);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    z-index: 10;
    transition: all 0.2s ease;
    box-shadow: var(--grp-shadow);
    color: var(--grp-text-gray);
}

.grp-slider-nav:hover {
    background: var(--grp-white);
    border-color: var(--grp-text-gray);
    color: var(--grp-text-dark);
}

.grp-slider-nav.swiper-button-disabled {
    opacity: 0.3;
    cursor: not-allowed;
}

.grp-slider-prev {
    left: 0;
}

.grp-slider-next {
    right: 0;
}

/* Pagination */
.grp-slider-pagination {
    text-align: center;
    margin-top: 20px;
}

.grp-slider-pagination .swiper-pagination-bullet {
    width: 8px;
    height: 8px;
    background: var(--grp-border);
    opacity: 1;
    margin: 0 4px;
    transition: all 0.2s ease;
}

.grp-slider-pagination .swiper-pagination-bullet-active {
    background: var(--grp-primary);
    width: 24px;
    border-radius: 4px;
}

/* ========================================
   REVIEW CARD
   ======================================== */

.grp-review-card {
    background: var(--grp-white);
    border-radius: var(--grp-radius);
    padding: 20px;
    box-shadow: var(--grp-shadow);
    height: 100%;
    display: flex;
    flex-direction: column;
    transition: all 0.3s ease;
    border: 1px solid rgba(0,0,0,0.04);
}

.grp-review-card:hover {
    box-shadow: var(--grp-shadow-lg);
}

.grp-theme-dark .grp-review-card {
    background: #333;
    border-color: #444;
}

/* Review Header */
.grp-review-header {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 12px;
}

.grp-reviewer-avatar-wrapper {
    flex-shrink: 0;
}

.grp-reviewer-avatar {
    width: 44px;
    height: 44px;
    border-radius: 50%;
    object-fit: cover;
}

.grp-reviewer-avatar-placeholder {
    width: 44px;
    height: 44px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--grp-white);
    font-size: 18px;
    font-weight: 600;
}

.grp-reviewer-info {
    flex: 1;
    min-width: 0;
}

.grp-reviewer-name {
    font-size: 15px;
    font-weight: 600;
    color: var(--grp-text-dark);
    margin: 0 0 2px;
    display: block;
    text-decoration: none;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.grp-reviewer-name:hover {
    color: var(--grp-primary);
}

.grp-theme-dark .grp-reviewer-name {
    color: var(--grp-white);
}

.grp-review-date {
    font-size: 12px;
    color: var(--grp-text-light);
    display: block;
}

/* Google Icon on Card */
.grp-google-icon-wrapper {
    flex-shrink: 0;
}

.grp-google-g-icon {
    display: block;
}

/* Rating Row */
.grp-review-rating-row {
    display: flex;
    align-items: center;
    gap: 6px;
    margin-bottom: 12px;
}

.grp-verified-icon {
    flex-shrink: 0;
}

/* Review Content */
.grp-review-content {
    flex: 1;
}

.grp-review-text {
    font-size: 14px;
    color: var(--grp-text-gray);
    line-height: 1.6;
    margin: 0;
    display: -webkit-box;
    -webkit-line-clamp: 4;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.grp-theme-dark .grp-review-text {
    color: #b8b8b8;
}

.grp-read-more,
.grp-read-less {
    display: inline;
    color: var(--grp-primary);
    cursor: pointer;
    font-weight: 500;
}

.grp-read-more:hover,
.grp-read-less:hover {
    text-decoration: underline;
}

/* ========================================
   STARS
   ======================================== */

.grp-stars {
    display: inline-flex;
    gap: 2px;
}

.grp-star {
    width: 18px;
    height: 18px;
    fill: var(--grp-border);
}

.grp-star-full {
    fill: var(--grp-star-color);
}

.grp-star-half {
    fill: url(#grp-star-gradient);
}

.grp-stars-small .grp-star,
.grp-stars-small .grp-stars .grp-star {
    width: 16px;
    height: 16px;
}

/* ========================================
   BADGE
   ======================================== */

.grp-badge {
    display: inline-flex;
    align-items: center;
    gap: 12px;
    padding: 15px 20px;
    background: var(--grp-white);
    border-radius: var(--grp-radius);
    box-shadow: var(--grp-shadow);
    text-decoration: none;
    transition: all 0.2s ease;
    border: 1px solid var(--grp-border);
}

.grp-badge:hover {
    box-shadow: var(--grp-shadow-lg);
    transform: translateY(-2px);
}

.grp-badge-google-icon {
    flex-shrink: 0;
}

.grp-badge-info {
    display: flex;
    flex-direction: column;
}

.grp-badge-rating {
    display: flex;
    align-items: center;
    gap: 8px;
}

.grp-badge-number {
    font-size: 24px;
    font-weight: 600;
    color: var(--grp-text-dark);
    line-height: 1;
}

.grp-badge-count {
    font-size: 12px;
    color: var(--grp-text-gray);
    margin-top: 4px;
}

/* ========================================
   STATS WIDGET
   ======================================== */

.grp-stats-widget {
    background: var(--grp-white);
    border-radius: var(--grp-radius);
    padding: 25px;
    box-shadow: var(--grp-shadow);
    border: 1px solid var(--grp-border);
}

.grp-theme-dark.grp-stats-widget {
    background: var(--grp-bg-dark);
    border-color: #444;
}

.grp-stats-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 20px;
}

.grp-stats-rating {
    text-align: center;
}

.grp-stats-number {
    font-size: 48px;
    font-weight: 600;
    color: var(--grp-text-dark);
    line-height: 1;
    display: block;
    margin-bottom: 8px;
}

.grp-theme-dark .grp-stats-number {
    color: var(--grp-white);
}

.grp-stats-count {
    font-size: 13px;
    color: var(--grp-text-gray);
    display: block;
    margin-top: 8px;
}

.grp-stats-breakdown {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.grp-stats-bar {
    display: flex;
    align-items: center;
    gap: 10px;
}

.grp-stats-bar-label {
    width: 40px;
    font-size: 13px;
    color: var(--grp-text-gray);
}

.grp-stats-bar-track {
    flex: 1;
    height: 8px;
    background: var(--grp-bg-light);
    border-radius: 4px;
    overflow: hidden;
}

.grp-stats-bar-fill {
    height: 100%;
    background: var(--grp-star-color);
    border-radius: 4px;
    transition: width 0.5s ease;
}

.grp-stats-bar-count {
    width: 30px;
    text-align: right;
    font-size: 13px;
    color: var(--grp-text-gray);
}

/* ========================================
   GRID LAYOUT
   ======================================== */

.grp-grid {
    display: grid;
    gap: 20px;
}

.grp-grid-cols-2 {
    grid-template-columns: repeat(2, 1fr);
}

.grp-grid-cols-3 {
    grid-template-columns: repeat(3, 1fr);
}

.grp-grid-cols-4 {
    grid-template-columns: repeat(4, 1fr);
}

/* ========================================
   LIST LAYOUT
   ======================================== */

.grp-list {
    display: flex;
    flex-direction: column;
    gap: 20px;
}

.grp-list .grp-review-card {
    flex-direction: row;
    gap: 20px;
}

.grp-list .grp-review-header {
    flex-direction: column;
    align-items: center;
    text-align: center;
    margin-bottom: 0;
    min-width: 150px;
}

.grp-list .grp-review-content {
    border-left: 1px solid var(--grp-border);
    padding-left: 20px;
}

/* ========================================
   NO REVIEWS MESSAGE
   ======================================== */

.grp-no-reviews {
    text-align: center;
    padding: 40px 20px;
    color: var(--grp-text-gray);
    font-style: italic;
}

/* ========================================
   ANIMATIONS
   ======================================== */

@keyframes grp-fade-in {
    from {
        opacity: 0;
        transform: translateY(10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.grp-review-card {
    animation: grp-fade-in 0.4s ease forwards;
}

/* ========================================
   RESPONSIVE STYLES
   ======================================== */

@media (max-width: 1024px) {
    .grp-grid-cols-4 {
        grid-template-columns: repeat(3, 1fr);
    }
    
    .grp-aggregate-section {
        flex: 0 0 180px;
    }
}

@media (max-width: 768px) {
    /* Switch to vertical layout on tablet */
    .grp-trustindex-style,
    .grp-layout-with-aggregate {
        flex-direction: column;
    }
    
    .grp-aggregate-section {
        flex: none;
        width: 100%;
    }
    
    .grp-aggregate-inner {
        padding: 15px;
    }
    
    .grp-slider-wrapper {
        padding: 0 45px;
    }
    
    .grp-grid-cols-3,
    .grp-grid-cols-4 {
        grid-template-columns: repeat(2, 1fr);
    }
    
    .grp-list .grp-review-card {
        flex-direction: column;
    }
    
    .grp-list .grp-review-header {
        flex-direction: row;
        text-align: left;
    }
    
    .grp-list .grp-review-content {
        border-left: none;
        padding-left: 0;
        border-top: 1px solid var(--grp-border);
        padding-top: 15px;
    }
}

@media (max-width: 576px) {
    .grp-trustindex-style {
        padding: 15px;
    }
    
    .grp-slider-wrapper {
        padding: 0;
    }
    
    .grp-slider-nav {
        display: none;
    }
    
    .grp-rating-label {
        font-size: 18px;
    }
    
    .grp-aggregate-stars .grp-star {
        width: 18px;
        height: 18px;
    }
    
    .grp-grid-cols-2,
    .grp-grid-cols-3,
    .grp-grid-cols-4 {
        grid-template-columns: 1fr;
    }
    
    .grp-badge {
        width: 100%;
        justify-content: center;
    }
}

/* Legacy Header Styles (for backwards compatibility) */
.grp-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 25px;
    padding: 20px;
    background: var(--grp-white);
    border-radius: var(--grp-radius);
    box-shadow: var(--grp-shadow);
}

.grp-theme-dark .grp-header {
    background: var(--grp-bg-dark);
}

.grp-header-info {
    display: flex;
    align-items: center;
    gap: 20px;
}

.grp-google-logo {
    height: 40px;
    width: auto;
}

.grp-header-rating {
    display: flex;
    flex-direction: column;
}

.grp-rating-large {
    display: flex;
    align-items: center;
    gap: 8px;
}

.grp-rating-number {
    font-size: 36px;
    font-weight: 500;
    color: var(--grp-text-dark);
    line-height: 1;
}

.grp-theme-dark .grp-rating-number {
    color: var(--grp-white);
}

.grp-rating-count {
    font-size: 14px;
    color: var(--grp-text-gray);
    margin-top: 4px;
}

.grp-theme-dark .grp-rating-count {
    color: var(--grp-text-light);
}

.grp-write-review {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 12px 24px;
    background: var(--grp-primary);
    color: var(--grp-white);
    text-decoration: none;
    border-radius: 24px;
    font-size: 14px;
    font-weight: 500;
    transition: all 0.2s ease;
}

.grp-write-review:hover {
    background: #3367d6;
    color: var(--grp-white);
    transform: translateY(-1px);
    box-shadow: var(--grp-shadow-lg);
}

@media (max-width: 576px) {
    .grp-header {
        flex-direction: column;
        text-align: center;
        gap: 15px;
    }
    
    .grp-header-info {
        flex-direction: column;
    }
}