/* 1. 댓글 평점 출력 영역 
----------------------------------------------------------- */
.comment-ratings {
    background: #f8f9fa;
    border-radius: 4px;
    padding: 15px;
    margin-bottom: 15px;
}

/* 2. 평균 평점 영역
----------------------------------------------------------- */
.rating-average {
    display: flex;
    align-items: center;
    padding: 10px;
    cursor: pointer;
    background: #fff;
    margin: -15px -15px 0;
    border-radius: 4px 4px 0 0;
    border-bottom: 1px solid #dee2e6;
}

.rating-average .average-content {
    display: flex;
    align-items: center;
    width: 100%;
    gap: 8px;
}

.rating-average .rating-stars {
    display: flex;
    color: #28a745;
    flex-shrink: 0;
}

.rating-average .score-text {
    color: #495057;
    white-space: nowrap;
}

.rating-average .label {
    color: #495057;
    white-space: nowrap;
}

.rating-average .toggle-icon {
    margin-left: auto;
    color: #adb5bd;
    transition: transform 0.3s;
}

/* 3. 평점 상세 항목 영역
----------------------------------------------------------- */
.rating-details {
    display: none;
    padding-top: 15px;
}

.rating-details.active {
    display: block;
}

.rating-item {
    margin-bottom: 10px;
}

.rating-item:last-child {
    margin-bottom: 0;
}

.item-content {
    display: flex;
    align-items: center;
    gap: 8px;
}

/* 모바일에서 개별 댓글 평점도 세로 배치 */
@media (max-width: 768px) {
    .rating-details .item-content {
        display: flex;
        flex-direction: column;
        align-items: center;
        gap: 6px;
        text-align: center;
    }
    
    /* 개별 댓글도 항목명과 점수를 한 줄로 */
    .rating-details .item-info {
        display: flex;
        align-items: center;
        gap: 8px;
        flex-wrap: nowrap;
        white-space: nowrap;
        order: 1;
    }
    
    .rating-details .rating-stars,
    .rating-details .bidirectional-stars-display {
        order: 2;
    }
}

.rating-stars {
    display: flex;
    color: #28a745;
    flex-shrink: 0;
}

.score-text {
    color: #495057;
    white-space: nowrap;
}

.item-title {
    color: #495057;
}

.rating-comment {
    margin-top: 5px;
    padding: 8px;
    background: #fff;
    border-radius: 3px;
}

/* 4. 모바일 대응 (평점 상세)
----------------------------------------------------------- */
@media (max-width: 768px) {
    .rating-item {
        flex-wrap: nowrap;
    }
    
    .rating-stars {
        min-width: 120px;
    }
}

/* 5. 별점 표시 영역 
----------------------------------------------------------- */
.rating-stars {
    display: flex;
    flex-direction: row;
    gap: 5px;
    justify-content: center;
    color: #28a745;
}

.comment-ratings .rating-stars {
    flex-direction: row;
}

.rating-stars .fa {
    margin-right: 2px;
}

.score-text {
    color: #495057;
    font-weight: normal;
}

/* 6. 별 아이콘 기본 상태 - 모든 별을 기본적으로 보이게 수정 */
.rating-stars label {
    cursor: pointer;
    font-size: 24px;
    color: #dee2e6; /* 기본 색상 설정 */
    display: inline-block;
}

.rating-stars label i {
    color: inherit; /* 부모의 색상 상속 */
    display: inline-block !important; /* 모든 별 아이콘을 항상 보이도록 강제 */
}

/* 입력용 별점 - 기본적으로 빈 별 표시 */
.rating-content .rating-stars label {
    color: #dee2e6;
}

.rating-content .rating-stars label:hover,
.rating-content .rating-stars label:hover ~ label,
.rating-content .rating-stars input:checked ~ label {
    color: #28a745;
}

/* 별 아이콘 전환 효과 제거 - 단순화 */
.rating-stars input {
    display: none;
}

/* 표시용 별점은 정순으로 배치 */
.comment-ratings .rating-stars,
.total-ratings .rating-stars,
.rated-result .rating-stars {
    flex-direction: row;
}

/* 입력용 별점은 역순 유지 (hover 효과를 위해) */
.rating-content .rating-stars {
    flex-direction: row-reverse;
}

/* 7. 탭 선택 스타일 
----------------------------------------------------------- */
/* 현재 활성화된 탭 (선택된 탭) - 짙은 회색 유지 */
.rating-tab-btn.active {
    background: #4a5568 !important;
    border-color: #4a5568 !important;
    color: #fff !important;
}

/* 평점 입력 완료된 탭 - 연한 하늘색 */
.rating-tab-btn.rated:not(.active) {
    background-color: #e7f1ff;
    border-color: #b8daff;
    color: #495057;
    position: relative;
    padding-right: 28px;
}

/* 양방향 평점 탭도 동일한 스타일 적용 */
.rating-tab-btn.rated:not(.active).rating-type-badge {
    background-color: #e7f1ff;
    border-color: #b8daff;
    color: #495057;
    position: relative;
    padding-right: 28px;
}

/* 체크마크 스타일 추가 */
.rating-tab-btn .check-icon {
    position: absolute;
    right: 10px;
    top: 50%;
    transform: translateY(-50%);
    opacity: 0;
    color: #ff6b6b;
    transition: opacity 0.2s ease-in-out;
    font-size: 0.85em;
}

.rating-tab-btn.rated .check-icon {
    opacity: 1;
}

/* 8. 평균 평점 표시 영역
----------------------------------------------------------- */
.rating-average {
    border-top: 1px solid #dee2e6;
    padding-top: 12px;
    font-weight: 500;
}

.rating-average .label {
    margin-right: 10px;
}

.rating-average .score {
    color: #28a745;
}

.rating-average .score .ml-2 {
    color: #495057;
}

