/* ===== REVIEW MODAL ===== */
.review-modal {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  z-index: 9999;
  display: none;
}

.review-modal-overlay {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background-color: rgba(0, 0, 0, 0.5);
  animation: fadeIn 0.3s ease;
}

.review-modal-content {
  position: fixed;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  background: #ffffff;
  border-radius: 12px;
  box-shadow: 0 10px 40px rgba(0, 0, 0, 0.2);
  width: 90%;
  max-width: 500px;
  max-height: 90vh;
  overflow-y: auto;
  padding: 32px 24px;
  animation: slideUp 0.3s ease;
  z-index: 10001;
}

.review-modal-close {
  position: absolute;
  top: 16px;
  right: 16px;
  background: none;
  border: none;
  font-size: 28px;
  color: #666666;
  cursor: pointer;
  width: 32px;
  height: 32px;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: color 0.2s ease;
}

.review-modal-close:hover {
  color: #222222;
}

.review-modal-title {
  font-size: 1.11rem;
  font-weight: 500;
  color: #222222;
  margin: 0 0 20px 0;
  padding-bottom: 14px;
  border-bottom: 2px solid #ff5a5a;
}

/* ===== REVIEW FORM ===== */
.review-form {
  display: flex;
  flex-direction: column;
  gap: 20px;
}

.review-label {
  display: block;
  font-size: 0.95rem;
  font-weight: 600;
  color: #222222;
  margin-bottom: 10px;
}

.required {
  color: #ff5a5a;
}

/* ===== STAR RATING ===== */
.review-rating-section {
  text-align: center;
}

.review-stars {
  display: flex;
  justify-content: center;
  gap: 8px;
  margin: 16px 0;
  flex-direction: row-reverse;
}

.review-stars input {
  display: none;
}

.star-label {
  font-size: 1.33rem;
  cursor: pointer;
  color: #ddd;
  transition: color 0.2s ease, text-shadow 0.2s ease;
  text-shadow: none;
}

.star-label:hover,
.star-label.hover {
  color: #ff5a5a;
  text-shadow: 0 0 8px rgba(255, 90, 90, 0.3);
}

.star-label.active {
  color: #ff5a5a;
  text-shadow: 0 2px 8px rgba(255, 90, 90, 0.4);
}

.rating-text {
  font-size: 0.9rem;
  color: #666666;
  margin: 12px 0 0 0;
  min-height: 20px;
}

/* ===== REVIEW TEXTAREA ===== */
.review-text-section {
  display: flex;
  flex-direction: column;
}

.review-textarea {
  min-height: 120px;
  padding: 12px 14px;
  border: 1px solid #ddd;
  border-radius: 6px;
  font-size: 0.95rem;
  font-family: inherit;
  resize: vertical;
  transition: border-color 0.2s ease, box-shadow 0.2s ease;
}

.review-textarea:focus {
  outline: none;
  border-color: #ff5a5a;
  box-shadow: 0 0 0 3px rgba(255, 90, 90, 0.1);
}

.char-count {
  font-size: 0.8rem;
  color: #999;
  margin: 6px 0 0 0;
  text-align: right;
}

/* ===== ACTION BUTTONS ===== */
.review-actions {
  display: flex;
  gap: 12px;
  margin-top: 8px;
}

.btn-submit,
.btn-close-modal {
  flex: 1;
  padding: 12px 20px;
  min-height: 46px;
  border: none;
  border-radius: 6px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  line-height: 1;
  font-size: 0.95rem;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s ease;
}

