/* ========================================
   Reddit-style Reviews / Отзывы
   Высокая специфичность для переопределения Bootstrap
   ======================================== */

.reviews-section {
    background: #fff;
    border-radius: 8px;
    padding: 20px;
    margin-bottom: 20px;
}

.reviews-section .reviews-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 20px;
    padding-bottom: 15px;
    border-bottom: 1px solid #e5e5e5;
}

.reviews-section .reviews-header h3 {
    display: flex;
    align-items: center;
    gap: 10px;
    margin: 0;
    font-size: 18px;
    color: #1483cb;
}

.reviews-section .reviews-header .reviews-count {
    background: #1483cb;
    color: #fff;
    padding: 2px 8px;
    border-radius: 12px;
    font-size: 13px;
    font-weight: 600;
}

.reviews-section .reviews-sort {
    display: flex;
    gap: 10px;
}

.reviews-section .reviews-sort .sort-btn {
    background: #fff;
    border: 1px solid #ddd;
    padding: 6px 12px;
    border-radius: 4px;
    font-size: 13px;
    color: #666;
    cursor: pointer;
    transition: all 0.2s;
}

.reviews-section .reviews-sort .sort-btn:hover {
    border-color: #1483cb;
    color: #1483cb;
}

.reviews-section .reviews-sort .sort-btn.active {
    background: #1483cb;
    border-color: #1483cb;
    color: #fff;
}

/* Review Item */
.reviews-section .review-item {
    position: relative;
    padding-left: 0;
    margin-bottom: 0;
}

.reviews-section .review-item.depth-0 {
    padding-top: 15px;
    border-top: 1px solid #f0f0f0;
}

.reviews-section .review-item.depth-0:first-child {
    padding-top: 0;
    border-top: none;
}

/* Thread Line для вложенности */
.reviews-section .review-item .review-thread-line {
    display: none;
}

.reviews-section .review-item.depth-1,
.reviews-section .review-item.depth-2,
.reviews-section .review-item.depth-3,
.reviews-section .review-item.depth-4,
.reviews-section .review-item.depth-5 {
    padding-left: 20px;
    margin-left: 12px;
    border-left: 2px solid #e0e0e0;
}

.reviews-section .review-item.depth-1:hover,
.reviews-section .review-item.depth-2:hover,
.reviews-section .review-item.depth-3:hover,
.reviews-section .review-item.depth-4:hover,
.reviews-section .review-item.depth-5:hover {
    border-left-color: #1483cb;
}

/* Content */
.reviews-section .review-content {
    background: #fafafa;
    border-radius: 8px;
    padding: 12px 15px;
    margin: 8px 0;
    transition: background 0.2s;
}

.reviews-section .review-item.depth-0 > .review-content {
    background: #fff;
    border: 1px solid #e8e8e8;
}

.reviews-section .review-content:hover {
    background: #f5f5f5;
}

/* Header */
.reviews-section .review-header {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 8px;
    margin-bottom: 8px;
}

.reviews-section .review-author {
    display: flex;
    align-items: center;
    gap: 6px;
    flex-wrap: wrap;
}

.reviews-section .author-name {
    display: flex;
    align-items: center;
    gap: 5px;
    font-weight: 600;
    color: #333;
    font-size: 14px;
}

.reviews-section .author-name .icon-user {
    opacity: 0.6;
}

