/* AI Personality Tests - Frontend Styles */

.aipt-test-container {
  max-width: 800px;
  margin: 0 auto;
  padding: 2rem;
  background: #ffffff;
  border-radius: 12px;
  box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -1px rgba(0, 0, 0, 0.06);
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
}

.aipt-test-header {
  text-align: center;
  margin-bottom: 3rem;
  padding-bottom: 2rem;
  border-bottom: 2px solid #f3f4f6;
}

.aipt-test-title {
  font-size: 2.5rem;
  font-weight: 700;
  color: #1f2937;
  margin-bottom: 1rem;
  background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.aipt-test-description {
  font-size: 1.125rem;
  color: #6b7280;
  line-height: 1.6;
  max-width: 600px;
  margin: 0 auto;
}

.aipt-progress-container {
  margin-bottom: 2rem;
  padding: 1rem;
  background: #f8fafc;
  border-radius: 8px;
  border: 1px solid #e2e8f0;
}

.aipt-progress-bar {
  width: 100%;
  height: 8px;
  background: #e2e8f0;
  border-radius: 4px;
  overflow: hidden;
  margin-bottom: 0.5rem;
}

.aipt-progress-fill {
  height: 100%;
  background: linear-gradient(90deg, #4f46e5, #7c3aed);
  border-radius: 4px;
  transition: width 0.3s ease;
}

.aipt-progress-text {
  font-size: 0.875rem;
  color: #64748b;
  text-align: center;
}

.aipt-questions {
  margin-bottom: 3rem;
}

.aipt-question {
  margin-bottom: 2.5rem;
  padding: 2rem;
  background: #f9fafb;
  border-radius: 12px;
  border: 1px solid #e5e7eb;
  transition: all 0.3s ease;
}

.aipt-question:hover {
  border-color: #d1d5db;
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.05);
}

.aipt-question.answered {
  border-color: #10b981;
  background: #f0fdf4;
}

.aipt-question.error {
  border-color: #ef4444 !important;
  background: #fef2f2 !important;
}

.aipt-question-text {
  font-size: 1.25rem;
  font-weight: 600;
  color: #374151;
  margin-bottom: 1.5rem;
  line-height: 1.5;
}

.aipt-likert-scale,
.aipt-boolean-options {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
}

@media (min-width: 768px) {
  .aipt-likert-scale {
    flex-direction: row;
    justify-content: space-between;
    align-items: center;
  }

  .aipt-boolean-options {
    flex-direction: row;
    gap: 2rem;
    justify-content: center;
  }
}

.aipt-option {
  display: flex;
  align-items: center;
  cursor: pointer;
  padding: 1rem;
  border-radius: 8px;
  border: 2px solid #e5e7eb;
  background: #ffffff;
  transition: all 0.2s ease;
  position: relative;
}

.aipt-option:hover {
  border-color: #9ca3af;
  background: #f9fafb;
}

.aipt-option input[type="radio"] {
  margin-right: 0.75rem;
  width: 1.25rem;
  height: 1.25rem;
  accent-color: #4f46e5;
}

.aipt-option input[type="radio"]:checked + .aipt-option-text {
  font-weight: 600;
  color: #4f46e5;
}

.aipt-option:has(input[type="radio"]:checked) {
  border-color: #4f46e5;
  background: #eef2ff;
}

.aipt-option-text {
  font-size: 0.95rem;
  color: #374151;
  transition: all 0.2s ease;
}

.aipt-lead-capture {
  background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
  color: white;
  padding: 2.5rem;
  border-radius: 12px;
  margin-bottom: 2rem;
}

.aipt-lead-capture h3 {
  font-size: 1.5rem;
  font-weight: 700;
  margin-bottom: 0.5rem;
}

.aipt-lead-capture p {
  margin-bottom: 2rem;
  opacity: 0.9;
}

.aipt-form-group {
  margin-bottom: 1.5rem;
}

.aipt-form-group label {
  display: block;
  font-weight: 600;
  margin-bottom: 0.5rem;
  font-size: 0.95rem;
}

.aipt-form-group input {
  width: 100%;
  padding: 0.875rem;
  border: 2px solid rgba(255, 255, 255, 0.3);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.1);
  color: white;
  font-size: 1rem;
  transition: all 0.2s ease;
}

