/* Шрифт как на всех страницах */
body, .container-wrapper, .admin-panel, .content-block,
.card, .btn, .modal-content, h1, h2, h3, h4, h5, h6 {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
}

/* Компенсация sticky-шапки - как в index */
body.has-sticky-header .container-wrapper {
    padding-top: 90px !important;
}

@media (max-width: 768px) {
    body.has-sticky-header .container-wrapper {
        padding-top: 120px !important;
    }
}

/* Плавный переход */
.container-wrapper {
    transition: padding-top 0.2s ease;
}

/* === ГЛАВНЫЙ КОНТЕЙНЕР - как в index === */
.container-wrapper {
    max-width: 1300px;
    margin: 5px auto;
    padding: 0 15px;
    min-height: calc(100vh - 160px);
    overflow-x: hidden;
}

@media (min-width: 1200px) {
    .container-wrapper {
        max-width: 1300px;
    }
}

@media (max-width: 768px) {
    .container-wrapper {
        padding: 0 10px;
    }
}

/* === КАРТОЧКИ - как в index === */
.card {
    transition: transform 0.2s ease, box-shadow 0.2s ease;
    border-radius: 12px;
    border: 1px solid #dee2e6 !important;
    background-color: #ffffff !important;
}

.card:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0,0,0,0.1);
}

/* === КНОПКИ - унифицированные с index === */
.btn {
    border-radius: 10px;
    font-weight: 500;
    transition: all 0.2s ease-in-out;
    padding: 6px 16px;
}

.btn-primary {
    background-color: #17c75c;
    border-color: #95e5d3;
    color: #000000;
}

.btn-primary:hover {
    background-color: #17c75c;
    border-color: #b0ece0;
    color: #000000;
    transform: translateY(-1px);
}

.btn-outline-primary {
    color: #000000;
    border-color: #95e5d3;
    background-color: transparent;
}

.btn-outline-primary:hover {
    background-color: #95e5d3;
    border-color: #95e5d3;
    color: #000000;
    transform: translateY(-1px);
}

.btn-success {
    background-color: #17c75c;
    border-color: #95e5d3;
    color: #000000;
}

.btn-success:hover {
    background-color: #b0ece0;
    border-color: #b0ece0;
    color: #000000;
    transform: translateY(-1px);
}

.btn-danger {
    background-color: #dc3545;
    border-color: #dc3545;
    color: white !important;
}

.btn-danger:hover {
    background-color: #c82333;
    border-color: #bd2130;
    transform: translateY(-1px);
}

.btn-secondary {
    background-color: #6c757d;
    border-color: #6c757d;
    color: white !important;
}

.btn-outline-secondary {
    border-color: #95e5d3;
    color: #000000;
}

.btn-outline-secondary:hover {
    background-color: #95e5d3;
    border-color: #95e5d3;
    color: #000000;
}

/* Кнопка "Ответить" - как в index */
.reply-btn {
    font-size: 0.875rem;
    padding: 4px 8px;
    border-radius: 10px;
    background: #17c75c;
    color: #000000;
    border: 1px solid #95e5d3;
}

.reply-btn:hover {
    background: #b0ece0;
    color: #000000;
    transform: translateY(-1px);
}

/* === ФОРМЫ === */
.form-control,
textarea {
    border: 2px solid #6c757d !important;
    background-color: #fefefe !important;
    transition: all 0.2s ease-in-out !important;
    border-radius: 6px !important;
    padding: 8px 12px !important;
}

.form-control:focus,
textarea:focus {
    border-color: #0d6efd !important;
    background-color: #ffffff !important;
    box-shadow: 0 0 0 3px rgba(13, 110, 253, 0.25) !important;
    outline: none !important;
}

.form-label {
    font-weight: 600 !important;
    color: #2c3e50 !important;
    margin-bottom: 8px !important;
}

/* === КАРТОЧКА ИНФОРМАЦИИ О ПОЛЬЗОВАТЕЛЕ === */
.user-info-card {
    margin-bottom: 1.5rem !important;
}

.user-info-card .card {
    border: none !important;
    border-radius: 16px !important;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
    background: white;
}

.user-info-card .card-body {
    padding: 1.25rem;
}

.user-avatar {
    color: #5a9e6e;
}

.user-avatar i {
    font-size: 2.5rem;
}

.user-details p {
    margin-bottom: 0.25rem;
    color: #2c3e50;
}

.user-info-card .card-title {
    font-size: 1.1rem;
    margin-bottom: 0.5rem;
}

