/* Survey Integration Styles */
/* Custom styles for survey functionality beyond Tailwind CSS */

/* Survey Container Styles */
.survey-container {
  @apply bg-white rounded-lg shadow-sm border border-gray-200;
}

.survey-header {
  @apply bg-gradient-to-r from-blue-600 to-purple-600 text-white p-8 rounded-t-lg;
}

.survey-content {
  @apply p-6;
}

/* SurveyJS Custom Styling */
.sv_main {
  background-color: transparent !important;
  font-family: inherit !important;
}

.sv_container {
  max-width: none !important;
  margin: 0 !important;
  padding: 0 !important;
}

.sv_body {
  padding: 0 !important;
}

.sv_page_title {
  @apply text-2xl font-bold text-gray-900 mb-6;
  font-size: 1.5rem !important;
  font-weight: 700 !important;
  color: #1f2937 !important;
  margin-bottom: 1.5rem !important;
}

.sv_page_description {
  @apply text-gray-600 mb-4;
  color: #4b5563 !important;
  margin-bottom: 1rem !important;
}

.sv_qstn {
  @apply mb-6;
  margin-bottom: 1.5rem !important;
  border: none !important;
  background: transparent !important;
}

.sv_qstn_content {
  padding: 0 !important;
}

.sv_q_title {
  @apply text-lg font-medium text-gray-900 mb-3;
  font-size: 1.125rem !important;
  font-weight: 500 !important;
  color: #1f2937 !important;
  margin-bottom: 0.75rem !important;
}

.sv_q_description {
  @apply text-sm text-gray-600 mb-2;
  font-size: 0.875rem !important;
  color: #6b7280 !important;
  margin-bottom: 0.5rem !important;
}

/* Form Controls */
.sv_q_text_root input,
.sv_q_text_root textarea {
  @apply w-full px-3 py-2 border border-gray-300 rounded-md focus:outline-none focus:ring-2 focus:ring-blue-500 focus:border-blue-500;
  width: 100% !important;
  padding: 0.5rem 0.75rem !important;
  border: 1px solid #d1d5db !important;
  border-radius: 0.375rem !important;
  font-size: 1rem !important;
}

.sv_q_text_root input:focus,
.sv_q_text_root textarea:focus {
  outline: none !important;
  border-color: #3b82f6 !important;
  box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.1) !important;
}

.sv_q_text_root textarea {
  min-height: 100px !important;
  resize: vertical !important;
}

/* Radio and Checkbox Styling */
.sv_q_radiogroup_item,
.sv_q_checkbox_item {
  @apply flex items-center mb-2;
  display: flex !important;
  align-items: center !important;
  margin-bottom: 0.5rem !important;
}

.sv_q_radiogroup_item input,
.sv_q_checkbox_item input {
  @apply mr-3;
  margin-right: 0.75rem !important;
  width: 1rem !important;
  height: 1rem !important;
}

.sv_q_radiogroup_item label,
.sv_q_checkbox_item label {
  @apply text-gray-700 cursor-pointer;
  color: #374151 !important;
  cursor: pointer !important;
  font-size: 1rem !important;
}

/* Dropdown Styling */
.sv_q_dropdown_control {
  @apply w-full px-3 py-2 border border-gray-300 rounded-md focus:outline-none focus:ring-2 focus:ring-blue-500 focus:border-blue-500;
  width: 100% !important;
  padding: 0.5rem 0.75rem !important;
  border: 1px solid #d1d5db !important;
  border-radius: 0.375rem !important;
  background-color: white !important;
}

/* Rating Styling */
.sv_q_rating {
  @apply flex items-center space-x-2;
}

.sv_q_rating_item {
  @apply cursor-pointer transition-colors;
  cursor: pointer !important;
  padding: 0.25rem !important;
}

.sv_q_rating_item:hover {
  @apply text-yellow-400;
  color: #fbbf24 !important;
}

.sv_q_rating_item.sv_q_rating_item_active {
  @apply text-yellow-500;
  color: #f59e0b !important;
}

/* Progress Bar Styling */
.sv_progress {
  @apply w-full bg-gray-200 rounded-full h-2 mb-6;
  width: 100% !important;
  background-color: #e5e7eb !important;
  border-radius: 9999px !important;
  height: 0.5rem !important;
  margin-bottom: 1.5rem !important;
}

