/**
 * Maasai Reviews - Frontend Styles
 * Designed to match the provided reference image
 */

/* Container */
.maasai-reviews-wrapper {
    padding: 30px 0;
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, sans-serif;
}

/* Header */
.maasai-reviews-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 30px;
    flex-wrap: wrap;
    gap: 15px;
}

.maasai-reviews-summary {
    display: flex;
    align-items: center;
    gap: 12px;
}

.maasai-reviews-summary .maasai-stars {
    font-size: 24px;
}

.maasai-reviews-count {
    font-size: 16px;
    color: #333;
    font-weight: 500;
}

.maasai-write-review-btn {
    background: #fff;
    border: 1px solid #333;
    padding: 10px 24px;
    font-size: 14px;
    font-weight: 500;
    border-radius: 4px;
    cursor: pointer;
    transition: all 0.2s ease;
}

.maasai-write-review-btn:hover {
    background: #333;
    color: #fff;
}

/* Grid */
.maasai-reviews-grid {
    display: flex;
    flex-wrap: wrap;
    margin: 0 -12px;
}

.maasai-review-col {
    padding: 12px;
}

/* Card */
.maasai-review-card {
    background: #fff;
    border-radius: 16px;
    overflow: hidden;
    box-shadow: 0 2px 12px rgba(0, 0, 0, 0.08);
    transition: transform 0.2s ease, box-shadow 0.2s ease;
    height: 100%;
    display: flex;
    flex-direction: column;
}

.maasai-review-card:hover {
    transform: translateY(-4px);
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.12);
}

/* Media */
.maasai-review-media {
    position: relative;
    padding-top: 100%;
    overflow: hidden;
    background: #f5f5f5;
}

.maasai-review-media img {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: opacity 0.3s ease;
}

.maasai-review-media img:not(.maasai-loaded) {
    opacity: 0;
}

.maasai-review-media img.maasai-loaded {
    opacity: 1;
}

.maasai-image-link {
    display: block;
    width: 100%;
    height: 100%;
    position: absolute;
    top: 0;
    left: 0;
}

/* Video wrapper */
.maasai-video-wrapper {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    cursor: pointer;
}

.maasai-video-wrapper img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.maasai-play-btn {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 60px;
    height: 60px;
    background: rgba(0, 0, 0, 0.6);
    border: none;
    border-radius: 50%;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s ease;
}

.maasai-play-btn:hover {
    background: rgba(0, 0, 0, 0.8);
    transform: translate(-50%, -50%) scale(1.1);
}

.maasai-play-btn svg {
    width: 24px;
    height: 24px;
    fill: #fff;
    margin-left: 4px;
}

/* Content */
.maasai-review-content {
    padding: 16px;
    flex: 1;
    display: flex;
    flex-direction: column;
}

/* Author */
.maasai-review-author {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 8px;
    margin-bottom: 4px;
}

.maasai-author-name {
    font-weight: 600;
    font-size: 14px;
    color: #333;
}

.maasai-verified-badge {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    background: #e8f4fd;
    color: #1877f2;
    padding: 2px 8px;
    border-radius: 12px;
    font-size: 11px;
    font-weight: 500;
}

.maasai-verified-badge svg {
    width: 12px;
    height: 12px;
    fill: #1877f2;
}

/* Date */
.maasai-review-date {
    font-size: 12px;
    color: #888;
    margin-bottom: 8px;
}

/* Rating */
.maasai-review-rating {
    margin-bottom: 10px;
}

.maasai-stars {
    display: inline-flex;
    gap: 1px;
}

.maasai-star {
    font-size: 16px;
    line-height: 1;
}

.maasai-star-filled {
    color: #ffc107;
}

.maasai-star-empty {
    color: #e0e0e0;
}

/* Review text */
.maasai-review-text {
    font-size: 14px;
    line-height: 1.6;
    color: #444;
    flex: 1;
}

/* Empty state */
.maasai-reviews-empty {
    text-align: center;
    padding: 60px 20px;
    color: #888;
    font-size: 16px;
}

/* Video Modal */
.maasai-video-modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 999999;
    display: flex;
    align-items: center;
    justify-content: center;
}

.maasai-video-modal-backdrop {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.9);
}

.maasai-video-modal-content {
    position: relative;
    max-width: 90%;
    max-height: 90%;
    z-index: 1;
}

.maasai-video-modal-content video {
    max-width: 100%;
    max-height: 80vh;
    border-radius: 8px;
}

.maasai-video-modal-close {
    position: absolute;
    top: -40px;
    right: 0;
    background: none;
    border: none;
    color: #fff;
    font-size: 32px;
    cursor: pointer;
    padding: 0;
    width: 40px;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: opacity 0.2s;
}

.maasai-video-modal-close:hover {
    opacity: 0.7;
}

/* Responsive - Tablet */
@media (max-width: 991px) {
    .maasai-review-col {
        flex: 0 0 50%;
        max-width: 50%;
    }
}

/* Responsive - Mobile */
@media (max-width: 575px) {
    .maasai-review-col {
        flex: 0 0 100%;
        max-width: 100%;
    }
    
    .maasai-reviews-header {
        flex-direction: column;
        align-items: flex-start;
    }
    
    .maasai-write-review-btn {
        width: 100%;
        text-align: center;
    }
    
    .maasai-play-btn {
        width: 50px;
        height: 50px;
    }
    
    .maasai-play-btn svg {
        width: 20px;
        height: 20px;
    }
}

/* Masonry-like effect for varying heights */
@supports (grid-template-rows: masonry) {
    .maasai-reviews-grid {
        display: grid;
        grid-template-columns: repeat(4, 1fr);
        grid-template-rows: masonry;
        gap: 24px;
    }
    
    .maasai-review-col {
        flex: none;
        max-width: none;
        padding: 0;
    }
    
    @media (max-width: 991px) {
        .maasai-reviews-grid {
            grid-template-columns: repeat(2, 1fr);
        }
    }
    
    @media (max-width: 575px) {
        .maasai-reviews-grid {
            grid-template-columns: 1fr;
        }
    }
}