/* === ФОРМА ОТЗЫВА === */
.comment-form .card {
    border: none !important;
    border-radius: 16px !important;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
}

.comment-form .card-header {
    background: #00BFFF !important;
    border: none;
    border-radius: 16px 16px 0 0 !important;
    font-weight: 500 !important;
    padding: 12px 20px;
}

.comment-form .card-header h5 {
    color: #360b0b !important;
    margin: 0;
    font-size: 1rem;
}

/* === СЕКЦИЯ ОТЗЫВОВ === */
.reviews-section {
    margin-top: 2rem;
}

.reviews-section h3 {
    color: #360b0b;
    font-weight: 600;
    font-size: 1.25rem;
}

/* === КАРТОЧКА ОТЗЫВА === */
.review-card {
    border: 1px solid #e9ecef;
    border-radius: 16px !important;
    margin-bottom: 1.5rem;
    transition: box-shadow 0.2s ease-in-out;
    background: white;
}

.review-card:hover {
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
}

.review-header {
    border-bottom: 1px solid #e9ecef;
    padding-bottom: 1rem;
}

.user-avatar-sm {
    color: #5a9e6e;
}

.user-avatar-sm i {
    font-size: 1.5rem;
}

.card-subtitle {
    color: #360b0b;
    font-weight: 600;
}

/* === ОТВЕТЫ НА ОТЗЫВЫ === */
.review-replies {
    margin-left: 2rem;
    margin-top: 1rem;
    padding-left: 1rem;
    border-left: 3px solid #5a9e6e;
}

.review-reply-card {
    background-color: #f8f9fa;
    border: 1px solid #dee2e6;
    border-radius: 12px !important;
    margin-bottom: 10px;
}

.review-reply-card .card-body {
    padding: 1rem;
}

/* === БЛОК ОТВЕТА === */
#replyTo {
    background-color: #e8f5e9;
    border: 1px solid #5a9e6e;
    border-radius: 12px;
}

/* === СООБЩЕНИЯ ОБ ОТСУТСТВИИ ОТЗЫВОВ === */
.no-reviews .card {
    background-color: #f8f9fa;
    border: none;
    border-radius: 16px !important;
}

.no-reviews i {
    opacity: 0.5;
}

/* === ХЛЕБНЫЕ КРОШКИ === */
.breadcrumb {
    background-color: transparent;
    padding: 0.75rem 0;
}

.breadcrumb-item a {
    color: #6c757d;
    text-decoration: none;
}

.breadcrumb-item a:hover {
    color: #5a9e6e;
}

.breadcrumb-item.active {
    color: #495057;
}

/* === АЛЕРТЫ === */
.alert {
    border: none;
    border-radius: 12px;
}

.alert-warning {
    background-color: #fff3cd;
    color: #856404 !important;
}

.alert-info {
    background-color: #d1ecf1;
    color: #0c5460 !important;
}

.alert-success {
    background-color: #d4edda;
    color: #155724 !important;
}

.alert-danger {
    color: #721c24 !important;
}

/* === БЛОК РЕЙТИНГА === */
.user-rating-section {
    margin: 15px 0;
}

.rating-info {
    background-color: #f8f9fa;
    border: 1px solid #e9ecef;
    border-radius: 12px;
    padding: 8px 16px;
    display: inline-block;
    text-align: center;
}

.rating-info strong {
    color: #495057;
    font-weight: 600;
    margin-right: 10px;
    font-size: 0.85rem;
}

.rating-stars {
    display: inline-flex;
    align-items: center;
    gap: 2px;
}

.rating-star {
    font-size: 16px;
    cursor: pointer;
    transition: color 0.2s ease;
    color: #ddd;
}

.rating-star.rated {
    color: #ffc107;
}

.rating-star.interactive-star:hover {
    color: #ffc107;
}

.rating-text {
    color: #6c757d;
    font-size: 0.8rem;
}

.rate-seller-text {
    font-size: 0.8rem;
}

.rate-seller-link {
    color: #17c75c;
    text-decoration: none;
    cursor: pointer;
}

.rate-seller-link:hover {
    text-decoration: underline;
    color: #b0ece0;
}

/* === ДРУГИЕ ЭЛЕМЕНТЫ === */
.fas, .far {
    margin-right: 0.5rem;
}

.mb-5 {
    margin-bottom: 1.5rem !important;
}

.mb-4 {
    margin-bottom: 1rem !important;
}

.mb-3 {
    margin-bottom: 0.75rem !important;
}

.mt-4 {
    margin-top: 1rem !important;
}

