/* WR Google Reviews - Frontend Styles */

/* Reset and base styles */
.wr-reviews-container * {
    box-sizing: border-box;
}

/* Main container */
.wr-reviews-container {
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
    max-width: 1400px;
    margin: 0 auto;
    padding: 20px;
    position: relative;
}

/* Error messages */
.wr-reviews-error {
    text-align: center;
    padding: 2rem;
    background: #f8f9fa;
    border: 1px solid #e9ecef;
    border-radius: 8px;
    color: #6c757d;
}

/* Title styling */
.wr-reviews-title {
    font-size: 2rem;
    font-weight: 700;
    color: #1a202c;
    text-align: center;
    margin: 0 0 2rem 0;
    letter-spacing: -0.02em;
}

/* Slider container */
.wr-reviews-slider {
    position: relative;
    overflow: hidden;
    padding: 20px 0 80px 0;
    cursor: grab;
    margin: 0 auto;
    max-width: 100%;
    width: 100%;
}

.wr-reviews-slider:active {
    cursor: grabbing;
}

.wr-reviews-slider.loading {
    opacity: 0.7;
}

.wr-reviews-slider.loading::after {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 32px;
    height: 32px;
    margin: -16px 0 0 -16px;
    border: 3px solid #e2e8f0;
    border-top-color: #3b82f6;
    border-radius: 50%;
    animation: spin 1s linear infinite;
    z-index: 10;
}

/* Track that holds all review items */
.wr-reviews-track {
    display: flex;
    transition: transform 0.8s cubic-bezier(0.25, 0.46, 0.45, 0.94);
    will-change: transform;
    padding: 0 60px;
    gap: 0;
    width: fit-content;
}

/* Individual review item */
.wr-review-item {
    flex: 0 0 auto;
    width: 420px;
    min-width: 380px;
    max-width: 450px;
    margin: 0 15px 0 0;
    padding: 1.25rem;
    background: #ffffff;
    border: 1px solid #e9ecef;
    border-radius: 8px;
    position: relative;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
    user-select: none;
    -webkit-user-select: none;
    -moz-user-select: none;
    -ms-user-select: none;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
}

.wr-review-item:last-child {
    margin-right: 0;
}

/* Review header */
.wr-review-header {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    margin-bottom: 0.75rem;
    flex-shrink: 0;
}

/* Reviewer avatar */
.wr-reviewer-avatar {
    flex-shrink: 0;
    width: 50px;
    height: 50px;
    border-radius: 50%;
    overflow: hidden;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

.wr-reviewer-avatar img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    border-radius: 50%;
    transition: transform 0.3s ease;
}

.wr-reviewer-avatar img:hover {
    transform: scale(1.05);
}

/* Reviewer info */
.wr-reviewer-info {
    flex: 1;
    min-width: 0;
}

.wr-reviewer-name {
    font-size: 1.1rem;
    font-weight: 600;
    color: #1a202c;
    margin: 0 0 0.5rem 0;
    line-height: 1.3;
    user-select: none;
    -webkit-user-select: none;
    -moz-user-select: none;
    -ms-user-select: none;
}

/* Star rating */
.wr-review-rating {
    display: flex;
    align-items: center;
    gap: 0.25rem;
    margin-bottom: 0.25rem;
}

.wr-star {
    font-size: 1.2rem;
    color: #e2e8f0;
    transition: color 0.2s ease;
}

.wr-star.filled {
    color: #ffd700;
    text-shadow: 0 1px 2px rgba(255, 215, 0, 0.3);
}

/* Review text */
.wr-review-text {
    flex: 1;
    margin-bottom: 0.75rem;
    user-select: none;
    -webkit-user-select: none;
    -moz-user-select: none;
    -ms-user-select: none;
    overflow: hidden;
}

.wr-review-text p {
    font-size: 0.85rem;
    line-height: 1.4;
    color: #374151;
    margin: 0;
    user-select: none;
    -webkit-user-select: none;
    -moz-user-select: none;
    -ms-user-select: none;
    display: -webkit-box;
    -webkit-line-clamp: 3;
    -webkit-box-orient: vertical;
    overflow: hidden;
    text-overflow: ellipsis;
}

/* Review date */
.wr-review-date {
    font-size: 0.8rem;
    color: #718096;
    font-weight: 500;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    user-select: none;
    -webkit-user-select: none;
    -moz-user-select: none;
    -ms-user-select: none;
    flex-shrink: 0;
}

/* Navigation buttons */
.wr-slider-nav {
    position: absolute !important;
    bottom: 20px !important;
    width: 50px !important;
    height: 40px !important;
    border: none !important;
    border-radius: 6px !important;
    background: #1e293b !important;
    color: #ffffff !important;
    font-size: 1.4rem !important;
    font-weight: bold !important;
    cursor: pointer !important;
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.15) !important;
    transition: all 0.3s ease !important;
    z-index: 100 !important;
    padding: 0 !important;
}

