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

html {
  font-size: 16px;
}

body {
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
  background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
  min-height: 100vh;
  color: #333;
}

#app {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
}

.container {
  max-width: 600px;
  width: 100%;
  background: white;
  border-radius: 12px;
  box-shadow: 0 10px 40px rgba(0, 0, 0, 0.15);
  padding: 40px;
}

h1 {
  font-size: 28px;
  margin-bottom: 12px;
  color: #222;
  text-align: center;
}

p {
  line-height: 1.6;
  color: #666;
}

.description {
  text-align: center;
  margin: 20px 0;
  font-size: 14px;
  color: #888;
}

.divider {
  text-align: center;
  margin: 20px 0;
  color: #999;
}

/* Forms */
.form {
  margin-top: 30px;
}

.form-group {
  margin-bottom: 20px;
}

label {
  display: block;
  margin-bottom: 8px;
  font-weight: 600;
  color: #333;
  font-size: 14px;
}

input[type="text"],
input[type="email"],
textarea,
select {
  width: 100%;
  padding: 12px;
  border: 1px solid #ddd;
  border-radius: 6px;
  font-size: 14px;
  font-family: inherit;
  transition: border-color 0.3s;
}

input[type="text"]:focus,
textarea:focus,
select:focus {
  outline: none;
  border-color: #667eea;
  box-shadow: 0 0 0 3px rgba(102, 126, 234, 0.1);
}

textarea {
  resize: vertical;
}

/* Buttons */
.btn {
  padding: 12px 24px;
  border: none;
  border-radius: 6px;
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.3s;
  display: inline-block;
  text-align: center;
}

.btn-primary {
  background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
  color: white;
  width: 100%;
}

.btn-primary:hover {
  transform: translateY(-2px);
  box-shadow: 0 8px 20px rgba(102, 126, 234, 0.3);
}

.btn-secondary {
  background: #f5f5f5;
  color: #333;
  width: 100%;
  border: 1px solid #ddd;
}

.btn-secondary:hover {
  background: #efefef;
}

.btn-tertiary {
  background: transparent;
  color: #667eea;
  width: 100%;
  border: 1px solid #667eea;
}

.btn-tertiary:hover {
  background: rgba(102, 126, 234, 0.05);
}

.button-group {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
  margin-top: 20px;
}

.button-group .btn {
  width: 100%;
}

/* Panels */
.home-panel,
.form,
.voting-panel,
.results-panel {
  background: #f9f9f9;
  padding: 20px;
  border-radius: 8px;
  border: 1px solid #efefef;
  margin-top: 20px;
}

.input-group {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 10px;
  margin-bottom: 15px;
}

.input-group input {
  margin-bottom: 0;
}

.input-group .btn {
  width: auto;
  padding: 12px 20px;
}

/* Alerts */
.alert {
  padding: 12px 16px;
  border-radius: 6px;
  margin-bottom: 20px;
  font-size: 14px;
}

.alert-error {
  background: #fee;
  color: #c33;
  border: 1px solid #fcc;
}

.alert-success {
  background: #efe;
  color: #3c3;
  border: 1px solid #cfc;
}

/* Responsive */
@media (max-width: 600px) {
  .container {
    padding: 20px;
    border-radius: 8px;
  }

  h1 {
    font-size: 22px;
  }

  .button-group {
    grid-template-columns: 1fr;
  }

  .input-group {
    grid-template-columns: 1fr;
  }

  .input-group .btn {
    width: 100%;
  }
}


/* Wizard Styles */
.wizard-header {
  margin-bottom: 30px;
  text-align: center;
}

.wizard-header h2 {
  font-size: 24px;
  margin-bottom: 8px;
}

.wizard-progress {
  font-size: 12px;
  color: #999;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.wizard-form {
  margin: 20px 0;
}

.wizard-buttons {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
  margin-top: 30px;
}

.wizard-buttons .btn {
  width: 100%;
  margin: 0;
}

/* Question Type Selection */
.question-types {
  display: grid;
  grid-template-columns: 1fr;
  gap: 12px;
  margin: 20px 0;
}

.question-type-btn {
  background: #f9f9f9;
  border: 2px solid #ddd;
  border-radius: 8px;
  padding: 16px;
  cursor: pointer;
  text-align: left;
  transition: all 0.3s;
  font-family: inherit;
}

.question-type-btn:hover {
  border-color: #667eea;
  background: #f5f7ff;
}