/* Анимация для новых отзывов */
.review-item.new-item {
    animation: fadeInUp 0.3s ease-out;
}

@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Скрытие статических отзывов */
.reviews-tree {
    display: none !important;
}

/* Фикс: текст на кнопке "Ответить" всегда видимый черным */
.reply-btn,
.reply-btn:hover,
.btn-outline-primary.reply-btn,
.btn-outline-primary.reply-btn:hover {
    color: #000000 !important;
}

/* === УМЕНЬШЕНИЕ ЭЛЕМЕНТОВ ДЛЯ ДЕСКТОПОВ (поиск и кнопки) === */
@media (min-width: 992px) {
    /* Поле ввода и кнопка поиска - меньше размер */
    .input-group-lg .form-control,
    .input-group-lg .btn {
        padding: 0.5rem 1rem !important;
        font-size: 0.95rem !important;
    }

    .input-group-lg {
        max-width: 500px;
        margin: 0 auto;
    }

    /* Кнопка "Смотреть отзывы" - меньше */
    .users-list .btn-lg {
        padding: 0.5rem 1rem !important;
        font-size: 0.9rem !important;
    }

    /* Карточки пользователей - компактнее */
    .users-list .card-body {
        padding: 1rem !important;
    }

    .users-list .card-title {
        font-size: 1.1rem !important;
        margin-bottom: 0.25rem !important;
    }
}

/* === ШИРИНА КОНТЕНТА КАК НА СТРАНИЦЕ ОТЗЫВОВ === */
@media (min-width: 1400px) {
    .reviews-section,
    .comment-form,
    .user-info-card {
        max-width: 1200px;
        margin-left: auto;
        margin-right: auto;
    }
}

/* === КНОПКА ОТВЕТИТЬ НА МОБИЛЬНЫХ - ШИРЕ === */
@media (max-width: 576px) {
    .reply-btn,
    .review-actions .reply-btn {
        min-width: 100px !important;
        width: auto !important;
        padding: 8px 12px !important;
        font-size: 0.8rem !important;
    }

    .review-actions {
        gap: 12px !important;
    }
}

@media (max-width: 480px) {
    .reply-btn,
    .review-actions .reply-btn {
        min-width: 90px !important;
        padding: 7px 10px !important;
        font-size: 0.75rem !important;
    }
}

/* === АДАПТИВНОСТЬ ДЛЯ МОБИЛЬНЫХ === */

/* Планшеты (до 768px) */
@media (max-width: 768px) {
    .user-info-card .card-body {
        padding: 1rem;
    }

    .user-info-card {
        margin-bottom: 1rem !important;
    }

    .user-info-card .card-title {
        font-size: 0.95rem;
    }

    .user-avatar i {
        font-size: 2rem;
    }

    .user-details .row {
        flex-direction: column;
        text-align: center;
    }

    .user-details p {
        font-size: 0.8rem;
    }

    .user-details .col-md-4 {
        margin-bottom: 0.5rem;
    }

    .review-replies {
        margin-left: 1rem;
    }

    .breadcrumb {
        font-size: 0.875rem;
    }

    .rating-info {
        padding: 6px 12px;
        display: block;
        text-align: center;
    }

    .rating-info strong {
        display: inline-block;
        margin-bottom: 0;
        margin-right: 5px;
        font-size: 0.8rem;
    }

    .rating-stars {
        margin: 3px 0;
    }

    .rating-star {
        font-size: 14px;
    }

    .rating-text {
        display: inline-block;
        margin-top: 0;
        font-size: 0.75rem;
    }

    .rate-seller-text {
        display: inline-block;
        margin-top: 0;
        font-size: 0.75rem;
    }

    /* Уменьшение формы поиска */
    .input-group {
        max-width: 100%;
    }

    .input-group .form-control {
        font-size: 14px !important;
        padding: 6px 10px !important;
    }

    .input-group .btn {
        font-size: 13px !important;
        padding: 6px 12px !important;
    }

    /* Кнопка ответа на мобильных */
    .review-actions {
        display: flex;
        flex-wrap: wrap;
        gap: 8px;
        justify-content: center;
    }

    .review-actions .reply-btn {
        width: auto;
        min-width: 100px;
        max-width: 150px;
        display: inline-flex;
        justify-content: center;
        font-size: 0.75rem;
        padding: 4px 10px;
        margin: 0;
    }

    .review-actions .delete-btn {
        width: auto;
        min-width: 100px;
        max-width: 150px;
        display: inline-flex;
        justify-content: center;
        font-size: 0.75rem;
        padding: 4px 10px;
        margin: 0;
    }

    .review-actions form {
        display: inline-flex;
        margin: 0;
    }
}

