/**
 * Atomic Google Reviews - Frontend Styles
 * Professional, neutral/Google-themed styling
 * @version 1.0.0
 */

/* ==========================================================================
   Base Container
   ========================================================================== */

.aigr-reviews,
.aigr-wrapper {
    max-width: 100%;
    box-sizing: border-box;
}

/* ==========================================================================
   Stars
   ========================================================================== */

.aigr-stars {
    display: inline-flex;
    gap: 1px;
    line-height: 1;
}

.aigr-star {
    font-size: 18px;
    line-height: 1;
}

.aigr-star--full {
    color: #fbbc04;
}

.aigr-star--half {
    color: #fbbc04;
    position: relative;
}

.aigr-star--empty {
    color: #dadce0;
}

/* ==========================================================================
   Intro Block (Google badge header)
   ========================================================================== */

.aigr-intro {
    display: flex;
    align-items: center;
    justify-content: space-between;
    background: #fff;
    border: 1px solid #e0e0e0;
    border-radius: 12px;
    padding: 20px 24px;
    margin-bottom: 24px;
    box-shadow: 0 1px 4px rgba(0, 0, 0, 0.06);
    gap: 16px;
    flex-wrap: wrap;
}

.aigr-intro__left {
    display: flex;
    align-items: center;
    gap: 14px;
}

