/**
 * Vavoom MyPage - Review Modal Styles
 * 리뷰 작성 모달 전용 스타일
 */

/* ==============================================
   리뷰 모달 기본 스타일
   ============================================== */

.vavoom-review-modal {
  display: none;
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  z-index: 9999;
}

.vavoom-modal-backdrop {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(0, 0, 0, 0.5);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
  box-sizing: border-box;
}

.vavoom-modal-content {
  background: #ffffff;
  border-radius: 12px;
  width: 100%;
  max-width: 500px;
  max-height: 90vh;
  overflow-y: auto;
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.3);
  position: relative;
  animation: modalSlideIn 0.3s ease-out;
}

@keyframes modalSlideIn {
  from {
    opacity: 0;
    transform: translateY(-50px) scale(0.9);
  }
  to {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
}

/* ==============================================
   모달 헤더
   ============================================== */

.vavoom-modal-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 20px 24px;
  border-bottom: 1px solid #e5e5e5;
  background: #f8f9fa;
  border-radius: 12px 12px 0 0;
}

.vavoom-modal-header h3 {
  margin: 0;
  font-size: 20px !important;
  font-weight: 600;
  color: #333;
}

.vavoom-modal-close {
  background: none;
  border: none;
  font-size: 24px;
  cursor: pointer;
  color: #666;
  padding: 0;
  width: 30px;
  height: 30px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
  transition: all 0.2s ease;
}

.vavoom-modal-close:hover {
  background: #e9ecef;
  color: #333;
}

/* ==============================================
   모달 바디
   ============================================== */

.vavoom-modal-body {
  padding: 24px;
}

/* 상품 정보 섹션 */
.vavoom-product-info {
  display: flex;
  align-items: flex-start;
  gap: 16px;
  margin-bottom: 24px;
  padding: 16px;
  background: #f8f9fa;
  border-radius: 8px;
  border: 1px solid #e9ecef;
}

.vavoom-product-info .product-thumbnail {
  width: 80px;
  height: 80px;
  object-fit: cover;
  border-radius: 8px;
  border: 1px solid #ddd;
  flex-shrink: 0;
}

.vavoom-product-info .product-details {
  flex: 1;
}

.vavoom-product-info .product-details h4 {
  margin: 0 0 8px 0;
  font-size: 16px;
  font-weight: 600;
  color: #333;
  line-height: 1.4;
}

.vavoom-product-info .product-price {
  margin: 0;
  font-size: 14px;
  color: #666;
  font-weight: 500;
}

/* 리뷰 폼 */
.vavoom-review-form {
  display: flex;
  flex-direction: column;
  gap: 20px;
}

