/* Reviews Module CSS */

/* Main Reviews Block */
.reviews-block {
    background: rgba(255, 255, 255, 0.05);
    backdrop-filter: blur(20px);
    border-radius: 20px;
    padding: 24px 20px;
    margin: 0;
    border: 1px solid rgba(255, 255, 255, 0.12);
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.1);
}

.reviews-header {
    text-align: center;
    margin-bottom: 16px;
}

.reviews-title {
    font-size: 18px;
    font-weight: 600;
    color: #fff;
    margin-bottom: 12px;
}

.reviews-rating {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 12px;
    margin-bottom: 8px;
}

.reviews-average {
    font-size: 36px;
    font-weight: 700;
    color: #fff;
    line-height: 1;
}

.reviews-stars {
    display: flex;
    gap: 4px;
    font-size: 20px;
}

.reviews-stars .star {
    color: #ffd700;
}

.reviews-stars .star.filled {
    color: #ffd700;
}

.reviews-stars .star.half {
    color: #ffd700;
    opacity: 0.6;
}

.reviews-stars .star.empty {
    color: rgba(255, 255, 255, 0.2);
}

.reviews-total {
    font-size: 14px;
    color: rgba(255, 255, 255, 0.7);
    text-align: center;
    margin-bottom: 16px;
}

.reviews-buttons {
    display: flex;
    gap: 12px;
    justify-content: center;
    transition: opacity 0.15s ease-out, visibility 0s linear 0s;
}

.reviews-rating,
.reviews-total {
    transition: opacity 0.15s ease-out;
}

.reviews-btn {
    flex: 1;
    max-width: 180px;
    padding: 14px 20px;
    background: rgba(255, 255, 255, 0.08);
    backdrop-filter: blur(10px);
    border: 1px solid rgba(255, 255, 255, 0.15);
    border-radius: 16px;
    color: #fff;
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
}

.reviews-btn:hover {
    background: rgba(255, 255, 255, 0.15);
}

.reviews-btn:active {
    background: rgba(255, 255, 255, 0.12);
}

.reviews-btn.primary {
    background: #D3F570;
    border: none;
    color: #000000;
    font-weight: 500;
}

.reviews-btn.primary:hover {
    background: #C5E85F;
}

.reviews-btn.primary:active {
    background: #B8DB55;
}

/* Modal Overlay */
.modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.8);
    backdrop-filter: blur(4px);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 10000;
    padding: 20px;
    opacity: 1;
    transition: opacity 0.3s;
    /* 🔧 ФИКС СВАЙПА: Только вертикальный скролл */
    touch-action: pan-y;
    overscroll-behavior: contain;
    overflow: hidden;
}

.modal-overlay.hidden {
    display: none;
    opacity: 0;
}

.modal-content {
    background: #1a1a1a;
    border-radius: 20px;
    max-width: 500px;
    width: 100%;
    max-height: 80vh;
    display: flex;
    flex-direction: column;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.5);
    border: 1px solid rgba(255, 255, 255, 0.1);
    margin: 20px;
    /* 🔧 ФИКС: Только вертикальный скролл, контент не выходит за границы */
    touch-action: pan-y;
    overflow: hidden;
    position: relative;
}

