/* Reset et base */
* {
  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: #333;
  background: #1a474a;
  min-height: 100vh;
  padding: 20px;
}

/* Conteneur principal */
#app {
  max-width: 800px;
  margin: 0 auto;
  background: white;
  border-radius: 16px;
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
  overflow: hidden;
}

/* Gestion des écrans */
.screen {
  padding: 40px;
  min-height: 500px;
}

.screen.hidden {
  display: none !important;
}

#start-screen.hidden,
#question-screen.hidden,
#result-screen.hidden {
  display: none !important;
}

/* Écran d'accueil */
#start-screen {
  text-align: center;
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  min-height: 500px;
}

#form-title {
  font-size: 2.5em;
  margin-bottom: 20px;
  color: #1a474a;
  font-weight: 700;
}

#form-description {
  font-size: 1.2em;
  color: #666;
  margin-bottom: 40px;
  max-width: 600px;
}

/* Boutons */
button {
  padding: 14px 32px;
  font-size: 1.1em;
  border: none;
  border-radius: 8px;
  cursor: pointer;
  transition: all 0.3s ease;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

#start-btn {
  background: #104041;
  color: #fff;
  box-shadow: 0 4px 15px rgba(16, 64, 65, 0.4);
}

#start-btn:hover {
  transform: translateY(-2px);
  box-shadow: 0 6px 20px rgba(16, 64, 65, 0.6);
  background: #0d3233;
}

#start-btn:active {
  transform: translateY(0);
}

button.subtle {
  background: #f5f5f5;
  color: #666;
}

button.subtle:hover {
  background: #e0e0e0;
}

#next-btn, #prev-btn {
  min-width: 120px;
}

#next-btn:disabled {
  background: #ccc;
  cursor: not-allowed;
  opacity: 0.6;
}

#next-btn:not(:disabled) {
  background: #104041;
  color: #fff;
}

#next-btn:not(:disabled):hover {
  transform: translateY(-2px);
  box-shadow: 0 4px 15px rgba(16, 64, 65, 0.4);
  background: #0d3233;
}

/* Écran de questions */
#question-screen {
  padding: 40px;
}

#form-title-top {
  font-size: 1.8em;
  margin-bottom: 30px;
  color: #1a474a;
  text-align: center;
}

/* Barre de progression */
#progress-container {
  width: 100%;
  height: 8px;
  background: #e0e0e0;
  border-radius: 4px;
  margin-bottom: 30px;
  overflow: hidden;
}

#progress-bar {
  height: 100%;
  background: #104041;
  border-radius: 4px;
  transition: width 0.3s ease;
  width: 0%;
}

/* Métadonnées de question */
#question-meta {
  display: flex;
  justify-content: space-between;
  margin-bottom: 20px;
  font-size: 0.9em;
  color: #666;
}

#question-count {
  font-weight: 600;
}

#question-category {
  color: #1a474a;
  font-weight: 600;
}

/* Question */
#question-text {
  font-size: 1.4em;
  font-weight: 600;
  margin-bottom: 30px;
  color: #333;
  line-height: 1.5;
}

#question-info {
  font-size: 0.95em;
  color: #888;
  margin-bottom: 20px;
  margin-top: -10px;
  font-style: italic;
  line-height: 1.5;
  display: none;
}

#question-url {
  margin-top: 10px;
  margin-bottom: 20px;
  display: none;
  text-align: center;
}

#question-url a {
  color: #1a474a;
  text-decoration: underline;
  font-weight: 500;
  transition: color 0.3s ease;
}

#question-url a:hover {
  color: #104041;
  text-decoration: none;
}

/* Zone de réponse */
#answer-area {
  margin: 30px 0;
  min-height: 100px;
}

/* Boutons de réponse */
.answer-buttons {
  display: flex;
  gap: 15px;
  flex-wrap: wrap;
  justify-content: center;
}

.answer-btn {
  padding: 16px 32px;
  font-size: 1.1em;
  border: 2px solid #e0e0e0;
  border-radius: 8px;
  background: white;
  cursor: pointer;
  transition: all 0.3s ease;
  font-weight: 500;
  min-width: 150px;
}

.answer-btn:hover {
  border-color: #1a474a;
  transform: translateY(-2px);
  box-shadow: 0 4px 12px rgba(26, 71, 74, 0.2);
}

