* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

body {
    font-family: Arial, sans-serif;
    background-color: #f5f5f5;
}

.container {
    max-width: 800px;
    margin: 20px auto;
    padding: 20px;
}

h1 {
    text-align: center;
    color: #333;
}

p {
    margin-bottom: 20px;
    line-height: 1.5;
}

button {
    display: block;
    width: 200px;
    margin: 20px auto;
    padding: 10px;
    background-color: #4caf50;
    color: white;
    border: none;
    border-radius: 5px;
    cursor: pointer;
    font-size: 16px;
}

button:disabled {
    background-color: #ccc;
    cursor: not-allowed;
}

.progress-bar {
    width: 100%;
    height: 20px;
    background: #e0e0e0;
    border-radius: 10px;
    overflow: hidden;
    margin: 20px 0;
}

.progress {
    height: 100%;
    background: #2e7d32;
    transition: width 0.3s ease;
}

.question h3 {
    margin-bottom: 10px;
}

.answers label {
    display: block;
    margin: 10px 0;
    padding: 10px;
    background: white;
    border: 1px solid #ddd;
    border-radius: 5px;
    cursor: pointer;
}

.answers label:hover {
    background: #f9f9f9;
}

.selection-info {
    margin: 15px 0;
    font-weight: bold;
    color: #555;
}

.selected-answer {
    padding: 12px;
    margin: 8px 0;
    background: #f9f9f9;
    border: 1px solid #e0e0e0;
    border-radius: 8px;
    cursor: move;
    display: flex;
    align-items: center;
}

.selected-answer:hover {
    background: #f0f8f0;
}

.rank {
    display: inline-block;
    width: 24px;
    height: 24px;
    border-radius: 50%;
    text-align: center;
    line-height: 24px;
    margin-right: 10px;
    font-weight: bold;
    color: white;
    font-size: 14px;
}

.rank-1 { background-color: #2e7d32; } /* Насыщенный зелёный — 1‑е место (4 балла) */
.rank-2 { background-color: #4caf50; } /* Средний зелёный — 2‑е место (3 балла) */
.rank-3 { background-color: #81c784; } /* Светлый зелёный — 3‑е место (2 балла) */
.rank-4 { background-color: #c8e6c9; } /* Очень светлый зелёный — 4‑е место (1 балл) */

.result-item {
    margin: 15px 0;
    padding: 15px;
    background: white;
    border: 1px solid #ddd;
    border-radius: 5px;
}

.vector-name {
    margin-bottom: 5px;
    font-size: 18px;
    font-weight: bold;
}

/* Стили для drag-and-drop */
.selected-answer.dragging {
    opacity: 0.5;
    transform: scale(1.05);
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.2);
}

.selected-answer:active {
    cursor: grabbing;
}

.selected-answer {
    cursor: grab;
}

@media (max-width: 600px) {
    .container {
        padding: 10px;
    }
    button {
        width: 100%;
    }
}


.answers-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
  margin-bottom: 20px;
}

.answer-item {
  padding: 12px 16px;
  border: 2px solid #ddd;
  border-radius: 8px;
  background: white;
  cursor: pointer;
  transition: all 0.3s ease;
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.answer-item:hover {
  border-color: #007bff;
  box-shadow: 0 2px 4px rgba(0,0,0,0.1);
}

/* Активный (выбранный) элемент */
.answer-item.active {
  border-color: #28a745;
  background: #f8fff9;
  font-weight: bold;
}

/* Номер ранга */
.rank-badge {
  background: #28a745;
  color: white;
  padding: 4px 8px;
  border-radius: 12px;
  font-size: 12px;
  min-width: 24px;
  text-align: center;
}

/* Область перетаскивания */
.drag-handle {
  width: 30px;
  height: 30px;
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 0.7;
  cursor: move;
  touch-action: none;
}

.drag-handle:hover {
  opacity: 1;
}

/* Иконка перетаскивания (три горизонтальные линии) */
.drag-icon {
  width: 18px;
  height: 14px;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
}

.drag-line {
  height: 2px;
  width: 100%;
  background: #666;
  border-radius: 2px;
}

/* Добавляем стили для диаграммы */
.chart-container {
    margin: 20px 0;
}

.chart {
    width: 100%;
    position: relative;
    margin-bottom: 20px;
}

.chart-bar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    height: 20px;
    margin: 5px 0;
    padding: 5px;
    box-sizing: border-box;
    border-radius: 5px;
    font-size: 14px;
}

.chart-bar.rank-1 { background-color: #2e7d32; color: white; }
.chart-bar.rank-2 { background-color: #4caf50; color: white; }
.chart-bar.rank-3 { background-color: #81c784; color: white; }
.chart-bar.rank-4 { background-color: #c8e6c9; color: white; }

.results-table {
    width: 100%;
    border-collapse: collapse;
    margin: 20px 0;
    font-family: Arial, sans-serif;
}

.results-table th,
.results-table td {
    padding: 12px;
    border: 1px solid #ddd;
    text-align: center;
}

.results-table th {
    background-color: #f0f0f0;
    font-weight: bold;
    color: #333;
}

.results-table tbody tr:nth-child(even) {
    background-color: #f9f9f9;
}

.results-table tbody tr:hover {
    background-color: #f2f2f2;
}

.results-table td.zero-score {
    color: #888;
}

.selected-answer {
  cursor: grab;
  user-select: none;
}
.selected-answer:active {
  cursor: grabbing;
}
.selected-answer.dragging {
  opacity: 0.5;
  transform: scale(1.05);
  box-shadow: 0 4px 8px rgba(0, 0, 0, 0.2);
  z-index: 1000;
}

/* Стили для кнопок */
.btn-primary {
  background-color: #4caf50;
  color: white;
  border: none;
  padding: 12px 24px;
  border-radius: 5px;
  cursor: pointer;
  font-size: 16px;
}

.btn-secondary {
  background-color: #607d8b;
  color: white;
  border: none;
  padding: 12px 24px;
  border-radius: 5px;
  cursor: pointer;
  font-size: 16px;
}

/* Группа кнопок */
.button-group {
  display: flex;
  gap: 15px;
  justify-content: center;
  margin-top: 20px;
}

.button-group button {
  width: auto;
}

/* Адаптивность */
@media (max-width: 600px) {
  .button-group {
    flex-direction: column;
  }
  .button-group button {
    width: 100%;
  }
}


