/* ==========================================================================
   Simple Google Reviews - Frontend Styles
   ========================================================================== */

/* Container */
.sgr-reviews-container {
    margin: 20px 0;
    padding: 0;
}

/* Grid Layout */
.sgr-layout-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 20px;
    padding: 10px 0;
}

@media (max-width: 768px) {
    .sgr-layout-grid {
        grid-template-columns: 1fr;
        gap: 15px;
    }
}

/* List Layout */
.sgr-layout-list {
    display: flex;
    flex-direction: column;
    gap: 15px;
}

/* Review Item */
.sgr-review-item {
    background: #ffffff;
    border: 1px solid #e5e7eb;
    border-radius: 12px;
    padding: 20px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.04);
    transition: all 0.3s ease;
    position: relative;
    overflow: hidden;
}

.sgr-review-item:hover {
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.08);
    transform: translateY(-2px);
}

/* Review Header */
.sgr-review-header {
    display: flex;
    align-items: center;
    margin-bottom: 12px;
    gap: 12px;
}

.sgr-review-avatar {
    width: 48px;
    height: 48px;
    border-radius: 50%;
    overflow: hidden;
    flex-shrink: 0;
    background: #f3f4f6;
    display: flex;
    align-items: center;
    justify-content: center;
}

.sgr-review-avatar img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.sgr-review-avatar-placeholder {
    width: 100%;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: #ffffff;
    font-weight: 600;
    font-size: 18px;
}

.sgr-review-author-info {
    flex: 1;
    min-width: 0;
}

.sgr-review-author {
    font-weight: 600;
    font-size: 15px;
    color: #1f2937;
    margin: 0 0 4px 0;
    line-height: 1.3;
}

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

.sgr-review-date {
    font-size: 13px;
    color: #6b7280;
}

/* Rating Stars */
.sgr-review-rating {
    display: flex;
    align-items: center;
    gap: 2px;
    margin-bottom: 12px;
}

.sgr-star {
    color: #fbbf24;
    font-size: 18px;
    line-height: 1;
}

.sgr-star.empty {
    color: #d1d5db;
}

/* Review Text */
.sgr-review-text {
    font-size: 14px;
    line-height: 1.6;
    color: #374151;
    margin: 0 0 12px 0;
    word-wrap: break-word;
}

.sgr-review-text.truncated {
    display: -webkit-box;
    -webkit-line-clamp: 4;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

/* Review Footer */
.sgr-review-footer {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-top: 12px;
    padding-top: 12px;
    border-top: 1px solid #f3f4f6;
}

.sgr-google-badge {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    font-size: 11px;
    color: #6b7280;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    font-weight: 500;
}

.sgr-google-icon {
    width: 14px;
    height: 14px;
}

/* Read More Button */
.sgr-read-more {
    background: none;
    border: none;
    color: #3b82f6;
    font-size: 13px;
    font-weight: 500;
    cursor: pointer;
    padding: 0;
    text-decoration: none;
    transition: color 0.2s;
}

.sgr-read-more:hover {
    color: #2563eb;
    text-decoration: underline;
}

/* Error & Empty States */
.sgr-error,
.sgr-no-reviews {
    background: #fef2f2;
    border: 1px solid #fecaca;
    border-radius: 8px;
    padding: 16px 20px;
    color: #991b1b;
    font-size: 14px;
    margin: 20px 0;
}

.sgr-no-reviews {
    background: #f9fafb;
    border-color: #e5e7eb;
    color: #6b7280;
    text-align: center;
}

/* Loading State */
.sgr-loading {
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 40px;
    color: #6b7280;
    font-size: 14px;
}

.sgr-loading::before {
    content: "";
    width: 20px;
    height: 20px;
    border: 2px solid #e5e7eb;
    border-top-color: #3b82f6;
    border-radius: 50%;
    margin-right: 10px;
    animation: sgr-spin 0.8s linear infinite;
}

@keyframes sgr-spin {
    to { transform: rotate(360deg); }
}

/* Carousel Layout (bonus feature) */
.sgr-layout-carousel {
    position: relative;
    overflow: hidden;
}

.sgr-carousel-track {
    display: flex;
    gap: 20px;
    transition: transform 0.3s ease;
}

.sgr-carousel-nav {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    background: #ffffff;
    border: 1px solid #e5e7eb;
    border-radius: 50%;
    width: 40px;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    z-index: 10;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
    transition: all 0.2s;
}

.sgr-carousel-nav:hover {
    background: #f9fafb;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
}

.sgr-carousel-nav.prev {
    left: -20px;
}

.sgr-carousel-nav.next {
    right: -20px;
}

/* Responsive */
@media (max-width: 768px) {
    .sgr-review-item {
        padding: 16px;
    }
    
    .sgr-review-avatar {
        width: 40px;
        height: 40px;
    }
    
    .sgr-review-author {
        font-size: 14px;
    }
    
    .sgr-review-text {
        font-size: 13px;
    }
}

/* Accessibility */
.sgr-sr-only {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border-width: 0;
}

/* Dark Mode Support */
@media (prefers-color-scheme: dark) {
    .sgr-review-item {
        background: #1f2937;
        border-color: #374151;
    }
    
    .sgr-review-author {
        color: #f9fafb;
    }
    
    .sgr-review-text {
        color: #d1d5db;
    }
    
    .sgr-review-date,
    .sgr-google-badge {
        color: #9ca3af;
    }
    
    .sgr-review-footer {
        border-top-color: #374151;
    }
    
    .sgr-error {
        background: #7f1d1d;
        border-color: #991b1b;
        color: #fecaca;
    }
    
    .sgr-no-reviews {
        background: #374151;
        border-color: #4b5563;
        color: #9ca3af;
    }
}

/* Print Styles */
@media print {
    .sgr-review-item {
        break-inside: avoid;
        box-shadow: none;
        border: 1px solid #ddd;
    }
    
    .sgr-carousel-nav {
        display: none;
    }
}
