/**
 * Google Reviews Display - Frontend Styles
 * Responsiiviset tyylit
 */

/* Variables */
:root {
    --grd-primary: #4285f4;
    --grd-secondary: #34a853;
    --grd-tertiary: #fbbc04;
    --grd-quaternary: #ea4335;
    --grd-text: #202124;
    --grd-text-secondary: #5f6368;
    --grd-bg: #ffffff;
    --grd-border: #dadce0;
    --grd-shadow: 0 1px 3px rgba(60, 64, 67, 0.3);
    --grd-shadow-hover: 0 4px 12px rgba(60, 64, 67, 0.15);
    --grd-radius: 16px;
    --grd-font: 'Google Sans', Roboto, Arial, sans-serif;
}

/* Container */
.grd-reviews-container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 40px 20px;
    font-family: var(--grd-font);
    color: var(--grd-text);
}

/* Header / Business Info */
.grd-business-info {
    background: var(--grd-bg);
    border-radius: var(--grd-radius);
    padding: 32px;
    margin-bottom: 40px;
    box-shadow: var(--grd-shadow);
    border: 1px solid var(--grd-border);
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
    position: relative;
    overflow: hidden;
}

/* Top colored bar */
.grd-business-info::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 6px;
    background: linear-gradient(90deg, var(--grd-primary) 25%, var(--grd-quaternary) 25% 50%, var(--grd-tertiary) 50% 75%, var(--grd-secondary) 75%);
}

.grd-title {
    font-size: 24px;
    font-weight: 500;
    margin: 0 0 24px 0;
    color: var(--grd-text);
    text-align: center; /* Centered title */
}

.grd-business-header {
    margin-bottom: 20px;
}

.grd-business-name {
    font-size: 2rem;
    font-weight: 400;
    margin: 0 0 8px 0;
    letter-spacing: -0.5px;
}

.grd-business-rating {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 8px;
}

.grd-rating-large {
    display: flex;
    align-items: center;
    gap: 12px;
}

.grd-rating-number {
    font-size: 3.5rem;
    font-weight: 400;
    color: var(--grd-text);
    line-height: 1;
}

.grd-total-ratings {
    color: var(--grd-text-secondary);
    font-size: 0.9rem;
}

/* Slider Styles */
.grd-slider-wrapper {
    position: relative;
    margin-bottom: 40px;
    display: flex;
    align-items: center;
    gap: 16px;
}

.grd-slider-track {
    display: flex !important; /* Force flex to keep items in row */
    flex-wrap: nowrap !important; /* Force single row */
    overflow-x: auto;
    scroll-snap-type: x mandatory;
    gap: 24px;
    padding: 20px 4px;
    width: 100%;
    scrollbar-width: none;
    -ms-overflow-style: none;
    scroll-behavior: smooth;
    align-items: stretch; /* Keep cards same height */
}

.grd-slider-track::-webkit-scrollbar { 
    display: none;  /* Chrome Safari */
}

/* Navigation Arrows */
.grd-slider-arrow {
    background: #fff;
    border: 1px solid var(--grd-border);
    border-radius: 50%;
    width: 48px; /* Increased size */
    height: 48px; /* Increased size */
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    box-shadow: var(--grd-shadow);
    transition: all 0.2s ease;
    flex-shrink: 0;
    z-index: 2;
}

.grd-slider-arrow:hover {
    background: #f1f3f4;
    box-shadow: var(--grd-shadow-hover);
}

.grd-slider-arrow svg {
    fill: var(--grd-text-secondary);
    transition: fill 0.2s ease;
}

.grd-slider-arrow:hover svg {
    fill: var(--grd-text);
}

.grd-slider-prev {
    order: 0;
}

.grd-slider-next {
    order: 2;
}

.grd-slider-track {
    order: 1;
}


/* Review Card */
.grd-review-card {
    /* Default: 3 visible items with gaps. 
       Formula: (100% - (gaps * (visible_items - 1))) / visible_items 
       (100% - 48px) / 3 = ~calc(33.333% - 16px)
    */
    flex: 0 0 calc(33.333% - 16px) !important;
    width: calc(33.333% - 16px) !important;
    max-width: calc(33.333% - 16px) !important;
    scroll-snap-align: start;
    
    background: var(--grd-bg);
    border: 1px solid var(--grd-border);
    border-radius: var(--grd-radius);
    padding: 24px;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    box-shadow: none;
    display: flex;
    flex-direction: column;
    height: auto;
    min-height: 250px;
    margin: 0 !important; /* Prevent external margins */
}

