/* Survey Form Styling */

.survey {
  margin: 2rem 0;
}

.survey-loading {
  text-align: center;
  padding: 2rem;
  color: #666;
}

.survey-error {
  background-color: #fee;
  border: 1px solid #fcc;
  color: #c33;
  padding: 1rem;
  border-radius: 4px;
  margin: 1rem 0;
}

/* Survey Form Container */
.survey-form {
  background: #f9f9f9;
  border: 1px solid #ddd;
  border-radius: 8px;
  padding: 2rem;
  max-width: 600px;
  margin: 1rem 0;
}

.survey-form-content {
  display: flex;
  flex-direction: column;
  gap: 1.5rem;
}

/* Question Container */
.survey-question-text,
.survey-question-single-choice,
.survey-question-multi-choice,
.survey-question-rating {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
}

/* Labels and Legend */
.survey-form label,
.survey-form legend {
  font-weight: 600;
  color: #333;
  font-size: 1rem;
}

.survey-form legend {
  padding: 0;
  margin-bottom: 0.5rem;
}

/* Text Input */
.survey-textarea {
  padding: 0.75rem;
  border: 1px solid #ccc;
  border-radius: 4px;
  font-family: inherit;
  font-size: 1rem;
  line-height: 1.5;
  color: #333;
  resize: vertical;
  min-height: 100px;
}

.survey-textarea:focus {
  outline: none;
  border-color: #007bff;
  box-shadow: 0 0 0 3px rgba(0, 123, 255, 0.25);
}

/* Radio Buttons */
.survey-radio-group,
.survey-checkbox-group {
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.survey-radio,
.survey-checkbox {
  width: 18px;
  height: 18px;
  cursor: pointer;
  accent-color: #007bff;
}

.survey-radio-group label,
.survey-checkbox-group label {
  font-weight: normal;
  cursor: pointer;
  margin: 0;
}

.survey-radio:focus,
.survey-checkbox:focus {
  outline: 2px solid #007bff;
  outline-offset: 2px;
}

/* Rating Scale */
.survey-rating-options {
  display: flex;
  gap: 1rem;
  flex-wrap: wrap;
}

.survey-rating-item {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.5rem;
}

.survey-rating-input {
  width: 20px;
  height: 20px;
  cursor: pointer;
  accent-color: #007bff;
}

.survey-rating-label {
  font-size: 0.875rem;
  font-weight: 500;
  color: #666;
  cursor: pointer;
}

.survey-rating-input:checked + .survey-rating-label {
  color: #007bff;
  font-weight: 600;
}

/* Submit Button */
.survey-form-actions {
  display: flex;
  gap: 1rem;
  justify-content: flex-end;
  margin-top: 1.5rem;
}

.survey-submit-btn {
  padding: 0.75rem 2rem;
  background-color: #007bff;
  color: white;
  border: none;
  border-radius: 4px;
  font-size: 1rem;
  font-weight: 600;
  cursor: pointer;
  transition: background-color 0.2s;
}

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

.survey-submit-btn:active {
  transform: scale(0.98);
}

.survey-submit-btn:disabled {
  background-color: #ccc;
  cursor: not-allowed;
  opacity: 0.6;
}

/* Thank You Message */
.survey-thank-you {
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 200px;
  padding: 2rem;
}

.survey-thank-you-content {
  text-align: center;
  animation: fadeIn 0.5s ease-in;
}

.survey-thank-you-content h2 {
  color: #28a745;
  font-size: 1.75rem;
  margin: 0 0 1rem 0;
}

.survey-thank-you-content p {
  color: #666;
  font-size: 1.1rem;
  margin: 0.5rem 0;
  line-height: 1.6;
}

/* Disabled Survey State */
.survey-disabled {
  background: #f5f5f5;
  border: 1px solid #ddd;
  border-radius: 8px;
  padding: 2rem;
  max-width: 600px;
  margin: 1rem 0;
  opacity: 0.85;
}

.survey-disabled-content {
  display: flex;
  flex-direction: column;
  gap: 1.5rem;
}

.survey-question-text-only {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
}

.survey-question-text-only label {
  font-weight: 600;
  color: #333;
  font-size: 1rem;
}

.survey-disabled-message {
  padding: 1rem;
  background-color: #fff3cd;
  border-left: 4px solid #ffc107;
  border-radius: 4px;
  margin-top: 0.5rem;
}

.survey-disabled-message p {
  margin: 0.5rem 0;
  color: #856404;
  font-size: 0.95rem;
  line-height: 1.5;
}

.survey-disabled-message p:first-child {
  margin-top: 0;
  font-weight: 600;
}

/* Animations */
@keyframes fadeIn {
  from {
    opacity: 0;
    transform: translateY(-10px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@keyframes fadeOut {
  from {
    opacity: 1;
    transform: translateY(0);
  }
  to {
    opacity: 0;
    transform: translateY(-10px);
  }
}

.survey-form {
  animation: fadeIn 0.5s ease-in;
}

/* Responsive Design */
@media (max-width: 768px) {
  .survey-form {
    padding: 1.5rem;
  }

  .survey-form-actions {
    flex-direction: column;
  }

  .survey-submit-btn {
    width: 100%;
  }

  .survey-rating-options {
    gap: 0.75rem;
  }
}

/* Loading State */
.survey-loading-spinner {
  display: inline-block;
  width: 20px;
  height: 20px;
  border: 3px solid #f3f3f3;
  border-top: 3px solid #007bff;
  border-radius: 50%;
  animation: spin 1s linear infinite;
}

@keyframes spin {
  0% { transform: rotate(0deg); }
  100% { transform: rotate(360deg); }
}