/* 9. 평점 입력 폼 영역
----------------------------------------------------------- */
.rating-section {
    position: relative;
    border: 1px solid #dee2e6;
    border-radius: 4px;
    background: #fff;
}

.rating-wrap {
    position: relative;
}

/* 10. 평점 탭 네비게이션 영역
----------------------------------------------------------- */
.rating-tabs {
    display: flex;
    align-items: start;
    border-bottom: 1px solid #dee2e6;
    background: #f8f9fa;
}

.rating-current {
    padding: 12px 15px;
    min-width: 140px;
    width: auto;
    font-weight: bold;
    color: #495057;
    display: flex;
    align-items: center;
}

.rating-current .fa-refresh {
    cursor: pointer;
    margin-right: 8px;
}

.rating-current .fa-refresh:hover {
    opacity: 0.7;
}

.rating-current .fa-star-o {
    margin-right: 5px;
}

.rating-tab-list {
    display: flex;
    padding: 8px 15px;
    overflow-x: auto;
    white-space: nowrap;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: none;
    -ms-overflow-style: none;
}

.rating-tab-list::-webkit-scrollbar {
    display: none;
}

.rating-tab-btn {
    position: relative;
    display: inline-block;
    flex: 0 0 auto;
    background: none;
    border: 1px solid #dee2e6;
    border-radius: 30px;
    padding: 4px 28px 4px 12px;
    font-size: 0.9rem;
    color: #495057;
    cursor: pointer;
    margin-right: 5px;
    transition: all 0.2s ease; /* 부드러운 전환 효과 */
}

/* 탭 hover 효과 */
.rating-tab-btn:hover {
    background: #4a5568;
    border-color: #4a5568;
    color: #fff;
}

.rating-tab-btn.active {
    background: #4a5568;
    border-color: #4a5568;
    color: #fff;
}

/* 양방향 평점 배지가 있는 탭도 동일한 크기 적용 */
.rating-tab-btn.rating-type-badge {
    padding: 4px 28px 4px 12px; /* 단방향과 동일한 패딩 */
    font-size: 0.9rem; /* 단방향과 동일한 폰트 크기 */
}

/* 양방향 탭 hover 효과도 동일하게 적용 */
.rating-tab-btn.rating-type-badge:hover {
    background: #4a5568;
    border-color: #4a5568;
    color: #fff;
}

/* active와 rated 상태 스타일 분리 */
.rating-tab-btn.active {
    background: #4a5568;
    border-color: #4a5568;
    color: #fff;
}

.rating-tab-btn .required {
    color: #ff6b6b;
    margin-left: 2px;
}

/* 11. 평점 입력 컨텐츠 영역
----------------------------------------------------------- */
.rating-content {
    display: none;
    padding: 15px;
}

.rating-content.active {
    display: block;
}

/* 단방향 별점 기본 스타일 수정 */
.rating-content .rating-stars label {
    cursor: pointer;
    font-size: 24px;
    color: #dee2e6;
    margin-right: 5px;
}

.rating-content .rating-stars label:hover,
.rating-content .rating-stars label:hover ~ label,
.rating-content .rating-stars input:checked ~ label {
    color: #28a745;
}

.rating-comment textarea {
    border: 1px solid #dee2e6;
    resize: none;
}

/* 12. 평가 결과 표시 영역
----------------------------------------------------------- */
.rated-result {
    background: #fff;
    padding: 15px;
    border-radius: 4px;
}

.rated-item {
    padding: 8px 12px;
    background: #f8f9fa;
    border-radius: 4px;
}

.rated-title {
    font-weight: 500;
    color: #495057;
}

.rated-score {
    color: #28a745;
}

.rated-score .fa {
    margin-right: 2px;
}

.rated-score span {
    color: #495057;
}

.rated-comment {
    font-size: 0.9rem;
    padding: 8px;
    background: #fff;
    border-radius: 3px;
}

/* 13. 반응형 스타일 
----------------------------------------------------------- */
@media (max-width: 768px) {
    .comment-ratings {
        padding: 10px;
    }
    
    .rating-title {
        flex-direction: column;
        align-items: flex-start;
        gap: 5px;
    }

    .rating-tabs {
        flex-direction: row;
    }
    
    .rating-current {
        width: 120px;
        min-width: 120px;
        border-right: 1px solid #dee2e6;
        border-bottom: 0;
        padding: 8px 10px;
        font-size: 0.9rem;
    }

    .rating-tab-list {
        flex: 1;
        padding: 8px;
    }

    .rating-tab-btn {
        padding: 3px 24px 3px 10px;
        font-size: 0.85rem;
    }

    .rating-tab-btn .check-icon {
        right: 8px;
        font-size: 0.8em;
    }

    .rating-average {
        gap: 5px;
    }
    
    .score-text,
    .item-title {
        font-size: 0.9rem;
    }
    
    /* 모바일에서 항목명 박스 크기 조정 */
    .item-title-box,
    .rated-title-box {
        font-size: 0.9rem;
        padding: 4px 8px;
        margin-right: 0;
        margin-bottom: 0;
    }
}

@media (max-width: 375px) {
    .rating-current {
        width: 100px;
        min-width: 100px;
        font-size: 0.85rem;
    }
}

/* 14. 댓글 내용 영역
----------------------------------------------------------- */
.comment-content {
    margin-top: 15px;
    word-break: break-word;
}

.comment-ratings + .comment-content {
    margin-top: 0;
}

/* 15. 평점 정보 아이콘과 모달
----------------------------------------------------------- */
.rating-info-icon {
    display: inline-block;
    margin-left: 4px;
    color: #adb5bd;
    cursor: pointer;
    font-size: 0.9em;
    vertical-align: middle;
}

.rating-info-icon:hover {
    color: #495057;
}