.wr-slider-nav svg {
    width: 24px !important;
    height: 24px !important;
    fill: currentColor !important;
}

.wr-slider-nav:hover {
    background: #334155 !important;
    transform: translateY(-1px) !important;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.2) !important;
}

.wr-slider-nav:active {
    transform: translateY(0) !important;
}

.wr-slider-nav.disabled {
    opacity: 0.4 !important;
    cursor: not-allowed !important;
    pointer-events: none !important;
}

.wr-prev {
    left: 50% !important;
    margin-left: -65px !important;
}

.wr-next {
    right: 50% !important;
    margin-right: -65px !important;
}

/* Hover effects removed to prevent zoom out on hover */

/* Loading animation */
@keyframes spin {
    to {
        transform: rotate(360deg);
    }
}

/* Responsive breakpoints */
@media (max-width: 768px) {
        .wr-reviews-container {
        padding: 15px;
    }

    .wr-reviews-title {
        font-size: 1.75rem;
        margin-bottom: 1.5rem;
    }

    .wr-reviews-track {
        padding: 0 50px;
    }

    .wr-review-item {
        width: 350px;
        min-width: 320px;
        padding: 1.25rem;
        margin-right: 15px;
    }

    .wr-reviewer-avatar {
        width: 48px;
        height: 48px;
    }

    .wr-reviewer-name {
        font-size: 1rem;
    }

    .wr-review-text p {
        font-size: 0.9rem;
    }

    .wr-slider-nav {
        width: 45px;
        height: 36px;
        font-size: 1.2rem;
    }

    .wr-prev {
        left: 50%;
        margin-left: -60px;
    }

    .wr-next {
        right: 50%;
        margin-right: -60px;
    }
}

@media (max-width: 480px) {
    .wr-reviews-container {
        padding: 10px;
    }

    .wr-reviews-title {
        font-size: 1.5rem;
        margin-bottom: 1rem;
    }

    .wr-reviews-track {
        padding: 0 40px;
    }

    .wr-review-item {
        width: 300px;
        min-width: 280px;
        padding: 1rem;
        margin-right: 10px;
    }

    .wr-review-header {
        gap: 0.75rem;
        margin-bottom: 1rem;
    }

    .wr-reviewer-avatar {
        width: 40px;
        height: 40px;
    }

    .wr-reviewer-name {
        font-size: 0.95rem;
    }

    .wr-star {
        font-size: 1rem;
    }

    .wr-review-text {
        margin-bottom: 1rem;
    }

    .wr-review-text p {
        font-size: 0.85rem;
        line-height: 1.5;
    }

    .wr-slider-nav {
        width: 40px;
        height: 32px;
        font-size: 1rem;
    }

    .wr-prev {
        left: 50%;
        margin-left: -55px;
    }

    .wr-next {
        right: 50%;
        margin-right: -55px;
    }
}

/* High contrast mode support */
@media (prefers-contrast: high) {
    .wr-review-item {
        border: 2px solid #000000;
    }

    .wr-slider-nav {
        border: 2px solid #000000;
        background: #ffffff;
        color: #000000;
    }

    .wr-star.filled {
        color: #ff6600;
    }
}

/* Reduced motion support */
@media (prefers-reduced-motion: reduce) {
    .wr-reviews-track {
        transition: none;
    }

    .wr-slider-nav {
        transition: none;
    }

    .wr-review-item {
        transition: none;
    }

    .wr-reviewer-avatar img {
        transition: none;
    }

    .wr-reviews-slider.loading::after {
        animation: none;
    }
}

/* Print styles */
@media print {
    .wr-slider-nav {
        display: none;
    }

    .wr-reviews-track {
        transform: none !important;
        display: block;
    }

    .wr-review-item {
        display: block;
        width: 100%;
        min-width: auto;
        max-width: none;
        border: 1px solid #000000;
        margin-bottom: 1rem;
        break-inside: avoid;
    }
}

/* Focus styles for accessibility */
.wr-reviews-slider:focus {
    outline: none !important;
}

.wr-slider-nav:focus {
    outline: none !important;
}

/* For keyboard accessibility, only show focus styles when using keyboard */
.wr-reviews-slider:focus-visible {
    outline: 2px solid #3b82f6 !important;
    outline-offset: 2px !important;
}

.wr-slider-nav:focus-visible {
    outline: 2px solid #3b82f6 !important;
    outline-offset: 2px !important;
}

/* Custom scrollbar for webkit browsers */
.wr-reviews-container::-webkit-scrollbar {
    width: 6px;
    height: 6px;
}

.wr-reviews-container::-webkit-scrollbar-track {
    background: #f1f5f9;
    border-radius: 3px;
}

.wr-reviews-container::-webkit-scrollbar-thumb {
    background: #cbd5e0;
    border-radius: 3px;
}

.wr-reviews-container::-webkit-scrollbar-thumb:hover {
    background: #a0aec0;
}