.btn-submit {
  background: linear-gradient(135deg, #ff5a5a 0%, #ff7c6f 100%);
  color: #ffffff;
}

.btn-submit:hover:not(:disabled) {
  transform: translateY(-2px);
  box-shadow: 0 6px 16px rgba(255, 90, 90, 0.3);
}

.btn-submit:disabled {
  opacity: 0.6;
  cursor: not-allowed;
}

.btn-close-modal {
  background-color: #f0f0f0;
  color: #222222;
}

.btn-close-modal:hover {
  background-color: #e0e0e0;
}

/* ===== SUCCESS MESSAGE ===== */
.review-success {
  text-align: center;
  padding: 20px;
}

.success-icon {
  font-size: 2rem;
  color: #27ae60;
  margin-bottom: 12px;
  animation: scaleIn 0.4s ease;
}

.review-success h3 {
  font-size: 1.1rem;
  font-weight: 700;
  color: #222222;
  margin: 12px 0 8px 0;
}

.review-success p {
  font-size: 0.95rem;
  color: #666666;
  margin: 0 0 16px 0;
}

/* ===== ERROR MESSAGE ===== */
.review-error {
  background-color: #fee;
  border: 1px solid #fcc;
  border-radius: 6px;
  padding: 12px 14px;
  margin-bottom: 12px;
}

.error-message {
  color: #c33;
  font-size: 0.9rem;
  margin: 0;
}

/* ===== REVIEW BUTTON IN ORDER ITEMS ===== */
.item-actions {
  display: flex;
  gap: 8px;
  align-items: center;
  justify-content: flex-end;
  position: relative;
  z-index: 3;
}

.btn-write-review {
  padding: 8px 16px;
  background: #000000;
  color: #ffffff;
  border: none;
  border-radius: 6px;
  font-size: 0.85rem;
  font-weight: 600;
  cursor: pointer;
  white-space: nowrap;
  transition: all 0.2s ease;
  position: relative;
  z-index: 4;
  pointer-events: auto;
  touch-action: manipulation;
}

.btn-write-review:hover {
  transform: translateY(-2px);
  box-shadow: 0 6px 16px rgba(0, 0, 0, 0.35);
}

.btn-write-review:active {
  transform: translateY(0);
}

.review-submitted {
  display: inline-block;
  padding: 8px 12px;
  background-color: #d4edda;
  color: #155724;
  border-radius: 6px;
  font-size: 0.85rem;
  font-weight: 600;
  white-space: nowrap;
}

/* ===== ANIMATIONS ===== */
@keyframes fadeIn {
  from {
    opacity: 0;
  }
  to {
    opacity: 1;
  }
}

@keyframes slideUp {
  from {
    opacity: 0;
    transform: translate(-50%, -40%);
  }
  to {
    opacity: 1;
    transform: translate(-50%, -50%);
  }
}

@keyframes scaleIn {
  from {
    opacity: 0;
    transform: scale(0);
  }
  to {
    opacity: 1;
    transform: scale(1);
  }
}

/* ===== RESPONSIVE ===== */
@media (max-width: 768px) {
  .review-modal-content {
    width: 95%;
    max-width: 100%;
    padding: 24px 18px;
  }

  .review-modal-title {
    font-size: 1.3rem;
    margin-bottom: 18px;
  }

  .review-stars {
    gap: 4px;
  }

  .star-label {
    font-size: 1.5rem;
  }

  .review-textarea {
    min-height: 100px;
    font-size: 16px; /* Prevent zoom on iOS */
  }

  .review-actions {
    flex-direction: column;
  }

  .btn-submit,
  .btn-close-modal {
    width: 100%;
  }
}

@media (max-width: 480px) {
  .review-modal-content {
    padding: 20px 16px;
  }

  .review-modal-title {
    font-size: 1.2rem;
    margin-bottom: 16px;
  }

  .review-rating-section {
    margin-bottom: 12px;
  }

  .review-star-label {
    font-size: 2rem;
    gap: 2px;
  }

  .review-textarea {
    min-height: 100px;
    font-size: 16px;
    padding: 10px 12px;
  }

  .char-count {
    font-size: 0.75rem;
  }

  .review-label {
    font-size: 0.9rem;
  }

  .btn-write-review {
    padding: 6px 12px;
    font-size: 0.8rem;
  }

  .review-success h3 {
    font-size: 1.1rem;
  }

  .success-icon {
    font-size: 1.8rem;
  }
}