.rating-info-modal {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.5);
    z-index: 1060;
}

.rating-info-modal-content {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    background: #fff;
    padding: 20px;
    border-radius: 8px;
    max-width: 300px;
    width: 90%;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.15);
}

.rating-info-text {
    color: #495057;
    font-size: 0.95rem;
    line-height: 1.5;
    margin-bottom: 15px;
    word-break: keep-all;
    text-align: center;
}

.rating-info-close {
    display: block;
    width: 100%;
    padding: 8px;
    background: #e9ecef;
    border: none;
    border-radius: 4px;
    color: #495057;
    cursor: pointer;
    font-size: 0.9rem;
    transition: background-color 0.2s;
}

.rating-info-close:hover {
    background: #dee2e6;
}

@media (max-width: 768px) {
    .rating-info-modal-content {
        max-width: 280px;
        padding: 15px;
    }
    
    .rating-info-text {
        font-size: 0.9rem;
    }
}

/* 16. 통합평점 영역 
----------------------------------------------------------- */
.total-ratings {
    background: linear-gradient(145deg, #f8f9ff, #f0f3ff);
    border: 1px solid rgba(147, 157, 255, 0.1);
    border-radius: 8px;
    padding: 15px;
    color: #555;
    box-shadow: 0 3px 10px rgba(147, 157, 255, 0.08);
}

/* 헤더 */
.total-ratings-header h5 {
    color: #555;
    font-weight: 600;
    font-size: 1rem;
    letter-spacing: -0.02em;
    text-align: center;
    margin-bottom: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
}

.total-participants {
    color: #939dff;
    font-size: 0.85rem;
    font-weight: 400;
}

/* 평균 평점 영역 */
.total-ratings-average {
    text-align: center;
    padding: 15px 0 5px;
    cursor: pointer;
}

.total-ratings-average .average-score {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    padding: 8px 16px;
    background: rgba(255,255,255,0.7);
    border-radius: 25px;
    box-shadow: 0 2px 8px rgba(147, 157, 255, 0.08);
}

/* 통합평점 별점 스타일 */
.total-ratings .rating-stars {
    position: relative;
    display: inline-flex;
}

.total-ratings .rating-stars .partial-stars {
    position: absolute;
    left: 0;
    top: 0;
    overflow: hidden;
    white-space: nowrap;
    color: #939dff;
}

.total-ratings .rating-stars .empty-stars {
    color: #ddd;
}

/* 평균 평점의 별 크기 */
.total-ratings-average .rating-stars {
    font-size: 40px; /* 32px에서 40px로 증가 */
}

.total-ratings-average .rating-stars .fa {
    margin-right: 3px; /* 2px에서 3px로 증가 */
}

/* 항목별 별점 크기도 조정 */
.total-ratings .rating-item-row .rating-stars {
    font-size: 28px; /* 24px에서 28px로 증가 */
}

.total-ratings .rating-item-row .rating-stars .fa {
    margin-right: 2px; /* 1px에서 2px로 증가 */
}

.total-ratings-average .score-text {
    font-size: 20px;
    font-weight: 600;
    color: #555;
    line-height: 1;
}

.total-ratings-average .toggle-icon {
    margin-left: 5px;
    color: #939dff;
    font-size: 0.8em;
    transition: transform 0.3s ease;
}

.total-ratings-average.open .toggle-icon {
    transform: rotate(180deg);
}

/* 항목별 평점 리스트 */
.total-ratings-items {
    display: none;
    background: rgba(255,255,255,0.5);
    border-radius: 6px;
    padding: 12px;
    margin-top: 10px;
}

.rating-item-row {
    padding: 6px 8px;
    border-radius: 4px;
    transition: all 0.2s ease;
    text-align: center;
}

.rating-item-row:hover {
    background: rgba(255,255,255,0.8);
}

.rating-item-row .item-content {
    display: inline-flex;
    align-items: center;
    gap: 6px;
}

/* 모바일에서 세로 배치 */
@media (max-width: 768px) {
    .rating-item-row .item-content {
        display: flex;
        flex-direction: column;
        align-items: center;
        gap: 6px;
        text-align: center;
    }
    
    /* 항목명, 점수, 인원을 한 줄로 */
    .rating-item-row .item-info {
        display: flex;
        align-items: center;
        gap: 8px;
        flex-wrap: nowrap;
        white-space: nowrap;
        order: 1;
    }
    
    .rating-item-row .rating-stars,
    .rating-item-row .bidirectional-stars-display {
        order: 2;
    }
}

.rating-item-row .score-text {
    font-weight: 500;
    color: #555;
    font-size: 0.9rem;
}

.rating-item-row .participants-count {
    color: #939dff;
    font-size: 0.85rem;
}

.rating-item-row .item-title {
    color: #666;
    font-size: 0.9rem;
    font-weight: 500;
}

.total-ratings .rating-info-icon {
    color: #939dff;
    opacity: 0.7;
    transition: opacity 0.2s ease;
    margin-left: 2px;
}

.total-ratings .rating-info-icon:hover {
    opacity: 1;
}

/* 모바일 대응 */
@media (max-width: 768px) {
    .total-ratings {
        padding: 12px;
    }
    
    .total-ratings-average .rating-stars {
        font-size: 20px;
    }
    
    .total-ratings-average .rating-stars .fa {
        margin-right: 0;
    }
    
    .total-ratings .rating-item-row .rating-stars {
        font-size: 16px;
    }
    
    .total-ratings .rating-item-row .rating-stars .fa {
        margin-right: -1px;
    }
    
    .total-ratings-items {
        padding: 10px;
    }
    
    .rating-item-row {
        padding: 5px;
    }
    
    .rating-item-row .item-content {
        gap: 4px;
    }
}

@media (max-width: 400px) {
    .total-ratings-average .rating-stars {
        font-size: 18px;
    }
    
    .total-ratings .rating-item-row .rating-stars {
        font-size: 15px;
    }
    
    .rating-item-row .score-text,
    .rating-item-row .participants-count,
    .rating-item-row .item-title {
        font-size: 0.85rem;
    }
}

/* 17. 양방향 평점 스타일 추가
----------------------------------------------------------- */

/* 평가방식 배지 - 탭 내부가 아닌 별도 표시용 */
.rated-title .rating-type-badge {
    display: inline-block;
    background: #17a2b8;
    color: #fff;
    font-size: 0.7rem;
    padding: 2px 6px;
    border-radius: 10px;
    margin-left: 4px;
    vertical-align: middle;
    font-weight: normal;
}

/* 탭 버튼에서는 배지 스타일 제거 - 일반 탭과 동일하게 */
.rating-tab-btn.rating-type-badge {
    background: none;
    color: #495057;
    font-size: 0.9rem;
    padding: 4px 28px 4px 12px;
}

/* 양방향 평점 입력 UI - 별점 방식 */
.bidirectional-rating {
    text-align: center;
    padding: 15px 0;
}

.rating-scale-info {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px; /* 15px에서 20px로 증가 */
    padding: 0 15px; /* 10px에서 15px로 증가 */
}

.scale-label {
    font-size: 1.1rem; /* 0.8rem에서 1.1rem으로 대폭 증가 */
    color: #6c757d;
    font-weight: 600; /* 500에서 600으로 증가 */
}

.scale-label.negative {
    color: #dc3545;
}

.scale-label.neutral {
    color: #6c757d;
}

.scale-label.positive {
    color: #28a745;
}

/* 양방향 별점 입력 수정 - 별 크기 확대 */
.bidirectional-stars {
    display: flex;
    flex-direction: row;
    justify-content: center;
    gap: 8px; /* 5px에서 8px로 증가 */
    margin: 15px 0; /* 10px에서 15px로 증가 */
}

.bidirectional-stars input {
    display: none;
}

.bidirectional-stars label {
    position: relative;
    cursor: pointer;
    font-size: 36px; /* 24px에서 36px로 대폭 증가 */
    transition: all 0.2s ease;
    color: #dee2e6;
}

/* 양방향 별점에서도 모든 별이 보이도록 수정 */
.bidirectional-stars label i {
    display: inline-block !important;
    color: inherit;
}

/* 별 위의 숫자 표시 - 크기에 맞춰 조정 */
.bidirectional-stars .star-number {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    font-size: 13px; /* 10px에서 13px로 증가 */
    font-weight: bold;
    color: #333;
    text-shadow: 1px 1px 1px rgba(255,255,255,0.8);
    pointer-events: none;
}

/* 음수 별 hover 및 checked 상태 */
.bidirectional-stars .negative-star:hover {
    color: #dc3545;
    transform: scale(1.1);
}

.bidirectional-stars .negative-star:hover .star-number {
    color: #fff;
    text-shadow: 1px 1px 1px rgba(0,0,0,0.8);
}

.bidirectional-stars input:checked + .negative-star {
    color: #dc3545;
    transform: scale(1.1);
}

.bidirectional-stars input:checked + .negative-star .star-number {
    color: #fff;
    text-shadow: 1px 1px 1px rgba(0,0,0,0.8);
}

/* 0점 별 hover 및 checked 상태 */
.bidirectional-stars .neutral-star:hover {
    color: #6c757d;
    transform: scale(1.1);
}

.bidirectional-stars .neutral-star:hover .star-number {
    color: #fff;
    text-shadow: 1px 1px 1px rgba(0,0,0,0.8);
}

.bidirectional-stars input:checked + .neutral-star {
    color: #6c757d;
    transform: scale(1.1);
}

.bidirectional-stars input:checked + .neutral-star .star-number {
    color: #fff;
    text-shadow: 1px 1px 1px rgba(0,0,0,0.8);
}

/* 양수 별 hover 및 checked 상태 */
.bidirectional-stars .positive-star:hover {
    color: #28a745;
    transform: scale(1.1);
}

.bidirectional-stars .positive-star:hover .star-number {
    color: #fff;
    text-shadow: 1px 1px 1px rgba(0,0,0,0.8);
}

.bidirectional-stars input:checked + .positive-star {
    color: #28a745;
    transform: scale(1.1);
}

.bidirectional-stars input:checked + .positive-star .star-number {
    color: #fff;
    text-shadow: 1px 1px 1px rgba(0,0,0,0.8);
}

/* 17. 양방향 평점 표시 스타일 */
.bidirectional-stars-display {
    display: inline-flex;
    gap: 3px;
    align-items: center;
}

/* 큰 양방향 별점 */
.bidirectional-stars-display.large .bidirectional-star {
    font-size: 28px;
    position: relative;
    display: inline-block;
}

.bidirectional-stars-display.large .bidirectional-star .star-number {
    font-size: 10px;
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    font-weight: bold;
    color: #fff;
    text-shadow: 1px 1px 2px rgba(0,0,0,0.9);
    pointer-events: none;
    z-index: 2;
    line-height: 1;
}

.bidirectional-star {
    position: relative;
    display: inline-block;
    font-size: 16px;
    opacity: 0.3;
    transition: all 0.2s ease;
}

.bidirectional-star.selected {
    opacity: 1;
    transform: scale(1.2);
}

.bidirectional-star.negative-star i {
    color: #dc3545;
}

.bidirectional-star.neutral-star i {
    color: #6c757d;
}

.bidirectional-star.positive-star i {
    color: #28a745;
}

.bidirectional-star .star-number {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    font-size: 7px;
    font-weight: bold;
    color: #fff;
    text-shadow: 1px 1px 1px rgba(0,0,0,0.8);
    pointer-events: none;
    z-index: 2;
    line-height: 1;
}

.badge-scale-info {
    display: flex; /* 가로 정렬을 위해 flexbox 사용 */
    justify-content: center; /* 가운데 정렬 */
    align-items: center;
    gap: 8px; /* 배지들 사이의 간격 */
    flex-wrap: wrap; /* 공간이 부족하면 줄바꿈 허용 */
    margin-bottom: 10px; /* 아래 막대 그래프와의 간격 */
}

.scale-text-badge {
    font-size: 0.8rem; /* 글자 크기 줄임 */
    padding: 3px 8px; /* 배지 패딩 */
    border-radius: 15px; /* 둥근 모서리 */
    font-weight: 600;
    white-space: nowrap; /* 줄바꿈 방지 */
}

/* 각 색상에 맞는 배지 배경색 */
.scale-text-badge.negative {
    background-color: #f8d7da; /* 연한 빨강 */
    color: #dc3545; /* 진한 빨강 */
}

.scale-text-badge.neutral {
    background-color: #e9ecef; /* 연한 회색 */
    color: #6c757d; /* 진한 회색 */
}

.scale-text-badge.positive {
    background-color: #d4edda; /* 연한 녹색 */
    color: #28a745; /* 진한 녹색 */
}

/* 기존 .rating-scale-info 모바일 스타일 수정 (혹시 충돌 방지 및 불필요한 속성 제거) */
@media (max-width: 768px) {
    .rating-scale-info {
        display: flex; /* <-- 이 속성이 이 미디어 쿼리 안에서 꼭 필요합니다. */
        flex-direction: row; /* <-- 이 속성도 이 미디어 쿼리 안에서 꼭 필요합니다. */
        justify-content: space-between;
        align-items: center;
        gap: 5px; /* 필요시 간격 조정 */
        margin-bottom: 10px;
        padding: 0 15px;
    }

    /* scale-label에 직접적인 스타일이 적용되어 있다면 이 클래스에 대한 모바일 스타일도 조정 */
    .rating-scale-info .scale-label { /* 이 부분은 그대로 두거나 필요에 따라 조정 */
        font-size: 0.9rem; /* 모바일에서 폰트 크기 조정 */
        font-weight: 600;
        white-space: nowrap;
    }

    .scale-text-badge { /* 이 스타일은 배지에 적용되므로 그대로 유지 */
        font-size: 0.8rem;
        padding: 3px 8px;
        border-radius: 15px;
        font-weight: 600;
        white-space: nowrap;
    }

    /* scale-label에 직접적인 스타일이 적용되어 있다면 이 클래스에 대한 모바일 스타일도 조정 */
    .rating-scale-info .scale-label {
        font-size: 0.8rem; /* 모바일에서 폰트 크기 조정 */
        font-weight: 500;
        /* 필요한 경우 추가 스타일 */
    }
}

/* 양방향 평점 막대그래프 (사용하지 않음) */
.bidirectional-display {
    display: flex;
    align-items: center;
    gap: 8px;
    justify-content: center;
}

.bidirectional-bar {
    position: relative;
    width: 100px;
    height: 6px;
    background: #f8f9fa;
    border-radius: 3px;
    overflow: hidden;
}

.bar-negative,
.bar-positive {
    position: absolute;
    height: 100%;
    border-radius: 3px;
}

.bar-negative {
    background: #dc3545;
    left: 0;
}

.bar-positive {
    background: #28a745;
    right: 0;
}

/* 양방향 점수 표시 (사용하지 않음) */
.bidirectional-score {
    font-weight: 600;
    padding: 4px 8px;
    border-radius: 12px;
    background: #f8f9fa;
    margin-right: 8px;
}

.bidirectional-score[data-value^="-"] {
    color: #dc3545;
    background: #f8d7da;
}

.bidirectional-score[data-value="0"] {
    color: #6c757d;
    background: #f8f9fa;
}

.bidirectional-score:not([data-value^="-"]):not([data-value="0"]) {
    color: #28a745;
    background: #d4edda;
}

/* 모바일 대응 (양방향 평점) */
@media (max-width: 768px) {
    .rating-scale-info {
        flex-direction: column;
        gap: 5px;
        margin-bottom: 10px;
    }
    
    .bidirectional-stars {
        gap: 3px;
    }
    
    .bidirectional-stars label {
        font-size: 20px;
    }
    
    .bidirectional-stars .star-number {
        font-size: 8px;
    }
    
    .bidirectional-stars-display {
        gap: 2px;
    }
    
    .bidirectional-star {
        font-size: 14px;
    }
    
    .bidirectional-star .star-number {
        font-size: 7px;
    }
}

@media (max-width: 480px) {
    .bidirectional-stars label {
        font-size: 18px;
    }
    
    .bidirectional-stars .star-number {
        font-size: 7px;
    }
    
    .bidirectional-star {
        font-size: 12px;
    }
    
    .bidirectional-star .star-number {
        font-size: 6px;
    }
}

/* 18. 통합평점의 양방향 표시 개선
----------------------------------------------------------- */
.total-ratings .bidirectional-stars-display {
    justify-content: center;
    gap: 4px; /* 간격 추가 */
}

.total-ratings .bidirectional-star {
    font-size: 32px; /* 22px에서 32px로 대폭 증가 */
    position: relative;
    display: inline-block;
}

.total-ratings .bidirectional-star .star-number {
    font-size: 12px; /* 8px에서 12px로 증가 */
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    font-weight: bold;
    color: #fff;
    text-shadow: 1px 1px 1px rgba(0,0,0,0.8);
    pointer-events: none;
    z-index: 2;
    line-height: 1;
}

/* 개별 댓글의 양방향 평점 표시 - 별 크기 확대 */
.comment-ratings .bidirectional-stars-display {
    justify-content: flex-start;
    gap: 4px; /* 간격 추가 */
}

.comment-ratings .bidirectional-star {
    font-size: 36px; /* 24px에서 36px로 대폭 증가 */
    display: inline-block;
    position: relative;
}

.comment-ratings .bidirectional-star .star-number {
    font-size: 13px; /* 9px에서 13px로 증가 */
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    font-weight: bold;
    color: #fff;
    text-shadow: 1px 1px 1px rgba(0,0,0,0.8);
    pointer-events: none;
    z-index: 2;
}

/* 개별 댓글의 단방향 별점 크기 */
.comment-ratings .rating-stars {
    font-size: 24px;
}

.comment-ratings .rating-stars .fa {
    margin-right: 3px;
}

/* 항목명 배경박스 스타일 */
.item-title-box,
.rated-title-box {
    display: inline-block;
    background: #f8f9fa;
    color: #495057;
    padding: 6px 12px;
    border-radius: 8px;
    font-size: 1rem;
    font-weight: 500;
    border: 1px solid #dee2e6;
    margin-right: 10px;
}

.item-title-box:hover,
.rated-title-box:hover {
    background: #e9ecef;
}

/* 모바일 대응 */
@media (max-width: 768px) {
    .item-title-box,
    .rated-title-box {
        font-size: 0.85rem;
        padding: 3px 6px;
    }
}

/* 모바일 전용 평점 헤더 */
.mobile-total-rating-info {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    padding: 10px 15px;
    border-radius: 20px;
    font-size: 1rem;
    font-weight: 600;
    display: inline-block;
    box-shadow: 0 2px 8px rgba(0,0,0,0.15);
}

.mobile-comment-rating-header {
background-color: #ffffff; /* 흰색 배경 */
border: 1px solid #e0e0e0;
border-radius: 8px;
padding: 5px 15px;
font-size: 0.95rem;
color: #555;
font-weight: 500;
display: flex;
justify-content: space-between;
align-items: center;
}

.mobile-comment-rating-header span {
flex-grow: 1;
}

.mobile-comment-rating-header .toggle-icon {
color: #007bff; /* 파란색 아이콘으로 강조 */
margin-left: 10px;
cursor: pointer;
}

/* 모바일 전용 세로 바 스타일 */
.bidirectional-bars-mobile {
    display: flex;
    justify-content: center;
    align-items: flex-end;
    gap: 4px;
    padding: 10px;
    height: 80px;
}

.bidirectional-bars-mobile.small {
    height: 60px;
    gap: 3px;
}

.unidirectional-bars-mobile {
    display: flex;
    justify-content: center;
    align-items: flex-end;
    gap: 4px;
    padding: 10px;
    height: 60px;
}

.rating-bar {
    width: 30px; /* 36px에서 30px로 줄임 */
    height: 40px;
    border-radius: 4px 4px 0 0;
    position: relative;
    transition: all 0.3s ease;
    opacity: 0.4;
    cursor: pointer;
    display: flex;
    align-items: flex-end;
    justify-content: center;
}

.bidirectional-bars-mobile.small .rating-bar {
    width: 26px; /* 30px에서 26px로 줄임 */
    height: 30px;
}

.unidirectional-bars-mobile .rating-bar {
    width: 28px; /* 32px에서 28px로 줄임 */
    height: 30px;
}

.rating-bar.selected {
    opacity: 1;
    height: 60px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.3);
}

