/* Edit Unknown Questions Panel & Editor Modal */
.edit-unknown-btn {
  background: #2d4a6f;
  border: 1px solid #3d5a80;
  color: #b3d4fc;
  border-radius: 6px;
  padding: 0.4rem 0.75rem;
  font-size: 0.85rem;
  cursor: pointer;
  transition: background 0.15s, border-color 0.15s;
}

.edit-unknown-btn:hover {
  background: #3d5a80;
  border-color: #5a7a9f;
}

/* Panel overlay */
.eu-panel-overlay {
  position: fixed;
  inset: 0;
  z-index: 2000;
  display: flex;
  align-items: stretch;
  justify-content: flex-end;
  background: rgba(0, 0, 0, 0.5);
}

.eu-panel-overlay.hidden {
  display: none;
}

.eu-panel {
  width: 100%;
  max-width: 480px;
  background: var(--card, #1a2332);
  border-left: 1px solid #2d3748;
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

.eu-panel-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 1rem 1.25rem;
  border-bottom: 1px solid #2d3748;
}

.eu-panel-header h2 {
  margin: 0;
  font-size: 1.1rem;
  color: #e8eaed;
}

.eu-panel-close {
  background: none;
  border: none;
  color: #9aa0a6;
  font-size: 1.5rem;
  cursor: pointer;
  padding: 0.25rem;
  line-height: 1;
}

.eu-panel-close:hover {
  color: #e8eaed;
}

.eu-exam-selector {
  padding: 0.75rem 1.25rem;
  border-bottom: 1px solid #2d3748;
}

.eu-exam-selector select {
  width: 100%;
  padding: 0.5rem;
  background: #0f1419;
  color: #e8eaed;
  border: 1px solid #3d4f66;
  border-radius: 6px;
  font-size: 0.9rem;
}

.eu-list {
  flex: 1;
  overflow-y: auto;
  padding: 0.75rem;
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(70px, 1fr));
  gap: 0.4rem;
  align-content: start;
}

.eu-list-empty {
  text-align: center;
  color: #9aa0a6;
  padding: 2rem 1rem;
  font-size: 0.9rem;
  grid-column: 1 / -1;
}

.eu-item {
  display: flex;
  align-items: center;
  justify-content: center;
  background: #0f1419;
  border: 1px solid #3d4f66;
  border-radius: 6px;
  cursor: pointer;
  transition: border-color 0.15s, background 0.15s;
  overflow: hidden;
  padding: 0.35rem 0.25rem;
  flex-direction: column;
  gap: 0.1rem;
  min-height: 48px;
}

.eu-item:hover {
  border-color: #5a7a9f;
  background: #152238;
}

.eu-item-id {
  font-size: 0.8rem;
  font-weight: 600;
  color: #e8eaed;
  text-align: center;
}

/* Editor Modal */
.eu-editor-overlay {
  position: fixed;
  inset: 0;
  z-index: 3000;
  display: flex;
  align-items: stretch;
  justify-content: center;
  padding: 1rem;
  background: rgba(0, 0, 0, 0.7);
}

.eu-editor-overlay.hidden {
  display: none;
}

.eu-editor {
  width: 100%;
  max-width: 1200px;
  max-height: calc(100vh - 2rem);
  overflow-y: auto;
  background: var(--card, #1a2332);
  border: 1px solid #2d3748;
  border-radius: 12px;
  padding: 1.25rem 1.5rem;
  display: flex;
  flex-direction: column;
  align-self: center;
}

.eu-editor h2 {
  margin: 0 0 0.75rem;
  font-size: 1.15rem;
  color: #e8eaed;
}

.eu-editor-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0.75rem 1.25rem;
}

.eu-editor-grid .eu-field-full {
  grid-column: 1 / -1;
}

.eu-field {
  margin-bottom: 0;
}

.eu-field label {
  display: block;
  font-size: 0.75rem;
  color: #9aa0a6;
  margin-bottom: 0.25rem;
  text-transform: uppercase;
  letter-spacing: 0.03em;
}

.eu-field select,
.eu-field input,
.eu-field textarea {
  width: 100%;
  padding: 0.4rem 0.6rem;
  background: #0f1419;
  color: #e8eaed;
  border: 1px solid #3d4f66;
  border-radius: 6px;
  font-size: 0.85rem;
  font-family: inherit;
}

