/* Admin Layout */
.admin-layout {
  display: flex;
  min-height: 100vh;
}

.admin-sidebar {
  width: 260px;
  background: var(--gray-800);
  color: white;
  padding: 24px 0;
  position: fixed;
  height: 100vh;
  overflow-y: auto;
}

.admin-logo {
  padding: 0 24px 24px;
  border-bottom: 1px solid var(--gray-700);
  margin-bottom: 24px;
}

.admin-logo h1 {
  font-size: 20px;
  font-weight: 700;
}

.admin-logo span {
  font-size: 12px;
  color: var(--gray-400);
}

.admin-nav {
  list-style: none;
}

.admin-nav a {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 24px;
  color: var(--gray-300);
  text-decoration: none;
  transition: all 0.2s;
}

.admin-nav a:hover {
  background: var(--gray-700);
  color: white;
}

.admin-nav a.active {
  background: var(--primary);
  color: white;
}

.admin-nav svg {
  width: 20px;
  height: 20px;
}

.admin-main {
  flex: 1;
  margin-left: 260px;
  padding: 24px 32px;
}

.admin-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 32px;
}

.admin-header h2 {
  font-size: 24px;
  font-weight: 600;
}

/* Question Type Selector */
.type-selector {
  display: flex;
  gap: 12px;
  margin-bottom: 20px;
}

.type-option {
  flex: 1;
  padding: 16px;
  border: 2px solid var(--gray-200);
  border-radius: 12px;
  text-align: center;
  cursor: pointer;
  transition: all 0.2s;
}

.type-option:hover {
  border-color: var(--primary);
}

.type-option.selected {
  border-color: var(--primary);
  background: rgba(79, 70, 229, 0.05);
}

.type-option svg {
  width: 32px;
  height: 32px;
  margin-bottom: 8px;
  color: var(--gray-500);
}

.type-option.selected svg {
  color: var(--primary);
}

.type-option span {
  display: block;
  font-size: 14px;
  font-weight: 500;
}

/* Choice Builder */
.choices-builder {
  margin-top: 20px;
}

.choices-list {
  margin-bottom: 16px;
}

.choice-item {
  display: flex;
  gap: 12px;
  align-items: center;
  padding: 16px;
  border: 1px solid var(--gray-200);
  border-radius: 12px;
  margin-bottom: 12px;
  background: white;
}

.choice-item.correct {
  border-color: var(--success);
  background: #f0fdf4;
}

.choice-marker {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  background: var(--gray-100);
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 600;
  font-size: 14px;
  color: var(--gray-600);
  flex-shrink: 0;
}

.choice-item.correct .choice-marker {
  background: var(--success);
  color: white;
}