.bidirectional-bars-mobile.small .rating-bar.selected {
    height: 45px;
}

.unidirectional-bars-mobile .rating-bar.selected {
    height: 45px;
}

.rating-bar.negative-bar {
    background: linear-gradient(to top, #dc3545, #e85d6d);
}

.rating-bar.neutral-bar {
    background: linear-gradient(to top, #6c757d, #8a9299);
}

.rating-bar.positive-bar {
    background: linear-gradient(to top, #28a745, #5cb85c);
}

.bar-number {
    font-size: 11px;
    font-weight: bold;
    color: #fff;
    text-shadow: 1px 1px 2px rgba(0,0,0,0.8);
    margin-bottom: 2px;
    line-height: 1;
}

.bidirectional-bars-mobile.small .bar-number {
    font-size: 10px;
}

/* 음수 바는 아래쪽에서 위로 성장 */
.rating-bar.negative-bar {
    align-items: flex-start;
}

.rating-bar.negative-bar .bar-number {
    margin-bottom: 0;
    margin-top: 2px;
}

/* 항목 정보 스타일 개선 - 한 줄로 배치 */
.rating-item .item-info {
    margin-bottom: 10px;
}

.rating-item .item-title-box {
    background: #f8f9fa;
    color: #495057;
    padding: 6px 12px;
    border-radius: 8px;
    font-size: 1rem;
    font-weight: 500;
    border: 1px solid #dee2e6;
    display: inline-flex;
    align-items: center;
    justify-content: space-between;
    min-width: 200px;
    width: 100%;
    max-width: 100%;
}

.rating-item .item-score-badge {
    background: #e9ecef;
    color: #495057;
    padding: 2px 8px;
    border-radius: 10px;
    font-size: 0.8rem;
    font-weight: 600;
    margin-left: 8px;
    white-space: nowrap;
    flex-shrink: 0;
}

/* 반응형 조정 */
@media (max-width: 480px) {
    .bidirectional-bars-mobile {
        gap: 3px;
        height: 70px;
    }
    
    .bidirectional-bars-mobile.small {
        height: 50px;
        gap: 2px;
    }
    
    .unidirectional-bars-mobile {
        gap: 3px;
        height: 50px;
    }
    
    .rating-bar {
        width: 26px; /* 30px에서 26px로 줄임 */
        height: 35px;
    }
    
    .bidirectional-bars-mobile.small .rating-bar {
        width: 22px; /* 26px에서 22px로 줄임 */
        height: 25px;
    }
    
    .unidirectional-bars-mobile .rating-bar {
        width: 24px; /* 28px에서 24px로 줄임 */
        height: 25px;
    }
    
    .rating-bar.selected {
        height: 50px;
    }
    
    .bidirectional-bars-mobile.small .rating-bar.selected {
        height: 40px;
    }
    
    .unidirectional-bars-mobile .rating-bar.selected {
        height: 40px;
    }
    
    .bar-number {
        font-size: 10px;
    }
    
    .bidirectional-bars-mobile.small .bar-number {
        font-size: 9px;
    }

    .rating-item .item-title-box {
        font-size: 0.9rem;
        padding: 4px 8px;
        min-width: 150px;
    }
    
    .rating-item .item-score-badge {
        font-size: 0.75rem;
        padding: 1px 6px;
        margin-left: 6px;
    }
}

/* 더 작은 화면 대응 */
@media (max-width: 360px) {
    .rating-bar {
        width: 24px;
    }
    
    .bidirectional-bars-mobile.small .rating-bar {
        width: 20px;
    }
    
    .unidirectional-bars-mobile .rating-bar {
        width: 22px;
    }
    
    .bidirectional-bars-mobile {
        gap: 2px;
    }
    
    .bidirectional-bars-mobile.small {
        gap: 1px;
    }
    
    .unidirectional-bars-mobile {
        gap: 2px;
    }

    .rating-item .item-title-box {
        font-size: 0.85rem;
        padding: 3px 6px;
        min-width: 120px;
    }
    
    .rating-item .item-score-badge {
        font-size: 0.7rem;
        padding: 1px 4px;
        margin-left: 4px;
    }
}

/* 평점 항목 연결 고리 디자인 */
.rating-item-wrapper {
    position: relative;
    display: flex;
    align-items: flex-start;
    margin-bottom: 20px;
    padding-left: 40px;
}

.rating-item-wrapper:last-child {
    margin-bottom: 0;
}

.rating-connector {
    position: absolute;
    left: 0;
    top: 0;
    height: 100%;
    width: 30px;
    display: flex;
    flex-direction: column;
    align-items: center;
    z-index: 1;
}

.connector-line-top {
    width: 2px;
    height: 15px;
    background: linear-gradient(to bottom, transparent, #ddd);
}

.connector-circle {
    width: 16px;
    height: 16px;
    border-radius: 50%;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 2px 6px rgba(102, 126, 234, 0.3);
    margin: 2px 0;
    flex-shrink: 0;
}

.connector-circle i {
    color: white;
    font-size: 6px;
}

.connector-line-bottom {
    width: 2px;
    flex: 1;
    background: linear-gradient(to bottom, #ddd, transparent);
    min-height: 15px;
}

/* 첫 번째 아이템은 위쪽 선 제거 */
.rating-item-wrapper:first-child .connector-line-top {
    display: none;
}

/* 마지막 아이템은 아래쪽 선 제거 */
.rating-item-wrapper:last-child .connector-line-bottom {
    display: none;
}

.rating-item-content {
    flex: 1;
    background: #fafbfc;
    border: 1px solid #e9ecef;
    border-radius: 12px;
    padding: 15px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.05);
    transition: all 0.3s ease;
}

.rating-item-content:hover {
    box-shadow: 0 4px 12px rgba(0,0,0,0.1);
    transform: translateY(-2px);
}

.rating-bars-section {
    margin-top: 5px;
    padding-top: 0px;
}

/* 모바일에서 연결고리 크기 조정 */
@media (max-width: 768px) {
    .rating-item-wrapper {
        padding-left: 35px;
        margin-bottom: 15px;
    }
    
    .rating-connector {
        width: 25px;
    }
    
    .connector-circle {
        width: 14px;
        height: 14px;
    }
    
    .connector-circle i {
        font-size: 5px;
    }
    
    .connector-line-top,
    .connector-line-bottom {
        width: 1.5px;
    }
    
    .connector-line-top {
        height: 12px;
    }
    
    .connector-line-bottom {
        min-height: 12px;
    }
    
    .rating-item-content {
        padding: 12px;
        border-radius: 10px;
    }
    
    .rating-bars-section {
        margin-top: 3px;
        padding-top: 0px;
    }
}

@media (max-width: 480px) {
    .rating-item-wrapper {
        padding-left: 30px;
        margin-bottom: 12px;
    }
    
    .rating-connector {
        width: 20px;
    }
    
    .connector-circle {
        width: 12px;
        height: 12px;
    }
    
    .connector-circle i {
        font-size: 4px;
    }
    
    .rating-item-content {
        padding: 10px;
        border-radius: 8px;
    }
}

/* PC 전용 항목명 박스 - 너비 제한 */
.item-title-box-pc {
    background: #f8f9fa;
    color: #495057;
    padding: 6px 12px;
    border-radius: 8px;
    font-size: 1rem;
    font-weight: 500;
    border: 1px solid #dee2e6;
    display: inline-flex;
    align-items: center;
    justify-content: space-between;
    min-width: 150px;
    max-width: 250px;
    margin-right: 15px;
}

.item-title-box-pc .item-score-badge {
    background: #e9ecef;
    color: #495057;
    padding: 2px 8px;
    border-radius: 10px;
    font-size: 0.8rem;
    font-weight: 600;
    margin-left: 8px;
    white-space: nowrap;
    flex-shrink: 0;
}

/* 모바일 평점 헤더 클릭 가능하게 */
.mobile-rating-clickable {
    cursor: pointer;
    transition: background-color 0.2s ease;
}

.mobile-rating-clickable:hover {
    background: #e9ecef;
}

.mobile-rating-clickable:active {
    background: #dee2e6;
}

/* 모바일 평점 컨테이너 */
.mobile-rating-container {
    display: flex;
    align-items: center;
    gap: 12px;
    width: 70%;
    max-width: 400px;
}

/* 새로운 모바일 평점 정보 박스 */
.mobile-total-rating-info-new {
    background: #fff;
    border: 2px solid #e9ecef;
    border-radius: 8px;
    color: #495057;
    padding: 12px 20px;
    font-size: 1.1rem;
    font-weight: 600;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
    flex: 1;
}

.mobile-participants-box {
    background: #f8f9fa;
    border: 2px solid #dee2e6;
    border-radius: 8px;
    color: #6c757d;
    padding: 12px 20px;
    font-size: 1.1rem;
    font-weight: 600;
    white-space: nowrap;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
    min-width: 80px;
    text-align: center;
}

/* 모바일 토글 화살표 */
.mobile-toggle-arrow {
    display: flex;
    justify-content: center;
    align-items: center;
    width: 100%;
    height: 30px;
    margin-top: 5px;
    cursor: pointer;
}

.mobile-toggle-arrow i {
    font-size: 20px;
    color: #939dff;
    transition: transform 0.3s ease;
}

.mobile-toggle-arrow:hover i {
    color: #7c85fc;
}

.mobile-toggle-arrow.open i {
    transform: rotate(180deg);
}

/* 통합평점 상세 항목용 중간 크기 바 */
.bidirectional-bars-mobile.medium {
    height: 70px;
    gap: 3px;
    padding: 8px;
}

.bidirectional-bars-mobile.medium .rating-bar {
    width: 28px;
    height: 35px;
}

.bidirectional-bars-mobile.medium .rating-bar.selected {
    height: 55px;
}

.bidirectional-bars-mobile.medium .bar-number {
    font-size: 11px;
}

.unidirectional-bars-mobile.medium {
    height: 65px;
    gap: 3px;
    padding: 8px;
}

.unidirectional-bars-mobile.medium .rating-bar {
    width: 26px;
    height: 35px;
}

.unidirectional-bars-mobile.medium .rating-bar.selected {
    height: 50px;
}

/* 반응형 조정 */
@media (max-width: 480px) {
    .mobile-total-rating-info-new {
        font-size: 1rem;
        padding: 10px 16px;
    }
    
    .mobile-participants-box {
        font-size: 1rem;
        padding: 10px 16px;
    }
    
    .bidirectional-bars-mobile.medium {
        height: 60px;
        gap: 2px;
        padding: 6px;
    }
    
    .bidirectional-bars-mobile.medium .rating-bar {
        width: 24px;
        height: 30px;
    }
    
    .bidirectional-bars-mobile.medium .rating-bar.selected {
        height: 45px;
    }
    
    .bidirectional-bars-mobile.medium .bar-number {
        font-size: 10px;
    }
    
    .unidirectional-bars-mobile.medium {
        height: 55px;
        gap: 2px;
        padding: 6px;
    }
    
    .unidirectional-bars-mobile.medium .rating-bar {
        width: 22px;
        height: 30px;
    }
    
    .unidirectional-bars-mobile.medium .rating-bar.selected {
        height: 40px;
    }
}

@media (max-width: 360px) {
    .d-flex.gap-3 {
        flex-direction: column;
        gap: 8px;
        align-items: center;
    }
    
    .mobile-total-rating-info-new {
        font-size: 0.95rem;
        padding: 8px 14px;
    }
}

/* 통합평점 연결 고리 스타일 */
.total-rating-wrapper {
    margin-bottom: 25px;
}

.total-rating-wrapper:last-child {
    margin-bottom: 0;
}

.total-connector {
    background: linear-gradient(135deg, #28a745 0%, #20c997 100%);
    box-shadow: 0 2px 8px rgba(40, 167, 69, 0.3);
}

.total-rating-content {
    background: #f0f8f0;
    border: 1px solid #d1ecf1;
    border-radius: 12px;
    padding: 18px;
    box-shadow: 0 3px 10px rgba(0,0,0,0.08);
}

.total-rating-content:hover {
    box-shadow: 0 5px 15px rgba(0,0,0,0.12);
    transform: translateY(-3px);
}

/* 첫 번째 통합평점 아이템은 위쪽 선 제거 */
.total-rating-wrapper:first-child .connector-line-top {
    display: none;
}

/* 마지막 통합평점 아이템은 아래쪽 선 제거 */
.total-rating-wrapper:last-child .connector-line-bottom {
    display: none;
}

/* 단방향 바에도 medium 크기 적용 */
.unidirectional-bars-mobile.medium {
    display: flex;
    justify-content: center;
    align-items: flex-end;
    gap: 4px;
    padding: 12px;
    height: 65px;
}

.unidirectional-bars-mobile.medium .rating-bar {
    width: 30px;
    height: 35px;
}

.unidirectional-bars-mobile.medium .rating-bar.selected {
    height: 50px;
}

.unidirectional-bars-mobile.medium .bar-number {
    font-size: 11px;
}

/* 모바일에서 통합평점 연결고리 크기 조정 */
@media (max-width: 768px) {
    .total-rating-wrapper {
        margin-bottom: 18px;
    }
    
    .total-rating-content {
        padding: 15px;
        border-radius: 10px;
    }
}

@media (max-width: 480px) {
    .total-rating-wrapper {
        margin-bottom: 15px;
    }
    
    .total-rating-content {
        padding: 12px;
        border-radius: 8px;
    }
    
    .unidirectional-bars-mobile.medium {
        height: 55px;
        gap: 3px;
        padding: 10px;
    }
    
    .unidirectional-bars-mobile.medium .rating-bar {
        width: 26px;
        height: 30px;
    }
    
    .unidirectional-bars-mobile.medium .rating-bar.selected {
        height: 40px;
    }
}