.question-type-btn.selected {
  background: #f5f7ff;
  border-color: #667eea;
  box-shadow: 0 0 0 3px rgba(102, 126, 234, 0.1);
}

.question-type-btn strong {
  display: block;
  margin-bottom: 4px;
  color: #222;
}

.question-type-btn .desc {
  display: block;
  font-size: 12px;
  color: #888;
}

/* Options List */
.options-list {
  background: #f9f9f9;
  border: 1px solid #efefef;
  border-radius: 8px;
  padding: 12px;
  margin: 20px 0;
}

.option-item {
  display: grid;
  grid-template-columns: 30px 1fr 30px;
  gap: 10px;
  align-items: center;
  margin-bottom: 12px;
  background: white;
  padding: 10px;
  border-radius: 6px;
  border: 1px solid #efefef;
}

.option-item:last-child {
  margin-bottom: 0;
}

.option-drag-handle {
  color: #999;
  cursor: grab;
  text-align: center;
}

.option-label {
  margin-bottom: 0 !important;
  min-height: 36px;
}

.btn-remove-option {
  background: #fee;
  color: #c33;
  border: none;
  border-radius: 4px;
  padding: 6px;
  cursor: pointer;
  font-size: 18px;
  font-weight: bold;
  transition: all 0.3s;
}

.btn-remove-option:hover {
  background: #fdd;
}

#addOption {
  width: 100%;
  margin-bottom: 20px;
}

/* Review Panel */
.review-panel {
  background: #f9f9f9;
  border: 1px solid #efefef;
  border-radius: 8px;
  padding: 20px;
  margin: 20px 0;
}

.review-section {
  margin-bottom: 20px;
}

.review-section:last-child {
  margin-bottom: 0;
}

.review-section h3 {
  font-size: 12px;
  color: #999;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  margin-bottom: 8px;
  font-weight: 600;
}

.review-section p,
.review-section ul {
  color: #333;
  font-size: 14px;
}

.review-section ul {
  list-style: none;
  padding-left: 0;
}

.review-section li {
  padding: 4px 0;
  border-bottom: 1px solid #efefef;
}

.review-section li:last-child {
  border-bottom: none;
}

/* Character Counter */
small {
  display: block;
  margin-top: 4px;
  font-size: 12px;
  color: #999;
}

input[type="text"]:invalid,
textarea:invalid {
  border-color: #fcc;
  background: #fee;
}


/* Wizard Styles */
.wizard-header {
  margin-bottom: 30px;
  text-align: center;
}

.wizard-header h2 {
  font-size: 24px;
  margin-bottom: 8px;
}

.wizard-progress {
  font-size: 12px;
  color: #999;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.wizard-form {
  margin: 20px 0;
}

.wizard-buttons {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
  margin-top: 30px;
}

.wizard-buttons .btn {
  width: 100%;
  margin: 0;
}

/* Question Type Selection */
.question-types {
  display: grid;
  grid-template-columns: 1fr;
  gap: 12px;
  margin: 20px 0;
}

.question-type-btn {
  background: #f9f9f9;
  border: 2px solid #ddd;
  border-radius: 8px;
  padding: 16px;
  cursor: pointer;
  text-align: left;
  transition: all 0.3s;
  font-family: inherit;
}

.question-type-btn:hover {
  border-color: #667eea;
  background: #f5f7ff;
}

.question-type-btn.selected {
  background: #f5f7ff;
  border-color: #667eea;
  box-shadow: 0 0 0 3px rgba(102, 126, 234, 0.1);
}

.question-type-btn strong {
  display: block;
  margin-bottom: 4px;
  color: #222;
}

.question-type-btn .desc {
  display: block;
  font-size: 12px;
  color: #888;
}

/* Options List */
.options-list {
  background: #f9f9f9;
  border: 1px solid #efefef;
  border-radius: 8px;
  padding: 12px;
  margin: 20px 0;
}

.option-item {
  display: grid;
  grid-template-columns: 30px 1fr 30px;
  gap: 10px;
  align-items: center;
  margin-bottom: 12px;
  background: white;
  padding: 10px;
  border-radius: 6px;
  border: 1px solid #efefef;
}

.option-item:last-child {
  margin-bottom: 0;
}

.option-drag-handle {
  color: #999;
  cursor: grab;
  text-align: center;
}

.option-label {
  margin-bottom: 0 !important;
  min-height: 36px;
}

.btn-remove-option {
  background: #fee;
  color: #c33;
  border: none;
  border-radius: 4px;
  padding: 6px;
  cursor: pointer;
  font-size: 18px;
  font-weight: bold;
  transition: all 0.3s;
}

