/**
 * Review Carousel Widget Styles
 * Standalone CSS for embedding review carousels
 */

/* Container */
.review-carousel-widget {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, sans-serif;
    max-width: 100%;
    margin: 0 auto;
    padding: 20px;
    box-sizing: border-box;
    background: linear-gradient(135deg, #1e88e5 0%, #0d47a1 100%);
    border-radius: 12px;
}

.review-carousel-widget *,
.review-carousel-widget *::before,
.review-carousel-widget *::after {
    box-sizing: border-box;
}

/* Header */
.rcw-header {
    text-align: center;
    margin-bottom: 20px;
    color: #fff;
}

.rcw-title {
    font-size: 1.5rem;
    font-weight: 600;
    margin: 0 0 10px 0;
    color: #fff;
}

.rcw-stats {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    flex-wrap: wrap;
}

.rcw-rating-value {
    font-size: 1.75rem;
    font-weight: 700;
    color: #fff;
}

.rcw-stars {
    display: flex;
    gap: 2px;
}

.rcw-star {
    font-size: 1.25rem;
    line-height: 1;
}

.rcw-star-full {
    color: #ffc107;
}

.rcw-star-partial {
    position: relative;
    color: rgba(255, 255, 255, 0.4);
}

.rcw-star-partial::before {
    content: "★";
    position: absolute;
    left: 0;
    width: var(--fill, 50%);
    overflow: hidden;
    color: #ffc107;
}

.rcw-star-empty {
    color: rgba(255, 255, 255, 0.4);
}

.rcw-review-count {
    font-size: 0.9rem;
    color: rgba(255, 255, 255, 0.9);
}

/* Container with arrows */
.rcw-container {
    position: relative;
    display: flex;
    align-items: center;
    gap: 10px;
}

/* Track wrapper - hides overflow */
.rcw-track-wrapper {
    flex: 1;
    overflow: hidden;
    position: relative;
}

/* Track - contains all cards, slides horizontally */
.rcw-track {
    display: flex;
    gap: 16px;
    transition: transform 0.4s ease-out;
}

/* Review Card */
.rcw-card {
    flex: 0 0 calc(33.333% - 11px);
    min-width: 280px;
    background: #fff;
    border-radius: 12px;
    padding: 20px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
    display: flex;
    flex-direction: column;
}

.rcw-card-header {
    display: flex;
    align-items: flex-start;
    gap: 12px;
    margin-bottom: 12px;
}

.rcw-reviewer-avatar {
    width: 44px;
    height: 44px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #fff;
    font-weight: 600;
    font-size: 1rem;
    flex-shrink: 0;
}

.rcw-reviewer-info {
    flex: 1;
    min-width: 0;
}

.rcw-reviewer-name {
    display: block;
    font-weight: 600;
    font-size: 0.95rem;
    color: #333;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    margin-bottom: 4px;
}

.rcw-card-stars {
    display: flex;
    gap: 1px;
}

.rcw-card-stars .rcw-star {
    font-size: 1rem;
    color: #ffc107;
}

.rcw-card-stars .rcw-star-empty {
    color: #ddd;
}

.rcw-source-icon {
    flex-shrink: 0;
}

/* Card Body */
.rcw-card-body {
    flex: 1;
    margin-bottom: 12px;
}

.rcw-comment {
    margin: 0;
    font-size: 0.9rem;
    line-height: 1.5;
    color: #555;
}

.rcw-more-link {
    background: none;
    border: none;
    color: #1e88e5;
    cursor: pointer;
    font-size: 0.9rem;
    padding: 0;
    margin-left: 4px;
    font-weight: 500;
}

.rcw-more-link:hover {
    text-decoration: underline;
}

/* Card Footer */
.rcw-card-footer {
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.rcw-date {
    font-size: 0.8rem;
    color: #888;
}

/* Navigation Arrows */
.rcw-arrow {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.95);
    border: none;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #333;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.2);
    transition: all 0.2s ease;
    flex-shrink: 0;
    z-index: 10;
}

.rcw-arrow:hover {
    background: #fff;
    transform: scale(1.1);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.25);
}

.rcw-arrow:disabled {
    opacity: 0.3;
    cursor: not-allowed;
    transform: none;
}

/* Pagination */
.rcw-pagination {
    display: flex;
    justify-content: center;
    gap: 8px;
    margin-top: 20px;
}

.rcw-dot {
    width: 10px;
    height: 10px;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.4);
    border: none;
    cursor: pointer;
    padding: 0;
    transition: all 0.2s ease;
}

.rcw-dot:hover {
    background: rgba(255, 255, 255, 0.7);
}

.rcw-dot-active {
    background: #fff;
    transform: scale(1.2);
}

/* Responsive */
@media (max-width: 1024px) {
    .rcw-card {
        flex: 0 0 calc(50% - 8px);
    }
}

@media (max-width: 640px) {
    .review-carousel-widget {
        padding: 16px;
    }

    .rcw-card {
        flex: 0 0 100%;
        min-width: 0;
    }

    .rcw-title {
        font-size: 1.25rem;
    }

    .rcw-rating-value {
        font-size: 1.5rem;
    }

    .rcw-arrow {
        width: 32px;
        height: 32px;
    }

    .rcw-container {
        gap: 6px;
    }
}

/* Animation for expanded text */
.rcw-comment-full {
    animation: rcw-fadeIn 0.3s ease;
}

@keyframes rcw-fadeIn {
    from {
        opacity: 0;
    }
    to {
        opacity: 1;
    }
}

/* Paused state indicator (optional) */
.review-carousel-widget[data-paused="true"] .rcw-dot-active {
    animation: rcw-pulse 1.5s ease-in-out infinite;
}

@keyframes rcw-pulse {
    0%, 100% {
        opacity: 1;
    }
    50% {
        opacity: 0.5;
    }
}