.aipt-form-group input.error {
  border-color: rgba(239, 68, 68, 0.5) !important;
  background: rgba(254, 242, 242, 0.1) !important;
}

.aipt-form-group input::placeholder {
  color: rgba(255, 255, 255, 0.7);
}

.aipt-form-group input:focus {
  outline: none;
  border-color: rgba(255, 255, 255, 0.8);
  background: rgba(255, 255, 255, 0.2);
}

.aipt-consent {
  margin: 1.5rem 0;
}

.aipt-checkbox-label {
  display: flex;
  align-items: flex-start;
  cursor: pointer;
  font-size: 0.9rem;
  line-height: 1.5;
}

.aipt-checkbox-label input[type="checkbox"] {
  margin-right: 0.75rem;
  margin-top: 0.125rem;
  width: 1.125rem;
  height: 1.125rem;
  accent-color: white;
}

.aipt-privacy-notice {
  margin-top: 1rem;
  opacity: 0.8;
}

.aipt-submit-btn {
  width: 100%;
  padding: 1rem 2rem;
  background: #ffffff;
  color: #4f46e5;
  border: none;
  border-radius: 8px;
  font-size: 1.125rem;
  font-weight: 700;
  cursor: pointer;
  transition: all 0.2s ease;
  position: relative;
  overflow: hidden;
}

.aipt-submit-btn:hover {
  background: #f3f4f6;
  transform: translateY(-1px);
}

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

.aipt-submit-btn:disabled,
.aipt-submit-btn.disabled {
  opacity: 0.5;
  cursor: not-allowed;
  transform: none;
}

.aipt-loading {
  display: inline-block;
}

/* Enhanced Results Styling */
.aipt-results {
  margin-top: 2rem;
  padding: 0;
  background: transparent;
  border: none;
  border-radius: 0;
}

.aipt-results-content {
  background: #ffffff;
  border-radius: 12px;
  overflow: hidden;
  box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -1px rgba(0, 0, 0, 0.06);
}

.aipt-result-header {
  background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
  color: white;
  padding: 2rem;
  text-align: center;
}

.aipt-result-header h3 {
  font-size: 1.75rem;
  font-weight: 700;
  margin: 0;
  text-shadow: 0 1px 2px rgba(0, 0, 0, 0.1);
}

.aipt-result-description {
  padding: 2rem;
  line-height: 1.7;
  font-size: 1rem;
  color: #374151;
}

/* Format AI-generated content better */
.aipt-result-description h1,
.aipt-result-description h2,
.aipt-result-description h3,
.aipt-result-description h4 {
  color: #1f2937;
  margin-top: 2rem;
  margin-bottom: 1rem;
  font-weight: 700;
}

.aipt-result-description h1 {
  font-size: 1.5rem;
  border-bottom: 2px solid #e5e7eb;
  padding-bottom: 0.5rem;
}

.aipt-result-description h2 {
  font-size: 1.25rem;
  color: #4f46e5;
}

.aipt-result-description h3 {
  font-size: 1.125rem;
  color: #6366f1;
}

.aipt-result-description p {
  margin-bottom: 1.5rem;
  line-height: 1.7;
}

.aipt-result-description ul,
.aipt-result-description ol {
  margin: 1.5rem 0;
  padding-left: 1.5rem;
}

.aipt-result-description li {
  margin-bottom: 0.75rem;
  line-height: 1.6;
}

.aipt-result-description strong {
  color: #1f2937;
  font-weight: 600;
}

.aipt-result-description em {
  color: #6b7280;
  font-style: italic;
}

/* Career recommendation specific styling */
.aipt-career-recommendation {
  background: #f8fafc;
  border: 1px solid #e2e8f0;
  border-radius: 8px;
  padding: 1.5rem;
  margin: 1.5rem 0;
  transition: all 0.2s ease;
}

.aipt-career-recommendation:hover {
  border-color: #c7d2fe;
  background: #f1f5f9;
  transform: translateY(-1px);
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.05);
}

.aipt-career-title {
  font-size: 1.25rem;
  font-weight: 700;
  color: #4f46e5;
  margin-bottom: 0.75rem;
  display: flex;
  align-items: center;
}