.eu-field textarea {
  min-height: 100px;
  resize: vertical;
}

.eu-field input:focus,
.eu-field textarea:focus,
.eu-field select:focus {
  outline: none;
  border-color: #0078d4;
}

.eu-dynamic-section {
  margin-top: 0.75rem;
  padding: 0.75rem;
  background: #0f1419;
  border: 1px solid #3d4f66;
  border-radius: 8px;
}

.eu-dynamic-section h3 {
  margin: 0 0 0.5rem;
  font-size: 0.9rem;
  color: #b3d4fc;
}

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

.eu-option-row input[type="text"] {
  flex: 1;
  padding: 0.4rem 0.6rem;
  background: #1a2332;
  color: #e8eaed;
  border: 1px solid #3d4f66;
  border-radius: 4px;
  font-size: 0.85rem;
}

.eu-option-row .eu-key-input {
  width: 40px;
  flex: none;
  text-align: center;
}

.eu-option-row button {
  padding: 0.3rem 0.5rem;
  font-size: 0.75rem;
  background: #3d1a1a;
  color: #ff6b6b;
  border: 1px solid #5a2a2a;
  border-radius: 4px;
  cursor: pointer;
}

.eu-add-btn {
  display: inline-block;
  margin-top: 0.5rem;
  padding: 0.35rem 0.75rem;
  font-size: 0.8rem;
  background: #1a3d1a;
  color: #6bff6b;
  border: 1px solid #2a5a2a;
  border-radius: 4px;
  cursor: pointer;
}

.eu-add-btn:hover {
  background: #2a5a2a;
}

.eu-answer-select {
  margin-top: 0.75rem;
}

.eu-answer-select label {
  font-size: 0.8rem;
  color: #9aa0a6;
  margin-bottom: 0.25rem;
  display: block;
}

.eu-statement-row {
  display: grid;
  grid-template-columns: 50px 1fr 1fr 70px 40px;
  gap: 0.4rem;
  align-items: center;
  margin-bottom: 0.5rem;
}

.eu-statement-row input,
.eu-statement-row select {
  padding: 0.35rem 0.5rem;
  background: #1a2332;
  color: #e8eaed;
  border: 1px solid #3d4f66;
  border-radius: 4px;
  font-size: 0.8rem;
}

.eu-zone-row {
  margin-bottom: 0.75rem;
  padding: 0.5rem;
  background: #1a2332;
  border: 1px solid #3d4f66;
  border-radius: 6px;
}

.eu-zone-row label {
  font-size: 0.75rem;
  color: #9aa0a6;
}

.eu-zone-answer {
  margin-top: 0.35rem;
}

.eu-zone-answer label {
  font-size: 0.7rem;
  color: #b3d4fc;
  margin-bottom: 0.2rem;
  display: block;
}

.eu-zone-answer select {
  width: 100%;
  padding: 0.35rem 0.5rem;
  background: #1a2332;
  color: #e8eaed;
  border: 1px solid #3d4f66;
  border-radius: 4px;
  font-size: 0.8rem;
}

.eu-zone-row input {
  width: 100%;
  padding: 0.35rem 0.5rem;
  background: #0f1419;
  color: #e8eaed;
  border: 1px solid #3d4f66;
  border-radius: 4px;
  font-size: 0.8rem;
  margin-bottom: 0.35rem;
}

.eu-editor-actions {
  display: flex;
  gap: 0.75rem;
  justify-content: flex-end;
  margin-top: 0.75rem;
  padding-top: 0.75rem;
  border-top: 1px solid #2d3748;
}

.eu-btn-save {
  background: #107c10;
  border: 1px solid #107c10;
  color: #fff;
  padding: 0.5rem 1.25rem;
  border-radius: 6px;
  cursor: pointer;
  font-size: 0.9rem;
}

.eu-btn-save:hover {
  filter: brightness(1.1);
}

.eu-btn-save:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

.eu-btn-cancel {
  background: #3d4f66;
  border: 1px solid #3d4f66;
  color: #e8eaed;
  padding: 0.5rem 1rem;
  border-radius: 6px;
  cursor: pointer;
  font-size: 0.9rem;
}

.eu-btn-cancel:hover {
  background: #5a6a80;
}