/* Мобильные телефоны (до 576px) */
@media (max-width: 576px) {
    .container-wrapper {
        padding: 0 8px;
    }

    .mb-5 {
        margin-bottom: 1rem !important;
    }

    .user-info-card .card-body {
        padding: 0.75rem;
    }

    .user-info-card .card-title {
        font-size: 0.85rem;
    }

    .user-avatar i {
        font-size: 1.75rem;
    }

    .user-details p {
        font-size: 0.7rem;
    }

    .comment-form .card-body {
        padding: 0.75rem;
    }

    .comment-form .card-header {
        padding: 8px 12px;
    }

    .comment-form .card-header h5 {
        font-size: 0.85rem;
    }

    .review-card .card-body {
        padding: 0.75rem;
    }

    .review-reply-card .card-body {
        padding: 0.6rem;
    }

    .review-actions {
        flex-direction: row;
        flex-wrap: wrap;
        gap: 8px;
        justify-content: center;
    }

    .review-actions .reply-btn {
        width: auto;
        min-width: 90px;
        max-width: 130px;
        font-size: 0.7rem;
        padding: 4px 8px;
        margin: 0;
    }

    .review-actions .delete-btn {
        width: auto;
        min-width: 90px;
        max-width: 130px;
        font-size: 0.7rem;
        padding: 4px 8px;
        margin: 0;
    }

    .review-actions form {
        display: inline-flex;
        margin: 0;
    }

    /* ФОРМА ПОИСКА - компактная на мобильных */
    .input-group {
        flex-direction: row;
        width: 100%;
        flex-wrap: nowrap;
    }

    .input-group .form-control {
        width: auto;
        flex: 1;
        border-radius: 6px 0 0 6px !important;
        margin-bottom: 0;
        font-size: 14px !important;
        padding: 6px 10px !important;
    }

    .input-group .btn {
        width: auto;
        flex-shrink: 0;
        border-radius: 0 6px 6px 0 !important;
        padding: 6px 12px !important;
        font-size: 13px !important;
    }

    .input-group-lg .form-control,
    .input-group-lg .btn {
        border-radius: 6px !important;
    }

    /* Заголовки */
    .display-5 {
        font-size: 1.3rem;
    }

    .lead {
        font-size: 0.9rem;
    }

    h4 {
        font-size: 1rem;
    }

    h4.card-title {
        font-size: 1rem !important;
    }

    h3 {
        font-size: 1.1rem;
    }

    .reviews-section h3 {
        font-size: 1.1rem;
    }

    /* Кнопки на мобильных */
    .btn {
        font-size: 0.8rem;
        padding: 5px 12px;
    }

    .btn-lg {
        padding: 6px 12px;
        font-size: 0.85rem;
    }

    /* Карточки пользователей */
    .users-list .card .row {
        flex-direction: column;
    }

    .users-list .card .col-md-8,
    .users-list .card .col-md-4 {
        width: 100%;
        text-align: center !important;
    }

    .users-list .card .col-md-4 {
        margin-top: 8px;
    }

    .users-list .btn {
        width: auto;
        display: inline-block;
        min-width: 120px;
    }

    .breadcrumb {
        font-size: 0.7rem;
    }

    /* Рейтинг */
    .rating-info {
        padding: 5px 10px;
    }

    .rating-info strong {
        font-size: 0.75rem;
    }

    .rating-star {
        font-size: 12px;
    }

    .rating-text, .rate-seller-text {
        font-size: 0.8rem;
    }
}

/* Очень маленькие телефоны (до 480px) */
@media (max-width: 480px) {
    .container-wrapper {
        padding: 0 6px;
    }

    .mb-5 {
        margin-bottom: 0.75rem !important;
    }

    .user-info-card .card-body {
        padding: 0.6rem;
    }

    .user-info-card .card-title {
        font-size: 0.8rem;
    }

    .user-avatar i {
        font-size: 1.5rem;
    }

    .comment-form .card-body {
        padding: 0.6rem;
    }

    .btn {
        font-size: 0.75rem;
        padding: 4px 10px;
    }

    .reply-btn {
        font-size: 0.7rem;
        padding: 3px 8px;
    }

    .btn-lg {
        padding: 6px 10px;
        font-size: 0.8rem;
    }

    .breadcrumb {
        font-size: 0.8rem;
    }

    .display-5 {
        font-size: 1.2rem;
    }

    h4.card-title {
        font-size: 0.9rem !important;
    }

    h3 {
        font-size: 1rem;
    }

    .reviews-section h3 {
        font-size: 1rem;
    }

    .rating-info {
        padding: 4px 8px;
    }

    .rating-info strong {
        font-size: 0.8rem;
    }

    .rating-star {
        font-size: 11px;
    }

    /* Форма поиска еще компактнее */
    .input-group .form-control {
        font-size: 12px !important;
        padding: 5px 8px !important;
    }

    .input-group .btn {
        font-size: 12px !important;
        padding: 5px 10px !important;
    }

    .review-actions .reply-btn,
    .review-actions .delete-btn {
        min-width: 80px;
        max-width: 110px;
        font-size: 0.65rem;
        padding: 3px 6px;
    }
}