.choice-content {
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.choice-content input[type="text"] {
  border: none;
  background: none;
  font-size: 15px;
  padding: 4px 0;
  outline: none;
}

.choice-image-preview {
  width: 60px;
  height: 60px;
  border-radius: 8px;
  object-fit: cover;
}

.choice-actions {
  display: flex;
  gap: 8px;
}

.choice-actions button {
  width: 32px;
  height: 32px;
  border-radius: 8px;
  border: none;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.2s;
}

.choice-actions .mark-correct {
  background: var(--gray-100);
  color: var(--gray-500);
}

.choice-actions .mark-correct:hover {
  background: var(--success);
  color: white;
}

.choice-actions .upload-image {
  background: var(--gray-100);
  color: var(--gray-500);
}

.choice-actions .upload-image:hover {
  background: var(--primary);
  color: white;
}

.choice-actions .remove-choice {
  background: var(--gray-100);
  color: var(--gray-500);
}

.choice-actions .remove-choice:hover {
  background: var(--danger);
  color: white;
}

/* Question Preview */
.question-preview {
  border: 2px dashed var(--gray-300);
  border-radius: 12px;
  padding: 24px;
  margin-top: 20px;
}

.preview-label {
  font-size: 12px;
  text-transform: uppercase;
  letter-spacing: 1px;
  color: var(--gray-500);
  margin-bottom: 16px;
}

/* Results Table Enhancements */
.score-cell {
  font-weight: 600;
}

.score-cell.high {
  color: var(--success);
}

.score-cell.medium {
  color: var(--warning);
}

.score-cell.low {
  color: var(--danger);
}

.violations-cell {
  color: var(--danger);
  font-weight: 500;
}

/* Category Badge */
.category-badge {
  display: inline-block;
  padding: 4px 12px;
  border-radius: 20px;
  font-size: 12px;
  font-weight: 500;
}

.category-badge[data-category="tech"] {
  background: #dbeafe;
  color: #1d4ed8;
}

.category-badge[data-category="iq"] {
  background: #fae8ff;
  color: #a21caf;
}

.category-badge[data-category="attention"] {
  background: #fef3c7;
  color: #b45309;
}

.category-badge[data-category="soft"] {
  background: #dcfce7;
  color: #166534;
}

/* Filter Bar */
.filter-bar {
  display: flex;
  gap: 12px;
  margin-bottom: 24px;
  flex-wrap: wrap;
}

.filter-bar .form-input,
.filter-bar .form-select {
  width: auto;
  min-width: 200px;
}

/* Actions Dropdown */
.actions-dropdown {
  position: relative;
}

.actions-dropdown-menu {
  position: absolute;
  right: 0;
  top: 100%;
  background: white;
  border-radius: 8px;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
  min-width: 160px;
  z-index: 100;
  opacity: 0;
  visibility: hidden;
  transform: translateY(-10px);
  transition: all 0.2s;
}

.actions-dropdown:hover .actions-dropdown-menu {
  opacity: 1;
  visibility: visible;
  transform: translateY(0);
}

.actions-dropdown-menu a,
.actions-dropdown-menu button {
  display: block;
  width: 100%;
  padding: 10px 16px;
  text-align: left;
  border: none;
  background: none;
  font-size: 14px;
  color: var(--gray-700);
  cursor: pointer;
  text-decoration: none;
}

.actions-dropdown-menu a:hover,
.actions-dropdown-menu button:hover {
  background: var(--gray-50);
}

.actions-dropdown-menu .danger {
  color: var(--danger);
}

/* Difficulty Selector */
.difficulty-selector {
  display: flex;
  gap: 8px;
}

.difficulty-option {
  padding: 8px 16px;
  border: 1px solid var(--gray-300);
  border-radius: 20px;
  font-size: 13px;
  cursor: pointer;
  transition: all 0.2s;
}

.difficulty-option:hover {
  border-color: var(--primary);
}

.difficulty-option.selected {
  background: var(--primary);
  border-color: var(--primary);
  color: white;
}

/* Time Input */
.time-input {
  display: flex;
  align-items: center;
  gap: 8px;
}

.time-input input {
  width: 80px;
  text-align: center;
}

.time-input span {
  color: var(--gray-500);
  font-size: 14px;
}

/* Results Detail */
.result-detail-header {
  display: flex;
  gap: 24px;
  margin-bottom: 32px;
}

.result-score-card {
  text-align: center;
  padding: 32px;
  background: linear-gradient(135deg, var(--primary), #818cf8);
  color: white;
  border-radius: 16px;
  min-width: 200px;
}

.result-score-value {
  font-size: 48px;
  font-weight: 700;
}

.result-score-label {
  font-size: 14px;
  opacity: 0.8;
}

.result-info-card {
  flex: 1;
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 16px;
}

.result-info-item {
  padding: 16px;
  background: var(--gray-50);
  border-radius: 12px;
}

.result-info-item label {
  font-size: 12px;
  color: var(--gray-500);
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.result-info-item span {
  display: block;
  font-size: 16px;
  font-weight: 500;
  margin-top: 4px;
}

/* Category Scores */
.category-scores {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 16px;
  margin-bottom: 32px;
}

.category-score-card {
  background: white;
  padding: 20px;
  border-radius: 12px;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
}

.category-score-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 12px;
}

.category-score-header h4 {
  font-size: 14px;
  font-weight: 500;
}

.category-score-value {
  font-size: 20px;
  font-weight: 700;
}

.category-score-bar {
  height: 8px;
  background: var(--gray-200);
  border-radius: 4px;
  overflow: hidden;
}

.category-score-fill {
  height: 100%;
  border-radius: 4px;
  transition: width 0.5s ease;
}

/* Responsive Admin */
@media (max-width: 1024px) {
  .admin-sidebar {
    width: 80px;
    padding: 16px 0;
  }

  .admin-logo {
    text-align: center;
    padding: 0 16px 16px;
  }

  .admin-logo span {
    display: none;
  }

  .admin-nav a {
    padding: 16px;
    justify-content: center;
  }

  .admin-nav a span {
    display: none;
  }

  .admin-main {
    margin-left: 80px;
    padding: 24px;
  }
}

@media (max-width: 768px) {
  .admin-sidebar {
    display: none;
  }

  .admin-main {
    margin-left: 0;
    padding: 16px;
  }

  .admin-header {
    flex-direction: column;
    gap: 16px;
    align-items: flex-start;
  }

  .filter-bar {
    flex-direction: column;
  }

  .filter-bar .form-input,
  .filter-bar .form-select {
    width: 100%;
  }
}