.aigr-intro__info {
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.aigr-intro__rating-row {
    display: flex;
    align-items: center;
    gap: 8px;
}

.aigr-intro__score {
    font-size: 1.75em;
    font-weight: 700;
    color: #202124;
    line-height: 1;
}

.aigr-intro__stars .aigr-star {
    font-size: 20px;
}

.aigr-intro__count {
    color: #5f6368;
    font-size: 0.9em;
    line-height: 1.3;
}

.aigr-intro__link {
    display: inline-flex;
    align-items: center;
    padding: 8px 20px;
    border: 1px solid #dadce0;
    border-radius: 20px;
    color: #1a73e8;
    text-decoration: none;
    font-size: 0.9em;
    font-weight: 500;
    transition: all 0.2s;
    white-space: nowrap;
}

.aigr-intro__link:hover {
    background: #f8f9fa;
    border-color: #1a73e8;
    color: #1a73e8;
}

/* ==========================================================================
   Intro Card (left position)
   ========================================================================== */

.aigr-wrapper--left {
    display: flex;
    gap: 20px;
    align-items: flex-start;
}

.aigr-wrapper--left > .aigr-reviews {
    flex: 1;
    min-width: 0;
}

.aigr-intro--card {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    text-align: center;
    background: #fff;
    border: 1px solid #e0e0e0;
    border-radius: 12px;
    padding: 32px 28px;
    box-shadow: 0 1px 4px rgba(0, 0, 0, 0.06);
    gap: 8px;
    flex-shrink: 0;
    width: 220px;
}

.aigr-intro--card .aigr-intro__score {
    font-size: 2.8em;
    font-weight: 700;
    color: #202124;
    line-height: 1;
    margin-top: 4px;
}

.aigr-intro--card .aigr-intro__stars .aigr-star {
    font-size: 22px;
}

.aigr-intro--card .aigr-intro__count {
    color: #5f6368;
    font-size: 0.85em;
    line-height: 1.4;
    margin-top: 2px;
}

.aigr-intro--card .aigr-intro__link {
    margin-top: 8px;
}

@media (max-width: 768px) {
    .aigr-wrapper--left {
        flex-direction: column;
    }

    .aigr-intro--card {
        width: 100%;
        min-height: auto;
        flex-direction: row;
        flex-wrap: wrap;
        justify-content: center;
        padding: 16px 20px;
        gap: 6px 14px;
    }

    .aigr-intro--card .aigr-intro__score {
        font-size: 1.75em;
    }

    .aigr-intro--card .aigr-intro__stars .aigr-star {
        font-size: 18px;
    }
}

/* ==========================================================================
   Review Card (shared)
   ========================================================================== */

.aigr-review {
    position: relative;
}

.aigr-review__header {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 10px;
}

.aigr-review__avatar {
    width: 44px;
    height: 44px;
    border-radius: 50%;
    object-fit: cover;
    flex-shrink: 0;
}

.aigr-review__avatar--placeholder {
    background: linear-gradient(135deg, #e8eaed 0%, #d2d5db 100%);
    color: #5f6368;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 600;
    font-size: 17px;
    text-transform: uppercase;
}

.aigr-review__meta {
    display: flex;
    flex-direction: column;
    gap: 1px;
}

.aigr-review__author {
    font-weight: 600;
    color: #202124;
    font-size: 0.95em;
    line-height: 1.3;
}

.aigr-review__date {
    color: #70757a;
    font-size: 0.8em;
    line-height: 1.3;
}

.aigr-review__stars {
    margin-bottom: 10px;
}

.aigr-review__text {
    color: #3c4043;
    line-height: 1.65;
    font-size: 0.95em;
    position: relative;
}

.aigr-review__text-inner {
    overflow: hidden;
    display: -webkit-box;
    -webkit-box-orient: vertical;
    -webkit-line-clamp: 4;
}

.aigr-review__text-inner.aigr-review__text-inner--expanded {
    -webkit-line-clamp: unset;
    display: block;
}

.aigr-review__read-more {
    display: inline-block;
    margin-top: 6px;
    color: #1a73e8;
    font-size: 0.85em;
    font-weight: 500;
    cursor: pointer;
    border: none;
    background: none;
    padding: 0;
    text-decoration: none;
    transition: color 0.2s;
}

.aigr-review__read-more:hover {
    color: #1558b0;
    text-decoration: underline;
}

.aigr-review__text p {
    margin: 0 0 8px;
}

.aigr-review__text p:last-child {
    margin-bottom: 0;
}

/* ==========================================================================
   Layout: Cards (stacked)
   ========================================================================== */

.aigr-reviews--cards {
    display: flex;
    flex-direction: column;
    gap: 16px;
}

.aigr-reviews--cards .aigr-review {
    background: #fff;
    border: 1px solid #e0e0e0;
    border-radius: 12px;
    padding: 24px;
    box-shadow: 0 1px 4px rgba(0, 0, 0, 0.05);
    transition: box-shadow 0.2s;
}

.aigr-reviews--cards .aigr-review:hover {
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}

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

.aigr-reviews--grid {
    display: grid;
    grid-template-columns: repeat(var(--aigr-grid-columns, 3), 1fr);
    gap: 20px;
}

.aigr-reviews--grid .aigr-review {
    background: #fff;
    border: 1px solid #e0e0e0;
    border-radius: 12px;
    padding: 24px;
    box-shadow: 0 1px 4px rgba(0, 0, 0, 0.05);
    transition: box-shadow 0.2s;
    display: flex;
    flex-direction: column;
}

.aigr-reviews--grid .aigr-review:hover {
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}

.aigr-reviews--grid .aigr-review__text {
    flex: 1;
}

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

.aigr-reviews--list .aigr-review {
    padding: 20px 0;
    border-bottom: 1px solid #e8e8e8;
}

.aigr-reviews--list .aigr-review:last-child {
    border-bottom: none;
}

/* ==========================================================================
   Layout: Minimal
   ========================================================================== */

.aigr-reviews--minimal .aigr-review {
    padding: 14px 0;
}

.aigr-reviews--minimal .aigr-review__avatar {
    display: none;
}

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

.aigr-reviews--slider {
    position: relative;
    max-width: 100%;
    overflow: hidden;
}

.aigr-slider__viewport {
    overflow: hidden;
    border-radius: 12px;
    max-width: 100%;
    /* Touch scrolling */
    -webkit-overflow-scrolling: touch;
}

.aigr-slider__track {
    display: flex;
    gap: 20px;
    transition: transform 0.4s cubic-bezier(0.25, 0.46, 0.45, 0.94);
    /* Enable touch drag */
    touch-action: pan-y;
    cursor: grab;
}

.aigr-slider__track:active {
    cursor: grabbing;
}

.aigr-slider__track .aigr-review {
    flex: 0 0 calc((100% - (var(--aigr-show, 1) - 1) * 20px) / var(--aigr-show, 1));
    min-width: 0;
    background: #fff;
    border: 1px solid #e0e0e0;
    border-radius: 12px;
    padding: 24px;
    box-shadow: 0 1px 4px rgba(0, 0, 0, 0.05);
    transition: box-shadow 0.2s;
    display: flex;
    flex-direction: column;
}

.aigr-slider__track .aigr-review:hover {
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}

.aigr-slider__track .aigr-review__text {
    flex: 1;
}

/* Controls */

.aigr-slider__controls {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 12px;
    margin-top: 20px;
}

.aigr-slider__arrow {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 40px;
    height: 40px;
    border-radius: 50%;
    border: 1px solid #dadce0;
    background: #fff;
    color: #5f6368;
    cursor: pointer;
    transition: all 0.2s;
    padding: 0;
    flex-shrink: 0;
}

.aigr-slider__arrow:hover {
    background: #f1f3f4;
    border-color: #bdc1c6;
    color: #202124;
}

.aigr-slider__arrow:active {
    background: #e8eaed;
}

.aigr-slider__arrow[disabled] {
    opacity: 0.35;
    cursor: default;
    pointer-events: none;
}

.aigr-slider__dots {
    display: flex;
    gap: 8px;
    align-items: center;
}

.aigr-slider__dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    border: none;
    background: #dadce0;
    padding: 0;
    cursor: pointer;
    transition: all 0.2s;
}

.aigr-slider__dot--active {
    background: #1a73e8;
    transform: scale(1.25);
}

.aigr-slider__dot:hover:not(.aigr-slider__dot--active) {
    background: #bdc1c6;
}

/* ==========================================================================
   Attribution
   ========================================================================== */

.aigr-reviews__attribution {
    margin-top: 16px;
    padding-top: 12px;
    border-top: 1px solid #e8e8e8;
    text-align: right;
}

.aigr-google-link {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    color: #70757a;
    text-decoration: none;
    font-size: 0.85em;
    transition: color 0.2s;
}

.aigr-google-link:hover {
    color: #1a73e8;
}

.aigr-google-icon {
    vertical-align: middle;
    flex-shrink: 0;
}

/* ==========================================================================
   Rating (inline)
   ========================================================================== */

.aigr-rating {
    display: flex;
    align-items: center;
    gap: 8px;
    flex-wrap: wrap;
}

.aigr-rating__number {
    font-size: 1.5em;
    font-weight: 700;
    color: #202124;
    line-height: 1;
}

.aigr-rating__count {
    color: #70757a;
    font-size: 0.9em;
}

/* ==========================================================================
   Rating Badge
   ========================================================================== */

.aigr-badge {
    display: inline-flex;
    flex-direction: column;
    align-items: center;
    background: #fff;
    border: 1px solid #e0e0e0;
    border-radius: 12px;
    padding: 20px 24px;
    text-align: center;
    box-shadow: 0 1px 4px rgba(0, 0, 0, 0.06);
}

.aigr-badge__inner {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 4px;
}

.aigr-badge__rating {
    font-size: 2.2em;
    font-weight: 700;
    color: #202124;
    line-height: 1.2;
}

.aigr-badge__count {
    color: #70757a;
    font-size: 0.85em;
}

.aigr-badge__link {
    display: inline-block;
    margin-top: 12px;
    padding-top: 12px;
    border-top: 1px solid #e0e0e0;
    color: #1a73e8;
    text-decoration: none;
    font-size: 0.85em;
    font-weight: 500;
}

.aigr-badge__link:hover {
    text-decoration: underline;
}

/* ==========================================================================
   No Content
   ========================================================================== */

.aigr-no-reviews,
.aigr-no-photos {
    color: #70757a;
    font-style: italic;
    padding: 20px;
    text-align: center;
}

/* ==========================================================================
   Photo Gallery
   ========================================================================== */

.aigr-photos--grid {
    display: grid;
    grid-template-columns: repeat(var(--aigr-columns, 3), 1fr);
    gap: 12px;
}

.aigr-photo {
    overflow: hidden;
    border-radius: 8px;
    line-height: 0;
}

.aigr-photo a {
    display: block;
    line-height: 0;
}

.aigr-photo__img {
    width: 100%;
    height: 200px;
    object-fit: cover;
    transition: transform 0.3s ease;
    border-radius: 8px;
}

.aigr-photo:hover .aigr-photo__img {
    transform: scale(1.03);
}

.aigr-photos--masonry {
    display: grid;
    grid-template-columns: repeat(var(--aigr-columns, 3), 1fr);
    gap: 12px;
}

.aigr-photos--masonry .aigr-photo__img {
    height: auto;
}

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

@media (max-width: 1024px) {
    .aigr-reviews--grid {
        grid-template-columns: repeat(2, 1fr) !important;
    }

    .aigr-slider__track {
        --aigr-show: 2 !important;
    }
}

@media (max-width: 768px) {
    .aigr-intro {
        flex-direction: column;
        align-items: flex-start;
        gap: 12px;
        padding: 16px 20px;
    }

    .aigr-reviews--grid {
        grid-template-columns: 1fr !important;
    }

    .aigr-slider__track {
        --aigr-show: 1 !important;
    }

    .aigr-reviews--cards .aigr-review,
    .aigr-reviews--grid .aigr-review,
    .aigr-slider__track .aigr-review {
        padding: 20px;
    }

    .aigr-photos--grid,
    .aigr-photos--masonry {
        grid-template-columns: repeat(2, 1fr);
    }

    .aigr-photo__img {
        height: 150px;
    }

    .aigr-badge {
        padding: 16px 20px;
    }
}

@media (max-width: 480px) {
    .aigr-photos--grid,
    .aigr-photos--masonry {
        grid-template-columns: 1fr;
    }

    .aigr-photo__img {
        height: 200px;
    }

    .aigr-slider__arrow {
        width: 36px;
        height: 36px;
    }

    .aigr-slider__arrow svg {
        width: 16px;
        height: 16px;
    }
}