.eu-toast {
  position: fixed;
  bottom: 1.5rem;
  right: 1.5rem;
  z-index: 4000;
  padding: 0.75rem 1.25rem;
  border-radius: 8px;
  font-size: 0.9rem;
  animation: euFadeIn 0.2s ease;
}

.eu-toast.success {
  background: #1a3d1a;
  border: 1px solid #107c10;
  color: #6bff6b;
}

.eu-toast.error {
  background: #3d1a1a;
  border: 1px solid #d13438;
  color: #ff6b6b;
}

@keyframes euFadeIn {
  from { opacity: 0; transform: translateY(10px); }
  to { opacity: 1; transform: translateY(0); }
}

.eu-images-gallery {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  margin-top: 0.35rem;
}

.eu-image-thumb {
  position: relative;
  width: 80px;
  height: 80px;
  border-radius: 6px;
  overflow: hidden;
  border: 1px solid #3d4f66;
  background: #0f1419;
}

.eu-image-thumb img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.eu-image-remove {
  position: absolute;
  top: 2px;
  right: 2px;
  width: 20px;
  height: 20px;
  background: rgba(200, 30, 30, 0.85);
  color: #fff;
  border: none;
  border-radius: 50%;
  font-size: 0.75rem;
  line-height: 1;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 0;
  transition: opacity 0.15s;
}

.eu-image-thumb:hover .eu-image-remove {
  opacity: 1;
}

.eu-no-images {
  font-size: 0.8rem;
  color: #9aa0a6;
}

.eu-image-upload {
  margin-top: 0.5rem;
  display: flex;
  align-items: center;
  gap: 0.75rem;
}

.eu-upload-btn {
  display: inline-block;
  padding: 0.4rem 0.85rem;
  font-size: 0.8rem;
  background: #1a3d5a;
  color: #b3d4fc;
  border: 1px solid #3d5a80;
  border-radius: 6px;
  cursor: pointer;
  transition: background 0.15s;
}

.eu-upload-btn:hover {
  background: #2d4a6f;
}

.eu-upload-hint {
  font-size: 0.75rem;
  color: #9aa0a6;
}

/* Login Modal */
.eu-login-overlay {
  position: fixed;
  inset: 0;
  z-index: 2500;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(0, 0, 0, 0.6);
}

.eu-login-overlay.hidden {
  display: none;
}

.eu-login-box {
  background: var(--card, #1a2332);
  border: 1px solid #2d3748;
  border-radius: 12px;
  padding: 1.5rem 2rem;
  width: 100%;
  max-width: 360px;
}

.eu-login-box h3 {
  margin: 0 0 1rem;
  font-size: 1.1rem;
  color: #e8eaed;
  text-align: center;
}

.eu-login-field {
  margin-bottom: 0.75rem;
}

.eu-login-field label {
  display: block;
  font-size: 0.8rem;
  color: #9aa0a6;
  margin-bottom: 0.25rem;
  text-transform: uppercase;
  letter-spacing: 0.03em;
}

.eu-login-field input {
  width: 100%;
  padding: 0.5rem 0.75rem;
  background: #0f1419;
  color: #e8eaed;
  border: 1px solid #3d4f66;
  border-radius: 6px;
  font-size: 0.9rem;
  box-sizing: border-box;
}

.eu-login-field input:focus {
  outline: none;
  border-color: #0078d4;
}

.eu-login-error {
  color: #ff6b6b;
  font-size: 0.85rem;
  text-align: center;
  margin: 0.5rem 0;
}

.eu-login-error.hidden {
  display: none;
}

.eu-login-actions {
  display: flex;
  gap: 0.75rem;
  justify-content: flex-end;
  margin-top: 1rem;
}

/* Unknown question highlight in list */
.eu-item.eu-item-unknown {
  background: #3d2b00;
  border-color: #e6a817;
}

.eu-item.eu-item-unknown:hover {
  background: #4d3a10;
  border-color: #f0c040;
}

.eu-item.eu-item-unknown .eu-item-id {
  color: #ffd54f;
}

.eu-item.eu-item-unknown .eu-item-type {
  color: #ffc107;
}

/* Type label in list items */
.eu-item-type {
  font-size: 0.5rem;
  color: #9aa0a6;
  text-align: center;
  margin-top: 0.1rem;
  text-transform: uppercase;
  letter-spacing: 0;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  max-width: 100%;
}

/* Adjust list item to show both id and type */