.answer-btn.selected {
  background: #1a474a;
  color: white;
  border-color: #1a474a;
  box-shadow: 0 4px 15px rgba(26, 71, 74, 0.4);
}

/* Select, Radio, Checkbox */
.answer-select, .answer-radio-group, .answer-checkbox-group {
  margin: 20px 0;
}

.answer-select select {
  width: 100%;
  padding: 12px;
  font-size: 1.1em;
  border: 2px solid #e0e0e0;
  border-radius: 8px;
  background: white;
  cursor: pointer;
  transition: border-color 0.3s ease;
}

.answer-select select:focus {
  outline: none;
  border-color: #1a474a;
}

.answer-radio-group, .answer-checkbox-group {
  display: flex;
  flex-direction: column;
  gap: 15px;
}

.radio-option, .checkbox-option {
  display: flex;
  align-items: center;
  padding: 15px;
  border: 2px solid #e0e0e0;
  border-radius: 8px;
  cursor: pointer;
  transition: all 0.3s ease;
  background: white;
}

.radio-option:hover, .checkbox-option:hover {
  border-color: #1a474a;
  background: #e8f4f5;
}

.radio-option.selected, .checkbox-option.selected {
  border-color: #1a474a;
  background: #e8f4f5;
}

.radio-option input[type="radio"],
.checkbox-option input[type="checkbox"] {
  margin-right: 12px;
  width: 20px;
  height: 20px;
  cursor: pointer;
}

.radio-option label,
.checkbox-option label {
  flex: 1;
  cursor: pointer;
  font-size: 1.1em;
}

/* Textbox */
.answer-textbox {
  width: 100%;
}

.answer-textbox input[type="text"],
.answer-textbox textarea {
  width: 100%;
  padding: 12px;
  font-size: 1.1em;
  border: 2px solid #e0e0e0;
  border-radius: 8px;
  font-family: inherit;
  transition: border-color 0.3s ease;
}

.answer-textbox input[type="text"]:focus,
.answer-textbox textarea:focus {
  outline: none;
  border-color: #1a474a;
}

.answer-textbox textarea {
  min-height: 120px;
  resize: vertical;
}

/* Slider */
.answer-slider {
  width: 100%;
  margin: 20px 0;
}

.slider-container {
  position: relative;
  padding: 20px 0;
}

.answer-slider input[type="range"] {
  width: 100%;
  height: 8px;
  border-radius: 4px;
  background: #e0e0e0;
  outline: none;
  -webkit-appearance: none;
}

.answer-slider input[type="range"]::-webkit-slider-thumb {
  -webkit-appearance: none;
  appearance: none;
  width: 24px;
  height: 24px;
  border-radius: 50%;
  background: #1a474a;
  cursor: pointer;
  box-shadow: 0 2px 8px rgba(26, 71, 74, 0.4);
}

.answer-slider input[type="range"]::-moz-range-thumb {
  width: 24px;
  height: 24px;
  border-radius: 50%;
  background: #1a474a;
  cursor: pointer;
  border: none;
  box-shadow: 0 2px 8px rgba(26, 71, 74, 0.4);
}

.slider-labels {
  display: flex;
  justify-content: space-between;
  margin-top: 10px;
  font-size: 0.9em;
  color: #666;
}

.slider-value {
  text-align: center;
  font-size: 1.2em;
  font-weight: 600;
  color: #1a474a;
  margin-top: 10px;
}

/* Navigation */
#nav-buttons {
  display: flex;
  justify-content: space-between;
  margin-top: 40px;
  gap: 15px;
}

#prev-btn.hidden {
  visibility: hidden;
}

/* Écran de résultats */
#result-screen {
  text-align: center;
  padding: 40px;
}

#result-title {
  font-size: 2em;
  margin-bottom: 15px;
  color: #1a474a;
}

#result-text {
  font-size: 1.2em;
  color: #666;
  margin-bottom: 40px;
  max-width: 600px;
  margin-left: auto;
  margin-right: auto;
}

/* Score circulaire */
#final-score {
  width: 200px;
  height: 200px;
  margin: 30px auto;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 3em;
  font-weight: 700;
  color: white;
  position: relative;
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.2);
}