.aipt-career-title::before {
  content: "💼";
  margin-right: 0.5rem;
  font-size: 1.1rem;
}

.aipt-career-description {
  color: #4b5563;
  line-height: 1.6;
  margin: 0;
}

.aipt-result-score {
  background: #f0f9ff;
  border: 1px solid #bae6fd;
  border-radius: 8px;
  padding: 1.5rem;
  margin: 1.5rem 2rem;
  text-align: center;
}

.aipt-result-score p {
  margin: 0;
  font-size: 1.125rem;
  color: #0369a1;
}

.aipt-result-footer {
  background: #f9fafb;
  padding: 2rem;
  text-align: center;
  border-top: 1px solid #e5e7eb;
}

.aipt-result-footer p {
  margin-bottom: 1rem;
  color: #6b7280;
}

.aipt-share-btn {
  background: #4f46e5;
  color: white;
  border: none;
  padding: 0.75rem 1.5rem;
  border-radius: 6px;
  font-weight: 600;
  cursor: pointer;
  margin-top: 1rem;
  transition: all 0.2s ease;
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
}

.aipt-share-btn:hover {
  background: #4338ca;
  transform: translateY(-1px);
}

.aipt-share-btn::before {
  content: "📤";
  font-size: 0.9rem;
}

.aipt-error-message {
  margin-bottom: 1rem;
  display: none;
}

.aipt-error-content {
  background: #fef2f2;
  border: 1px solid #fecaca;
  color: #dc2626;
  padding: 1rem;
  border-radius: 8px;
  display: flex;
  align-items: center;
  gap: 0.75rem;
}

.aipt-error-icon {
  font-size: 1.25rem;
}

.aipt-error-text {
  flex: 1;
}

.aipt-error-close {
  background: none;
  border: none;
  font-size: 1.5rem;
  cursor: pointer;
  color: #dc2626;
  padding: 0;
  width: 24px;
  height: 24px;
  display: flex;
  align-items: center;
  justify-content: center;
}

/* Responsive Design */
@media (max-width: 768px) {
  .aipt-test-container {
    padding: 1.5rem;
    margin: 1rem;
  }

  .aipt-test-title {
    font-size: 2rem;
  }

  .aipt-question {
    padding: 1.5rem;
  }

  .aipt-lead-capture {
    padding: 2rem;
  }

  .aipt-option {
    padding: 0.75rem;
  }

  .aipt-result-header {
    padding: 1.5rem;
  }

  .aipt-result-header h3 {
    font-size: 1.5rem;
  }

  .aipt-result-description {
    padding: 1.5rem;
  }

  .aipt-career-recommendation {
    padding: 1.25rem;
  }

  .aipt-career-title {
    font-size: 1.125rem;
  }
}

/* Animation for form submission */
@keyframes pulse {
  0%,
  100% {
    opacity: 1;
  }
  50% {
    opacity: 0.5;
  }
}

.aipt-submit-btn.loading .aipt-loading {
  animation: pulse 1.5s infinite;
}

/* Focus styles for accessibility */
.aipt-option:focus-within {
  outline: 2px solid #4f46e5;
  outline-offset: 2px;
}

.aipt-form-group input:focus,
.aipt-submit-btn:focus {
  outline: 2px solid #4f46e5;
  outline-offset: 2px;
}

/* Additional progress bar and error message styles */
.aipt-progress-container {
  margin-bottom: 2rem;
  padding: 1rem;
  background: #f8fafc;
  border-radius: 8px;
  border: 1px solid #e2e8f0;
}

.aipt-progress-bar {
  width: 100%;
  height: 8px;
  background: #e2e8f0;
  border-radius: 4px;
  overflow: hidden;
  margin-bottom: 0.5rem;
}

.aipt-progress-fill {
  height: 100%;
  background: linear-gradient(90deg, #4f46e5, #7c3aed);
  border-radius: 4px;
  transition: width 0.3s ease;
}

.aipt-progress-text {
  font-size: 0.875rem;
  color: #64748b;
  text-align: center;
}

.aipt-question.error {
  border-color: #ef4444 !important;
  background: #fef2f2 !important;
}

.aipt-form-group input.error {
  border-color: rgba(239, 68, 68, 0.5) !important;
  background: rgba(254, 242, 242, 0.1) !important;
}

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