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

body {
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  background: linear-gradient(135deg, #1a1a2e 0%, #16213e 50%, #0f3460 100%);
  color: #fff;
  min-height: 100vh;
}

.screen {
  min-height: 100vh;
}

.hidden {
  display: none !important;
}

/* Containers */
.create-container,
.success-container {
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: 2rem;
  max-width: 600px;
  margin: 0 auto;
}

.success-container {
  justify-content: center;
  text-align: center;
}

.back-link {
  position: absolute;
  top: 2rem;
  left: 2rem;
  color: #94a3b8;
  text-decoration: none;
  font-size: 0.9rem;
}

.back-link:hover {
  color: #fff;
}

.logo {
  font-size: 4rem;
  margin-bottom: 1rem;
  margin-top: 3rem;
}

h1 {
  font-size: 2rem;
  margin-bottom: 0.5rem;
  background: linear-gradient(90deg, #22c55e, #4ade80);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.subtitle {
  color: #94a3b8;
  margin-bottom: 2rem;
}

/* Form Sections */
.form-section {
  width: 100%;
  margin-bottom: 1.5rem;
}

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

.label-hint {
  font-weight: 400;
  color: #64748b;
  font-size: 0.8rem;
}

.form-input {
  width: 100%;
  padding: 0.75rem 1rem;
  font-size: 1rem;
  background: rgba(255, 255, 255, 0.05);
  border: 2px solid rgba(255, 255, 255, 0.1);
  border-radius: 10px;
  color: #fff;
  outline: none;
  transition: border-color 0.3s;
}

.form-input:focus {
  border-color: #22c55e;
}

.form-input::placeholder {
  color: #64748b;
}

/* Video URL Inputs */
.video-inputs {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
}

.video-input-row {
  display: flex;
  align-items: center;
  gap: 0.75rem;
}

.video-number {
  width: 28px;
  height: 28px;
  background: #22c55e;
  color: #fff;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 600;
  font-size: 0.85rem;
  flex-shrink: 0;
}

.video-url-input {
  flex: 1;
  padding: 0.75rem 1rem;
  font-size: 0.95rem;
  background: rgba(255, 255, 255, 0.05);
  border: 2px solid rgba(255, 255, 255, 0.1);
  border-radius: 10px;
  color: #fff;
  outline: none;
  transition: border-color 0.3s;
}

.video-url-input:focus {
  border-color: #22c55e;
}

.video-url-input::placeholder {
  color: #64748b;
}

/* Interventions */
#interventions-container {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
  margin-bottom: 0.75rem;
}

.intervention-row {
  display: flex;
  gap: 0.5rem;
  align-items: center;
  background: rgba(255, 255, 255, 0.05);
  padding: 0.75rem;
  border-radius: 10px;
  border: 1px solid rgba(255, 255, 255, 0.1);
}

.intervention-time {
  width: 80px;
  padding: 0.5rem;
  font-size: 0.9rem;
  background: rgba(255, 255, 255, 0.1);
  border: 1px solid rgba(255, 255, 255, 0.2);
  border-radius: 6px;
  color: #fff;
  text-align: center;
}

.intervention-time::placeholder {
  color: #64748b;
}

.intervention-type {
  width: 120px;
  padding: 0.5rem;
  font-size: 0.9rem;
  background: rgba(255, 255, 255, 0.1);
  border: 1px solid rgba(255, 255, 255, 0.2);
  border-radius: 6px;
  color: #fff;
  cursor: pointer;
}

.intervention-type option {
  background: #1a1a2e;
  color: #fff;
}

.intervention-message {
  flex: 1;
  padding: 0.5rem;
  font-size: 0.9rem;
  background: rgba(255, 255, 255, 0.1);
  border: 1px solid rgba(255, 255, 255, 0.2);
  border-radius: 6px;
  color: #fff;
}

.intervention-message::placeholder {
  color: #64748b;
}

.remove-intervention-btn {
  width: 32px;
  height: 32px;
  background: rgba(239, 68, 68, 0.2);
  border: none;
  border-radius: 6px;
  color: #ef4444;
  cursor: pointer;
  font-size: 1.2rem;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background 0.2s;
}

.remove-intervention-btn:hover {
  background: rgba(239, 68, 68, 0.4);
}

/* Toggle Switch */
.toggle-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 0.5rem;
}

.toggle-switch {
  position: relative;
  display: inline-block;
  width: 50px;
  height: 26px;
}

.toggle-switch input {
  opacity: 0;
  width: 0;
  height: 0;
}

.toggle-slider {
  position: absolute;
  cursor: pointer;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(255, 255, 255, 0.2);
  transition: 0.3s;
  border-radius: 26px;
}

.toggle-slider::before {
  position: absolute;
  content: "";
  height: 20px;
  width: 20px;
  left: 3px;
  bottom: 3px;
  background: #fff;
  transition: 0.3s;
  border-radius: 50%;
}

.toggle-switch input:checked + .toggle-slider {
  background: #22c55e;
}

.toggle-switch input:checked + .toggle-slider::before {
  transform: translateX(24px);
}

.form-hint {
  font-size: 0.8rem;
  color: #64748b;
  margin-bottom: 1rem;
}

/* Questions Section */
.questions-section {
  margin-top: 1rem;
}

#questions-container {
  display: flex;
  flex-direction: column;
  gap: 1rem;
  margin-bottom: 0.75rem;
}

.question-card {
  background: rgba(139, 92, 246, 0.1);
  border: 1px solid rgba(139, 92, 246, 0.3);
  border-radius: 12px;
  padding: 1rem;
}