/* 별점 필드 */
.rating-field {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.rating-field label {
  font-size: 14px;
  font-weight: 600;
  color: #333;
}

.star-rating {
  display: flex;
  flex-direction: row-reverse;
  gap: 2px;
  align-items: center;
}

.star-rating input[type="radio"] {
  display: none;
}

.star-rating label {
  font-size: 28px;
  color: #ddd;
  cursor: pointer;
  transition: color 0.2s ease;
  user-select: none;
}

.star-rating label:hover,
.star-rating label:hover ~ label {
  color: #ffd700;
}

.star-rating input[type="radio"]:checked ~ label {
  color: #ffd700;
}

/* 리뷰 내용 필드 */
.review-field {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.review-field label {
  font-size: 14px;
  font-weight: 600;
  color: #333;
}

.review-field textarea {
  width: 100%;
  min-height: 120px;
  padding: 12px;
  border: 1px solid #ddd;
  border-radius: 6px;
  font-size: 14px;
  line-height: 1.5;
  resize: vertical;
  box-sizing: border-box;
  font-family: inherit;
}

.review-field textarea:focus {
  outline: none;
  border-color: #007cba;
  box-shadow: 0 0 0 1px #007cba;
}

.review-field textarea::placeholder {
  color: #999;
}

/* 사진 업로드 필드 */
.photo-upload-field {
  display: flex;
  flex-direction: column;
  gap: 10px;
}
.photo-upload-field label {
  font-size: 14px;
  font-weight: 600;
  color: #333;
}
.photo-dropzone {
  border: 2px dashed #d6d9dc;
  border-radius: 12px;
  padding: 16px;
  background: #fbfcfe;
  transition: border-color 0.2s ease, background 0.2s ease, box-shadow 0.2s ease;
  cursor: pointer;
}
.photo-dropzone.is-dragover {
  border-color: #0ea5e9;
  background: #f0f9ff;
  box-shadow: 0 0 0 3px rgba(14,165,233,0.12);
}
.photo-dropzone-inner {
  display: flex;
  align-items: center;
  gap: 12px;
}
.photo-dropzone .dz-icon { font-size: 28px; }
.photo-dropzone .dz-text { display: flex; flex-direction: column; gap: 2px; color: #555; font-size: 13px; }
.photo-dropzone .dz-text strong { color: #111; }
.photo-upload-trigger {
  margin-left: auto;
  padding: 8px 12px;
  background: #fa5250;
  color: #fff !important;
  border: none;
  border-radius: 8px;
  font-size: 13px;
  font-weight: 700;
  cursor: pointer;
}
.photo-upload-trigger:hover { background: #fa5250; }
.photo-preview-grid { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 2px; }
.photo-empty-hint { width: 100%; padding: 10px; text-align: center; color: #888; font-size: 13px; background: #f8fafc; border: 1px dashed #e2e8f0; border-radius: 8px; }
.photo-thumb { position: relative; width: 62px; height: 62px; background-size: cover; background-position: center; border-radius: 8px; border: 1px solid #e5e7eb; box-shadow: 0 1px 2px rgba(0,0,0,0.04); }
.photo-thumb .photo-remove { position: absolute; top: -6px; right: -6px; width: 20px; height: 20px; border-radius: 50%; border: none; background: #ef4444; color: #fff; font-weight: 700; cursor: pointer; box-shadow: 0 1px 2px rgba(0,0,0,0.12); line-height: 20px; padding: 0; }
.photo-thumb .photo-remove:hover { background: #dc2626; }

/* ==============================================
   모달 액션 버튼
   ============================================== */

.vavoom-modal-actions {
  display: flex;
  gap: 12px;
  justify-content: flex-end;
  margin-top: 24px;
  padding-top: 20px;
  border-top: 1px solid #e5e5e5;
}

.vavoom-modal-actions button {
  padding: 10px 20px;
  border: none;
  border-radius: 6px;
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s ease;
  min-width: 80px;
}

.btn-cancel {
  background: #f8f9fa;
  color: #666;
  border: 1px solid #ddd;
}

.btn-cancel:hover {
  background: #e9ecef;
  color: #333;
}

.btn-submit {
  background: #fa5250;
  color: white;
}

.btn-submit:hover:not(:disabled) {
  background: #005a87;
}

.btn-submit:disabled {
  background: #ccc;
  cursor: not-allowed;
}

/* 로딩 상태 */
.vavoom-modal-loading {
  pointer-events: none;
  opacity: 0.7;
}

.vavoom-modal-loading .btn-submit {
  background: #ccc;
  cursor: not-allowed;
}

.vavoom-modal-loading .btn-submit::after {
  content: "";
  display: inline-block;
  width: 16px;
  height: 16px;
  margin-left: 8px;
  border: 2px solid #ffffff;
  border-radius: 50%;
  border-top-color: transparent;
  animation: spin 1s ease-in-out infinite;
}

@keyframes spin {
  to {
    transform: rotate(360deg);
  }
}

/* ==============================================
   성공/에러 메시지
   ============================================== */

.vavoom-review-message {
  padding: 12px 16px;
  border-radius: 6px;
  margin-bottom: 16px;
  font-size: 14px;
  font-weight: 500;
}

.vavoom-review-message.success {
  background: #d4edda;
  color: #155724;
  border: 1px solid #c3e6cb;
}

.vavoom-review-message.error {
  background: #f8d7da;
  color: #721c24;
  border: 1px solid #f5c6cb;
}

/* ==============================================
   반응형 디자인
   ============================================== */

@media (max-width: 768px) {
  .vavoom-modal-backdrop {
    padding: 10px;
  }

  .vavoom-modal-content {
    max-height: 95vh;
  }

  .vavoom-modal-header {
    padding: 16px 20px;
  }

  .vavoom-modal-header h3 {
    font-size: 18px !important;
  }

  .vavoom-modal-body {
    padding: 20px;
  }

  .vavoom-product-info {
    flex-direction: column;
    align-items: center;
    text-align: center;
    gap: 12px;
  }

  .vavoom-product-info .product-thumbnail {
    width: 60px;
    height: 60px;
  }

  .star-rating label {
    font-size: 24px;
  }

  .vavoom-modal-actions {
    flex-direction: column-reverse;
  }

  .vavoom-modal-actions button {
    width: 100%;
    padding: 12px;
  }
}

@media (max-width: 480px) {
  .vavoom-modal-backdrop {
    padding: 5px;
  }

  .vavoom-modal-header {
    padding: 12px 16px;
  }

  .vavoom-modal-body {
    padding: 16px;
  }
}

.visually-hidden-file {
  position: absolute !important;
  width: 1px !important;
  height: 1px !important;
  padding: 0 !important;
  margin: -1px !important;
  overflow: hidden !important;
  clip: rect(0, 0, 0, 0) !important;
  white-space: nowrap !important;
  border: 0 !important;
}

/* Completed review photos (mypage list) */
.vavoom-review-photos { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 10px; }
.vavoom-review-photo { display: block; width: 70px; height: 70px; border-radius: 8px; overflow: hidden; border: 1px solid #e5e7eb; }
.vavoom-review-photo img { width: 100%; height: 100%; object-fit: cover; display: block; }
