* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

body {
  background-color: #1e1e1e;
  font-family: 'Amazon Ember', 'Helvetica Neue', Roboto, Arial, sans-serif;
  color: #d4d4d4;
  min-height: 100vh;
}

.container {
  max-width: 1200px;
  margin: 0 auto;
  padding: 20px;
}

.content-wrapper {
  background: #2d2d2d;
  border: 1px solid #4a4a4a;
  border-radius: 8px;
  overflow: hidden;
}

.header-content {
  padding: 24px 32px;
  border-bottom: 1px solid #3c3c3c;
}

.header-title {
  font-size: 28px;
  font-weight: 700;
  color: #ffffff;
  margin: 0 0 8px 0;
}

.header-description {
  font-size: 14px;
  color: #cccccc;
  margin: 0;
}

.content {
  padding: 32px;
}

.device-section {
  margin-bottom: 16px;
}

.device-header {
  background: #3c3c3c;
  padding: 16px 20px;
  border: 1px solid #4a4a4a;
  border-radius: 8px 8px 0 0;
  display: flex;
  align-items: center;
  cursor: pointer;
  transition: background-color 0.15s ease;
}

.device-header:hover {
  background: #4a4a4a;
}

.device-header input[type='checkbox'] {
  width: 18px;
  height: 18px;
  margin-right: 12px;
  cursor: pointer;
  accent-color: #0972d3;
}

.device-header label {
  font-weight: 600;
  font-size: 16px;
  cursor: pointer;
  flex: 1;
  color: #ffffff;
}

.add-instance-btn {
  margin-left: auto;
  padding: 4px 8px;
  background: #037f0c;
  color: #ffffff;
  border: none;
  border-radius: 6px;
  cursor: pointer;
  font-size: 18px;
  font-weight: 700;
  line-height: 1;
  transition: background-color 0.15s ease;
}

.add-instance-btn:hover {
  background: #026609;
}
.add-instance-btn.remove {
  background: #d91515;
}
.add-instance-btn.remove:hover {
  background: #b91212;
}

.device-body {
  padding: 24px;
  background: #2d2d2d;
  border: 1px solid #4a4a4a;
  border-top: none;
  border-radius: 0 0 8px 8px;
  display: none;
}

.device-body.active {
  display: block;
}

.form-group {
  margin-bottom: 20px;
}

.form-group label {
  display: block;
  margin-bottom: 8px;
  font-weight: 600;
  font-size: 14px;
  color: #d4d4d4;
}

.form-group input,
.form-group select {
  width: 100%;
  padding: 8px 12px;
  background: #1e1e1e;
  border: 1px solid #555555;
  border-radius: 8px;
  font-size: 14px;
  color: #ffffff;
  transition:
    border-color 0.15s ease,
    box-shadow 0.15s ease;
}

.form-group input:hover,
.form-group select:hover {
  border-color: #687078;
}

.form-group input:focus,
.form-group select:focus {
  outline: none;
  border-color: #0972d3;
  box-shadow: 0 0 0 2px rgba(9, 114, 211, 0.25);
}

.form-group select option {
  background: #1e1e1e;
  color: #ffffff;
}

.error-message {
  display: block;
  margin-top: 4px;
  color: #d91515;
  font-size: 12px;
}

.channels-section {
  margin-top: 20px;
  padding: 20px;
  background: #1e1e1e;
  border-radius: 8px;
  border: 1px solid #4a4a4a;
}

.channels-section h4 {
  margin: 0 0 16px 0;
  font-size: 16px;
  font-weight: 600;
  color: #ffffff;
}

.channel-item {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 12px;
  align-items: center;
  padding: 12px;
  background: #2d2d2d;
  border-radius: 8px;
  border: 1px solid #4a4a4a;
}

.channel-item input,
.channel-item select {
  flex: 1 1 140px;
  min-width: 120px;
  padding: 8px 12px;
  background: #2d2d2d;
  border: 1px solid #555555;
  border-radius: 8px;
  font-size: 14px;
  color: #ffffff;
  transition: border-color 0.15s ease;
}

.channel-item input:hover,
.channel-item select:hover {
  border-color: #687078;
}

.channel-item input:focus,
.channel-item select:focus {
  outline: none;
  border-color: #0972d3;
  box-shadow: 0 0 0 2px rgba(9, 114, 211, 0.25);
}

.channel-item select option {
  background: #2d2d2d;
  color: #ffffff;
}

.channel-item button {
  padding: 8px 16px;
  background: #d91515;
  color: #ffffff;
  border: none;
  border-radius: 8px;
  cursor: pointer;
  font-size: 14px;
  font-weight: 600;
  transition: background-color 0.15s ease;
}

.channel-item button:hover {
  background: #b91212;
}

.add-channel-btn {
  padding: 8px 16px;
  background: #037f0c;
  color: #ffffff;
  border: none;
  border-radius: 8px;
  cursor: pointer;
  font-size: 14px;
  font-weight: 600;
  transition: background-color 0.15s ease;
}

.add-channel-btn:hover {
  background: #026609;
}

.actions {
  margin-top: 32px;
  display: flex;
  gap: 12px;
}

.btn {
  padding: 10px 20px;
  border: none;
  border-radius: 8px;
  font-size: 14px;
  cursor: pointer;
  font-weight: 600;
  transition: background-color 0.15s ease;
}

.btn-primary {
  background: #0972d3;
  color: #ffffff;
}
.btn-primary:hover {
  background: #0862c2;
}
.btn-secondary {
  background: #555555;
  color: #ffffff;
}
.btn-secondary:hover {
  background: #5f6b7a;
}

.output {
  margin-top: 24px;
  padding: 20px;
  background: #1e1e1e;
  color: #d4d4d4;
  border: 1px solid #4a4a4a;
  border-radius: 8px;
  font-family: 'Monaco', 'Menlo', 'Ubuntu Mono', 'Consolas', monospace;
  white-space: pre-wrap;
  font-size: 13px;
  line-height: 1.6;
  display: none;
}

.output.active {
  display: block;
}

.toast {
  position: fixed;
  bottom: 24px;
  right: 24px;
  padding: 12px 20px;
  border-radius: 8px;
  font-size: 13px;
  font-weight: 600;
  z-index: 1000;
  transition:
    opacity 0.3s,
    transform 0.3s;
  background: #1a3a1a;
  color: #4ec94e;
  border: 1px solid #2d5a2d;
}

.toast.hidden {
  opacity: 0;
  transform: translateY(10px);
  pointer-events: none;
}
