/* feedback.css - フィードバックUI専用スタイル */

.feedback-container {
  background: #f8f9fa;
  border: 1px solid #e9ecef;
  border-radius: 12px;
  padding: 20px;
  margin: 20px 0;
  transition: opacity 0.3s ease;
}

.feedback-section {
  background: #f8f9fa;
  border: 1px solid #e9ecef;
  border-radius: 12px;
  padding: 20px;
  margin: 20px 0;
  transition: opacity 0.3s ease;
  position: relative;
}

/* セクションヘッダー */
.section-header {
  position: relative;
  margin-bottom: 15px;
}

/* ×ボタンスタイル */
.close-section-btn {
  position: absolute;
  top: -10px;
  right: -10px;
  width: 28px;
  height: 28px;
  border-radius: 50%;
  background: #dc3545;
  color: white;
  border: none;
  font-size: 16px;
  font-weight: bold;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 2px 6px rgba(0,0,0,0.3);
  z-index: 10;
  transition: all 0.2s ease;
}

.close-section-btn:hover {
  background: #c82333;
  transform: scale(1.1);
  box-shadow: 0 3px 8px rgba(0,0,0,0.4);
}

.close-section-btn:active {
  transform: scale(0.95);
}

.feedback-header {
  text-align: center;
  margin-bottom: 16px;
}

.feedback-title {
  font-size: 16px;
  font-weight: 600;
  color: #495057;
  display: block;
  margin-bottom: 4px;
}

.feedback-subtitle {
  color: #6c757d;
  font-size: 12px;
}

.feedback-buttons {
  display: flex;
  gap: 12px;
  justify-content: center;
  margin-bottom: 16px;
}

.feedback-btn {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 10px 16px;
  border: 2px solid transparent;
  border-radius: 8px;
  background: white;
  cursor: pointer;
  font-size: 14px;
  font-weight: 500;
  transition: all 0.2s ease;
}

.feedback-good {
  color: #28a745;
  border-color: #28a745;
}

.feedback-good:hover {
  background: #28a745;
  color: white;
}

.feedback-bad {
  color: #dc3545;
  border-color: #dc3545;
}

.feedback-bad:hover {
  background: #dc3545;
  color: white;
}

.feedback-detail {
  border-top: 1px solid #e9ecef;
  padding-top: 16px;
}

.feedback-detail textarea {
  width: 100%;
  border: 1px solid #ced4da;
  border-radius: 6px;
  padding: 12px;
  font-size: 14px;
  resize: vertical;
  margin-bottom: 12px;
}

.feedback-actions {
  display: flex;
  gap: 8px;
  justify-content: flex-end;
}

.feedback-submit-btn {
  background: #007bff;
  color: white;
  border: none;
  padding: 8px 16px;
  border-radius: 6px;
  font-size: 14px;
  cursor: pointer;
}

.feedback-submit-btn:hover {
  background: #0056b3;
}

.feedback-cancel-btn {
  background: #6c757d;
  color: white;
  border: none;
  padding: 8px 16px;
  border-radius: 6px;
  font-size: 14px;
  cursor: pointer;
}

.feedback-cancel-btn:hover {
  background: #545b62;
}

.feedback-thanks {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  color: #28a745;
  font-weight: 500;
  padding: 16px;
}

.feedback-thanks i {
  font-size: 18px;
}

.feedback-status {
  margin-top: 12px;
  padding: 8px 12px;
  border-radius: 6px;
  font-size: 13px;
}

.feedback-status.success {
  background-color: #d1fae5;
  color: #065f46;
}

.feedback-status.error {
  background-color: #fee2e2;
  color: #991b1b;
}

.feedback-error {
  padding: 16px;
  background-color: #fee2e2;
  border: 1px solid #f87171;
  border-radius: 6px;
  color: #991b1b;
}

/* 旧クラス名（V1/V2統一版）のサポート */
.btn-feedback {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 10px 16px;
  border: 2px solid transparent;
  border-radius: 8px;
  background: white;
  cursor: pointer;
  font-size: 14px;
  font-weight: 500;
  transition: all 0.2s ease;
}

.btn-feedback.good {
  color: #28a745;
  border-color: #28a745;
}

.btn-feedback.good:hover {
  background: #28a745;
  color: white;
}

.btn-feedback.bad {
  color: #dc3545;
  border-color: #dc3545;
}

.btn-feedback.bad:hover {
  background: #dc3545;
  color: white;
}

.submit-buttons {
  display: flex;
  gap: 8px;
  justify-content: flex-end;
}

.submit-btn {
  padding: 8px 16px;
  border: none;
  border-radius: 6px;
  cursor: pointer;
  font-size: 14px;
  transition: all 0.2s;
}

.submit-btn.primary {
  background-color: #007bff;
  color: white;
}

.submit-btn.primary:hover {
  background-color: #0056b3;
}

.submit-btn.secondary {
  background-color: #6c757d;
  color: white;
}

.submit-btn.secondary:hover {
  background-color: #545b62;
}

/* V3専用スタイル */
.feedback-section h3 {
  color: #495057;
  font-size: 16px;
  font-weight: 600;
  margin-bottom: 16px;
  text-align: center;
}

.feedback-question p {
  color: #6c757d;
  font-size: 14px;
  margin-bottom: 12px;
  text-align: center;
}

.feedback-btn.helpful {
  color: #28a745;
  border-color: #28a745;
}

.feedback-btn.helpful:hover,
.feedback-btn.helpful.selected {
  background: #28a745;
  color: white;
}

.feedback-btn.not-helpful {
  color: #dc3545;
  border-color: #dc3545;
}