.question-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 0.75rem;
}

.question-number {
  font-weight: 600;
  color: #a78bfa;
  font-size: 0.9rem;
}

.remove-question-btn {
  width: 28px;
  height: 28px;
  background: rgba(239, 68, 68, 0.2);
  border: none;
  border-radius: 6px;
  color: #ef4444;
  cursor: pointer;
  font-size: 1rem;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background 0.2s;
}

.remove-question-btn:hover {
  background: rgba(239, 68, 68, 0.4);
}

.question-text-input {
  width: 100%;
  padding: 0.75rem;
  font-size: 0.95rem;
  background: rgba(255, 255, 255, 0.1);
  border: 1px solid rgba(255, 255, 255, 0.2);
  border-radius: 8px;
  color: #fff;
  margin-bottom: 0.75rem;
}

.question-text-input::placeholder {
  color: #64748b;
}

.question-text-input:focus {
  outline: none;
  border-color: #a78bfa;
}

.options-label {
  font-size: 0.8rem;
  color: #94a3b8;
  margin-bottom: 0.5rem;
  display: block;
}

.options-container {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

.option-row {
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.correct-radio {
  width: 18px;
  height: 18px;
  accent-color: #22c55e;
  cursor: pointer;
}

.option-input {
  flex: 1;
  padding: 0.5rem 0.75rem;
  font-size: 0.9rem;
  background: rgba(255, 255, 255, 0.1);
  border: 1px solid rgba(255, 255, 255, 0.2);
  border-radius: 6px;
  color: #fff;
}

.option-input::placeholder {
  color: #64748b;
}

.option-input:focus {
  outline: none;
  border-color: #a78bfa;
}

.correct-hint {
  font-size: 0.75rem;
  color: #64748b;
  margin-top: 0.5rem;
  display: flex;
  align-items: center;
  gap: 0.25rem;
}

.correct-hint::before {
  content: "●";
  color: #22c55e;
}

/* Video selector for questions */
.video-select {
  width: 100%;
  padding: 0.5rem;
  font-size: 0.85rem;
  background: rgba(255, 255, 255, 0.1);
  border: 1px solid rgba(255, 255, 255, 0.2);
  border-radius: 6px;
  color: #fff;
  margin-bottom: 0.75rem;
  cursor: pointer;
}

.video-select option {
  background: #1a1a2e;
  color: #fff;
}

/* Buttons */
.btn {
  padding: 0.75rem 1.5rem;
  font-size: 1rem;
  font-weight: 600;
  border: none;
  border-radius: 10px;
  cursor: pointer;
  transition: all 0.3s;
  text-decoration: none;
  display: inline-block;
  text-align: center;
}

.btn.large {
  padding: 1rem 2.5rem;
  font-size: 1.1rem;
  border-radius: 12px;
  margin-top: 1rem;
}

.btn.small {
  padding: 0.5rem 1rem;
  font-size: 0.85rem;
}

.btn.primary {
  background: #22c55e;
  color: #fff;
}

.btn.primary:hover {
  background: #16a34a;
  transform: translateY(-2px);
}

.btn.secondary {
  background: rgba(255, 255, 255, 0.1);
  color: #fff;
  border: 1px solid rgba(255, 255, 255, 0.2);
}

.btn.secondary:hover {
  background: rgba(255, 255, 255, 0.2);
}

.btn:disabled {
  opacity: 0.5;
  cursor: not-allowed;
  transform: none !important;
}

/* Error Message */
.error-message {
  color: #ef4444;
  font-size: 0.9rem;
  margin-top: 1rem;
  text-align: center;
}

/* Success Screen */
.test-code-display {
  background: rgba(34, 197, 94, 0.1);
  border: 2px solid #22c55e;
  border-radius: 16px;
  padding: 1.5rem 2rem;
  margin-bottom: 1.5rem;
  display: flex;
  align-items: center;
  gap: 1rem;
}

#test-code {
  font-size: 2.5rem;
  font-weight: bold;
  letter-spacing: 0.3em;
  color: #22c55e;
}

.share-link {
  display: flex;
  gap: 0.5rem;
  margin-bottom: 2rem;
  width: 100%;
  max-width: 500px;
}

.share-link input {
  flex: 1;
  padding: 0.75rem 1rem;
  font-size: 0.9rem;
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid rgba(255, 255, 255, 0.2);
  border-radius: 8px;
  color: #94a3b8;
}

/* Test Summary */
.test-summary {
  background: rgba(255, 255, 255, 0.05);
  border-radius: 12px;
  padding: 1.5rem;
  margin-bottom: 2rem;
  width: 100%;
  max-width: 400px;
  text-align: left;
}

.test-summary h3 {
  font-size: 0.9rem;
  color: #94a3b8;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  margin-bottom: 1rem;
}

.summary-row {
  display: flex;
  justify-content: space-between;
  padding: 0.5rem 0;
  border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

.summary-row:last-child {
  border-bottom: none;
}

.summary-row .label {
  color: #64748b;
}

.summary-row .value {
  font-weight: 500;
}

/* Action Buttons */
.action-buttons {
  display: flex;
  gap: 1rem;
  flex-wrap: wrap;
  justify-content: center;
}

/* Responsive */
@media (max-width: 600px) {
  .intervention-row {
    flex-wrap: wrap;
  }

  .intervention-time {
    width: 70px;
  }

  .intervention-type {
    flex: 1;
  }

  .intervention-message {
    width: 100%;
    flex: none;
  }

  .test-code-display {
    flex-direction: column;
    text-align: center;
  }

  #test-code {
    font-size: 2rem;
  }
}
