.automation-list-container {
  display: block;
  max-width: 800px;
  margin: 0 auto;
}

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

.automation-header .control-button {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 8px 16px;
}

.automation-list {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.automation-item {
  background-color: var(--card-color);
  border: 1px solid var(--border-color);
  border-radius: 12px;
  padding: 16px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  transition: transform 0.2s;
  cursor: pointer;
}

.automation-item:hover {
  border-color: var(--accent-color-hover-border);
}

.automation-info {
  display: flex;
  flex-direction: column;
}

.automation-name {
  font-weight: 600;
  font-size: 1.1rem;
  color: var(--text-color);
}

.automation-desc {
  color: var(--text-muted-color);
  font-size: 0.9rem;
}

.automation-actions {
  display: flex;
  gap: 8px;
  align-items: center;
}

.automation-status {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 24px;
  /* Icon size */
  height: 24px;
  /* Icon size */
}

.automation-status.enabled svg {
  color: var(--success-color);
}

.automation-status.disabled svg {
  color: var(--text-muted-color);
}

.icon-btn {
  background: transparent;
  border: none;
  cursor: pointer;
  color: var(--text-muted-color);
  padding: 8px;
  border-radius: 50%;
  transition: background 0.2s, color 0.2s;
  display: flex;
  align-items: center;
  justify-content: center;
}

.icon-btn:hover {
  background-color: rgba(255, 255, 255, 0.1);
  color: var(--text-color);
}

.icon-btn.delete-btn:hover {
  color: var(--error-color);
  background-color: rgba(244, 67, 54, 0.1);
}

/* Editor Dialog Styles */
.editor-dialog {
  background-color: var(--card-color);
  color: var(--text-color);
  border: 1px solid var(--border-color);
  border-radius: 12px;
  padding: 24px;
  width: 95%;
  max-width: 650px;
  max-height: 90vh;
  overflow-y: auto;
  margin: auto;
}

.editor-dialog::backdrop {
  background-color: rgba(0, 0, 0, 0.6);
  backdrop-filter: blur(4px);
}

.editor-dialog h3 {
  margin-bottom: 20px;
  font-size: 1.5rem;
}

.editor-dialog h4 {
  margin-bottom: 12px;
  font-size: 1.1rem;
  color: var(--accent-color);
  border-bottom: 1px solid var(--border-color);
  padding-bottom: 8px;
}

.editor-errors {
  display: none;
  /* Hidden by default */
  margin-bottom: 15px;
  padding: 10px;
  background-color: rgba(244, 67, 54, 0.1);
  border: 1px solid var(--error-color);
  border-radius: 6px;
  color: var(--error-color);
  font-size: 0.9em;
}

.editor-errors p {
  margin: 0;
  padding: 0;
}

.form-section {
  margin-bottom: 24px;
}

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

.form-group label {
  display: block;
  margin-bottom: 6px;
  color: var(--text-muted-color);
  font-size: 0.9rem;
}

.checkbox-group {
  display: flex;
  align-items: center;
  gap: 12px;
}

.checkbox-group label {
  margin-bottom: 0;
  cursor: pointer;
}

.checkbox-group input[type="checkbox"] {
  /* Hide default checkbox */
  appearance: none;
  -webkit-appearance: none;
  -moz-appearance: none;

  width: 24px;
  /* Increased size */
  height: 24px;
  /* Increased size */
  background-color: var(--bg-color);
  border: 2px solid var(--border-color);
  /* Slightly thicker border */
  border-radius: 4px;
  cursor: pointer;
  position: relative;
  flex-shrink: 0;
  transition: background-color 0.2s, border-color 0.2s;
}

.checkbox-group input[type="checkbox"]:checked {
  background-color: var(--accent-color);
  border-color: var(--accent-color);
}

.checkbox-group input[type="checkbox"]:focus {
  outline: none;
  box-shadow: 0 0 0 3px var(--accent-color-dim);
}

/* Custom checkmark */
.checkbox-group input[type="checkbox"]::before {
  content: '';
  display: block;
  width: 16px;
  /* Adjusted checkmark size */
  height: 16px;
  /* Adjusted checkmark size */
  background-color: white;
  /* Color of the checkmark - changed to white */
  mask-image: url('data:image/svg+xml;utf8,<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" fill="white"><path d="M9.545 18l-5.545-5.545 1.414-1.414 4.131 4.131 9.006-9.006 1.414 1.414z"/></svg>');
  mask-repeat: no-repeat;
  mask-size: contain;
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%) scale(0);
  /* Hidden by default */
  transition: transform 0.2s ease-out;
}

.checkbox-group input[type="checkbox"]:checked::before {
  transform: translate(-50%, -50%) scale(1);
}

.dialog-input {
  width: 100%;
  padding: 10px;
  background-color: var(--bg-color);
  border: 1px solid var(--border-color);
  border-radius: 6px;
  color: var(--text-color);
  font-size: 1rem;
}

.dialog-input:focus {
  outline: none;
  border-color: var(--accent-color);
}

/* Dynamic Lists */
.dynamic-list {
  display: flex;
  flex-direction: column;
  gap: 10px;
  margin-bottom: 10px;
}

.dynamic-row {
  display: flex;
  align-items: center;
  gap: 8px;
  background-color: rgba(255, 255, 255, 0.03);
  padding: 8px;
  border-radius: 8px;
}

/* Condition Row */
.condition-row .cond-field {
  flex: 2;
}

.condition-row .cond-operator {
  flex: 0 0 70px;
}

.condition-row .cond-value {
  flex: 1;
}


/* Action Row */
.action-row {
  flex-direction: column;
  gap: 8px;
  align-items: stretch;
}

.action-row .row-top {
  display: flex;
  gap: 8px;
}

.action-row .row-bottom {
  display: flex;
  gap: 8px;
}

.action-row .action-device {
  flex: 2;
}

.action-row .action-delay {
  flex: 0 0 90px;
}

.action-row .action-command {
  flex: 1;
  font-family: monospace;
  font-size: 0.9em;
}

/* Buttons */
.secondary-btn {
  background: transparent;
  border: 1px dashed var(--text-muted-color);
  color: var(--text-muted-color);
  padding: 8px 12px;
  border-radius: 6px;
  cursor: pointer;
  display: block;
  /* Required for margin: auto to work */
  margin: 0 auto;
  /* Center the button */
  transition: all 0.2s;
}

.secondary-btn:hover {
  border-color: var(--accent-color);
  color: var(--accent-color);
  background-color: rgba(0, 170, 255, 0.05);
}

.dialog-buttons {
  display: flex;
  justify-content: flex-end;
  gap: 16px;
  margin-top: 24px;
  border-top: 1px solid var(--border-color);
  padding-top: 16px;
}

div.param-value-control>div>.dropdown-button {
  width: 100%;
}

/* Responsive adjustments */
.mobile-remove {
  display: none !important;
}

@media (max-width: 600px) {
  .condition-row {
    flex-wrap: wrap;
  }

  .condition-row .cond-field {
    flex: 1 0 100%;
  }

  .condition-row .cond-operator {
    flex: 1;
  }

  .condition-row .cond-value {
    flex: 1;
  }

  .mobile-remove {
    display: flex !important;
  }

  .desktop-remove {
    display: none !important;
  }
}