/**
 * Frontend Styles for Google Reviews Carousel
 * Version: 1.0.0
 * Author: Dukiwi SA
 * License: GPL v3
 */

/* Container */
.dukiwi-grc-container {
    max-width: 800px;
    margin: 0 auto;
    padding: 30px 20px;
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Oxygen-Sans, Ubuntu, Cantarell, "Helvetica Neue", sans-serif;
}

/* Header with overall rating */
.dukiwi-grc-header {
    text-align: center;
    margin-bottom: 30px;
    padding-bottom: 20px;
    border-bottom: 2px solid #f0f0f0;
}

.dukiwi-grc-overall-rating {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 15px;
    flex-wrap: wrap;
}

.dukiwi-grc-rating-number {
    font-size: 32px;
    font-weight: bold;
    color: #333;
}

.dukiwi-grc-total-reviews {
    color: #666;
    font-size: 16px;
}

/* Stars */
.dukiwi-grc-stars {
    display: inline-flex;
    gap: 2px;
    font-size: 24px;
}

.dukiwi-grc-review-header .dukiwi-grc-stars {
    font-size: 18px;
}

.dukiwi-grc-star {
    color: #ffc107;
    line-height: 1;
}

.dukiwi-grc-star-full {
    color: #ffc107;
}

.dukiwi-grc-star-half {
    color: #ffc107;
    position: relative;
    display: inline-block;
}

.dukiwi-grc-star-half::before {
    content: '★';
    position: absolute;
    left: 0;
    width: 50%;
    overflow: hidden;
}

.dukiwi-grc-star-empty {
    color: #e0e0e0;
}

/* Carousel */
.dukiwi-grc-carousel {
    position: relative;
    overflow: hidden;
    background: #fff;
    border-radius: 12px;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
    padding: 40px 20px;
    min-height: 300px;
}

.dukiwi-grc-carousel-track {
    position: relative;
    width: 100%;
}

.dukiwi-grc-slide {
    display: none;
    opacity: 0;
    transition: opacity 0.5s ease-in-out;
}

.dukiwi-grc-slide.active {
    display: block;
    opacity: 1;
}

/* Review card */
.dukiwi-grc-review {
    display: flex;
    gap: 20px;
    align-items: flex-start;
}

.dukiwi-grc-author-photo {
    flex-shrink: 0;
}

.dukiwi-grc-author-photo img {
    width: 60px;
    height: 60px;
    border-radius: 50%;
    object-fit: cover;
    border: 2px solid #f0f0f0;
}

.dukiwi-grc-review-content {
    flex: 1;
}

.dukiwi-grc-review-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 10px;
    flex-wrap: wrap;
    gap: 10px;
}

.dukiwi-grc-author-name {
    margin: 0;
    font-size: 18px;
    font-weight: 600;
    color: #333;
}

.dukiwi-grc-review-date {
    color: #999;
    font-size: 14px;
    margin-bottom: 12px;
}

.dukiwi-grc-review-text {
    color: #555;
    line-height: 1.6;
    font-size: 15px;
}

.dukiwi-grc-review-text p {
    margin: 0 0 10px 0;
}

.dukiwi-grc-review-text p:last-child {
    margin-bottom: 0;
}

/* Navigation buttons */
.dukiwi-grc-nav {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    background: rgba(255, 255, 255, 0.95);
    border: 1px solid #e0e0e0;
    border-radius: 50%;
    width: 45px;
    height: 45px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.3s ease;
    z-index: 10;
    font-size: 24px;
    color: #333;
}

.dukiwi-grc-nav:hover {
    background: #fff;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.15);
    transform: translateY(-50%) scale(1.05);
}

.dukiwi-grc-nav:active {
    transform: translateY(-50%) scale(0.95);
}

.dukiwi-grc-nav-prev {
    left: 10px;
}

.dukiwi-grc-nav-next {
    right: 10px;
}

.dukiwi-grc-nav span {
    line-height: 1;
    display: block;
}

/* Dots navigation */
.dukiwi-grc-dots {
    display: flex;
    justify-content: center;
    gap: 10px;
    margin-top: 25px;
}

.dukiwi-grc-dot {
    width: 12px;
    height: 12px;
    border-radius: 50%;
    background: #e0e0e0;
    border: none;
    cursor: pointer;
    transition: all 0.3s ease;
    padding: 0;
}

.dukiwi-grc-dot:hover {
    background: #bbb;
    transform: scale(1.2);
}

.dukiwi-grc-dot.active {
    background: #2271b1;
    width: 30px;
    border-radius: 6px;
}

/* Footer */
.dukiwi-grc-footer {
    text-align: center;
    margin-top: 25px;
}

.dukiwi-grc-google-link {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    color: #2271b1;
    text-decoration: none;
    font-weight: 500;
    font-size: 15px;
    transition: color 0.3s ease;
}

.dukiwi-grc-google-link:hover {
    color: #135e96;
    text-decoration: underline;
}

/* Error and no reviews messages */
.dukiwi-grc-error,
.dukiwi-grc-no-reviews {
    background: #fff3cd;
    border: 1px solid #ffc107;
    border-radius: 8px;
    padding: 20px;
    text-align: center;
    color: #856404;
}

.dukiwi-grc-error {
    background: #f8d7da;
    border-color: #dc3545;
    color: #721c24;
}

/* Responsive design */
@media (max-width: 768px) {
    .dukiwi-grc-container {
        padding: 20px 15px;
    }
    
    .dukiwi-grc-carousel {
        padding: 30px 15px;
        min-height: 350px;
    }
    
    .dukiwi-grc-review {
        flex-direction: column;
        align-items: center;
        text-align: center;
    }
    
    .dukiwi-grc-review-header {
        flex-direction: column;
        align-items: center;
    }
    
    .dukiwi-grc-nav {
        width: 40px;
        height: 40px;
        font-size: 20px;
    }
    
    .dukiwi-grc-nav-prev {
        left: 5px;
    }
    
    .dukiwi-grc-nav-next {
        right: 5px;
    }
    
    .dukiwi-grc-rating-number {
        font-size: 28px;
    }
    
    .dukiwi-grc-author-photo img {
        width: 50px;
        height: 50px;
    }
}

@media (max-width: 480px) {
    .dukiwi-grc-carousel {
        min-height: 400px;
    }
    
    .dukiwi-grc-overall-rating {
        flex-direction: column;
        gap: 10px;
    }
    
    .dukiwi-grc-review-text {
        font-size: 14px;
    }
}

/* Accessibility */
.dukiwi-grc-nav:focus,
.dukiwi-grc-dot:focus {
    outline: 2px solid #2271b1;
    outline-offset: 2px;
}

/* Loading state */
.dukiwi-grc-loading {
    text-align: center;
    padding: 60px 20px;
    color: #666;
}

.dukiwi-grc-loading::before {
    content: '';
    display: inline-block;
    width: 40px;
    height: 40px;
    border: 4px solid #f3f3f3;
    border-top: 4px solid #2271b1;
    border-radius: 50%;
    animation: dukiwi-grc-spin 1s linear infinite;
    margin-bottom: 15px;
}

@keyframes dukiwi-grc-spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

/* Animation for slide transitions */
@keyframes dukiwi-grc-fadeIn {
    from {
        opacity: 0;
        transform: translateX(20px);
    }
    to {
        opacity: 1;
        transform: translateX(0);
    }
}

.dukiwi-grc-slide.active {
    animation: dukiwi-grc-fadeIn 0.5s ease-in-out;
}