.score-text {
  font-size: 1.3em;
  font-weight: 600;
  margin-top: 20px;
  margin-bottom: 30px;
}

/* CTA */
#result-cta {
  margin: 30px 0;
}

#result-cta button {
  background: #104041;
  color: #fff;
  box-shadow: 0 4px 15px rgba(16, 64, 65, 0.4);
}

#result-cta button:hover {
  transform: translateY(-2px);
  box-shadow: 0 6px 20px rgba(16, 64, 65, 0.6);
  background: #0d3233;
}

/* Détails par catégorie */
#category-details {
  text-align: left;
  margin-top: 40px;
}

.category-section {
  margin-bottom: 20px;
  padding: 0;
  background: white;
  border-radius: 12px;
  border: 1px solid #e0e0e0;
  overflow: hidden;
}

.category-header {
  transition: background 0.3s;
  cursor: pointer;
  padding: 15px 20px;
  background: #f8f9fa;
  border-radius: 8px;
  margin: 10px;
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.category-header:hover {
  background: #f0f0f0 !important;
}

.category-section h3 {
  font-size: 1.3em;
  color: #1a474a;
  margin: 0;
}

.category-score-header {
  font-size: 1.2em;
  font-weight: 600;
  display: flex;
  align-items: center;
  gap: 10px;
}

.category-score-info {
  font-size: 1.1em;
  font-weight: 600;
  margin-bottom: 20px;
  color: #333;
}

.toggle-details-btn {
  font-size: 0.9em;
  padding: 6px 12px;
}

.category-details-content {
  background: #f8f9fa;
  border-top: 1px solid #e0e0e0;
  padding: 20px;
  display: none;
}

.question-detail {
  margin: 15px 0;
  padding: 15px;
  background: white;
  border-radius: 8px;
  border-left: 3px solid #e0e0e0;
}

.question-detail .question-text {
  font-weight: 600;
  margin-bottom: 8px;
  color: #333;
}

.question-detail .answer-label {
  color: #666;
  margin-bottom: 8px;
  font-style: italic;
}

.question-detail .feedback {
  margin-top: 8px;
  padding: 8px;
  border-radius: 4px;
}

.question-detail .feedback.positive {
  background: #e8f5e9;
  color: #2e7d32;
}

.question-detail .feedback.neutral {
  background: #f5f5f5;
  color: #333;
}

.question-detail .feedback.negative {
  background: #ffebee;
  color: #c62828;
}

/* Partage de lien */
#share-link {
  margin-top: 30px;
  padding: 20px;
  background: #e8f4f5;
  border-radius: 12px;
}

#share-link input {
  padding: 12px;
  font-size: 1em;
  border: 2px solid #e0e0e0;
  border-radius: 8px;
  margin-right: 10px;
  font-family: monospace;
}

#copy-btn {
  padding: 12px 24px;
  background: #1a474a;
  color: white;
  border: none;
  border-radius: 8px;
  cursor: pointer;
  font-weight: 600;
}

#copy-btn:hover {
  background: #0f2d2f;
  transform: translateY(-2px);
}

/* Table de debug */
.debug-table {
  width: 100%;
  margin-top: 40px;
  border-collapse: collapse;
  text-align: left;
  background: white;
  border-radius: 8px;
  overflow: hidden;
}

.debug-table th {
  background: #1a474a;
  color: white;
  padding: 12px;
  font-weight: 600;
}

.debug-table td {
  padding: 12px;
  border-bottom: 1px solid #e0e0e0;
}

.debug-table tr:last-child td {
  border-bottom: none;
}

.debug-table tr:nth-child(even) {
  background: #e8f4f5;
}

/* Responsive */
@media (max-width: 768px) {
  body {
    padding: 10px;
  }

  .screen {
    padding: 20px;
  }

  #form-title {
    font-size: 2em;
  }

  #question-text {
    font-size: 1.2em;
  }

  .answer-buttons {
    flex-direction: column;
  }

  .answer-btn {
    width: 100%;
  }

  #nav-buttons {
    flex-direction: column;
  }

  #nav-buttons button {
    width: 100%;
  }

  #final-score {
    width: 150px;
    height: 150px;
    font-size: 2.5em;
  }

  #share-link input {
    width: 100%;
    margin-bottom: 10px;
  }

  #copy-btn {
    width: 100%;
  }
}

