/* === CommandModal Component === */
.backdrop {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  z-index: 900;
  background: rgba(10, 14, 23, 0.8);
  backdrop-filter: blur(6px);
  display: flex;
  align-items: center;
  justify-content: center;
  animation: backdropIn 0.15s ease;
}

@keyframes backdropIn {
  from { opacity: 0; }
  to { opacity: 1; }
}

.modal {
  background: var(--deep-void);
  border: 1px solid var(--hull-grey);
  border-radius: 8px;
  width: 100%;
  max-width: 440px;
  max-height: 80vh;
  display: flex;
  flex-direction: column;
  box-shadow: 0 16px 64px rgba(0, 0, 0, 0.6), 0 0 40px rgba(0, 212, 255, 0.08);
  animation: modalIn 0.2s ease;
  overflow: hidden;
}

@keyframes modalIn {
  from {
    opacity: 0;
    transform: scale(0.95) translateY(8px);
  }
  to {
    opacity: 1;
    transform: scale(1) translateY(0);
  }
}

/* Header */
.header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 1rem 1.25rem;
  border-bottom: 1px solid rgba(61, 90, 108, 0.4);
  background: linear-gradient(90deg, rgba(0, 212, 255, 0.05), transparent);
}

.title {
  font-family: var(--font-orbitron), 'Orbitron', sans-serif;
  font-size: 0.9rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--plasma-cyan);
}

.closeButton {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 28px;
  height: 28px;
  background: none;
  border: 1px solid transparent;
  border-radius: 4px;
  color: var(--chrome-silver);
  cursor: pointer;
  transition: all 0.2s ease;
}

.closeButton:hover {
  color: var(--star-white);
  border-color: var(--hull-grey);
  background: rgba(61, 90, 108, 0.2);
}

/* Body (form) */
.body {
  padding: 1.25rem;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

.body::-webkit-scrollbar {
  width: 4px;
}

.body::-webkit-scrollbar-track {
  background: var(--deep-void);
}

.body::-webkit-scrollbar-thumb {
  background: var(--hull-grey);
  border-radius: 2px;
}

/* Field group */
.field {
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
}

.fieldLabel {
  font-family: var(--font-jetbrains), 'JetBrains Mono', monospace;
  font-size: 0.7rem;
  font-weight: 600;
  color: var(--chrome-silver);
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.required {
  color: var(--claw-red);
  margin-left: 0.2rem;
}

.fieldInput {
  width: 100%;
  padding: 0.5rem 0.6rem;
  background: rgba(26, 39, 68, 0.5);
  border: 1px solid var(--hull-grey);
  border-radius: 4px;
  color: var(--star-white);
  font-family: var(--font-jetbrains), 'JetBrains Mono', monospace;
  font-size: 0.75rem;
  outline: none;
  transition: border-color 0.2s ease, box-shadow 0.2s ease;
}

.fieldInput:focus {
  border-color: var(--plasma-cyan);
  box-shadow: 0 0 8px rgba(0, 212, 255, 0.15);
}

.fieldInput::placeholder {
  color: var(--hull-grey);
}

/* Select dropdown */
.fieldSelect {
  width: 100%;
  padding: 0.5rem 0.6rem;
  background: rgba(26, 39, 68, 0.5);
  border: 1px solid var(--hull-grey);
  border-radius: 4px;
  color: var(--star-white);
  font-family: var(--font-jetbrains), 'JetBrains Mono', monospace;
  font-size: 0.75rem;
  outline: none;
  cursor: pointer;
  appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 24 24' fill='none' stroke='%23a8c5d6' stroke-width='2'%3E%3Cpath d='m6 9 6 6 6-6'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 0.6rem center;
  padding-right: 2rem;
  transition: border-color 0.2s ease, box-shadow 0.2s ease;
}

.fieldSelect:focus {
  border-color: var(--plasma-cyan);
  box-shadow: 0 0 8px rgba(0, 212, 255, 0.15);
}

.fieldSelect option {
  background: var(--deep-void);
  color: var(--star-white);
}

/* Footer with actions */
.footer {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 0.75rem;
  padding: 1rem 1.25rem;
  border-top: 1px solid rgba(61, 90, 108, 0.4);
}

.cancelButton {
  padding: 0.45rem 0.9rem;
  background: rgba(61, 90, 108, 0.15);
  border: 1px solid var(--hull-grey);
  border-radius: 4px;
  color: var(--chrome-silver);
  font-family: var(--font-jetbrains), 'JetBrains Mono', monospace;
  font-size: 0.75rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  cursor: pointer;
  transition: all 0.2s ease;
}

.cancelButton:hover {
  background: rgba(61, 90, 108, 0.3);
  border-color: var(--chrome-silver);
}

.submitButton {
  padding: 0.45rem 0.9rem;
  background: rgba(0, 212, 255, 0.1);
  border: 1px solid var(--plasma-cyan);
  border-radius: 4px;
  color: var(--plasma-cyan);
  font-family: var(--font-jetbrains), 'JetBrains Mono', monospace;
  font-size: 0.75rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  cursor: pointer;
  transition: all 0.2s ease;
}

.submitButton:hover {
  background: rgba(0, 212, 255, 0.2);
  box-shadow: 0 0 16px rgba(0, 212, 255, 0.3);
}

.submitButton:disabled {
  opacity: 0.4;
  cursor: not-allowed;
}

/* Mobile */
@media (max-width: 600px) {
  .modal {
    max-width: 100%;
    max-height: 90vh;
    margin: 0.5rem;
    border-radius: 6px;
  }

  .header {
    padding: 0.75rem 0.85rem;
  }

  .title {
    font-size: 0.85rem;
  }

  .closeButton {
    width: 44px;
    height: 44px;
  }

  .body {
    padding: 0.85rem;
  }

  .fieldLabel {
    font-size: 0.8rem;
  }

  .fieldInput,
  .fieldSelect {
    font-size: 16px; /* prevents iOS zoom */
    padding: 0.6rem;
    min-height: 44px;
  }

  .footer {
    padding: 0.75rem 0.85rem;
    flex-direction: column;
    gap: 0.5rem;
  }

  .cancelButton,
  .submitButton {
    width: 100%;
    min-height: 44px;
    font-size: 0.8rem;
    text-align: center;
    justify-content: center;
  }
}