.btn-remove-option:hover {
  background: #fdd;
}

#addOption {
  width: 100%;
  margin-bottom: 20px;
}

/* Review Panel */
.review-panel {
  background: #f9f9f9;
  border: 1px solid #efefef;
  border-radius: 8px;
  padding: 20px;
  margin: 20px 0;
}

.review-section {
  margin-bottom: 20px;
}

.review-section:last-child {
  margin-bottom: 0;
}

.review-section h3 {
  font-size: 12px;
  color: #999;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  margin-bottom: 8px;
  font-weight: 600;
}

.review-section p,
.review-section ul {
  color: #333;
  font-size: 14px;
}

.review-section ul {
  list-style: none;
  padding-left: 0;
}

.review-section li {
  padding: 4px 0;
  border-bottom: 1px solid #efefef;
}

.review-section li:last-child {
  border-bottom: none;
}

/* Character Counter */
small {
  display: block;
  margin-top: 4px;
  font-size: 12px;
  color: #999;
}

input[type="text"]:invalid,
textarea:invalid {
  border-color: #fcc;
  background: #fee;
}


/* Voting Form Styles */
.voting-form {
  background: white;
  padding: 0;
}

.radio-option,
.checkbox-option {
  display: block;
  padding: 12px;
  margin-bottom: 8px;
  border: 1px solid #efefef;
  border-radius: 6px;
  cursor: pointer;
  transition: all 0.3s;
  font-size: 14px;
}

.radio-option:hover,
.checkbox-option:hover {
  background: #f9f9f9;
}

.radio-option.selected,
.checkbox-option.selected {
  background: #f5f7ff;
  border-color: #667eea;
  box-shadow: 0 0 0 3px rgba(102, 126, 234, 0.1);
}

.radio-option input,
.checkbox-option input {
  margin-right: 10px;
  cursor: pointer;
}

.option-text {
  vertical-align: middle;
}

/* Option Buttons (Yes/No) */
.voting-options {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
  margin: 20px 0;
}

.option-btn {
  background: #f9f9f9;
  border: 2px solid #ddd;
  border-radius: 8px;
  padding: 20px;
  cursor: pointer;
  text-align: center;
  font-size: 16px;
  font-weight: 600;
  transition: all 0.3s;
  font-family: inherit;
}

.option-btn:hover {
  border-color: #667eea;
  background: #f5f7ff;
}

.option-btn.selected {
  background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
  color: white;
  border-color: #667eea;
  box-shadow: 0 8px 20px rgba(102, 126, 234, 0.3);
}

/* Text Answer Styles */
.answer-input,
.answer-textarea {
  margin-bottom: 0 !important;
  width: 100%;
}

.answer-textarea {
  padding: 12px !important;
  border: 1px solid #ddd !important;
  border-radius: 6px !important;
  font-family: inherit;
}

/* Ranking Styles */
.ranking-instructions {
  background: #f9f9f9;
  padding: 12px;
  border-radius: 6px;
  margin-bottom: 20px;
}

.ranking-instructions p {
  font-size: 13px;
  color: #666;
  margin: 0;
}

.ranking-list {
  background: #f9f9f9;
  border: 1px solid #efefef;
  border-radius: 8px;
  padding: 12px;
  margin: 20px 0;
}

.ranking-item {
  display: grid;
  grid-template-columns: 30px 30px 1fr;
  gap: 12px;
  align-items: center;
  background: white;
  padding: 12px;
  margin-bottom: 8px;
  border-radius: 6px;
  border: 1px solid #efefef;
  cursor: grab;
  transition: all 0.3s;
}

.ranking-item:last-child {
  margin-bottom: 0;
}

.ranking-item:hover {
  background: #f5f7ff;
  border-color: #ddd;
}

.ranking-item.dragging {
  opacity: 0.5;
  background: #e8eef9;
}

.rank-handle {
  color: #999;
  text-align: center;
  cursor: grab;
}

.rank-number {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 30px;
  height: 30px;
  background: #667eea;
  color: white;
  border-radius: 50%;
  font-weight: 600;
  font-size: 12px;
}

.rank-label {
  color: #333;
  font-size: 14px;
}

/* Scale Styles */
.scale-container {
  margin: 20px 0;
}

