/**
 * Google Reviews Styling
 *
 * Styles for the Google Business reviews carousel section.
 * Works in conjunction with React GoogleReviews component and Tailwind.
 *
 * @package eRide
 * @version 1.1.0
 * @updated 2026-01-13 - Use shared animations from variables.css
 *
 * DEPENDENCIES:
 * - variables.css (provides eride-pulse animation)
 */

/* ==========================================================================
   Section Container
   ========================================================================== */

.eride-google-reviews-pattern,
.google-reviews-section {
    background: linear-gradient(180deg, #f8fafc 0%, #ffffff 100%);
}

.google-reviews-section {
    padding: 4rem 1rem;
}

@media (min-width: 768px) {
    .google-reviews-section {
        padding: 6rem 2rem;
    }
}

/* ==========================================================================
   Skeleton Styles (Before React Hydration)
   ========================================================================== */

.google-reviews-skeleton {
    max-width: 1200px;
    margin: 0 auto;
}

/* Header */
.google-reviews-header {
    text-align: center;
    margin-bottom: 2.5rem;
}

.google-reviews-title {
    font-size: 1.875rem;
    font-weight: 700;
    color: #0f172a;
    margin: 0 0 0.5rem;
    line-height: 1.2;
}

@media (min-width: 768px) {
    .google-reviews-title {
        font-size: 2.25rem;
    }
}

.google-reviews-subtitle {
    font-size: 1rem;
    color: #64748b;
    margin: 0;
}

/* Business Summary */
.google-reviews-business-summary {
    display: inline-flex;
    flex-direction: column;
    align-items: center;
    gap: 1rem;
    background: white;
    border-radius: 1rem;
    padding: 1rem 1.5rem;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
    border: 1px solid #e2e8f0;
    margin-top: 1.5rem;
}

@media (min-width: 640px) {
    .google-reviews-business-summary {
        flex-direction: row;
        gap: 1.5rem;
    }
}

.google-reviews-rating {
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

.google-reviews-rating .rating-value {
    font-size: 1.875rem;
    font-weight: 700;
    color: #0f172a;
}

.google-reviews-rating .rating-stars {
    display: flex;
    align-items: center;
    gap: 2px;
}

.google-reviews-rating .rating-count {
    font-size: 0.875rem;
    color: #64748b;
    margin-top: 0.25rem;
}

.google-reviews-link {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-size: 0.875rem;
    font-weight: 500;
    color: #64748b;
    text-decoration: none;
    transition: color 0.2s;
}

.google-reviews-link:hover {
    color: #14b8a6;
}

.google-reviews-link svg {
    flex-shrink: 0;
}

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

.google-reviews-carousel {
    display: grid;
    grid-template-columns: 1fr;
    gap: 1rem;
    max-width: 1200px;
    margin: 0 auto;
}

@media (min-width: 640px) {
    .google-reviews-carousel {
        grid-template-columns: repeat(2, 1fr);
    }
}

@media (min-width: 1024px) {
    .google-reviews-carousel {
        grid-template-columns: repeat(3, 1fr);
    }
}

/* ==========================================================================
   Review Card (Skeleton version)
   ========================================================================== */

.google-review-card {
    background: white;
    border-radius: 1rem;
    padding: 1.25rem;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
    border: 1px solid #f1f5f9;
    height: 100%;
    display: flex;
    flex-direction: column;
}

.google-review-card .review-header {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    margin-bottom: 0.75rem;
}

.google-review-card .review-avatar {
    width: 2.5rem;
    height: 2.5rem;
    border-radius: 50%;
    object-fit: cover;
}

.google-review-card .review-avatar--placeholder {
    background: linear-gradient(135deg, #2dd4bf, #14b8a6);
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-weight: 500;
    font-size: 1rem;
}

.google-review-card .review-meta {
    flex: 1;
    min-width: 0;
}

.google-review-card .review-author {
    display: block;
    font-weight: 500;
    color: #0f172a;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.google-review-card .review-date {
    display: block;
    font-size: 0.875rem;
    color: #64748b;
}

.google-review-card .review-stars {
    display: flex;
    align-items: center;
    gap: 2px;
    margin-bottom: 0.75rem;
}

.google-review-card .review-stars .star {
    flex-shrink: 0;
}

.google-review-card .review-content {
    flex: 1;
}

.google-review-card .review-content p {
    font-size: 0.875rem;
    line-height: 1.6;
    color: #475569;
    margin: 0;
}

/* ==========================================================================
   Skeleton Loading Animations
   ========================================================================== */

.google-review-card--skeleton {
    animation: eride-pulse 2s cubic-bezier(0.4, 0, 0.6, 1) infinite;
}

.skeleton-avatar {
    width: 2.5rem;
    height: 2.5rem;
    border-radius: 50%;
    background: #e2e8f0;
}

.skeleton-text {
    height: 0.875rem;
    background: #e2e8f0;
    border-radius: 0.25rem;
    margin-bottom: 0.5rem;
}

.skeleton-name {
    width: 60%;
}

.skeleton-date {
    width: 40%;
    height: 0.75rem;
}

.skeleton-stars {
    height: 1.25rem;
    width: 6rem;
    background: #e2e8f0;
    border-radius: 0.25rem;
    margin-bottom: 0.75rem;
}

.skeleton-short {
    width: 70%;
}

/* Note: Using eride-pulse from variables.css instead of local @keyframes */

/* ==========================================================================
   Navigation
   ========================================================================== */

.google-reviews-nav {
    display: flex;
    justify-content: center;
    gap: 0.5rem;
    margin-top: 1.5rem;
}

/* ==========================================================================
   React Component Overrides (After Hydration)
   ========================================================================== */

/* Ensure proper containment for Tailwind */
.eride-react-root .google-reviews {
    max-width: 1200px;
    margin: 0 auto;
}

/* Carousel navigation arrows positioning */
.eride-react-root .google-reviews .relative {
    padding: 0 1rem;
}

@media (min-width: 768px) {
    .eride-react-root .google-reviews .relative {
        padding: 0 2rem;
    }
}

/* Card hover effects */
.eride-react-root .google-reviews [class*="ReviewCard"] {
    transition: transform 0.2s, box-shadow 0.2s;
}

.eride-react-root .google-reviews [class*="ReviewCard"]:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
}

/* ==========================================================================
   Dark Mode Support (Future)
   ========================================================================== */

@media (prefers-color-scheme: dark) {
    /* Add dark mode styles when needed */
}

/* ==========================================================================
   Print Styles
   ========================================================================== */

@media print {
    .google-reviews-section {
        background: white;
        padding: 1rem 0;
    }

    .google-reviews-carousel {
        display: block;
    }

    .google-review-card {
        break-inside: avoid;
        margin-bottom: 1rem;
        box-shadow: none;
        border: 1px solid #e2e8f0;
    }

    .google-reviews-nav,
    .google-reviews-link {
        display: none;
    }
}
