/**
 * P4U Google Reviews - Front Styles (v1.0.0)
 *
 * Carousel layout with business summary card + review cards
 * Adapted to GAMB purple theme (#9C77EA)
 */

/* =========================================================================
   Section container
   ========================================================================= */

.p4u-greviews-section {
    padding: 60px 0;
    background: #fff;
}

.p4u-greviews-container {
    max-width: 1342px;
    margin: 0 auto;
    padding: 0 20px;
}

/* =========================================================================
   Header
   ========================================================================= */

.p4u-greviews-header {
    text-align: center;
    margin-bottom: 40px;
}

.p4u-greviews-title {
    font-family: 'Roboto', sans-serif;
    font-size: 32px;
    font-weight: 700;
    color: #1D0A4A;
    margin: 0 0 8px;
}

.p4u-greviews-subtitle {
    font-family: 'Roboto', sans-serif;
    font-size: 16px;
    color: #666;
    margin: 0;
}

/* =========================================================================
   Loading skeleton
   ========================================================================= */

.p4u-greviews-skeleton {
    display: flex;
    gap: 20px;
    justify-content: center;
}

.p4u-skeleton-card {
    width: 300px;
    height: 200px;
    border-radius: 12px;
    background: linear-gradient(110deg, #f0eef5 8%, #e8e5f0 18%, #f0eef5 33%);
    background-size: 200% 100%;
    animation: p4u-skeleton-shine 1.5s linear infinite;
}

@keyframes p4u-skeleton-shine {
    to {
        background-position-x: -200%;
    }
}

/* =========================================================================
   Content layout (summary + carousel)
   ========================================================================= */

.p4u-greviews-content {
    display: flex;
    align-items: stretch;
    gap: 30px;
}

/* =========================================================================
   Business summary card
   ========================================================================= */

.p4u-greviews-summary {
    flex: 0 0 240px;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    text-align: center;
    padding: 30px 20px;
    border-radius: 12px;
    background: #f8f7fc;
    border: 1px solid #e0dce8;
}

.p4u-greviews-biz-name {
    font-family: 'Roboto', sans-serif;
    font-size: 16px;
    font-weight: 700;
    color: #1D0A4A;
    margin: 0 0 12px;
    line-height: 1.3;
}

.p4u-greviews-avg-stars {
    display: flex;
    gap: 2px;
    justify-content: center;
    margin-bottom: 8px;
}

.p4u-greviews-avg-stars .p4u-star {
    width: 24px;
    height: 24px;
    color: #f5a623;
}

.p4u-greviews-avg-stars .p4u-star.empty {
    color: #ddd;
}

.p4u-greviews-count {
    font-size: 14px;
    color: #666;
    margin-bottom: 20px;
}

.p4u-greviews-count strong {
    color: #1D0A4A;
}

.p4u-greviews-write-btn {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 10px 24px;
    border-radius: 20px;
    background: #9C77EA;
    color: #fff;
    text-decoration: none;
    font-family: 'Roboto', sans-serif;
    font-size: 14px;
    font-weight: 600;
    transition: background 0.25s ease, transform 0.2s ease;
    border: none;
    cursor: pointer;
}

.p4u-greviews-write-btn:hover {
    background: #8460d6;
    color: #fff;
    text-decoration: none;
    transform: translateY(-1px);
}

.p4u-greviews-write-btn svg {
    width: 16px;
    height: 16px;
    fill: currentColor;
}

/* =========================================================================
   Carousel
   ========================================================================= */

.p4u-greviews-carousel-wrapper {
    flex: 1;
    position: relative;
    min-width: 0;
    display: flex;
    align-items: center;
}

.p4u-greviews-carousel {
    overflow: hidden;
    flex: 1;
    border-radius: 12px;
}

.p4u-greviews-track {
    display: flex;
    gap: 20px;
    transition: transform 0.4s cubic-bezier(0.25, 0.8, 0.25, 1);
    will-change: transform;
}

/* Nav arrows */
.p4u-greviews-nav {
    position: absolute;
    z-index: 2;
    top: 50%;
    transform: translateY(-50%);
    width: 44px;
    height: 44px;
    border-radius: 50%;
    border: 2px solid #e0dce8;
    background: #fff;
    color: #1D0A4A;
    font-size: 22px;
    line-height: 1;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.25s ease;
    box-shadow: 0 2px 8px rgba(29, 10, 74, 0.08);
}

.p4u-greviews-nav:hover {
    background: #9C77EA;
    border-color: #9C77EA;
    color: #fff;
}

.p4u-greviews-nav:disabled {
    opacity: 0.3;
    cursor: default;
    pointer-events: none;
}

.p4u-greviews-prev {
    left: -22px;
}

.p4u-greviews-next {
    right: -22px;
}

/* =========================================================================
   Review card
   ========================================================================= */

.p4u-greviews-card {
    flex: 0 0 300px;
    background: #fff;
    border: 1px solid #e0dce8;
    border-radius: 12px;
    padding: 24px;
    display: flex;
    flex-direction: column;
    transition: box-shadow 0.25s ease;
}

.p4u-greviews-card:hover {
    box-shadow: 0 4px 16px rgba(29, 10, 74, 0.1);
}

/* Card header: avatar + name + date + Google icon */
.p4u-greviews-card-header {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 12px;
}

.p4u-greviews-avatar {
    width: 44px;
    height: 44px;
    border-radius: 50%;
    overflow: hidden;
    flex-shrink: 0;
    background: #9C77EA;
    display: flex;
    align-items: center;
    justify-content: center;
}

.p4u-greviews-avatar img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.p4u-greviews-avatar-initial {
    font-family: 'Roboto', sans-serif;
    font-size: 18px;
    font-weight: 700;
    color: #fff;
}

.p4u-greviews-card-meta {
    flex: 1;
    min-width: 0;
}

.p4u-greviews-author {
    font-family: 'Roboto', sans-serif;
    font-size: 14px;
    font-weight: 600;
    color: #1D0A4A;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.p4u-greviews-date {
    font-size: 12px;
    color: #999;
}

.p4u-greviews-google-icon {
    flex-shrink: 0;
    width: 24px;
    height: 24px;
}

.p4u-greviews-google-icon img {
    width: 100%;
    height: 100%;
}

/* Stars row */
.p4u-greviews-stars {
    display: flex;
    gap: 2px;
    margin-bottom: 12px;
}

.p4u-greviews-stars .p4u-star {
    width: 18px;
    height: 18px;
    color: #f5a623;
}

.p4u-greviews-stars .p4u-star.empty {
    color: #ddd;
}

/* Review text */
.p4u-greviews-text {
    font-family: 'Roboto', sans-serif;
    font-size: 14px;
    line-height: 1.5;
    color: #333;
    flex: 1;
    overflow: hidden;
    display: -webkit-box;
    -webkit-line-clamp: 4;
    -webkit-box-orient: vertical;
}

.p4u-greviews-text.expanded {
    -webkit-line-clamp: unset;
    display: block;
}

.p4u-greviews-readmore {
    display: inline-block;
    margin-top: 8px;
    font-size: 13px;
    color: #9C77EA;
    cursor: pointer;
    border: none;
    background: none;
    padding: 0;
    font-family: 'Roboto', sans-serif;
    transition: color 0.2s;
}

.p4u-greviews-readmore:hover {
    color: #8460d6;
    text-decoration: underline;
}

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

@media (max-width: 991px) {
    .p4u-greviews-content {
        flex-direction: column;
        align-items: center;
    }

    .p4u-greviews-summary {
        flex: none;
        width: 100%;
        max-width: 400px;
        flex-direction: row;
        flex-wrap: wrap;
        gap: 12px;
    }

    .p4u-greviews-biz-name {
        margin-bottom: 0;
    }

    .p4u-greviews-carousel-wrapper {
        width: 100%;
    }

    .p4u-greviews-prev {
        left: -10px;
    }

    .p4u-greviews-next {
        right: -10px;
    }
}

@media (max-width: 767px) {
    .p4u-greviews-section {
        padding: 40px 0;
    }

    .p4u-greviews-title {
        font-size: 24px;
    }

    .p4u-greviews-header {
        margin-bottom: 24px;
    }

    .p4u-greviews-card {
        flex: 0 0 260px;
        padding: 18px;
    }

    .p4u-greviews-summary {
        padding: 20px 16px;
    }

    .p4u-greviews-nav {
        width: 36px;
        height: 36px;
        font-size: 18px;
    }

    .p4u-greviews-prev {
        left: -6px;
    }

    .p4u-greviews-next {
        right: -6px;
    }
}

@media (max-width: 480px) {
    .p4u-greviews-card {
        flex: 0 0 240px;
    }
}
