/* =============================================
   FEEDBACK HEADER - 액션바 & 리뷰 모달
   ============================================= */

.header-top-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    width: 100%;
}

/* 업데이트 표시 */
.update-indicator {
    display: flex;
    align-items: center;
    gap: 6px;
}

.update-dot {
    position: relative;
    width: 6px;
    height: 6px;
}

.update-dot::before {
    content: '';
    position: absolute;
    inset: 0;
    border-radius: 50%;
    background: #22c55e;
    animation: ping 1.5s cubic-bezier(0, 0, 0.2, 1) infinite;
}

.update-dot::after {
    content: '';
    position: absolute;
    inset: 0;
    border-radius: 50%;
    background: #22c55e;
}

@keyframes ping {
    75%, 100% {
        transform: scale(2);
        opacity: 0;
    }
}

.update-text {
    font-size: 10px;
    color: #22c55e;
    font-weight: 500;
}

/* 구분선 */
.header-divider {
    width: 100%;
    height: 1px;
    background: rgba(255, 255, 255, 0.08);
    margin: 4px 0;
}

/* 액션바 */
.header-action-bar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
    width: 100%;
}

.action-left {
    display: flex;
    align-items: center;
    gap: 8px;
}

/* 조회수 */
.view-count-wrapper {
    display: flex;
    align-items: center;
    gap: 4px;
    color: var(--text-secondary, #848b9c);
    font-size: 12px;
    padding-right: 8px;
    border-right: 1px solid var(--border-primary, rgba(255, 255, 255, 0.08));
}

.view-count-wrapper i {
    font-size: 14px;
}

/* 버튼 그룹 */
.action-btn-group {
    display: flex;
    background: var(--bg-tertiary, #1a1d26);
    border-radius: 8px;
    border: 1px solid var(--border-primary, rgba(255, 255, 255, 0.08));
    height: 32px;
    overflow: hidden;
}

.action-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    padding: 0 12px;
    background: transparent;
    border: none;
    color: var(--text-secondary, #848b9c);
    cursor: pointer;
    transition: all 0.2s ease;
    font-size: 12px;
}

.action-btn:hover {
    background: rgba(255, 255, 255, 0.05);
    color: var(--text-primary, #fff);
}

.action-btn.liked {
    color: var(--primary, #e2c068);
}

.action-btn.disliked {
    color: #ef4444;
}

.action-btn-divider {
    width: 1px;
    background: var(--border-primary, rgba(255, 255, 255, 0.08));
}

.action-count {
    color: var(--text-primary, #fff);
    font-weight: 700;
}

/* 공유/홈추가 버튼 */
.share-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 32px;
    height: 32px;
    background: var(--bg-tertiary, #1a1d26);
    border: 1px solid var(--border-primary, rgba(255, 255, 255, 0.08));
    border-radius: 8px;
    color: var(--text-secondary, #848b9c);
    cursor: pointer;
    transition: all 0.2s ease;
}

.share-btn:hover {
    border-color: var(--text-secondary, #848b9c);
    color: var(--text-primary, #fff);
}

/* 리뷰 영역 (클릭 가능) */
.review-area {
    display: flex;
    align-items: center;
    gap: 6px;
    height: 32px;
    padding: 0 12px;
    background: var(--bg-tertiary, #1a1d26);
    border: 1px solid var(--border-primary, rgba(255, 255, 255, 0.08));
    border-radius: 8px;
    color: var(--text-primary, #fff);
    cursor: pointer;
    transition: all 0.2s ease;
    font-size: 12px;
}

.review-area:hover {
    border-color: var(--primary, #e2c068);
    background: rgba(226, 192, 104, 0.1);
}

.review-area i.ri-star-fill {
    color: var(--primary, #e2c068);
}

.review-rating {
    font-weight: 700;
}

.review-count {
    color: var(--text-secondary, #848b9c);
    font-weight: 400;
}

.review-arrow {
    color: var(--text-secondary, #848b9c);
    font-size: 10px;
    margin-left: 4px;
}

/* 380px 이하에서 한줄평 텍스트 숨김 */
@media (max-width: 380px) {
    .review-arrow {
        display: none;
    }
}

.review-area:hover .review-arrow {
    color: var(--primary, #e2c068);
}

/* 리뷰 모달 */
.review-modal-overlay {
    position: fixed;
    inset: 0;
    z-index: 1000;
    display: flex;
    align-items: flex-end;
    justify-content: center;
    background: rgba(0, 0, 0, 0.85);
    /* backdrop-filter: blur(4px); - 성능 이슈로 제거 */
    opacity: 0;
    visibility: hidden;
    pointer-events: none;
    transition: opacity 0.3s ease, visibility 0.3s ease;
    will-change: opacity;
}

.review-modal-overlay.active {
    opacity: 1;
    visibility: visible;
    pointer-events: auto;
}

.review-modal-container {
    position: relative;
    width: 100%;
    max-width: 420px;
    max-height: 85vh;
    background: var(--bg-card, #12151c);
    border-radius: 20px 20px 0 0;
    border: 1px solid var(--border-primary, rgba(255, 255, 255, 0.08));
    border-bottom: none;
    display: flex;
    flex-direction: column;
    transform: translateY(100%);
    transition: transform 0.3s ease;
    contain: layout style; /* 성능 최적화: 레이아웃 계산 범위 제한 */
    will-change: transform;
}

.review-modal-overlay.active .review-modal-container {
    transform: translateY(0);
}

@media (min-width: 640px) {
    .review-modal-overlay {
        align-items: center;
    }
    .review-modal-container {
        border-radius: 20px;
        border-bottom: 1px solid var(--border-primary, rgba(255, 255, 255, 0.08));
        transform: translateY(20px) scale(0.95);
    }
    .review-modal-overlay.active .review-modal-container {
        transform: translateY(0) scale(1);
    }
}

.review-modal-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 16px 20px;
    border-bottom: 1px solid var(--border-primary, rgba(255, 255, 255, 0.08));
}

.review-modal-title {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 16px;
    font-weight: 700;
    color: var(--text-primary, #fff);
}

.review-modal-title i {
    color: var(--primary, #e2c068);
}

.review-modal-count {
    color: var(--text-secondary, #848b9c);
    font-size: 14px;
    font-weight: 400;
}

.review-modal-header-actions {
    display: flex;
    align-items: center;
    gap: 4px;
}

.review-admin-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 36px;
    height: 36px;
    background: transparent;
    border: none;
    color: var(--text-secondary, #848b9c);
    cursor: pointer;
    border-radius: 8px;
    font-size: 18px;
    transition: all 0.2s ease;
}

.review-admin-btn:hover {
    background: rgba(255, 255, 255, 0.05);
    color: var(--primary, #e2c068);
}

.review-admin-btn.active {
    color: var(--primary, #e2c068);
}

.review-modal-close {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 36px;
    height: 36px;
    background: transparent;
    border: none;
    color: var(--text-secondary, #848b9c);
    cursor: pointer;
    border-radius: 8px;
    font-size: 24px; /* 기존 모달과 동일한 크기 */
}

.review-modal-close:hover {
    background: rgba(255, 255, 255, 0.05);
    color: var(--text-primary, #fff);
}

.review-modal-body {
    flex: 1;
    overflow-y: auto;
    padding: 20px;
    background: var(--bg-deep, #0f1115);
    contain: content; /* 성능 최적화: 스크롤 영역 격리 */
}

.review-modal-body::-webkit-scrollbar {
    display: none;
}

/* 리뷰 폼 */
.review-form {
    background: var(--bg-card, #12151c);
    border: 1px solid var(--border-primary, rgba(255, 255, 255, 0.08));
    border-radius: 16px;
    padding: 16px;
    margin-bottom: 20px;
}

.review-form-label {
    display: block;
    text-align: center;
    font-size: 12px;
    color: var(--text-secondary, #848b9c);
    margin-bottom: 8px;
}

.review-form-notice {
    font-size: 10px;
    color: var(--text-secondary, #848b9c);
    text-align: center;
    margin: 4px 0 12px 0;
    opacity: 0.7;
}

.star-input-group {
    display: flex;
    justify-content: center;
    gap: 8px;
    margin-bottom: 16px;
}

.star-input-btn {
    background: transparent;
    border: none;
    padding: 4px;
    cursor: pointer;
    transition: transform 0.2s ease;
    font-size: 28px;
    color: #3a3f4b;
}

.star-input-btn:hover {
    transform: scale(1.15);
}

.star-input-btn.active,
.star-input-btn.active i {
    color: var(--primary, #e2c068);
}

.turnstile-container {
    display: flex;
    justify-content: center;
    padding: 8px 0;
    margin-bottom: 12px;
}

.review-input-wrapper {
    position: relative;
    contain: layout style; /* 성능 최적화 */
}

.review-input {
    width: 100%;
    padding: 12px 70px 12px 16px;
    background: var(--bg-deep, #0f1115);
    border: 1px solid var(--border-primary, rgba(255, 255, 255, 0.12));
    border-radius: 10px;
    color: var(--text-primary, #fff);
    font-size: 14px;
    outline: none;
    contain: strict; /* 성능 최적화: 입력 시 reflow 범위 제한 */
}

.review-input::placeholder {
    color: var(--text-secondary, #848b9c);
}

.review-input:focus {
    border-color: var(--primary, #e2c068);
}

.review-submit-btn {
    position: absolute;
    right: 6px;
    top: 6px;
    bottom: 6px;
    padding: 0 14px;
    background: var(--primary, #e2c068);
    border: none;
    border-radius: 6px;
    color: #000;
    font-size: 12px;
    font-weight: 700;
    cursor: pointer;
}

.review-submit-btn:hover {
    background: #f0d078;
}

.review-submit-btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

.review-divider {
    display: flex;
    align-items: center;
    gap: 12px;
    margin: 16px 0;
}

.review-divider-line {
    flex: 1;
    height: 1px;
    background: var(--border-primary, rgba(255, 255, 255, 0.08));
}

.review-divider-text {
    font-size: 10px;
    color: var(--text-secondary, #848b9c);
}

.review-list {
    display: flex;
    flex-direction: column;
    gap: 12px;
    min-height: 100px; /* CLS 방지: 리뷰 리스트 영역 확보 */
    max-height: 400px;
    overflow-y: auto;
    scrollbar-width: none; /* Firefox */
    -ms-overflow-style: none; /* IE/Edge */
}

.review-list::-webkit-scrollbar {
    display: none; /* Chrome, Safari */
}

.review-item {
    display: flex;
    gap: 12px;
    padding: 12px;
    background: var(--bg-card, #12151c);
    border: 1px solid var(--border-primary, rgba(255, 255, 255, 0.08));
    border-radius: 12px;
}

.review-avatar {
    flex-shrink: 0;
    width: 32px;
    height: 32px;
    background: var(--bg-tertiary, #1a1d26);
    border: 1px solid var(--border-primary, rgba(255, 255, 255, 0.08));
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 12px;
    font-weight: 700;
    color: var(--text-secondary, #848b9c);
}

.review-content {
    flex: 1;
    min-width: 0;
}

.review-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 4px;
}

.review-username {
    font-size: 12px;
    font-weight: 700;
    color: var(--text-primary, #fff);
}

.review-date {
    font-size: 10px;
    color: var(--text-secondary, #848b9c);
}

.review-stars {
    display: flex;
    gap: 2px;
    margin-bottom: 6px;
    font-size: 12px;
}

.review-stars i.filled {
    color: var(--primary, #e2c068);
}

.review-stars i.empty {
    color: #3a3f4b;
}

.review-text {
    font-size: 13px;
    color: var(--text-secondary, #a0a8b8);
    line-height: 1.5;
    word-break: break-word;
}

/* 페이지네이션 */
.review-pagination {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 4px;
    margin-top: 16px;
    padding-top: 12px;
    border-top: 1px solid var(--border-primary, rgba(255, 255, 255, 0.08));
}

.review-page-btn {
    min-width: 32px;
    height: 32px;
    padding: 0 8px;
    background: transparent;
    border: 1px solid var(--border-primary, rgba(255, 255, 255, 0.08));
    border-radius: 8px;
    color: var(--text-secondary, #848b9c);
    font-size: 13px;
    cursor: pointer;
    transition: all 0.2s ease;
}

.review-page-btn:hover:not(:disabled) {
    background: rgba(255, 255, 255, 0.05);
    color: var(--text-primary, #fff);
}

.review-page-btn.active {
    background: var(--primary, #e2c068);
    border-color: var(--primary, #e2c068);
    color: #000;
    font-weight: 600;
}

.review-page-btn:disabled {
    opacity: 0.3;
    cursor: not-allowed;
}

.review-page-ellipsis {
    color: var(--text-secondary, #848b9c);
    font-size: 12px;
    padding: 0 4px;
}

.review-empty {
    text-align: center;
    padding: 32px;
    color: var(--text-secondary, #848b9c);
    font-size: 12px;
}

.feedback-toast {
    position: fixed;
    bottom: 80px;
    left: 50%;
    transform: translateX(-50%) translateY(20px);
    padding: 12px 20px;
    background: var(--bg-card, #12151c);
    border: 1px solid var(--border-primary, rgba(255, 255, 255, 0.12));
    border-radius: 10px;
    color: var(--text-primary, #fff);
    font-size: 13px;
    opacity: 0;
    visibility: hidden;
    transition: all 0.3s ease;
    z-index: 1001;
}

.feedback-toast.show {
    opacity: 1;
    visibility: visible;
    transform: translateX(-50%) translateY(0);
}

/* ========================================
   관리자 모달
   ======================================== */
.admin-modal-overlay {
    position: fixed;
    inset: 0;
    z-index: 1100;
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(0, 0, 0, 0.85);
    opacity: 0;
    visibility: hidden;
    pointer-events: none;
    transition: opacity 0.3s ease, visibility 0.3s ease;
}

.admin-modal-overlay.active {
    opacity: 1;
    visibility: visible;
    pointer-events: auto;
}

.admin-modal {
    width: 90%;
    max-width: 320px;
    background: var(--bg-card, #12151c);
    border: 1px solid var(--border-primary, rgba(255, 255, 255, 0.08));
    border-radius: 16px;
    overflow: hidden;
}

.admin-modal-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 16px;
    border-bottom: 1px solid var(--border-primary, rgba(255, 255, 255, 0.08));
}

.admin-modal-header h4 {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 14px;
    font-weight: 600;
    color: var(--text-primary, #fff);
}

.admin-modal-header h4 i {
    color: var(--primary, #e2c068);
}

.admin-modal-close {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 32px;
    height: 32px;
    background: transparent;
    border: none;
    color: var(--text-secondary, #848b9c);
    cursor: pointer;
    border-radius: 8px;
    font-size: 20px;
}

.admin-modal-close:hover {
    background: rgba(255, 255, 255, 0.05);
    color: var(--text-primary, #fff);
}

.admin-modal-body {
    padding: 16px;
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.admin-password-input {
    width: 100%;
    padding: 12px 16px;
    background: var(--bg-deep, #0f1115);
    border: 1px solid var(--border-primary, rgba(255, 255, 255, 0.12));
    border-radius: 10px;
    color: var(--text-primary, #fff);
    font-size: 14px;
    outline: none;
}

.admin-password-input:focus {
    border-color: var(--primary, #e2c068);
}

.admin-confirm-btn {
    width: 100%;
    padding: 12px;
    background: var(--primary, #e2c068);
    border: none;
    border-radius: 10px;
    color: #000;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    transition: opacity 0.2s ease;
}

.admin-confirm-btn:hover {
    opacity: 0.9;
}

/* ========================================
   리뷰 삭제 버튼
   ======================================== */
.review-delete-btn {
    background: transparent;
    border: none;
    color: var(--text-secondary, #848b9c);
    cursor: pointer;
    padding: 4px;
    font-size: 14px;
    opacity: 0.6;
    transition: all 0.2s ease;
}

.review-delete-btn:hover {
    color: #ff6b6b;
    opacity: 1;
}

.review-item-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    width: 100%;
}

.review-item-info {
    display: flex;
    align-items: center;
    gap: 8px;
}