/*
 * Songil Astra Child Theme - Review CSS
 * 작성자: Songil, Grok (xAI)
 * 최종 수정: 2025-05-12
 * 목차:
 * 1. 리뷰 섹션 스타일
 * 2. 리뷰 폼 및 버튼 스타일
 * 3. 리뷰 수정/삭제 및 별점 스타일
 * 4. 이미지 미리보기 및 모달 스타일
 */

/*
 * 1. 리뷰 섹션 스타일
 * - 리뷰 컨테이너 및 아이템 디자인
 * - 리뷰 헤더, 작성자, 평점, 이미지 스타일
 */
.reviews {
    margin: 30px 0;
}

.reviews h3 {
    font-size: 22px;
    margin-bottom: 20px;
    color: #333333;
}

.reviews .review-item {
    background: #f9f9f9;
    border-radius: 8px;
    padding: 15px;
    margin-bottom: 15px;
    border-bottom: 1px solid #ddd;
}

.reviews .review-item:last-child {
    border-bottom: 1px solid #ddd;
}

.review-header {
    display: flex;
    align-items: center;
    justify-content: flex-start;
    gap: 10px;
    margin-left: 58px;
}

.review-author-container {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    margin-bottom: 10px;
    position: relative;
}

.review-author {
    display: flex;
    align-items: center;
    font-size: 14px;
    color: #333;
    margin-bottom: 5px;
    font-weight: bold;
    margin-left: 58px;
}

.author-avatar {
    width: 48px;
    height: 48px;
    border-radius: 50%;
    position: absolute;
    top: 50%;
    left: 0;
    transform: translateY(-50%);
    object-fit: cover;
}

.review-rating {
    color: #f39c12;
    font-weight: bold;
}

.review-date {
    font-size: 13px;
    color: #777777;
}

.reviews .review-item .review-comment {
    font-size: 15px;
    color: #555555;
    margin: 10px 0;
    white-space: pre-wrap;
    word-wrap: break-word;
    line-height: 1.2;
    display: inline-block;
}

.reviews .review-item .review-comment br {
    display: none;
}

.review-images {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    margin: 10px 0;
}

.review-image-container {
    cursor: pointer;
}

.review-image {
    width: 240px;
    height: 150px;
    object-fit: cover;
    border-radius: 5px;
}

/*
 * 2. 리뷰 폼 및 버튼 스타일
 * - 리뷰 작성 폼 및 제출 버튼 디자인
 * - 코스모스팜 메시지 버튼 스타일
 */
.review-form {
    margin: 30px 0;
    background: #ffffff;
    border-radius: 10px;
    padding: 20px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
}

.review-form h3 {
    font-size: 20px;
    margin-bottom: 15px;
    color: #333333;
}

.review-form label {
    display: block;
    font-size: 14px;
    margin-bottom: 5px;
    color: #333333;
}

.review-form input[type="number"],
.review-form textarea {
    width: 100%;
    padding: 10px;
    border: 1px solid #dddddd;
    border-radius: 5px;
    margin-bottom: 15px;
    font-size: 14px;
}

.review-form textarea {
    resize: vertical;
    min-height: 200px;
}

.review-submit {
    background: #28a745;
    color: #ffffff;
    border: none;
    padding: 10px 20px;
    border-radius: 5px;
    cursor: pointer;
    transition: background 0.3s ease;
}

.review-submit:hover {
    background: #218838;
}

.cosmosfarm-members-message-button {
    display: inline-block;
    padding: 10px 20px;
    background: #28a745;
    color: #ffffff;
    text-decoration: none;
    border-radius: 5px;
    margin-top: 15px;
    transition: background 0.3s ease;
}

.cosmosfarm-members-message-button:hover {
    background: #218838;
}

/*
 * 3. 리뷰 수정/삭제 및 별점 스타일
 * - 리뷰 수정/삭제 버튼 및 폼 디자인
 * - 별점 입력 스타일
 */
.review-actions {
    margin-top: 15px;
}

.review-action-form {
    display: inline-block;
    margin: 0 5px;
}

.review-edit-button {
    background: #007bff;
    color: #ffffff;
    border: none;
    padding: 5px 10px;
    border-radius: 5px;
    cursor: pointer;
    transition: background 0.3s ease;
}

.review-edit-button:hover {
    background: #0056b3;
}

.review-delete-button {
    background: #dc3545;
    color: #ffffff;
    border: none;
    padding: 5px 10px;
    border-radius: 5px;
    cursor: pointer;
    transition: background 0.3s ease;
}

.review-delete-button:hover {
    background: #c82333;
}

.review-edit-form {
    margin: 20px 0;
    background: #ffffff;
    border-radius: 10px;
    padding: 15px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
    transition: opacity 0.3s ease, max-height 0.3s ease;
    opacity: 1;
    max-height: 1000px;
    overflow: auto;
}

.review-edit-form[style*="display: block"] {
    opacity: 1;
    max-height: 1000px;
    overflow: auto;
}

.review-edit-form h3 {
    font-size: 18px;
    margin-bottom: 15px;
    color: #333333;
}

.review-edit-form label {
    display: block;
    font-size: 14px;
    margin-bottom: 5px;
    color: #333333;
}