.grd-review-card:hover {
    box-shadow: var(--grd-shadow-hover);
    transform: translateY(-4px);
    border-color: transparent;
}

/* Author Info */
.grd-review-header {
    margin-bottom: 16px;
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
}

.grd-author-info {
    display: flex;
    align-items: center;
    gap: 16px;
}

.grd-author-photo {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    object-fit: cover;
}

.grd-author-placeholder {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background-color: var(--grd-primary);
    color: #fff;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 18px;
    font-weight: 500;
}

.grd-author-details {
    display: flex;
    flex-direction: column;
}

.grd-author-name {
    font-weight: 500;
    font-size: 0.95rem;
    color: var(--grd-text);
    text-decoration: none;
    margin-bottom: 2px;
}

.grd-google-icon {
    width: 20px;
    height: 20px;
    opacity: 1;
}

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

.grd-review-time {
    color: var(--grd-text-secondary);
    font-size: 0.8rem;
}

/* Stars */
.grd-stars {
    display: inline-flex;
    gap: 1px;
    color: var(--grd-tertiary);
}

.grd-star {
    font-size: 1.25rem;
}

.grd-stars-small .grd-star {
    font-size: 0.9rem;
}

/* Content */
.grd-review-text {
    font-size: 0.95rem;
    line-height: 1.6;
    color: var(--grd-text);
    flex-grow: 1; /* Pushes footer down if needed */
}

.grd-read-more {
    background: none;
    border: none;
    color: var(--grd-primary);
    padding: 0;
    font-weight: 500;
    cursor: pointer;
    margin-top: 8px;
    font-size: 0.9rem;
}

/* Footer Buttons */
.grd-footer {
    text-align: center;
}

.grd-view-all-button {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 12px 32px;
    background-color: #fff;
    color: var(--grd-primary);
    border: 1px solid var(--grd-border);
    border-radius: 24px;
    font-weight: 500;
    text-decoration: none;
    transition: all 0.2s ease;
    box-shadow: 0 1px 2px rgba(60,64,67,0.3);
}

.grd-view-all-button:hover {
    background-color: #f8f9fa;
    box-shadow: 0 1px 3px rgba(60,64,67,0.3), 0 4px 8px 3px rgba(60,64,67,0.15);
    transform: translateY(-1px);
}

/* Responsive */

/* Tablet: 2 visible */
@media (max-width: 992px) {
    .grd-review-card {
        flex: 0 0 calc(50% - 12px) !important;
        width: calc(50% - 12px) !important;
        max-width: calc(50% - 12px) !important;
    }
}

/* Mobile: 1 visible */
@media (max-width: 600px) {
    .grd-review-card {
        flex: 0 0 100% !important;
        width: 100% !important;
        max-width: 100% !important;
    }
    
    .grd-slider-wrapper {
        position: relative;
    }

    .grd-slider-arrow {
        position: absolute;
        top: 50%;
        transform: translateY(-50%);
        background: rgba(255, 255, 255, 0.9);
    }

    .grd-slider-prev {
        left: -10px;
    }

    .grd-slider-next {
        right: -10px;
    }
    
    .grd-business-info {
        padding: 24px;
    }

    .grd-business-name {
        font-size: 1.5rem;
    }

    .grd-rating-number {
        font-size: 2.5rem;
    }
}

/* Dark Mode */
@media (prefers-color-scheme: dark) {
    :root {
        --grd-bg: #202124;
        --grd-text: #e8eaed;
        --grd-text-secondary: #9aa0a6;
        --grd-border: #3c4043;
    }

    .grd-slider-arrow {
        background: #303134;
        border-color: #5f6368;
    }

    .grd-slider-arrow:hover {
        background: #3c4043;
    }

    .grd-view-all-button {
        background-color: #303134;
        color: #8ab4f8;
        border-color: #5f6368;
    }

    .grd-view-all-button:hover {
        background-color: #3c4043;
    }
}