.sv_progress_bar {
  @apply bg-blue-600 h-2 rounded-full transition-all duration-300;
  background-color: #2563eb !important;
  height: 0.5rem !important;
  border-radius: 9999px !important;
  transition: all 0.3s ease !important;
}

/* Navigation Buttons */
.sv_nav {
  @apply flex justify-between items-center mt-8 pt-6 border-t border-gray-200;
  display: flex !important;
  justify-content: space-between !important;
  align-items: center !important;
  margin-top: 2rem !important;
  padding-top: 1.5rem !important;
  border-top: 1px solid #e5e7eb !important;
}

.sv_prev_btn,
.sv_next_btn,
.sv_complete_btn {
  @apply px-6 py-2 font-medium rounded-lg transition-colors;
  padding: 0.5rem 1.5rem !important;
  font-weight: 500 !important;
  border-radius: 0.5rem !important;
  border: none !important;
  cursor: pointer !important;
  font-size: 1rem !important;
}

.sv_prev_btn {
  @apply bg-gray-300 text-gray-700 hover:bg-gray-400;
  background-color: #d1d5db !important;
  color: #374151 !important;
}

.sv_prev_btn:hover {
  background-color: #9ca3af !important;
}

.sv_next_btn {
  @apply bg-blue-600 text-white hover:bg-blue-700;
  background-color: #2563eb !important;
  color: white !important;
}

.sv_next_btn:hover {
  background-color: #1d4ed8 !important;
}

.sv_complete_btn {
  @apply bg-green-600 text-white hover:bg-green-700;
  background-color: #059669 !important;
  color: white !important;
}

.sv_complete_btn:hover {
  background-color: #047857 !important;
}

/* Error Styling */
.sv_q_erbox {
  @apply bg-red-50 border border-red-200 text-red-700 px-3 py-2 rounded-md mt-2;
  background-color: #fef2f2 !important;
  border: 1px solid #fecaca !important;
  color: #b91c1c !important;
  padding: 0.5rem 0.75rem !important;
  border-radius: 0.375rem !important;
  margin-top: 0.5rem !important;
  font-size: 0.875rem !important;
}

/* Required Question Indicator */
.sv_q_required {
  @apply text-red-500;
  color: #ef4444 !important;
}

/* Survey Results Styles */
.survey-results-container {
  @apply space-y-6;
}

.result-card {
  @apply bg-white rounded-lg shadow-sm border border-gray-200 p-6;
}

.result-header {
  @apply flex items-center justify-between mb-4;
}

.result-title {
  @apply text-lg font-medium text-gray-900;
}

.result-count {
  @apply text-sm text-gray-500;
}

.result-chart {
  @apply h-64 w-full;
}

/* Question Management Styles */
.question-item {
  @apply border border-gray-200 rounded-lg p-4 mb-4 transition-all duration-200;
}

.question-item:hover {
  @apply shadow-md border-gray-300;
}

.question-item.dragging {
  @apply opacity-50 transform rotate-2;
}

.question-handle {
  @apply cursor-move text-gray-400 hover:text-gray-600;
  cursor: grab !important;
}

.question-handle:active {
  cursor: grabbing !important;
}

.question-actions {
  @apply flex items-center space-x-2;
}

.question-action-btn {
  @apply p-2 text-gray-400 hover:text-gray-600 rounded-md transition-colors;
}

.question-action-btn:hover {
  @apply bg-gray-100;
}

/* Survey Status Badges */
.status-badge {
  @apply inline-flex items-center px-2.5 py-0.5 rounded-full text-xs font-medium;
}

.status-draft {
  @apply bg-gray-100 text-gray-800;
}

.status-active {
  @apply bg-green-100 text-green-800;
}

.status-paused {
  @apply bg-yellow-100 text-yellow-800;
}

.status-completed {
  @apply bg-blue-100 text-blue-800;
}

.status-archived {
  @apply bg-gray-100 text-gray-600;
}

/* Loading States */
.loading-spinner {
  @apply inline-block animate-spin rounded-full border-b-2 border-current;
  width: 1rem;
  height: 1rem;
}

.loading-overlay {
  @apply fixed inset-0 bg-gray-600 bg-opacity-50 flex items-center justify-center z-50;
}

.loading-content {
  @apply bg-white rounded-lg p-6 shadow-lg;
}

/* Toast Notifications */
.toast {
  @apply fixed top-4 right-4 px-4 py-2 rounded-lg shadow-lg z-50 transition-all duration-300;
  transform: translateX(100%);
}

.toast.show {
  transform: translateX(0);
}