/* Owner Badge - Prominent Style */
.reviews-section .author-badge.badge-owner {
    display: inline-flex !important;
    align-items: center;
    gap: 5px;
    background: linear-gradient(135deg, #1483cb 0%, #0d5a8c 100%) !important;
    color: #fff !important;
    padding: 4px 12px !important;
    border-radius: 16px !important;
    font-weight: 600;
    font-size: 13px !important;
    box-shadow: 0 2px 4px rgba(20, 131, 203, 0.3);
    text-shadow: 0 1px 1px rgba(0, 0, 0, 0.1);
    line-height: 1.4;
}

.reviews-section .author-badge.badge-owner svg {
    width: 14px;
    height: 14px;
}

.reviews-section .badge-owner-label {
    display: inline-block;
    background: linear-gradient(135deg, #e3f2fd 0%, #bbdefb 100%) !important;
    color: #0d5a8c !important;
    padding: 3px 10px !important;
    border-radius: 12px !important;
    font-size: 11px !important;
    font-weight: 600;
    border: 1px solid rgba(20, 131, 203, 0.2);
    text-transform: uppercase;
    letter-spacing: 0.3px;
    line-height: 1.4;
}

/* Badges - Enhanced (переопределяем Bootstrap) */
.reviews-section .badge {
    display: inline-flex !important;
    align-items: center;
    gap: 4px;
    padding: 3px 8px !important;
    border-radius: 12px !important;
    font-size: 11px !important;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.3px;
    line-height: 1.4;
}

.reviews-section .badge svg {
    width: 12px;
    height: 12px;
}

.reviews-section .badge-verified {
    background: linear-gradient(135deg, #e8f5e9 0%, #c8e6c9 100%) !important;
    color: #2e7d32 !important;
    border: 1px solid rgba(46, 125, 50, 0.2);
}

.reviews-section .badge-verified svg {
    color: #4caf50;
}

.reviews-section .badge-top {
    background: linear-gradient(135deg, #fff8e1 0%, #ffecb3 100%) !important;
    color: #ff8f00 !important;
    border: 1px solid rgba(255, 143, 0, 0.3);
    box-shadow: 0 1px 3px rgba(255, 193, 7, 0.3);
}

.reviews-section .badge-top::before {
    content: "★";
    font-size: 10px;
}

.reviews-section .badge-expert {
    background: linear-gradient(135deg, #ede7f6 0%, #d1c4e9 100%) !important;
    color: #5e35b1 !important;
    border: 1px solid rgba(94, 53, 177, 0.2);
}

/* Date */
.reviews-section .review-date {
    color: #888;
    font-size: 12px;
    margin-left: auto;
}

/* Rating */
.reviews-section .review-rating {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 10px;
}

.reviews-section .rating-stars {
    display: flex;
    gap: 2px;
}

.reviews-section .rating-stars .star {
    color: #ddd;
    font-size: 16px;
}

.reviews-section .rating-stars .star.filled {
    color: #f5a623;
}

.reviews-section .rating-value {
    background: #fff3e0;
    color: #e65100;
    padding: 2px 8px;
    border-radius: 4px;
    font-size: 12px;
    font-weight: 600;
}

/* Text */
.reviews-section .review-text {
    color: #333;
    font-size: 14px;
    line-height: 1.6;
    margin-bottom: 10px;
    word-wrap: break-word;
}

/* Footer */
.reviews-section .review-footer {
    display: flex;
    align-items: center;
    gap: 15px;
    flex-wrap: wrap;
}

/* Votes - Reddit Style */
.reviews-section .review-votes {
    display: inline-flex;
    align-items: center;
    gap: 2px;
    background: #f6f7f8;
    border-radius: 20px;
    padding: 2px 6px;
}

.reviews-section .vote-btn {
    display: inline-flex !important;
    align-items: center;
    justify-content: center;
    background: transparent !important;
    border: none !important;
    width: 28px;
    height: 28px;
    border-radius: 50% !important;
    color: #878a8c;
    cursor: pointer;
    transition: all 0.15s ease;
    padding: 0 !important;
    margin: 0;
    line-height: 1;
}

.reviews-section .vote-btn svg {
    width: 18px;
    height: 18px;
    transition: transform 0.15s ease;
    display: block;
}

.reviews-section .vote-btn:hover {
    background: rgba(0, 0, 0, 0.05) !important;
}

.reviews-section .vote-btn:active svg {
    transform: scale(0.9);
}

.reviews-section .vote-btn.vote-up:hover {
    color: #ff4500;
    background: rgba(255, 69, 0, 0.1) !important;
}

.reviews-section .vote-btn.vote-down:hover {
    color: #7193ff;
    background: rgba(113, 147, 255, 0.1) !important;
}

.reviews-section .vote-btn.active.vote-up {
    color: #ff4500;
}

.reviews-section .vote-btn.active.vote-up svg {
    fill: #ff4500;
}

.reviews-section .vote-btn.active.vote-down {
    color: #7193ff;
}

.reviews-section .vote-btn.active.vote-down svg {
    fill: #7193ff;
}

.reviews-section .vote-score {
    min-width: 24px;
    text-align: center;
    font-size: 12px;
    font-weight: 700;
    color: #1a1a1b;
    padding: 0 4px;
}

.reviews-section .vote-score.positive {
    color: #ff4500;
}

.reviews-section .vote-score.negative {
    color: #7193ff;
}

/* Spoiler Effect - Telegram Style */
.reviews-section .review-votes.spoiler {
    position: relative;
    cursor: pointer;
}

.reviews-section .review-votes.spoiler .vote-score {
    background: #878a8c;
    color: #878a8c !important;
    border-radius: 4px;
    padding: 2px 6px !important;
    min-width: 28px;
    user-select: none;
}

.reviews-section .review-votes.spoiler .vote-btn {
    opacity: 0.5;
    cursor: pointer;
}

/* Vote Tooltip */
.vote-tooltip {
    position: fixed;
    background: #333;
    color: #fff;
    padding: 8px 14px;
    border-radius: 6px;
    font-size: 13px;
    font-weight: 500;
    white-space: nowrap;
    z-index: 10000;
    opacity: 0;
    transform: translateY(5px);
    transition: opacity 0.2s ease, transform 0.2s ease;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.2);
    pointer-events: none;
}

.vote-tooltip::after {
    content: "";
    position: absolute;
    bottom: -6px;
    left: 50%;
    transform: translateX(-50%);
    border-width: 6px 6px 0;
    border-style: solid;
    border-color: #333 transparent transparent;
}

.vote-tooltip.show {
    opacity: 1;
    transform: translateY(0);
}

/* Reply Button */
.reviews-section .reply-btn {
    display: inline-flex !important;
    align-items: center;
    gap: 5px;
    background: transparent !important;
    border: none !important;
    padding: 6px 12px !important;
    border-radius: 4px;
    color: #666;
    cursor: pointer;
    font-size: 12px;
    transition: all 0.2s;
}

.reviews-section .reply-btn:hover {
    background: #e3f2fd !important;
    color: #1483cb;
}

/* Expand Replies */
.reviews-section .expand-replies-btn {
    display: inline-flex !important;
    align-items: center;
    gap: 5px;
    background: #f5f5f5 !important;
    border: none !important;
    padding: 6px 12px !important;
    border-radius: 4px;
    color: #1483cb;
    cursor: pointer;
    font-size: 12px;
    font-weight: 500;
    transition: all 0.2s;
}

.reviews-section .expand-replies-btn:hover {
    background: #e3f2fd !important;
}

/* Children */
.reviews-section .review-children {
    margin-top: 5px;
}

/* Empty State */
.reviews-section .reviews-empty {
    text-align: center;
    padding: 40px 20px;
    color: #888;
}

.reviews-section .reviews-empty svg {
    width: 48px;
    height: 48px;
    opacity: 0.3;
    margin-bottom: 15px;
}

.reviews-section .reviews-empty p {
    margin: 0;
    font-size: 14px;
}

/* Reply Form */
.reviews-section .reply-form {
    background: #f8f9fa;
    border-radius: 8px;
    padding: 15px;
    margin-top: 10px;
    display: none;
}

.reviews-section .reply-form.active {
    display: block;
}

.reviews-section .reply-form textarea {
    width: 100%;
    border: 1px solid #ddd;
    border-radius: 6px;
    padding: 10px;
    font-size: 14px;
    resize: vertical;
    min-height: 80px;
    margin-bottom: 10px;
}

.reviews-section .reply-form textarea:focus {
    outline: none;
    border-color: #1483cb;
}

.reviews-section .reply-form-actions {
    display: flex;
    justify-content: flex-end;
    gap: 10px;
}

.reviews-section .reply-form .btn-cancel {
    background: #f0f0f0 !important;
    border: none !important;
    padding: 8px 16px !important;
    border-radius: 4px;
    color: #666;
    cursor: pointer;
}

.reviews-section .reply-form .btn-submit {
    background: #1483cb !important;
    border: none !important;
    padding: 8px 16px !important;
    border-radius: 4px;
    color: #fff;
    cursor: pointer;
    font-weight: 500;
}

.reviews-section .reply-form .btn-submit:hover {
    background: #1169a4 !important;
}

/* Mobile Responsive */
@media (max-width: 768px) {
    .reviews-section .reviews-header {
        flex-direction: column;
        align-items: flex-start;
        gap: 10px;
    }

    .reviews-section .review-item.depth-1,
    .reviews-section .review-item.depth-2,
    .reviews-section .review-item.depth-3,
    .reviews-section .review-item.depth-4,
    .reviews-section .review-item.depth-5 {
        padding-left: 12px;
        margin-left: 8px;
    }

    .reviews-section .review-content {
        padding: 10px 12px;
    }

    .reviews-section .review-header {
        flex-direction: column;
        align-items: flex-start;
    }

    .reviews-section .review-date {
        margin-left: 0;
        margin-top: 5px;
    }

    .reviews-section .review-footer {
        gap: 10px;
    }
}

/* Animations */
@keyframes reviewFadeIn {
    from {
        opacity: 0;
        transform: translateY(-10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.reviews-section .review-item.new {
    animation: reviewFadeIn 0.3s ease;
}
