/**
 * BS Reviews - Public Styles
 * Review Slider with Statistics Sidebar
 * Auto-adjusting layout based on available space
 */

.bs-reviews-wrapper {
    display: flex !important;
    flex-direction: row !important;
    flex-wrap: nowrap !important;
    gap: 20px !important;
    margin: 40px 0 !important;
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Oxygen-Sans, Ubuntu, Cantarell, "Helvetica Neue", sans-serif !important;
    width: 100% !important;
    min-width: 100% !important;
    max-width: 100% !important;
    box-sizing: border-box !important;
    align-items: flex-start !important;
    overflow: visible !important;
}

.bs-reviews-wrapper > * {
    max-width: none !important;
    width: auto !important;
}

/* Statistics Sidebar */
.bs-reviews-stats-sidebar {
    flex: 0 0 280px !important;
    flex-shrink: 0;
    min-width: 280px;
}

.bs-stats-box {
    background: linear-gradient(135deg, #1a1a1a 0%, #2d2d2d 100%);
    color: #ffffff;
    padding: 40px 30px;
    border-radius: 16px;
    text-align: center;
    box-shadow: 0 2px 12px rgba(0, 0, 0, 0.08);
    border: 1px solid transparent;
}

.bs-stats-rating {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 15px;
    margin-bottom: 20px;
}

.bs-stats-number {
    font-size: 72px;
    font-weight: 700;
    line-height: 1;
    background: linear-gradient(135deg, #ffc107 0%, #ff9800 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.bs-stats-stars .bs-stars {
    font-size: 20px;
}

.bs-stats-total {
    font-size: 16px;
    color: #ffffff;
    line-height: 1.5;
}

.bs-stats-platform {
    font-size: 14px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 1px;
    margin-bottom: 15px;
}

/* Slider Container */
.bs-reviews-slider-container {
    flex: 1 1 auto !important;
    min-width: 0; /* Important for flex child */
    position: relative;
    padding: 0 50px; /* 50px each side so 44px arrow buttons don't overlap the cards */
}

.bs-reviews-slider {
    position: relative;
    overflow: hidden;
    border-radius: 16px;
    background: transparent;
    padding: 12px; /* Space for border-radius of cards */
    margin: -12px; /* Offset padding to maintain layout */
}

/* Slider Track - flexible width */
.bs-reviews-slider-track {
    display: flex;
    transition: transform 0.5s ease-in-out;
    will-change: transform;
}

/* Individual Slide - fixed square size */
.bs-review-slide {
    flex: 0 0 280px; /* Fixed width: same as stats box (default for large desktop) */
    padding: 0;
    box-sizing: border-box;
    margin-right: 20px; /* Spacing between cards */
}

.bs-review-slide:last-child {
    margin-right: 0;
}

/* Review Card */
.bs-review-card {
    display: flex;
    flex-direction: column;
    text-align: center;
    background: #ffffff;
    border-radius: 12px;
    padding: 18px 15px;
    box-shadow: 0 2px 12px rgba(0, 0, 0, 0.08);
    border: 1px solid #e5e5e5;
    transition: box-shadow 0.3s ease, transform 0.3s ease;
    width: 280px;
    height: 280px;
    overflow: hidden;
    cursor: pointer;
}

.bs-review-card:hover {
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.12);
    transform: translateY(-2px);
}

/* Rating Stars */
.bs-review-rating {
    margin-bottom: 6px;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 4px;
}

.bs-review-rating-number {
    font-size: 16px;
    font-weight: 600;
    color: #666;
}

/* Review Title */
.bs-review-title {
    margin: 0 0 6px 0;
    font-size: 14px;
    font-weight: 600;
    line-height: 1.3;
    color: #333;
    display: -webkit-box;
    -webkit-line-clamp: 1;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.bs-stars {
    display: inline-flex;
    gap: 3px;
    font-size: 16px;
    line-height: 1;
}

.bs-star {
    color: #ddd;
    transition: color 0.2s ease;
}

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

.bs-star.bs-star-half {
    position: relative;
}

.bs-star.bs-star-half::before {
    content: '★';
    position: absolute;
    left: 0;
    top: 0;
    width: 50%;
    overflow: hidden;
    color: #ffc107;
}

.bs-star.bs-star-half {
    color: #ddd;
}

/* Review Content */
.bs-review-content-wrapper {
    margin-bottom: 6px;
}

.bs-review-content {
    font-size: 13px;
    line-height: 1.4;
    color: #333;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.bs-review-content p {
    margin: 0;
}

/* Review Meta */
.bs-review-meta {
    display: flex;
    flex-direction: column;
    gap: 2px;
    margin-bottom: 4px;
}

.bs-review-author {
    font-weight: 600;
    color: #333;
    font-size: 14px;
}

.bs-review-date {
    color: #999;
    font-size: 13px;
}

/* Source Badge */
.bs-review-source {
    display: inline-block;
    padding: 4px 12px;
    background: #f0f0f0;
    color: #666;
    font-size: 11px;
    font-weight: 500;
    border-radius: 12px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    align-self: center;
}

/* Navigation Arrows */
.bs-slider-nav {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    width: 44px;
    height: 44px;
    background: #ffffff;
    border: 2px solid #e0e0e0;
    border-radius: 50%;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s ease;
    z-index: 100 !important; /* Higher z-index to override theme */
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
    padding: 0;
}

.bs-slider-nav::before {
    content: '';
    font-size: 28px;
    line-height: 1;
    color: #333;
    display: flex;
    align-items: center;
    justify-content: center;
}

.bs-slider-prev::before {
    content: '‹';
    margin-left: -2px;
}

.bs-slider-next::before {
    content: '›';
    margin-left: 2px;
}

.bs-slider-nav:hover {
    background: #ffc107;
    border-color: #ffc107;
    transform: translateY(-50%) scale(1.1);
    box-shadow: 0 4px 12px rgba(255, 193, 7, 0.4);
}

.bs-slider-nav:hover::before {
    color: #fff;
}

.bs-slider-nav:active,
.bs-slider-nav:focus {
    background: #ffffff !important;
    border-color: #e0e0e0 !important;
    transform: translateY(-50%) scale(0.95);
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
    outline: none !important;
}

.bs-slider-nav:active::before,
.bs-slider-nav:focus::before {
    color: #333 !important;
}

.bs-slider-prev {
    left: 0;
}

.bs-slider-next {
    right: 0;
}

/* Dots/Pagination */
.bs-reviews-wrapper .bs-slider-dots {
    display: flex !important;
    justify-content: center !important;
    gap: 8px !important;
    margin-top: 20px !important;
    list-style: none !important;
    padding: 0 !important;
}

.bs-slider-dot {
    width: 10px !important;
    height: 10px !important;
    border-radius: 50% !important;
    background: #ddd !important;
    cursor: pointer !important;
    transition: all 0.3s ease !important;
    border: 2px solid transparent !important;
    padding: 0 !important;
    font-size: 0 !important;
    line-height: 0 !important;
}

.bs-slider-dot:hover {
    background: #bbb !important;
}

.bs-slider-dot.bs-slider-dot-active {
    background: #ffc107 !important;
    width: 30px !important;
    border-radius: 6px !important;
}

/* No Reviews Message */
.bs-reviews-no-reviews {
    text-align: center;
    padding: 40px;
    background: #f9f9f9;
    border-radius: 8px;
    color: #666;
    font-style: italic;
}

/* =============================================================================
   RESPONSIVE DESIGN - Logical breakpoints synced with JS detection
   ============================================================================= */

/* Stats sidebar hidden below 1100px */
@media (max-width: 1100px) {
    .bs-reviews-stats-sidebar {
        display: none !important;
    }

    .bs-reviews-wrapper {
        flex-direction: column;
    }
}

/* Large Desktop (>1260px): 280px cards - 3 slides fit with 50px right padding */
@media (min-width: 1261px) {
    .bs-reviews-wrapper:not(.bs-reviews-no-stats) .bs-review-slide {
        flex: 0 0 280px;
    }

    .bs-reviews-wrapper.bs-reviews-no-stats .bs-review-slide {
        flex: 0 0 280px;
    }

    .bs-review-card {
        width: 280px;
        height: 280px;
        padding: 25px 20px;
    }
}

/* Medium Desktop (1101-1260px): 250px cards - 3 slides fit with 50px right padding */
@media (min-width: 1101px) and (max-width: 1260px) {
    .bs-reviews-wrapper .bs-review-slide {
        flex: 0 0 250px;
    }

    .bs-review-card {
        width: 250px;
        height: 250px;
        padding: 22px 18px;
    }
}

/* Small Desktop with stats (1001-1100px): 230px cards - 3 slides */
@media (min-width: 1001px) and (max-width: 1100px) {
    .bs-reviews-wrapper:not(.bs-reviews-no-stats) .bs-review-slide {
        flex: 0 0 230px;
    }

    .bs-review-card {
        width: 230px;
        height: 230px;
        padding: 20px 16px;
    }
}

/* Tablet Landscape (769-1000px) */
@media (min-width: 769px) and (max-width: 1000px) {
    .bs-review-card {
        padding: 20px 15px;
    }
}

/* Tablet Portrait (601-768px) */
@media (min-width: 601px) and (max-width: 768px) {
    .bs-review-card {
        padding: 18px 14px;
        height: auto !important;
    }
}

/* Mobile (≤600px) */
@media (max-width: 600px) {
    .bs-reviews-wrapper {
        margin: 20px 0;
    }

    .bs-review-card {
        padding: 20px 15px;
        height: auto !important;
    }

    .bs-review-content {
        font-size: 13px;
    }

    .bs-review-content p:first-child {
        font-size: 14px;
    }

    .bs-stars {
        font-size: 14px;
    }

    .bs-slider-nav {
        width: 36px;
        height: 36px;
    }

    .bs-reviews-wrapper .bs-slider-dots {
        display: none !important;
    }
}

/* Animation Classes */
.bs-review-slide {
    opacity: 0;
    transition: opacity 0.5s ease;
}

.bs-review-slide.bs-review-slide-active {
    opacity: 1;
}

/* Pause on Hover */
.bs-reviews-wrapper:hover .bs-reviews-slider[data-autoplay="true"] {
    animation-play-state: paused;
}

/* Touch/Swipe Support - Prevent text selection during swipe */
.bs-reviews-slider {
    touch-action: pan-y;
    user-select: none;
    -webkit-user-select: none;
}

.bs-reviews-slider .bs-review-card {
    touch-action: pan-y;
}

/* =============================================================================
   INLINE REVIEW POPUP
   Expands on the card's exact position within the slider
   ============================================================================= */

.bs-review-popup {
    position: absolute;
    z-index: 500;
    background: #ffffff;
    border-radius: 12px;
    box-shadow: 0 8px 40px rgba(0, 0, 0, 0.18);
    border: 2px solid #d0d0d0;
    display: none;
    flex-direction: column;
    text-align: center;
}

.bs-review-popup.bs-popup-open {
    display: flex;
}

.bs-review-popup-close {
    position: absolute;
    top: 6px;
    right: 6px;
    width: 26px;
    height: 26px;
    background: rgba(0, 0, 0, 0.06);
    border: none;
    border-radius: 50%;
    font-size: 18px;
    line-height: 1;
    cursor: pointer;
    color: #666;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 0;
    transition: background 0.2s, color 0.2s;
}

.bs-review-popup-close:hover {
    background: rgba(0, 0, 0, 0.12);
    color: #333;
}

.bs-review-popup-content {
    padding: 18px 18px 18px 18px;
    padding-top: 38px; /* room for the close button */
    display: flex;
    flex-direction: column;
    gap: 8px;
}

/* Full text inside popup - unrestricted */
.bs-review-popup-content .bs-review-content {
    -webkit-line-clamp: unset;
    display: block;
    overflow: visible;
    font-size: 13px;
    line-height: 1.5;
    text-align: left;
}

.bs-review-popup-content .bs-review-content p {
    margin: 0 0 5px 0;
}

.bs-review-popup-content .bs-review-title {
    -webkit-line-clamp: unset;
    display: block;
    overflow: visible;
    font-size: 14px;
    margin-bottom: 2px;
}

.bs-review-popup-content .bs-review-rating {
    margin-bottom: 2px;
    gap: 4px;
}

.bs-review-popup-content .bs-review-meta {
    margin-bottom: 0;
    gap: 2px;
}

/* =============================================================================
   NO STATS SIDEBAR LAYOUT
   When stats sidebar is hidden via shortcode, same responsive behavior
   ============================================================================= */

/* Both layouts now use same responsive breakpoints */
/* Stats sidebar is hidden via media query below 1000px for all layouts */