.scale-labels {
  display: grid;
  grid-template-columns: 1fr 1fr 1fr;
  text-align: center;
  margin-bottom: 16px;
  font-size: 12px;
  color: #999;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.scale-buttons {
  display: grid;
  grid-template-columns: repeat(10, 1fr);
  gap: 6px;
  margin: 20px 0;
}

.scale-btn {
  aspect-ratio: 1;
  background: #f9f9f9;
  border: 1px solid #ddd;
  border-radius: 6px;
  cursor: pointer;
  font-weight: 600;
  font-size: 12px;
  transition: all 0.3s;
}

.scale-btn:hover {
  border-color: #667eea;
  background: #f5f7ff;
}

.scale-btn.selected {
  background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
  color: white;
  border-color: #667eea;
  box-shadow: 0 0 0 3px rgba(102, 126, 234, 0.1);
}

/* Responsive */
@media (max-width: 600px) {
  .voting-options {
    grid-template-columns: 1fr;
  }

  .scale-buttons {
    grid-template-columns: repeat(5, 1fr);
  }

  .option-item {
    grid-template-columns: 1fr 30px;
  }

  .option-drag-handle {
    display: none;
  }
}


/* Results Display Styles */
.results-summary {
  background: #f9f9f9;
  padding: 16px;
  border-radius: 8px;
  margin-bottom: 20px;
  border: 1px solid #efefef;
}

.vote-count {
  margin: 0;
  font-size: 14px;
  color: #666;
}

.vote-count strong {
  color: #333;
  font-size: 16px;
}

.ranking-note {
  font-size: 12px;
  color: #999;
  margin-top: 8px;
  margin-bottom: 0;
}

/* Choice Results */
.choice-results {
  margin: 20px 0;
}

.result-item {
  margin-bottom: 20px;
}

.result-label {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 8px;
}

.option-name {
  font-weight: 600;
  color: #333;
}

.result-stats {
  font-size: 12px;
  color: #999;
}

.progress-bar-container {
  height: 24px;
  background: #f0f0f0;
  border-radius: 4px;
  overflow: hidden;
}