.modal-header {
    padding: 20px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.modal-title {
    font-size: 20px;
    font-weight: 600;
    color: #fff;
}

.modal-close {
    width: 32px;
    height: 32px;
    border-radius: 8px;
    background: rgba(255, 255, 255, 0.1);
    border: none;
    color: #fff;
    font-size: 24px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s;
}

.modal-close:hover {
    background: rgba(255, 255, 255, 0.2);
}

.modal-body {
    padding: 20px;
    overflow-y: auto;
    overflow-x: hidden;
    flex: 1;
    min-height: 0;
    max-height: calc(80vh - 100px);
    /* 🔧 ФИКС СВАЙПА: Запрет горизонтального скролла */
    touch-action: pan-y;
    overscroll-behavior-x: none;
    overscroll-behavior-y: contain;
    -webkit-overflow-scrolling: touch;
}

/* Star Rating Input */
.star-rating {
    display: flex;
    justify-content: center;
    gap: 8px;
    margin: 20px 0;
}

.star-rating .star {
    font-size: 36px;
    color: rgba(255, 255, 255, 0.3);
    cursor: pointer;
    transition: all 0.2s;
    user-select: none;
}

.star-rating .star:hover,
.star-rating .star.selected {
    color: #ffd700;
    transform: scale(1.1);
}

/* Review Form */
.review-form {
    display: flex;
    flex-direction: column;
    gap: 16px;
}

.review-form label {
    font-size: 14px;
    color: rgba(255, 255, 255, 0.7);
    margin-bottom: 8px;
    display: block;
}

.review-form textarea {
    width: 100%;
    min-height: 120px;
    padding: 12px;
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 12px;
    color: #fff;
    font-size: 14px;
    font-family: inherit;
    resize: vertical;
    transition: all 0.2s;
    /* 🔧 ФИКС: Только вертикальный скролл в textarea */
    touch-action: pan-y;
    overflow-x: hidden;
    box-sizing: border-box;
}

.review-form textarea:focus {
    outline: none;
    border-color: #667eea;
    background: rgba(255, 255, 255, 0.08);
}

.review-form textarea::placeholder {
    color: rgba(255, 255, 255, 0.4);
}

.char-counter {
    text-align: right;
    font-size: 12px;
    color: rgba(255, 255, 255, 0.5);
    margin-top: -8px;
}

.submit-btn {
    width: 100%;
    height: 56px;
    padding: 0 20px;
    background: #D3F570;
    border: none;
    border-radius: 16px;
    color: #000000;
    font-size: 16px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s;
}

.submit-btn:hover {
    background: #C5E85F;
}

.submit-btn:active {
    background: #B8DB55;
}

.submit-btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
    background: #D3F570;
}

/* Reviews List */
.reviews-list {
    display: flex;
    flex-direction: column;
    gap: 16px;
}

.review-item {
    background: rgba(255, 255, 255, 0.05);
    border-radius: 12px;
    padding: 16px;
    border: 1px solid rgba(255, 255, 255, 0.1);
}

.review-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 12px;
    gap: 12px;
    /* 🔧 ФИКС: Не даем элементам выходить за границы */
    min-width: 0;
}

.review-author {
    font-size: 14px;
    font-weight: 600;
    color: #fff;
    /* 🔧 ФИКС: Длинное имя обрезается с многоточием */
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    flex: 1;
    min-width: 0;
    max-width: calc(100% - 100px);
}

.review-stars {
    font-size: 16px;
    color: #ffd700;
    /* 🔧 ФИКС: Звезды всегда остаются справа и не сжимаются */
    flex-shrink: 0;
    white-space: nowrap;
}

.review-text {
    font-size: 14px;
    line-height: 1.6;
    color: rgba(255, 255, 255, 0.9);
    margin-bottom: 8px;
    white-space: pre-wrap;
    word-break: break-word;
    /* 🔧 ФИКС: Контент не выходит за границы */
    overflow-wrap: break-word;
    max-width: 100%;
}

.review-footer {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-top: 8px;
}

.review-date {
    font-size: 12px;
    color: rgba(255, 255, 255, 0.5);
}

.review-delete-btn {
    padding: 4px 10px;
    background: rgba(255, 100, 100, 0.2);
    border: 1px solid rgba(255, 100, 100, 0.4);
    border-radius: 6px;
    color: #ff6464;
    font-size: 11px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s ease;
}

.review-delete-btn:hover {
    background: rgba(255, 100, 100, 0.3);
    border-color: rgba(255, 100, 100, 0.6);
}

.review-delete-btn:active {
    transform: scale(0.95);
}

/* Pagination */
.pagination-buttons {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 16px;
    margin-top: 20px;
    padding-top: 20px;
    border-top: 1px solid rgba(255, 255, 255, 0.1);
}

.pagination-btn {
    padding: 8px 16px;
    background: rgba(255, 255, 255, 0.1);
    border: 1px solid rgba(255, 255, 255, 0.2);
    border-radius: 8px;
    color: #fff;
    font-size: 14px;
    cursor: pointer;
    transition: all 0.2s;
}

.pagination-btn:hover {
    background: rgba(255, 255, 255, 0.2);
}

.pagination-info {
    font-size: 14px;
    color: rgba(255, 255, 255, 0.7);
}

/* Mobile Responsive */
@media (max-width: 480px) {
    .modal-content {
        max-width: 100%;
        border-radius: 20px;
        max-height: 90vh;
    }
    
    .reviews-buttons {
        flex-direction: column;
    }
    
    .reviews-btn {
        max-width: none;
    }
    
    .star-rating .star {
        font-size: 32px;
    }
}

