/**
 * Testimonials Gallery Styles
 * 
 * Стили для галереи отзывов с видео/фото
 * @package BVTS
 */

/* ================================================
   LAYOUT & CONTAINER
   ================================================ */

.bvts-testimonials {
    --testimonials-gap: 24px;
    --testimonials-columns: 3;
    --card-radius: 16px;
    --card-media-ratio: 3 / 4;
    
    margin: 0;
    padding: 0;
}

.bvts-testimonials[data-columns="2"] {
    --testimonials-columns: 2;
}

.bvts-testimonials[data-columns="3"] {
    --testimonials-columns: 3;
}

.bvts-testimonials[data-columns="4"] {
    --testimonials-columns: 4;
}

.bvts-testimonials[data-columns="5"] {
    --testimonials-columns: 5;
}

.bvts-testimonials[data-columns="6"] {
    --testimonials-columns: 6;
}

/* ================================================
   HEADER WITH COUNTER
   ================================================ */

.bvts-testimonials__header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: 16px;
    margin-bottom: 32px;
}

.bvts-testimonials__title {
    margin: 0;
    font-size: clamp(28px, 5vw, 42px);
    font-weight: 700;
    line-height: 1.2;
    letter-spacing: -0.02em;
}

.bvts-testimonials__counter {
    display: flex;
    align-items: baseline;
    gap: 6px;
    padding: 8px 16px;
    background: var(--color-surface, #f5f5f5);
    border-radius: 100px;
    font-size: 14px;
    color: var(--color-text-secondary, #666);
}

.bvts-testimonials__counter-number {
    font-weight: 700;
    font-size: 18px;
    color: var(--color-text, #1a1a1a);
}

/* ================================================
   GRID
   ================================================ */

.bvts-testimonials__grid {
    display: flex;
    flex-wrap: wrap;
    gap: var(--testimonials-gap);
    margin: 0;
    padding: 0;
    list-style: none;
}

/* ================================================
   CARD
   ================================================ */

.bvts-testimonial-card {
    flex: 0 0 calc((100% - (var(--testimonials-columns) - 1) * var(--testimonials-gap)) / var(--testimonials-columns));
    width: calc((100% - (var(--testimonials-columns) - 1) * var(--testimonials-gap)) / var(--testimonials-columns));
    display: flex;
    flex-direction: column;
    gap: 16px;
}

/* ================================================
   MEDIA (Video / Image)
   ================================================ */

.bvts-testimonial-card__media {
    position: relative;
    aspect-ratio: var(--card-media-ratio);
    border-radius: var(--card-radius);
    overflow: hidden;
    background: linear-gradient(135deg, #e8e8e8 0%, #d4d4d4 100%);
    display: block;
    width: 100%;
    padding: 0;
    margin: 0;
}

.bvts-testimonial-card__video,
.bvts-testimonial-card__image,
.bvts-testimonial-card__media img,
.bvts-testimonial-card__media video {
    position: absolute;
    top: 0;
    left: 0;
    width: 100% !important;
    height: 100% !important;
    min-width: 100% !important;
    min-height: 100% !important;
    max-width: none !important;
    max-height: none !important;
    object-fit: cover;
    object-position: center;
    transition: transform 0.4s cubic-bezier(0.25, 0.46, 0.45, 0.94);
}

.bvts-testimonial-card__video[poster] {
    width: 100% !important;
    height: 100% !important;
    min-width: 100% !important;
    min-height: 100% !important;
    max-width: none !important;
    max-height: none !important;
    object-fit: cover;
    object-position: center;
}

.bvts-testimonial-card__video {
    opacity: 0;
    transition: opacity 0.3s ease, transform 0.4s cubic-bezier(0.25, 0.46, 0.45, 0.94);
}

/* Видео с poster сразу видимое */
.bvts-testimonial-card__video.has-poster {
    opacity: 1;
}

.bvts-testimonial-card__video.is-loaded {
    opacity: 1;
}

.bvts-testimonial-card__video-placeholder {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: linear-gradient(135deg, #e8e8e8 0%, #d4d4d4 100%);
    animation: testimonial-shimmer 1.5s ease-in-out infinite;
}

.bvts-testimonial-card__video.is-loaded + .bvts-testimonial-card__video-placeholder {
    display: none;
}

@keyframes testimonial-shimmer {
    0%, 100% {
        opacity: 1;
    }
    50% {
        opacity: 0.6;
    }
}

/* Hover effect */
.bvts-testimonial-card:hover .bvts-testimonial-card__video,
.bvts-testimonial-card:hover .bvts-testimonial-card__image {
    transform: scale(1.03);
}

/* ================================================
   PLAY BUTTON
   ================================================ */

.bvts-testimonial-card__play-btn {
    position: absolute;
    bottom: 16px;
    left: 16px;
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 10px 20px;
    background: var(--color-primary, #a855f7);
    color: #fff;
    font-size: 14px;
    font-weight: 600;
    text-decoration: none;
    border-radius: 100px;
    transition: all 0.25s ease;
    z-index: 2;
}

.bvts-testimonial-card__play-btn:hover {
    background: var(--color-primary-hover, #9333ea);
    color: #fff;
    transform: translateY(-2px);
    box-shadow: 0 8px 24px rgba(168, 85, 247, 0.35);
}

.bvts-testimonial-card__play-btn:active {
    transform: translateY(0);
}

/* ================================================
   CONTENT
   ================================================ */

.bvts-testimonial-card__content {
    display: flex;
    flex-direction: column;
    gap: 6px;
    padding: 0 4px;
}

.bvts-testimonial-card__title {
    margin: 0;
    font-size: 16px;
    font-weight: 600;
    line-height: 1.4;
    color: var(--color-text, #1a1a1a);
    /* Ограничение в 3 строки */
    display: -webkit-box;
    -webkit-line-clamp: 3;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.bvts-testimonial-card__meta {
    display: flex;
    align-items: center;
    gap: 8px;
}

.bvts-testimonial-card__author {
    margin: 0;
    font-size: 14px;
    font-weight: 400;
    color: var(--color-text-secondary, #666);
}

.bvts-testimonial-card__telegram {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 24px;
    height: 24px;
    color: #0088cc;
    background: rgba(0, 136, 204, 0.1);
    border-radius: 50%;
    transition: all 0.2s ease;
    flex-shrink: 0;
}

.bvts-testimonial-card__telegram:hover {
    color: #fff;
    background: #0088cc;
    transform: scale(1.1);
}

.bvts-testimonial-card__telegram svg {
    width: 14px;
    height: 14px;
}

/* ================================================
   RESPONSIVE
   ================================================ */

/* Tablet */
@media (max-width: 1024px) {
    .bvts-testimonials {
        --testimonials-gap: 20px;
    }
    
    .bvts-testimonials[data-columns="4"],
    .bvts-testimonials[data-columns="5"],
    .bvts-testimonials[data-columns="6"] {
        --testimonials-columns: 3;
    }
}

/* Small Tablet */
@media (max-width: 768px) {
    .bvts-testimonials {
        --testimonials-gap: 16px;
    }
    
    .bvts-testimonials[data-columns="2"],
    .bvts-testimonials[data-columns="3"],
    .bvts-testimonials[data-columns="4"],
    .bvts-testimonials[data-columns="5"],
    .bvts-testimonials[data-columns="6"] {
        --testimonials-columns: 2;
    }
    
    .bvts-testimonials__header {
        margin-bottom: 24px;
    }
    
    .bvts-testimonials__title {
        font-size: 28px;
    }
}

/* Mobile */
@media (max-width: 576px) {
    .bvts-testimonials[data-columns="2"],
    .bvts-testimonials[data-columns="3"],
    .bvts-testimonials[data-columns="4"],
    .bvts-testimonials[data-columns="5"],
    .bvts-testimonials[data-columns="6"] {
        --testimonials-columns: 1;
    }
    
    .bvts-testimonial-card {
        max-width: 400px;
        margin-left: auto;
        margin-right: auto;
    }
    
    .bvts-testimonials__header {
        flex-direction: column;
        align-items: flex-start;
        gap: 12px;
    }
    
    .bvts-testimonial-card__play-btn {
        bottom: 12px;
        left: 12px;
        padding: 8px 16px;
        font-size: 13px;
    }
}

/* ================================================
   LOAD MORE BUTTON
   ================================================ */

.bvts-testimonials__load-more {
    display: flex;
    justify-content: center;
    margin-top: 40px;
}

.bvts-load-more-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 16px 32px;
    min-width: 200px;
    background: var(--color-primary, #a855f7);
    color: #fff;
    font-family: inherit;
    font-size: 16px;
    font-weight: 600;
    text-align: center;
    border: none;
    border-radius: 100px;
    cursor: pointer;
    transition: all 0.25s ease;
}

.bvts-load-more-btn:hover {
    background: var(--color-primary-hover, #9333ea);
    transform: translateY(-2px);
    box-shadow: 0 8px 24px rgba(168, 85, 247, 0.35);
}

.bvts-load-more-btn:active {
    transform: translateY(0);
}

.bvts-load-more-btn.is-loading {
    opacity: 0.7;
    cursor: wait;
    transform: none;
    box-shadow: none;
}

.bvts-load-more-btn__count {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 28px;
    height: 28px;
    padding: 0 8px;
    background: rgba(255, 255, 255, 0.2);
    border-radius: 100px;
    font-size: 14px;
    font-weight: 700;
}

.bvts-load-more-btn__loading {
    display: inline-flex;
    align-items: center;
    gap: 8px;
}

.bvts-load-more-btn__loading::after {
    content: '';
    display: inline-block;
    width: 16px;
    height: 16px;
    border: 2px solid rgba(255, 255, 255, 0.3);
    border-top-color: #fff;
    border-radius: 50%;
    animation: bvts-spin 0.8s linear infinite;
}

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

/* Responsive */
@media (max-width: 576px) {
    .bvts-testimonials__load-more {
        margin-top: 32px;
    }
    
    .bvts-load-more-btn {
        width: 100%;
        max-width: 300px;
        padding: 14px 24px;
        font-size: 15px;
    }
}
