/* Стили для мастера заполнения */
.dropdown-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 12px 16px;
  background: #f8fafc;
  border-bottom: 1px solid #e5e7eb;
  font-weight: 600;
  color: #374151;
}

.dropdown-divider {
  height: 1px;
  background: #e5e7eb;
  margin: 8px 0;
}

.wizard-btn {
  background: linear-gradient(135deg, #3b82f6, #1d4ed8);
  color: white;
  border: none;
  padding: 8px 16px;
  border-radius: 8px;
  font-size: 0.85rem;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s ease;
  display: flex;
  align-items: center;
  gap: 6px;
  box-shadow: 0 2px 4px rgba(59, 130, 246, 0.2);
}

.wizard-btn:hover {
  background: linear-gradient(135deg, #2563eb, #1e40af);
  transform: translateY(-1px);
  box-shadow: 0 4px 8px rgba(59, 130, 246, 0.3);
}

.wizard-btn:active {
  transform: translateY(0);
  box-shadow: 0 2px 4px rgba(59, 130, 246, 0.2);
}

/* Стили для модального окна мастера */
.wizard-modal {
  position: fixed;
  top: 0;
  left: 0;
  width: 100vw;
  height: 100vh;
  z-index: 2147483647;
  display: flex;
  align-items: center;
  justify-content: center;
  animation: wizardFadeIn 0.3s ease;
}

.wizard-backdrop {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(0, 0, 0, 0.85);
  backdrop-filter: blur(8px);
  animation: backdropFadeIn 0.3s ease;
}

.wizard-container {
  position: relative;
  background: white;
  border-radius: 16px;
  box-shadow: 0 25px 50px rgba(0, 0, 0, 0.25);
  width: 96vw;
  height: 92vh;
  max-width: 1500px;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  z-index: 2147483648;
}

.wizard-header {
  background: linear-gradient(135deg, #3b82f6, #1d4ed8);
  color: white;
  padding: 24px 32px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  border-bottom: 1px solid #e5e7eb;
}

.wizard-title h2 {
  margin: 0 0 8px 0;
  font-size: 1.5rem;
  font-weight: 700;
  display: flex;
  align-items: center;
  gap: 12px;
}

.wizard-title p {
  margin: 0;
  opacity: 0.9;
  font-size: 1rem;
}

.wizard-close {
  background: rgba(255, 255, 255, 0.2);
  border: none;
  color: white;
  width: 40px;
  height: 40px;
  border-radius: 50%;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.2rem;
  transition: all 0.2s ease;
}

.wizard-close:hover {
  background: rgba(255, 255, 255, 0.3);
  transform: scale(1.1);
}

.wizard-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 16px;
}

.wizard-mode-toggle {
  display: inline-flex;
  background: rgba(15, 23, 42, 0.08);
  padding: 4px;
  border-radius: 999px;
  gap: 4px;
}

.wizard-mode-btn {
  border: none;
  background: transparent;
  color: #e5e7eb;
  padding: 6px 12px;
  border-radius: 999px;
  font-size: 0.8rem;
  font-weight: 500;
  cursor: pointer;
  transition: background 0.2s, color 0.2s;
}

.wizard-mode-btn:hover {
  background: rgba(255, 255, 255, 0.1);
}

.wizard-mode-btn-active {
  background: #ffffff;
  color: #1d4ed8;
}

.wizard-content {
  display: flex;
  flex: 1;
  overflow: hidden;
}

.wizard-sidebar {
  width: 300px;
  background: #f8fafc;
  border-right: 1px solid #e5e7eb;
  padding: 24px;
  overflow-y: auto;
}

.wizard-progress {
  margin-bottom: 24px;
}

.progress-bar {
  width: 100%;
  height: 8px;
  background: #e5e7eb;
  border-radius: 4px;
  overflow: hidden;
  margin-bottom: 8px;
}

.progress-fill {
  height: 100%;
  background: linear-gradient(90deg, #3b82f6, #1d4ed8);
  border-radius: 4px;
  transition: width 0.3s ease;
  width: 6.25%;
}

.progress-text {
  font-size: 0.9rem;
  color: #6b7280;
  font-weight: 500;
}

.wizard-steps {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.wizard-step {
  padding: 12px 16px;
  border-radius: 8px;
  cursor: pointer;
  transition: all 0.2s ease;
  border: 2px solid transparent;
  background: white;
  display: flex;
  align-items: center;
  gap: 12px;
}

.wizard-step:hover {
  background: #f3f4f6;
  border-color: #d1d5db;
}

.wizard-step.active {
  background: #dbeafe;
  border-color: #3b82f6;
  color: #1d4ed8;
  font-weight: 600;
}

.wizard-step.completed {
  background: #dcfce7;
  border-color: #10b981;
  color: #047857;
}

.wizard-step-icon {
  width: 24px;
  height: 24px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.8rem;
  font-weight: 600;
}

.wizard-step.active .wizard-step-icon {
  background: #3b82f6;
  color: white;
}

.wizard-step.completed .wizard-step-icon {
  background: #10b981;
  color: white;
}

.wizard-step-text {
  flex: 1;
  font-size: 0.9rem;
  line-height: 1.4;
  text-align: left;
}

.wizard-step-drag-handle {
  margin-left: auto;
  cursor: grab;
  color: #9ca3af;
  font-size: 12px;
  padding: 4px;
  border-radius: 4px;
  transition: all 0.2s ease;
  user-select: none;
}

.wizard-step-drag-handle:hover {
  background: #f3f4f6;
  color: #6b7280;
}

.wizard-step:active .wizard-step-drag-handle {
  cursor: grabbing;
}

.wizard-step.dragging {
  opacity: 0.5;
  transform: rotate(5deg);
}

.wizard-step.drag-over {
  border-color: #3b82f6;
  background: #dbeafe;
}

.wizard-main {
  flex: 1;
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

.wizard-step-content {
  flex: 1;
  padding: 32px;
  overflow-y: auto;
}

.wizard-actions {
  padding: 24px 32px;
  background: #f8fafc;
  border-top: 1px solid #e5e7eb;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 16px;
}

.wizard-actions-center {
  display: flex;
  flex-direction: row;
  align-items: center;
  flex-wrap: wrap;
  gap: 12px;
  flex: 1;
  justify-content: center;
}

.wizard-save-status {
  font-size: 0.85rem;
  font-weight: 500;
  padding: 6px 14px;
  border-radius: 20px;
  transition: all 0.3s ease;
  opacity: 0;
  transform: translateY(-10px);
  min-height: 20px;
}

.wizard-save-status.success {
  background: #dcfce7;
  color: #166534;
  opacity: 1;
  transform: translateY(0);
}

.wizard-save-status.error {
  background: #fef2f2;
  color: #dc2626;
  opacity: 1;
  transform: translateY(0);
}

.wizard-save-status.saving {
  background: #dbeafe;
  color: #1d4ed8;
  opacity: 1;
  transform: translateY(0);
}

.wizard-actions .btn {
  padding: 12px 24px;
  font-weight: 600;
  border-radius: 8px;
  transition: all 0.2s ease;
  display: flex;
  align-items: center;
  gap: 8px;
}

.wizard-actions .btn:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

.wizard-actions .btn:not(:disabled):hover {
  transform: translateY(-2px);
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
}

.btn-warning {
  background: linear-gradient(135deg, #f59e0b 0%, #d97706 100%);
  color: white;
  border: none;
}

.btn-warning:hover {
  background: linear-gradient(135deg, #d97706 0%, #b45309 100%);
  transform: translateY(-2px);
  box-shadow: 0 4px 12px rgba(245, 158, 11, 0.3);
}

@keyframes wizardFadeIn {
  from { opacity: 0; }
  to { opacity: 1; }
}

@keyframes backdropFadeIn {
  from { opacity: 0; }
  to { opacity: 1; }
}

/* Стили для полей мастера */
.wizard-step-header {
  margin-bottom: 32px;
  text-align: center;
}

.wizard-step-header h3 {
  margin: 0 0 8px 0;
  font-size: 1.5rem;
  color: #1f2937;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 12px;
}

.wizard-step-header p {
  margin: 0;
  color: #6b7280;
  font-size: 1rem;
}

.wizard-form {
  max-width: 600px;
  margin: 0 auto;
}

.wizard-field {
  margin-bottom: 24px;
}

.wizard-label {
  display: block;
  margin-bottom: 8px;
  font-weight: 600;
  color: #374151;
  font-size: 1rem;
  display: flex;
  align-items: center;
  gap: 8px;
}

.wizard-label .required {
  color: #ef4444;
  margin-left: 4px;
}

.wizard-input {
  width: 100%;
  padding: 12px 16px;
  border: 2px solid #e5e7eb;
  border-radius: 8px;
  font-size: 1rem;
  transition: all 0.2s ease;
  box-sizing: border-box;
}

.wizard-input:focus {
  outline: none;
  border-color: #3b82f6;
  box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.1);
}

.wizard-input[type="textarea"] {
  resize: vertical;
  min-height: 100px;
}

/* Стили для новых типов полей */
.file-preview {
  margin-top: 8px;
  padding: 8px 12px;
  background-color: #f3f4f6;
  border: 1px solid #d1d5db;
  border-radius: 6px;
  font-size: 0.875rem;
  color: #374151;
}

.file-or-text-container {
  margin-top: 8px;
}

.input-type-selector {
  display: flex;
  gap: 16px;
  margin-bottom: 12px;
  padding: 8px;
  background-color: #f9fafb;
  border-radius: 6px;
}

.radio-label {
  display: flex;
  align-items: center;
  gap: 6px;
  cursor: pointer;
  font-size: 0.875rem;
  color: #374151;
}

.radio-label input[type="radio"] {
  margin: 0;
  cursor: pointer;
}

.radio-label:hover {
  color: #1f2937;
}

/* Стили для drag & drop */
.file-upload-container {
  margin-top: 8px;
}

.file-drop-zone {
  border: 2px dashed #d1d5db;
  border-radius: 8px;
  padding: 24px;
  text-align: center;
  background-color: #f9fafb;
  transition: all 0.2s ease;
  cursor: pointer;
}

.file-drop-zone:hover {
  border-color: #3b82f6;
  background-color: #eff6ff;
}

.file-drop-zone.drag-over {
  border-color: #3b82f6;
  background-color: #dbeafe;
  transform: scale(1.02);
}

.drop-zone-content {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
}

.drop-zone-content .icon {
  font-size: 2rem;
  color: #6b7280;
}

.drop-zone-content p {
  margin: 0;
  color: #374151;
  font-size: 0.875rem;
}

.file-select-link {
  color: #3b82f6;
  text-decoration: underline;
  cursor: pointer;
}

.file-select-link:hover {
  color: #1d4ed8;
}

.file-types {
  font-size: 0.75rem !important;
  color: #6b7280 !important;
}

.file-list {
  margin-top: 12px;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.file-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 8px 12px;
  background-color: #f3f4f6;
  border: 1px solid #d1d5db;
  border-radius: 6px;
  font-size: 0.875rem;
}

.file-info {
  display: flex;
  align-items: center;
  gap: 8px;
  flex: 1;
}

.file-icon {
  font-size: 1.2rem;
}

.file-name {
  font-weight: 500;
  color: #374151;
}

.file-size {
  color: #6b7280;
  font-size: 0.75rem;
}

.file-remove {
  background: none;
  border: none;
  color: #ef4444;
  font-size: 1.2rem;
  cursor: pointer;
  padding: 4px;
  border-radius: 4px;
  transition: background-color 0.2s ease;
}

.file-remove:hover {
  background-color: #fee2e2;
}

/* Стили для ссылок скачивания */
.download-link {
  color: #3b82f6;
  text-decoration: none;
  font-weight: 500;
  padding: 4px 8px;
  border-radius: 4px;
  background-color: #eff6ff;
  border: 1px solid #dbeafe;
  transition: all 0.2s ease;
  display: inline-block;
}

.download-link:hover {
  color: #1d4ed8;
  background-color: #dbeafe;
  border-color: #3b82f6;
  transform: translateY(-1px);
  box-shadow: 0 2px 4px rgba(59, 130, 246, 0.2);
}

/* Адаптивность для мастера */
@media (max-width: 768px) {
  .wizard-container {
    width: 100vw;
    height: 100vh;
    border-radius: 0;
  }
  
  .wizard-sidebar {
    width: 250px;
    padding: 16px;
  }
  
  .wizard-step-content {
    padding: 20px;
  }
  
  .wizard-actions {
    padding: 16px 20px;
    flex-direction: column;
  }
  
  .wizard-actions .btn {
    width: 100%;
    justify-content: center;
  }
  
  .wizard-actions-center {
    order: -1;
    width: 100%;
    margin-bottom: 16px;
  }
  
  .wizard-actions {
    flex-direction: column;
    gap: 12px;
  }
  
  .wizard-actions .btn {
    min-height: 44px;
    box-sizing: border-box;
  }
}

@media (max-width: 480px) {
  .wizard-sidebar {
    width: 100%;
    max-width: 100%;
  }
  
  .wizard-step-content {
    padding: 16px 12px;
  }
  
  .wizard-step-title {
    font-size: 1.2rem;
  }
}

/* Стили для новых типов полей - изображения и документы */
.image-list, .document-list {
  margin-top: 12px;
}

.image-item, .document-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 8px 12px;
  margin: 4px 0;
  background: #f8f9fa;
  border-radius: 6px;
  border: 1px solid #e9ecef;
  transition: all 0.2s ease;
}

.image-item:hover, .document-item:hover {
  background: #e9ecef;
  border-color: #dee2e6;
}

.image-preview {
  width: 40px;
  height: 40px;
  object-fit: cover;
  border-radius: 4px;
  margin-right: 8px;
}

.image-display-name, .document-display-name {
  flex: 1;
  margin-right: 8px;
  padding: 4px 8px;
  border: 1px solid #ddd;
  border-radius: 4px;
  font-size: 14px;
  background: white;
}

.image-display-name:focus, .document-display-name:focus {
  outline: none;
  border-color: #3b82f6;
  box-shadow: 0 0 0 2px rgba(59, 130, 246, 0.1);
}

.image-remove, .document-remove {
  background: #dc3545;
  color: white;
  border: none;
  border-radius: 50%;
  width: 24px;
  height: 24px;
  cursor: pointer;
  font-size: 14px;
  margin-left: 8px;
  transition: all 0.2s ease;
}

.image-remove:hover, .document-remove:hover {
  background: #c82333;
  transform: scale(1.1);
}

/* Стили для зон загрузки изображений и документов */
.file-upload-container {
  margin-top: 8px;
}

.file-drop-zone {
  border: 2px dashed #d1d5db;
  border-radius: 8px;
  padding: 20px;
  text-align: center;
  background: #f9fafb;
  transition: all 0.2s ease;
  cursor: pointer;
}

.file-drop-zone:hover {
  border-color: #3b82f6;
  background: #f0f9ff;
}

.file-drop-zone.drag-over {
  border-color: #3b82f6;
  background: #dbeafe;
}

.drop-zone-content {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
}

.drop-zone-content .icon {
  font-size: 24px;
  color: #6b7280;
}

.drop-zone-content p {
  margin: 0;
  color: #374151;
  font-size: 14px;
}

.file-types {
  font-size: 12px;
  color: #6b7280;
  margin-top: 4px;
}

.file-select-link {
  color: #3b82f6;
  text-decoration: underline;
  cursor: pointer;
}

.file-select-link:hover {
  color: #1d4ed8;
}

/* Режим тегов: блоки и строки */
.wizard-tags-description {
  margin: 0 0 20px 0;
  color: #6b7280;
  font-size: 0.9rem;
}

.wizard-tags-list {
  display: flex;
  flex-direction: column;
  gap: 24px;
}

.wizard-tags-block-group {
  background: #f8fafc;
  border: 1px solid #e5e7eb;
  border-radius: 10px;
  padding: 16px;
}

.wizard-tags-block-group-title {
  font-weight: 600;
  color: #1e40af;
  margin-bottom: 12px;
  padding-bottom: 8px;
  border-bottom: 1px solid #e5e7eb;
}

.wizard-tags-block-group .wizard-tags-row {
  margin-bottom: 10px;
}

.wizard-tags-block-group .wizard-tags-row:last-child {
  margin-bottom: 0;
}

.wizard-tags-row {
  display: flex;
  align-items: center;
  gap: 16px;
  flex-wrap: wrap;
}

.wizard-tags-row .wizard-tags-block-info {
  flex: 1;
  min-width: 140px;
}

.wizard-tags-row .wizard-tags-block-title {
  font-weight: 500;
  color: #374151;
}

.wizard-tags-row .wizard-tags-block-subtitle {
  font-size: 0.8rem;
  color: #6b7280;
  margin-top: 2px;
}

.wizard-tags-row .wizard-tags-input-wrapper {
  min-width: 180px;
}

.wizard-tags-row .wizard-tags-input-wrapper input {
  width: 100%;
  max-width: 220px;
  padding: 8px 12px;
  border: 1px solid #e5e7eb;
  border-radius: 6px;
  font-size: 0.9rem;
}

.wizard-tags-row-controls {
  display: flex;
  flex-direction: column;
  gap: 4px;
  margin-left: auto;
}

.wizard-tags-row-move-btn {
  width: 28px;
  height: 28px;
  padding: 0;
  border: 1px solid #e5e7eb;
  border-radius: 4px;
  background: #ffffff;
  color: #374151;
  font-size: 14px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.2s;
}

.wizard-tags-row-move-btn:hover:not(:disabled) {
  background: #f3f4f6;
  border-color: #d1d5db;
}

.wizard-tags-row-move-btn:disabled {
  opacity: 0.4;
  cursor: not-allowed;
}

.wizard-input-error {
  border-color: #ef4444 !important;
}

/* На публичных страницах отключаем hover у блоков документов */
.content-block .document-item:hover,
.content-block .document-link:hover,
.content-block .file-item:hover,
.content-block .download-link:hover,
.form-data-section .document-item:hover,
.form-data-section .document-link:hover,
.form-data-section .file-item:hover,
.form-data-section .download-link:hover,
.documents-list .document-item:hover,
.documents-list .file-item:hover,
.documents-list .download-link:hover,
.content-block .documents-list a:hover,
.form-data-section .documents-list a:hover {
  background: #ffffff !important;
  background-color: #ffffff !important;
  border-color: #e5e7eb !important;
  color: #2563eb !important;
  box-shadow: none !important;
  transform: none !important;
}
.content-block .file-item .download-link:hover,
.content-block .document-item .download-link:hover,
.form-data-section .file-item .download-link:hover,
.form-data-section .document-item .download-link:hover,
.documents-list .download-link:hover,
.documents-list a.document-link:hover {
  background: #eff6ff !important;
  background-color: #eff6ff !important;
  color: #3b82f6 !important;
  border-color: transparent !important;
  box-shadow: none !important;
  transform: none !important;
}

/* Переключатель отображения карточек (Меньше/Больше) в блоке персон — преподаватель */
.sveden-card-display-mode .persons-display-toggle {
  display: flex;
  gap: 8px;
}
.sveden-card-display-mode .persons-toggle-btn {
  padding: 8px 16px;
  border: 1px solid #e5e7eb;
  border-radius: 8px;
  background: #fff;
  color: #64748b;
  font-size: 0.9rem;
  cursor: pointer;
  transition: background 0.2s, color 0.2s, border-color 0.2s;
}
.sveden-card-display-mode .persons-toggle-btn:hover {
  background: #f8fafc;
  color: #334155;
}
.sveden-card-display-mode .persons-toggle-btn.is-active {
  background: #3b82f6;
  color: #fff;
  border-color: #3b82f6;
}