.review-edit-form input[type="number"],
.review-edit-form textarea {
    width: 100%;
    padding: 10px;
    border: 1px solid #dddddd;
    border-radius: 5px;
    margin-bottom: 15px;
    font-size: 14px;
}

.review-edit-form textarea {
    resize: vertical;
    min-height: 200px;
}

.review-update-button {
    background: #28a745;
    color: #ffffff;
    border: none;
    padding: 10px 20px;
    border-radius: 5px;
    cursor: pointer;
    transition: background 0.3s ease;
    margin-right: 10px;
}

.review-update-button:hover {
    background: #218838;
}

.review-cancel-button {
    background: #6c757d;
    color: #ffffff;
    border: none;
    padding: 10px 20px;
    border-radius: 5px;
    cursor: pointer;
    transition: background 0.3s ease;
}

.review-cancel-button:hover {
    background: #5a6268;
}

.rating {
    font-size: 16px;
    margin-bottom: 15px;
    color: inherit;
}

.star-rating {
    display: inline-block;
    font-size: 24px;
    line-height: 1;
}

.star {
    color: #ccc;
    cursor: default;
    margin-right: 5px;
}

.star.filled {
    color: #f39c12;
}

.star.half {
    color: #f39c12;
    position: relative;
    overflow: hidden;
    width: 12px;
}

.star.empty {
    color: #ccc;
}

/*
 * 4. 이미지 미리보기 및 모달 스타일
 * - 이미지 미리보기 및 삭제 버튼 스타일
 * - 이미지 모달 및 썸네일 스타일
 */
.image-preview {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    margin-top: 10px;
}

.preview-item {
    position: relative;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 5px;
}

.preview-item img {
    width: 70px;
    height: 70px;
    object-fit: cover;
    border-radius: 5px;
}

.preview-item span {
    font-size: 12px;
    color: #666;
    text-align: center;
    max-width: 70px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.image-preview .preview-item .delete-preview {
    position: absolute;
    top: -6px;
    right: -6px;
    background: #000;
    color: #fff;
    border: none;
    border-radius: 50%;
    width: 14px;
    height: 14px;
    line-height: 14px;
    font-size: 10px;
    text-align: center;
    cursor: pointer;
    z-index: 10;
    font-family: Arial, sans-serif;
    -webkit-appearance: none;
    appearance: none;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 0;
}

.existing-images {
    margin-top: 10px;
}

.image-list {
    display: flex;
    flex-wrap: wrap;
    gap: 15px;
}

.image-item {
    display: flex;
    flex-direction: column;
    align-items: center;
}

.image-item img {
    width: 100px;
    height: 60px;
    object-fit: cover;
    border-radius: 5px;
}

.image-item label {
    margin-top: 5px;
    font-size: 12px;
}

.image-modal {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.8);
    z-index: 1000;
    justify-content: center;
    align-items: center;
}

.modal-content {
    position: relative;
    width: 800px;
    height: 600px;
    background-color: #fff;
    border-radius: 0;
    padding: 0;
    text-align: center;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
}

.modal-close {
    position: absolute;
    top: 10px;
    right: 200px;
    font-size: 58px;
    color: #fff;
    cursor: pointer;
    background: transparent;
    border-radius: 0;
    width: auto;
    height: auto;
    line-height: normal;
    text-align: center;
    z-index: 10;
}

.modal-main-image {
    width: 100%;
    height: 500px;
    display: flex;
    justify-content: center;
    align-items: center;
}

.modal-main-image img {
    max-width: 100%;
    max-height: 100%;
    object-fit: contain;
    border-radius: 0;
}

.modal-thumbnails {
    display: flex;
    justify-content: center;
    gap: 10px;
    margin-top: 10px;
    flex-wrap: wrap;
}

.modal-thumbnails img {
    width: 60px;
    height: 60px;
    object-fit: cover;
    border-radius: 5px;
    cursor: pointer;
    opacity: 0.6;
}

.modal-thumbnails img.active {
    opacity: 1;
    border: 2px solid #f39c12;
}

.modal-controls {
    margin-top: 10px;
    color: #fff;
    font-size: 16px;
    text-align: center;
}

.modal-prev, .modal-next {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    background: none;
    border: none;
    color: #fff;
    font-size: 60px;
    cursor: pointer;
    z-index: 10;
}

.modal-prev {
    left: 200px;
}

.modal-next {
    right: 200px;
}

.modal-prev:disabled, .modal-next:disabled {
    opacity: 0.3;
    cursor: not-allowed;
}

.modal-footer {
    width: 100%;
    display: flex;
    flex-direction: column;
    align-items: center;
    position: absolute;
    bottom: -80px;
}

.existing-image-preview {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    margin-top: 10px;
}

.existing-image-preview .preview-item {
    position: relative;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 5px;
}

.existing-image-preview .preview-item img {
    width: 70px;
    height: 70px;
    object-fit: cover;
    border-radius: 5px;
}

.delete-existing-image {
    position: absolute;
    top: -6px;
    right: -6px;
    background: #000;
    color: #fff;
    border: none;
    border-radius: 50%;
    width: 14px;
    height: 14px;
    line-height: 14px;
    font-size: 10px;
    text-align: center;
    cursor: pointer;
    z-index: 10;
    font-family: Arial, sans-serif;
    -webkit-appearance: none;
    appearance: none;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 0;
}