/* K-Sleep Care Onboarding - Custom Styles */

/* Base Styles */
* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

body {
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
  line-height: 1.6;
  color: #1f2937;
}

/* Container */
.module-container {
  min-height: 100vh;
  padding: 2rem 1rem;
  max-width: 1400px;
  margin: 0 auto;
}

/* Progress Bar */
.progress-bar {
  width: 100%;
  height: 8px;
  background-color: #e5e7eb;
  border-radius: 9999px;
  overflow: hidden;
  box-shadow: inset 0 2px 4px rgba(0, 0, 0, 0.1);
}

.progress-fill {
  height: 100%;
  background: linear-gradient(90deg, #3b82f6 0%, #8b5cf6 100%);
  transition: width 0.5s ease-in-out;
  border-radius: 9999px;
}

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

.fade-in {
  animation: fadeIn 0.5s ease-out;
}

/* Welcome Header */
.welcome-header {
  text-align: center;
  margin-bottom: 3rem;
}

.logo-container {
  display: flex;
  justify-content: center;
  align-items: center;
}

/* Form Styles */
.form-group {
  margin-bottom: 1.5rem;
}

.form-label {
  display: block;
  font-weight: 600;
  color: #374151;
  margin-bottom: 0.5rem;
  font-size: 1rem;
}

.form-input {
  width: 100%;
  padding: 0.75rem 1rem;
  border: 2px solid #d1d5db;
  border-radius: 0.5rem;
  font-size: 1rem;
  transition: all 0.2s;
  background-color: #fff;
}

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

.form-input::placeholder {
  color: #9ca3af;
}

/* Checkbox Styles */
.checkbox-label {
  display: flex;
  align-items: center;
  padding: 0.75rem;
  border: 1px solid #e5e7eb;
  border-radius: 0.5rem;
  cursor: pointer;
  transition: all 0.2s;
  background-color: #fff;
}

.checkbox-label:hover {
  background-color: #f9fafb;
  border-color: #3b82f6;
}

.checkbox-label input[type="checkbox"] {
  width: 1.25rem;
  height: 1.25rem;
  margin-right: 0.75rem;
  cursor: pointer;
  accent-color: #3b82f6;
}

.checkbox-label span {
  color: #374151;
  font-size: 0.95rem;
}

/* Radio Styles */
.radio-label {
  display: flex;
  align-items: center;
  padding: 1rem;
  border: 2px solid #e5e7eb;
  border-radius: 0.75rem;
  cursor: pointer;
  transition: all 0.2s;
  background-color: #fff;
  margin-bottom: 0.75rem;
}

.radio-label:hover {
  background-color: #f9fafb;
  border-color: #3b82f6;
}

.radio-label input[type="radio"] {
  width: 1.25rem;
  height: 1.25rem;
  margin-right: 1rem;
  cursor: pointer;
  accent-color: #3b82f6;
}

.radio-label span {
  color: #374151;
  font-size: 1.05rem;
}

.radio-label.correct-answer {
  background-color: #f0f9ff;
}

/* Button Styles */
.btn-primary {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0.875rem 2rem;
  background: linear-gradient(135deg, #3b82f6 0%, #2563eb 100%);
  color: white;
  font-weight: 600;
  font-size: 1.1rem;
  border: none;
  border-radius: 0.75rem;
  cursor: pointer;
  transition: all 0.3s;
  box-shadow: 0 4px 6px rgba(59, 130, 246, 0.3);
}

.btn-primary:hover {
  background: linear-gradient(135deg, #2563eb 0%, #1d4ed8 100%);
  transform: translateY(-2px);
  box-shadow: 0 6px 12px rgba(59, 130, 246, 0.4);
}

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

.btn-primary:disabled {
  background: #9ca3af;
  cursor: not-allowed;
  transform: none;
  box-shadow: none;
  opacity: 0.6;
}

.btn-primary:not(:disabled) {
  cursor: pointer;
  opacity: 1;
}

/* Survey Question Styles */
.survey-question {
  padding: 1.5rem;
  background-color: #f9fafb;
  border-radius: 0.75rem;
  border: 1px solid #e5e7eb;
}

.answer-btn {
  text-align: center;
  cursor: pointer;
  transition: all 0.2s;
  background-color: #fff;
}

.answer-btn:hover {
  transform: translateY(-2px);
  box-shadow: 0 4px 8px rgba(0, 0, 0, 0.1);
}

.answer-btn.selected {
  background-color: #dbeafe;
  border-color: #3b82f6 !important;
}

.epworth-btn {
  text-align: center;
  cursor: pointer;
  transition: all 0.2s;
  background-color: #fff;
}

.epworth-btn:hover {
  transform: translateY(-2px);
  box-shadow: 0 4px 8px rgba(0, 0, 0, 0.1);
}

.epworth-btn.selected {
  background-color: #dbeafe;
  border-color: #3b82f6 !important;
}

/* CPAP History Buttons */
.cpap-history-btn {
  cursor: pointer;
  transition: all 0.2s;
}

.cpap-history-btn:hover {
  background-color: #f9fafb;
  transform: translateX(4px);
}

/* Priority Items (Drag and Drop) */
.priority-item {
  user-select: none;
  transition: all 0.2s;
}

.priority-item:hover {
  transform: translateX(4px);
  box-shadow: 0 4px 8px rgba(0, 0, 0, 0.1);
}

.priority-item.dragging {
  opacity: 0.5;
  cursor: move;
}

.priority-number {
  transition: all 0.3s;
}

/* Video Container */
.aspect-w-16 {
  position: relative;
  padding-bottom: 56.25%; /* 16:9 aspect ratio */
}

.aspect-w-16 > * {
  position: absolute;
  height: 100%;
  width: 100%;
  top: 0;
  right: 0;
  bottom: 0;
  left: 0;
}

/* Alert Boxes */
.alert {
  padding: 1rem 1.5rem;
  border-radius: 0.5rem;
  margin-bottom: 1.5rem;
}

.alert-info {
  background-color: #dbeafe;
  border-left: 4px solid #3b82f6;
  color: #1e40af;
}

.alert-warning {
  background-color: #fef3c7;
  border-left: 4px solid #f59e0b;
  color: #92400e;
}

.alert-success {
  background-color: #d1fae5;
  border-left: 4px solid #10b981;
  color: #065f46;
}

.alert-danger {
  background-color: #fee2e2;
  border-left: 4px solid #ef4444;
  color: #991b1b;
}

/* Responsive Design */
@media (max-width: 768px) {
  .module-container {
    padding: 1rem 0.5rem;
  }
  
  .grid {
    grid-template-columns: 1fr !important;
  }
  
  .btn-primary {
    width: 100%;
    font-size: 1rem;
  }
  
  .survey-question {
    padding: 1rem;
  }
  
  h1 {
    font-size: 2rem !important;
  }
  
  h2 {
    font-size: 1.75rem !important;
  }
  
  h3 {
    font-size: 1.5rem !important;
  }
}

@media (max-width: 480px) {
  .epworth-btn {
    padding: 0.75rem 0.5rem;
  }
  
  .answer-btn {
    padding: 0.75rem;
  }
  
  .priority-item {
    padding: 0.75rem !important;
  }
}

/* Utility Classes */
.text-center {
  text-align: center;
}

.mt-2 { margin-top: 0.5rem; }
.mt-3 { margin-top: 0.75rem; }
.mt-4 { margin-top: 1rem; }
.mt-6 { margin-top: 1.5rem; }
.mt-8 { margin-top: 2rem; }

.mb-2 { margin-bottom: 0.5rem; }
.mb-3 { margin-bottom: 0.75rem; }
.mb-4 { margin-bottom: 1rem; }
.mb-6 { margin-bottom: 1.5rem; }
.mb-8 { margin-bottom: 2rem; }

.mr-2 { margin-right: 0.5rem; }
.mr-3 { margin-right: 0.75rem; }
.mr-4 { margin-right: 1rem; }

.ml-2 { margin-left: 0.5rem; }
.ml-3 { margin-left: 0.75rem; }
.ml-4 { margin-left: 1rem; }

.p-4 { padding: 1rem; }
.p-6 { padding: 1.5rem; }
.p-8 { padding: 2rem; }

.space-y-2 > * + * { margin-top: 0.5rem; }
.space-y-3 > * + * { margin-top: 0.75rem; }
.space-y-4 > * + * { margin-top: 1rem; }
.space-y-6 > * + * { margin-top: 1.5rem; }

.flex { display: flex; }
.flex-col { flex-direction: column; }
.items-center { align-items: center; }
.items-start { align-items: flex-start; }
.justify-center { justify-content: center; }
.justify-between { justify-content: space-between; }

.grid { display: grid; }
.gap-2 { gap: 0.5rem; }
.gap-3 { gap: 0.75rem; }
.gap-4 { gap: 1rem; }
.gap-6 { gap: 1.5rem; }

.hidden { display: none !important; }

/* Loading Spinner */
.spinner {
  border: 4px solid #f3f4f6;
  border-top: 4px solid #3b82f6;
  border-radius: 50%;
  width: 40px;
  height: 40px;
  animation: spin 1s linear infinite;
  margin: 2rem auto;
}

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

/* Smooth Scroll */
html {
  scroll-behavior: smooth;
}

/* Focus Styles for Accessibility */
button:focus,
input:focus,
select:focus,
textarea:focus {
  outline: 2px solid #3b82f6;
  outline-offset: 2px;
}

/* Print Styles */
@media print {
  .btn-primary,
  button {
    display: none;
  }
  
  .progress-bar {
    display: none;
  }
}

/* Interactive Survey Typebot Styles */
.chat-bubble {
  animation: slideUp 0.5s ease-out;
}

@keyframes slideUp {
  from {
    opacity: 0;
    transform: translateY(20px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.typing-indicator {
  display: flex;
  align-items: center;
  padding: 12px 16px;
  background: white;
  border-radius: 18px;
  gap: 4px;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}

.typing-indicator span {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: #d1d5db;
  animation: typing 1.4s infinite;
}

.typing-indicator span:nth-child(2) {
  animation-delay: 0.2s;
}

.typing-indicator span:nth-child(3) {
  animation-delay: 0.4s;
}

@keyframes typing {
  0%, 60%, 100% {
    transform: translateY(0);
    background: #d1d5db;
  }
  30% {
    transform: translateY(-10px);
    background: #9ca3af;
  }
}

.option-button {
  transition: all 0.3s ease;
}

.option-button:hover {
  transform: translateX(8px);
  box-shadow: 0 4px 12px rgba(59, 130, 246, 0.2);
}

.option-button.selected {
  background: #dbeafe !important;
  border-color: #3b82f6 !important;
  font-weight: 600;
}

/* Custom scrollbar for chat container */
#interactiveSurveyChat::-webkit-scrollbar {
  width: 6px;
}

#interactiveSurveyChat::-webkit-scrollbar-track {
  background: #f1f1f1;
}

#interactiveSurveyChat::-webkit-scrollbar-thumb {
  background: #d1d5db;
  border-radius: 3px;
}

#interactiveSurveyChat::-webkit-scrollbar-thumb:hover {
  background: #9ca3af;
}