.progress-bar {
  height: 100%;
  background: linear-gradient(90deg, #667eea 0%, #764ba2 100%);
  border-radius: 4px;
  transition: width 0.3s;
  min-width: 2%;
}

/* Text Results */
.text-results {
  margin: 20px 0;
}

.responses-list {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.response-item {
  display: flex;
  gap: 12px;
  background: #f9f9f9;
  padding: 12px;
  border-radius: 6px;
  border: 1px solid #efefef;
}

.response-number {
  flex-shrink: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 30px;
  height: 30px;
  background: #667eea;
  color: white;
  border-radius: 50%;
  font-weight: 600;
  font-size: 12px;
}

.response-text {
  flex: 1;
  margin: 0;
  color: #333;
  font-size: 14px;
  line-height: 1.5;
  word-wrap: break-word;
  white-space: pre-wrap;
}

/* Ranking Results */
.ranking-results {
  margin: 20px 0;
}

.ranking-result-item {
  display: grid;
  grid-template-columns: 30px 1fr;
  gap: 12px;
  align-items: center;
  padding: 12px;
  background: #f9f9f9;
  border-radius: 6px;
  border: 1px solid #efefef;
  margin-bottom: 8px;
}

.ranking-result-item:last-child {
  margin-bottom: 0;
}

.ranking-position {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 30px;
  height: 30px;
  background: #667eea;
  color: white;
  border-radius: 50%;
  font-weight: 600;
  font-size: 14px;
}

.ranking-details {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.ranking-label {
  font-weight: 600;
  color: #333;
  font-size: 14px;
}

.ranking-avg {
  font-size: 12px;
  color: #999;
}

/* Scale Results */
.scale-stats {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 12px;
  margin: 0;
}

.stat-item {
  background: white;
  padding: 12px;
  border: 1px solid #efefef;
  border-radius: 6px;
  text-align: center;
}

.stat-label {
  display: block;
  font-size: 11px;
  color: #999;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  margin-bottom: 6px;
}

.stat-value {
  display: block;
  font-size: 18px;
  font-weight: 600;
  color: #667eea;
}

.scale-distribution {
  display: grid;
  grid-template-columns: repeat(10, 1fr);
  gap: 8px;
  margin: 20px 0;
}

.scale-bar-item {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
}

.scale-bar-container {
  width: 100%;
  height: 120px;
  background: #f0f0f0;
  border-radius: 4px;
  overflow: hidden;
  display: flex;
  align-items: flex-end;
}

.scale-bar {
  width: 100%;
  background: linear-gradient(180deg, #667eea 0%, #764ba2 100%);
  transition: height 0.3s;
}

.scale-label {
  font-size: 12px;
  font-weight: 600;
  color: #333;
}

.scale-count {
  font-size: 11px;
  color: #999;
}

.no-results {
  text-align: center;
  color: #999;
  padding: 20px;
}

/* Responsive */
@media (max-width: 600px) {
  .scale-stats {
    grid-template-columns: 1fr;
  }

  .scale-distribution {
    grid-template-columns: repeat(5, 1fr);
  }

  .scale-bar-container {
    height: 80px;
  }
}


/* Admin Panel */
.admin-panel {
  background: #f9f9f9;
  border: 2px solid #ddd;
  border-radius: 8px;
  padding: 16px;
  margin-top: 20px;
}

.admin-panel h3 {
  margin: 0 0 12px 0;
  font-size: 14px;
  color: #999;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.admin-actions {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
  margin-bottom: 16px;
}

.admin-actions .btn {
  width: 100%;
  padding: 10px !important;
  font-size: 13px;
}

.admin-info {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.info-item {
  display: grid;
  grid-template-columns: 90px 1fr auto;
  gap: 8px;
  align-items: center;
  padding: 8px;
  background: white;
  border-radius: 4px;
  border: 1px solid #efefef;
}

.info-label {
  font-size: 11px;
  color: #999;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.info-value {
  font-family: monospace;
  font-size: 12px;
  color: #333;
  word-break: break-all;
}

.btn-copy {
  background: #667eea;
  color: white;
  border: none;
  border-radius: 4px;
  padding: 4px 8px;
  font-size: 11px;
  cursor: pointer;
  transition: background 0.3s;
}

.btn-copy:hover {
  background: #5568d3;
}


/* Label Editor */
.label-editor {
  background: #f5f7ff;
  border: 1px solid #ddd;
  border-radius: 6px;
  padding: 12px;
  margin: 16px 0;
  display: grid;
  grid-template-columns: 1fr auto auto;
  gap: 8px;
  align-items: center;
}

.label-input {
  padding: 8px 12px !important;
  border: 1px solid #ddd !important;
  border-radius: 4px !important;
  font-size: 13px;
  font-family: inherit;
}

.label-input::placeholder {
  color: #ccc;
}

.label-save-btn,
.label-clear-btn {
  background: #667eea;
  color: white;
  border: none;
  border-radius: 4px;
  padding: 8px 12px;
  font-size: 12px;
  font-weight: 600;
  cursor: pointer;
  transition: background 0.3s;
  white-space: nowrap;
}

.label-save-btn:hover {
  background: #5568d3;
}

.label-clear-btn {
  background: #999;
}

.label-clear-btn:hover {
  background: #888;
}

/* Responsive */
@media (max-width: 600px) {
  .label-editor {
    grid-template-columns: 1fr;
  }

  .label-save-btn,
  .label-clear-btn {
    width: 100%;
  }
}


/* Input Validation Styles */
.field-error {
  border-color: #fcc !important;
  background-color: #fee !important;
}

.field-error-message {
  display: block;
  margin-top: 4px;
  font-size: 12px;
  color: #c33;
  font-weight: 500;
}

.validation-alert {
  background: #fee;
  color: #c33;
  border: 1px solid #fcc;
  border-radius: 6px;
  padding: 12px 16px;
  margin-bottom: 16px;
  font-size: 13px;
  font-weight: 500;
}

/* Form group with validation */
.form-group {
  position: relative;
}

.form-group.has-error input,
.form-group.has-error textarea,
.form-group.has-error select {
  border-color: #fcc;
  background-color: #fee;
}

/* Real-time validation feedback */
input[aria-invalid="true"],
textarea[aria-invalid="true"],
select[aria-invalid="true"] {
  border-color: #fcc;
  background-color: #fee;
}

input[aria-invalid="false"],
textarea[aria-invalid="false"],
select[aria-invalid="false"] {
  border-color: #cfc;
  background-color: #efe;
}

/* Character counter warnings */
.char-warning {
  color: #f93;
}

.char-critical {
  color: #c33;
  font-weight: 600;
}

/* Validation success state */
.validation-success {
  background: #efe;
  color: #3c3;
  border: 1px solid #cfc;
  border-radius: 6px;
  padding: 12px 16px;
  margin-bottom: 16px;
  font-size: 13px;
  font-weight: 500;
}