.feedback-btn.not-helpful:hover,
.feedback-btn.not-helpful.selected {
  background: #dc3545;
  color: white;
}

.feedback-details {
  border-top: 1px solid #e9ecef;
  padding-top: 16px;
  margin-top: 16px;
}

.feedback-details textarea {
  width: 100%;
  min-height: 80px;
  border: 1px solid #ced4da;
  border-radius: 6px;
  padding: 12px;
  font-size: 14px;
  font-family: inherit;
  resize: vertical;
  margin-bottom: 12px;
  box-sizing: border-box;
}

.feedback-details textarea:focus {
  outline: none;
  border-color: #007bff;
  box-shadow: 0 0 0 2px rgba(0, 123, 255, 0.1);
}

/* モダンなラジオボタンUI */
.feedback-radio-group {
  display: flex;
  gap: 20px;
  justify-content: center;
  margin: 16px 0;
}

.feedback-radio-option {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 20px;
  border: 2px solid #e9ecef;
  border-radius: 12px;
  cursor: pointer;
  transition: all 0.2s ease;
  background: white;
  min-width: 120px;
}

.feedback-radio-option:hover {
  border-color: #007bff;
  background: #f8f9fa;
}

.feedback-radio-option input[type="radio"] {
  display: none;
}

.feedback-radio-custom {
  width: 20px;
  height: 20px;
  border: 2px solid #ced4da;
  border-radius: 50%;
  position: relative;
  transition: all 0.2s ease;
}

.feedback-radio-custom::after {
  content: '';
  width: 10px;
  height: 10px;
  background: #007bff;
  border-radius: 50%;
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%) scale(0);
  transition: transform 0.2s ease;
}

.feedback-radio-option input[type="radio"]:checked + .feedback-radio-custom {
  border-color: #007bff;
}

.feedback-radio-option input[type="radio"]:checked + .feedback-radio-custom::after {
  transform: translate(-50%, -50%) scale(1);
}

.feedback-radio-option input[type="radio"]:checked ~ .feedback-radio-label {
  color: #007bff;
  font-weight: 600;
}

.feedback-radio-label {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 14px;
  color: #495057;
  transition: all 0.2s ease;
}

.feedback-radio-label i {
  font-size: 16px;
}

/* 「適切」の色 */
.feedback-radio-option:has(input[value="helpful"]) input[type="radio"]:checked + .feedback-radio-custom {
  border-color: #28a745;
}

.feedback-radio-option:has(input[value="helpful"]) input[type="radio"]:checked + .feedback-radio-custom::after {
  background: #28a745;
}

.feedback-radio-option:has(input[value="helpful"]) input[type="radio"]:checked ~ .feedback-radio-label {
  color: #28a745;
}

.feedback-radio-option:has(input[value="helpful"]):hover {
  border-color: #28a745;
}

/* 「不適切」の色 */
.feedback-radio-option:has(input[value="not-helpful"]) input[type="radio"]:checked + .feedback-radio-custom {
  border-color: #dc3545;
}

.feedback-radio-option:has(input[value="not-helpful"]) input[type="radio"]:checked + .feedback-radio-custom::after {
  background: #dc3545;
}

.feedback-radio-option:has(input[value="not-helpful"]) input[type="radio"]:checked ~ .feedback-radio-label {
  color: #dc3545;
}

.feedback-radio-option:has(input[value="not-helpful"]):hover {
  border-color: #dc3545;
}

.feedback-details label {
  display: block;
  font-size: 14px;
  font-weight: 500;
  color: #495057;
  margin-bottom: 8px;
}

/* 新しいフィードバックボタンスタイル（V1/V2/V3統一） */
.feedback-button-group {
  display: flex;
  gap: 12px;
  justify-content: center;
  margin-top: 16px;
}

.feedback-button {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 12px 20px;
  border: 2px solid transparent;
  border-radius: 8px;
  background: white;
  cursor: pointer;
  font-size: 14px;
  font-weight: 500;
  transition: all 0.2s ease;
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

.feedback-button:hover {
  transform: translateY(-1px);
  box-shadow: 0 4px 8px rgba(0, 0, 0, 0.15);
}

.feedback-good {
  border-color: #10b981;
  color: #10b981;
}

.feedback-good:hover {
  background: #10b981;
  color: white;
}

.feedback-bad {
  border-color: #ef4444;
  color: #ef4444;
}

.feedback-bad:hover {
  background: #ef4444;
  color: white;
}

.feedback-button:disabled {
  opacity: 0.6;
  cursor: not-allowed;
  transform: none;
}

/* 成功・エラーメッセージスタイル */
.feedback-success-message,
.feedback-error-message {
  margin-top: 12px;
}

.feedback-message-content {
  background: linear-gradient(135deg, #10b981, #059669);
  color: white;
  padding: 20px;
  border-radius: 12px;
  text-align: center;
  box-shadow: 0 4px 12px rgba(16, 185, 129, 0.3);
  font-weight: 500;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
}

.feedback-message-content.error {
  background: linear-gradient(135deg, #ef4444, #dc2626);
  box-shadow: 0 4px 12px rgba(239, 68, 68, 0.3);
}

.feedback-message-content i {
  font-size: 18px;
}

/* レスポンシブ対応 */
@media (max-width: 768px) {
  .feedback-radio-group {
    flex-direction: column;
    align-items: center;
    gap: 12px;
  }
  
  .feedback-radio-option {
    width: 100%;
    max-width: 250px;
    justify-content: center;
  }
  
  .feedback-actions {
    flex-direction: column;
    gap: 8px;
  }
  
  .feedback-submit-btn,
  .feedback-cancel-btn {
    width: 100%;
  }
}