.toast.hide {
  transform: translateX(100%);
  opacity: 0;
}

.toast-success {
  @apply bg-green-100 border border-green-400 text-green-700;
}

.toast-error {
  @apply bg-red-100 border border-red-400 text-red-700;
}

.toast-info {
  @apply bg-blue-100 border border-blue-400 text-blue-700;
}

.toast-warning {
  @apply bg-yellow-100 border border-yellow-400 text-yellow-700;
}

/* Modal Styles */
.modal-overlay {
  @apply fixed inset-0 bg-gray-600 bg-opacity-50 overflow-y-auto h-full w-full z-50;
}

.modal-content {
  @apply relative top-20 mx-auto p-5 border w-11/12 md:w-3/4 lg:w-1/2 shadow-lg rounded-md bg-white;
}

.modal-header {
  @apply flex items-center justify-between mb-4;
}

.modal-title {
  @apply text-lg font-medium text-gray-900;
}

.modal-close {
  @apply text-gray-400 hover:text-gray-600 transition-colors;
}

.modal-body {
  @apply mb-4;
}

.modal-footer {
  @apply flex items-center justify-end space-x-3;
}

/* Chart Containers */
.chart-container {
  @apply bg-white rounded-lg shadow-sm border border-gray-200 p-6;
}

.chart-header {
  @apply flex items-center justify-between mb-4;
}

.chart-title {
  @apply text-lg font-medium text-gray-900;
}

.chart-actions {
  @apply flex items-center space-x-2;
}

.chart-canvas {
  @apply w-full h-64;
}

/* Responsive Design */
@media (max-width: 640px) {
  .survey-header {
    @apply p-4;
  }
  
  .survey-content {
    @apply p-4;
  }
  
  .sv_nav {
    @apply flex-col space-y-3;
    flex-direction: column !important;
  }
  
  .sv_prev_btn,
  .sv_next_btn,
  .sv_complete_btn {
    @apply w-full;
    width: 100% !important;
  }
  
  .modal-content {
    @apply w-11/12 top-10;
  }
  
  .question-actions {
    @apply flex-col space-y-2 space-x-0;
  }
}

/* Print Styles */
@media print {
  .survey-header,
  .sv_nav,
  .question-actions,
  .modal-overlay,
  .toast {
    display: none !important;
  }
  
  .survey-container {
    @apply shadow-none border-none;
  }
  
  .question-item {
    @apply break-inside-avoid;
  }
}

/* Dark Mode Support (if needed) */
@media (prefers-color-scheme: dark) {
  .survey-container {
    @apply bg-gray-800 border-gray-700;
  }
  
  .sv_q_title {
    color: #f9fafb !important;
  }
  
  .sv_q_description {
    color: #d1d5db !important;
  }
  
  .sv_q_text_root input,
  .sv_q_text_root textarea {
    @apply bg-gray-700 border-gray-600 text-white;
    background-color: #374151 !important;
    border-color: #4b5563 !important;
    color: white !important;
  }
}

/* Animation Classes */
.fade-in {
  animation: fadeIn 0.3s ease-in-out;
}

.fade-out {
  animation: fadeOut 0.3s ease-in-out;
}

.slide-in-right {
  animation: slideInRight 0.3s ease-in-out;
}

.slide-out-right {
  animation: slideOutRight 0.3s ease-in-out;
}

@keyframes fadeIn {
  from { opacity: 0; }
  to { opacity: 1; }
}

@keyframes fadeOut {
  from { opacity: 1; }
  to { opacity: 0; }
}

@keyframes slideInRight {
  from { transform: translateX(100%); }
  to { transform: translateX(0); }
}

@keyframes slideOutRight {
  from { transform: translateX(0); }
  to { transform: translateX(100%); }
}

/* Utility Classes */
.survey-shadow {
  box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -1px rgba(0, 0, 0, 0.06);
}

.survey-shadow-lg {
  box-shadow: 0 10px 15px -3px rgba(0, 0, 0, 0.1), 0 4px 6px -2px rgba(0, 0, 0, 0.05);
}

.survey-gradient {
  background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
}

.survey-gradient-success {
  background: linear-gradient(135deg, #48bb78 0%, #38a169 100%);
}

.survey-gradient-warning {
  background: linear-gradient(135deg, #f6ad55 0%, #ed8936 100%);
}

.survey-gradient-error {
  background: linear-gradient(135deg, #fc8181 0%, #e53e3e 100%);
}