/* Очень маленькие телефоны (до 360px) */
@media (max-width: 360px) {
    .container-wrapper {
        padding: 0 4px;
    }

    .user-info-card .card-body {
        padding: 0.5rem;
    }

    .user-info-card .card-title {
        font-size: 0.75rem;
    }

    .comment-form .card-header {
        padding: 6px 10px;
    }

    .comment-form .card-header h5 {
        font-size: 0.8rem;
    }

    .review-card .card-body {
        padding: 0.6rem;
    }

    .btn {
        font-size: 0.7rem;
        padding: 3px 8px;
    }

    .reply-btn {
        font-size: 0.65rem;
        padding: 2px 6px;
    }

    h4.card-title {
        font-size: 0.75rem !important;
    }

    .rating-star {
        font-size: 10px;
    }

    .review-actions .reply-btn,
    .review-actions .delete-btn {
        min-width: 70px;
        max-width: 100px;
        font-size: 0.6rem;
        padding: 2px 5px;
    }

    .input-group .form-control {
        font-size: 11px !important;
        padding: 4px 6px !important;
    }

    .input-group .btn {
        font-size: 11px !important;
        padding: 4px 8px !important;
    }
}

/* Планшеты в ландшафтной ориентации */
@media (min-width: 769px) and (max-width: 1024px) {
    .container-wrapper {
        max-width: 95%;
    }

    .user-info-card .card-body {
        padding: 1rem;
    }

    .user-info-card {
        margin-bottom: 1.25rem !important;
    }
}

/* === ВЫРАВНИВАНИЕ ШИРИНЫ СТРАНИЦЫ ОТЗЫВОВ ПОД СТРАНИЦУ ПОИСКА === */
@media (min-width: 992px) {
    /* Ограничиваем контейнер на странице отзывов */
    .container.mt-4 {
        max-width: 83.333333% !important;
        width: 100%;
        margin-left: auto;
        margin-right: auto;
    }

    /* Убираем двойное ограничение у внутренних блоков */
    .container.mt-4 .reviews-section,
    .container.mt-4 .comment-form,
    .container.mt-4 .user-info-card,
    .container.mt-4 .breadcrumb,
    .container.mt-4 .alert {
        max-width: 100% !important;
        width: 100%;
    }
}

@media (min-width: 1200px) {
    .container.mt-4 {
        max-width: 83.333333% !important;
    }
}

/* На мобильных всё остается как было */
@media (max-width: 991px) {
    .container.mt-4 {
        max-width: 100% !important;
        padding: 0 15px;
    }
}

/* === УМЕНЬШЕНИЕ ВЫСОТЫ КНОПКИ ОТВЕТИТЬ НА МОБИЛЬНЫХ === */
@media (max-width: 768px) {
    .reply-btn,
    .review-actions .reply-btn {
        padding: 4px 8px !important;
        font-size: 1.1rem !important;
        line-height: 1.6 !important;
        min-height: auto !important;
        height: auto !important;
    }
}

@media (max-width: 576px) {
    .reply-btn,
    .review-actions .reply-btn {
        padding: 3px 8px !important;
        font-size: 1rem !important;
        line-height: 1.5 !important;
    }
    .fs-6 {
        font-size: 0.9rem !important;
    }
}

@media (max-width: 480px) {
    .reply-btn,
    .review-actions .reply-btn {
        padding: 2px 6px !important;
        font-size: 0.9rem !important;
        line-height: 1.4 !important;
    }
    .fs-6 {
        font-size: 0.8rem !important;
    }
}

@media (max-width: 360px) {
    .reply-btn,
    .review-actions .reply-btn {
        padding: 2px 6px !important;
        font-size: 0.8rem !important;
        line-height: 1.3 !important;
    }
    .fs-6 {
        font-size: 0.7rem !important;
    }
}

